Skip to content

Commit

Permalink
Merge pull request #584 from anatawa12/satania-kisetene
Browse files Browse the repository at this point in the history
feat: Satania's Kisetene compatibility
  • Loading branch information
anatawa12 authored Oct 14, 2023
2 parents 0f4e2cf + 83fc5ac commit 0f34658
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-PRERELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog].

## [Unreleased]
### Added
- Add compatibility for Satania's KiseteneEx `#584`

### Changed

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog].

## [Unreleased]
### Added
- Add compatibility for Satania's KiseteneEx `#584`

### Changed

Expand Down
28 changes: 28 additions & 0 deletions Editor/Processors/TraceAndOptimize/ComponentDependencyCollector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -590,10 +590,38 @@ void CollectTransforms(Transform bone)
_byTypeParser.Add(contextHolder, (collector, deps, component) => deps.EntrypointComponent = true);
}

#region Satania's Kisetene Components

// KiseteneComponent holds information about which cloth the bone came from, which is not important on build
var kiseteneComponent = GetTypeByGuidFileId("e78466b6bcd24e5409dca557eb81d45b", 11500000);
if (kiseteneComponent != null)
_byTypeParser.Add(kiseteneComponent, (collector, deps, component) => deps.EntrypointComponent = true);

// FlyAvatarSetupTool is on-inspector tool which is not important on build
var flyAvatarSetupTool = GetTypeByGuidFileId("7f9c3fe1cfb9d1843a9dc7da26352ce2", 11500000);
if (flyAvatarSetupTool != null)
_byTypeParser.Add(flyAvatarSetupTool, (collector, deps, component) => deps.EntrypointComponent = true);

// BlendShapeOverrider is on-inspector tool which is not important on build
var blendShapeOverrider = GetTypeByGuidFileId("95f6e1368d803614f8a351322ab09bac", 11500000);
if (blendShapeOverrider != null)
_byTypeParser.Add(blendShapeOverrider, (collector, deps, component) => deps.EntrypointComponent = true);

#endregion


// Components Proceed after T&O later
AddEntryPointParser<MergeBone>();
}

private static Type GetTypeByGuidFileId(string guid, long fileId)
{
if (!GlobalObjectId.TryParse($"GlobalObjectId_V1-1-{guid}-{fileId}-0", out var id)) return null;
var script = GlobalObjectId.GlobalObjectIdentifierToObjectSlow(id) as MonoScript;
if (!script) return null;
return script.GetClass();
}

#endregion
}
}
Expand Down

0 comments on commit 0f34658

Please sign in to comment.