Skip to content

Commit 4eeb7a3

Browse files
robertdorn83marwie
authored andcommitted
clearer animation export warning when gameobject was not exported
1 parent 161e9b4 commit 4eeb7a3

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

Runtime/Scripts/SceneExporter/ExporterAnimationPointer.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,21 @@ public void AddAnimationData(Object animatedObject, string propertyName, GLTFAni
8181
var channelTargetId = GetIndex(animatedObject);
8282
if (channelTargetId < 0)
8383
{
84+
if (animatedObject != null && animatedObject is GameObject go &&
85+
(!go.activeSelf || !go.activeInHierarchy || go.CompareTag("EditorOnly")))
86+
{
87+
if (go.CompareTag("EditorOnly"))
88+
{
89+
Debug.LogWarning(null, $"Animation for {animatedObject.name} ({animatedObject.GetType()}) has not been exported as the object itself is not exported (EditorOnly). Remove the EditorOnly tag when you want to export the GameObject. (InstanceID: {animatedObject.GetInstanceID()})", animatedObject);
90+
return;
91+
}
92+
if (!go.activeSelf || !go.activeInHierarchy)
93+
{
94+
Debug.LogWarning(null, $"Animation for {animatedObject.name} ({animatedObject.GetType()}) has not been exported as the object itself is not exported. Enable the GameObject when you want to export it or enable 'Export disabled Game Objects' in the settings. (InstanceID: {animatedObject.GetInstanceID()})", animatedObject);
95+
return;
96+
}
97+
98+
}
8499
Debug.LogWarning(null, $"Animation for {animatedObject.name} ({animatedObject.GetType()}) has not been exported as the object itself is not exported (disabled/EditorOnly). (InstanceID: {animatedObject.GetInstanceID()})", animatedObject);
85100
return;
86101
}

0 commit comments

Comments
 (0)