Skip to content

Commit

Permalink
fix: animated colors on arbitrary components, and camera background c…
Browse files Browse the repository at this point in the history
…olor, should be linear
  • Loading branch information
hybridherbst committed Nov 13, 2023
1 parent 8cfe314 commit 547fba4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Runtime/Scripts/SceneExporter/ExporterAnimationPointer.cs
Expand Up @@ -70,6 +70,7 @@ public void AddAnimationData(Object animatedObject, string propertyName, GLTFAni
bool convertToLinearColor = false;
string secondPropertyName = null;
string extensionName = null;
var propertyType = values[0]?.GetType();

switch (animatedObject)
{
Expand Down Expand Up @@ -337,6 +338,7 @@ public void AddAnimationData(Object animatedObject, string propertyName, GLTFAni
propertyName = "perspective/zfar";
break;
case "backgroundColor":
convertToLinearColor = true;
break;
default:
Debug.Log(LogType.Warning, "Unknown property name on Camera " + camera + ": " + propertyName);
Expand Down Expand Up @@ -397,6 +399,11 @@ public void AddAnimationData(Object animatedObject, string propertyName, GLTFAni
{
return;
}

// If the animated property is a color, we need to convert to linear –
// we're doing the same on regular non-animated property export.
if (propertyType == typeof(Color))
convertToLinearColor = true;
}
break;
}
Expand Down

0 comments on commit 547fba4

Please sign in to comment.