Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Satania's Kisetene compatibility #584

Merged
merged 3 commits into from
Oct 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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