Exocortex / ExocortexCrate

http://exocortex.com/products/crate
BSD 3-Clause "New" or "Revised" License
134 stars 68 forks source link

For wrong translation used when maya is not set in cm #26

Closed renaudll closed 9 years ago

bhouston commented 9 years ago

Nice. Should we also be doing this conversion on export as well?

bhouston commented 9 years ago

BTW the Alembic file format is actually unitless, which means that it doesn't specify a unit. This generally means we shouldn't be doing any type of unit conversion for import or export generally. It is up to the user to be responsible for units.

renaudll commented 9 years ago

You are right, however the translation of a maya transform expect the data in the unit size of the scene. I've done some tests and in all cases, Exocortex export the data in centimeter (maya's internal unit). However when importing it doesn't do the conversion wich can cause issues if the unit size is not set in centimeter. Here's some repro-steps that better illustrate the problem:

1) Open maya and set it in meter 2) Create a locator with a translation of 1 3) Export the locator via ExocortexCrate 4) Re-import the locator via ExocortexCrate 5) Notice the locator now have a translation of 100

bhouston commented 9 years ago

So I looked a bit more at the code. I will merge this. I think the issue is that while we do export without looking at units, we are accessing the transform matrix directly. When we import, we are specifying a translation, rather than the transform matrix, and I suspect we need to have units on the translation. Your PR does this.

I didn't realize the translation required units while the transform matrix did not.

bhouston commented 9 years ago

Thanks!