-
Notifications
You must be signed in to change notification settings - Fork 78
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
Fix ExportSkeleton USDZ scale #184
base: dev
Are you sure you want to change the base?
Fix ExportSkeleton USDZ scale #184
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks for the fix!
@@ -80,6 +80,8 @@ public static class SkeletonExporter { | |||
// 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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After some local testing, this only seems right in some scenarios... I'm digging in a bit more to better understand what's going on between the bbox and geometry scales
After adding scale in ExportContext bounds were now broken for animated meshes. I'm still not 100% sure about this, but at least the order of magnitude of the bounds is correct again (and exports look right in usdview which they don't without this PR).