Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ public static void ExportSkelRoot(ObjectContext objContext, ExportContext export
// This is required because USD expects the extent to be a local bound for the SkelRoot.
var oldParent = objContext.gameObject.transform.parent;
objContext.gameObject.transform.SetParent(null, worldPositionStays: false);
var originalScale = objContext.gameObject.transform.localScale;
objContext.gameObject.transform.localScale *= 1 / exportContext.scale;
Copy link
Contributor

@jcowles jcowles Jul 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do believe this was intended to be captured by SetParent(null, ...) above, it's just that the scale wasn't captured.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess my remaining question is if this should be 1/exportContext.scale or if it should just be 1.


try {
foreach (var r in objContext.gameObject.GetComponentsInChildren<Renderer>()) {
Expand All @@ -94,6 +96,7 @@ public static void ExportSkelRoot(ObjectContext objContext, ExportContext export
} finally {
// Restore the root parent.
objContext.gameObject.transform.SetParent(oldParent, worldPositionStays: false);
objContext.gameObject.transform.localScale = originalScale;
}

// Convert handedness if needed.
Expand Down