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

chore(merge-smr): Add error that describes Cloth component is unsupported #949

Merged
merged 2 commits into from
Mar 25, 2024
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
4 changes: 4 additions & 0 deletions CHANGELOG-PRERELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ The format is based on [Keep a Changelog].
- Combined warning per Merge Skinned Mesh component.
- Previously, AAO warns for each source Renderers.
- Since this version, AAO creates one warning for each Merge Skinned Mesh component.
- An error is occured with Cloth component in Merge Skinned Mesh component `#949`
Sayamame-beans marked this conversation as resolved.
Show resolved Hide resolved
- The Cloth component is not supported by Merge Skinned Mesh component.
- In previous versions, AAO will keep the source Skinned Mesh Renderer if it's with Cloth component by bug.
- Since this version, AAO will make an error if the source Skinned Mesh Renderer is with Cloth component.

### Deprecated

Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ The format is based on [Keep a Changelog].
- Combined warning per Merge Skinned Mesh component.
- Previously, AAO warns for each source Renderers.
- Since this version, AAO creates one warning for each Merge Skinned Mesh component.
- An error is occured with Cloth component in Merge Skinned Mesh component `#949`
Sayamame-beans marked this conversation as resolved.
Show resolved Hide resolved
- The Cloth component is not supported by Merge Skinned Mesh component.
- In previous versions, AAO will keep the source Skinned Mesh Renderer if it's with Cloth component by bug.
- Since this version, AAO will make an error if the source Skinned Mesh Renderer is with Cloth component.

### Deprecated

Expand Down
14 changes: 10 additions & 4 deletions Editor/Processors/SkinnedMeshes/MergeSkinnedMeshProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,17 @@ TexCoordStatus TexCoordStatusMax(TexCoordStatus x, TexCoordStatus y) =>

context.RecordMergeComponent(renderer, Target);
var rendererGameObject = renderer.gameObject;
var toDestroy = renderer.GetComponent<RemoveZeroSizedPolygon>();
if (toDestroy)
var removeZeroSizedPolygon = renderer.GetComponent<RemoveZeroSizedPolygon>();
if (removeZeroSizedPolygon)
{
BuildLog.LogWarning("MergeSkinnedMesh:warning:removeZeroSizedPolygonOnSources", toDestroy);
DestroyTracker.DestroyImmediate(toDestroy);
BuildLog.LogWarning("MergeSkinnedMesh:warning:removeZeroSizedPolygonOnSources", removeZeroSizedPolygon);
DestroyTracker.DestroyImmediate(removeZeroSizedPolygon);
}
var cloth = renderer.GetComponent<Cloth>();
if (cloth)
{
BuildLog.LogError("MergeSkinnedMesh:error:clothOnSources", cloth);
DestroyTracker.DestroyImmediate(removeZeroSizedPolygon);
}
DestroyTracker.DestroyImmediate(renderer);

Expand Down
6 changes: 6 additions & 0 deletions Localization/en.po
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,12 @@ msgstr ""
"If the animation will not affects to other meshes, (for example, it affects only to the disabled shader features of meshes) please report this issue to Avatar Optimizer.\n"
"If the shader is well-known, I'll add logic to check if the feature is enabled for renderers other than animated.\n"

msgid "MergeSkinnedMesh:error:clothOnSources"
msgstr "Cloth component is attached to the source SkinnedMeshRenderer, so it cannot be merged."
Sayamame-beans marked this conversation as resolved.
Show resolved Hide resolved

msgid "MergeSkinnedMesh:error:clothOnSources:description"
msgstr "Please remove Cloth component from the source SkinnedMeshRenderer or exclude the source SkinnedMeshRenderer."
Sayamame-beans marked this conversation as resolved.
Show resolved Hide resolved

# endregion

# region MergeToonLitMaterial
Expand Down
6 changes: 6 additions & 0 deletions Localization/ja.po
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,12 @@ msgstr ""
msgid "MergeSkinnedMesh:warning:removeZeroSizedPolygonOnSources"
msgstr "Remove Zero Sized Polygonsは遅めに処理されるため、統合対象のメッシュにつけても効果がありません"

msgid "MergeSkinnedMesh:error:clothOnSources"
msgstr "Clothコンポーネントが統合対象のメッシュについているため、統合できません"
Sayamame-beans marked this conversation as resolved.
Show resolved Hide resolved

msgid "MergeSkinnedMesh:error:clothOnSources:description"
msgstr "統合対象のメッシュからClothコンポーネントを削除するか、統合対象のメッシュから除外してください"
Sayamame-beans marked this conversation as resolved.
Show resolved Hide resolved

# endregion

# region MergeToonLitMaterial
Expand Down
Loading