Skip to content

Conversation

@hybridherbst
Copy link
Contributor

@hybridherbst hybridherbst commented May 14, 2020

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).

Copy link
Contributor

@jcowles jcowles left a 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!

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.

Copy link
Contributor

@jcowles jcowles left a 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants