Thread: [Maya2osg-users] Matrix exported does not obey units set in Maya
Status: Alpha
Brought to you by:
jtaibo
From: Jean-Sébastien G. <jea...@cm...> - 2011-06-27 19:58:47
|
Hello all, Maya is initially set to treat its units as centimeters (I don't know why), and here we always set it to meters in Window - Settings/Preferences - Preferences. However, when I export a file with Maya2osg, the exported file's transforms seem to have gone back to centimeters (or something). I have a transform which I've moved to (0 0.7 0), and it's exported as a matrix with a translation of (0 70 0). I guess when exporting we would need to get the current units setup from Maya and make sure we export in those units everywhere... But I'm surprised no one has run into this before. Any suggestions? J-S -- ______________________________________________________ Jean-Sebastien Guay jea...@cm... http://www.cm-labs.com/ http://whitestar02.dyndns-web.com/ |
From: Javier T. <jav...@gm...> - 2011-06-29 23:23:53
|
I haven't noticed this kind of problem because I have never bothered about what units Maya *thinks* it use. I just consider units as units :) and everything is in place when exported. What is the difference in configuring meters as the units in Maya configuration instead of just considering that the units are meters no matter what Maya has in its config? I think the only difference can be when using dynamic simulation, but even then I am not sure if they will take into account the unit configured in Maya. In some cases it just consider units as meters, and after all you can apply spatial and temporal scaling factors to the dynamic engine. On Mon, Jun 27, 2011 at 9:52 PM, Jean-Sébastien Guay <jea...@cm...> wrote: > Hello all, > > Maya is initially set to treat its units as centimeters (I don't know > why), and here we always set it to meters in Window - > Settings/Preferences - Preferences. However, when I export a file with > Maya2osg, the exported file's transforms seem to have gone back to > centimeters (or something). > > I have a transform which I've moved to (0 0.7 0), and it's exported as a > matrix with a translation of (0 70 0). > > I guess when exporting we would need to get the current units setup from > Maya and make sure we export in those units everywhere... But I'm > surprised no one has run into this before. > > Any suggestions? > > J-S > -- > ______________________________________________________ > Jean-Sebastien Guay jea...@cm... > http://www.cm-labs.com/ > http://whitestar02.dyndns-web.com/ > > ------------------------------------------------------------------------------ > All of the data generated in your IT infrastructure is seriously valuable. > Why? It contains a definitive record of application performance, security > threats, fraudulent activity, and more. Splunk takes this data and makes > sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-d2d-c2 > _______________________________________________ > Maya2osg-users mailing list > May...@li... > https://lists.sourceforge.net/lists/listinfo/maya2osg-users > -- Javier Taibo |
From: Jean-Sébastien G. <jea...@cm...> - 2011-06-29 23:39:58
|
Hi Javier, > What is the difference in configuring meters as the units in Maya > configuration instead of just considering that the units are meters no > matter what Maya has in its config? It has an influence when you import files coming from other 3D packages, in particular CAD applications. Those file formats generally specify which units they are in, and if your own scene is built using millimeters (but assuming one unit is a meter) then it won't match the imported file. There may be other implications too. But in short, I think we should probably do it right in the plugin, because we cannot predict how users will have configured Maya. At the very least we can apply a scale at the top of the graph, but I think it would be better to export with the configured units, otherwise examining the file will be confusing (why is this box 200 meters wide? Oh it's really 2 meters wide if I take into account the scale at the root of the graph...) I'm not suggesting you do anything about it. I'll work on it. I just wanted to know if anyone had encountered this before, and now I know why not :-) J-S -- ______________________________________________________ Jean-Sebastien Guay jea...@cm... http://www.cm-labs.com/ http://whitestar02.dyndns-web.com/ |
From: Javier T. <jav...@gm...> - 2011-06-30 06:37:40
|
Hi J-S, On Thu, Jun 30, 2011 at 1:39 AM, Jean-Sébastien Guay <jea...@cm...> wrote: > Hi Javier, > >> What is the difference in configuring meters as the units in Maya >> configuration instead of just considering that the units are meters no >> matter what Maya has in its config? > > It has an influence when you import files coming from other 3D packages, > in particular CAD applications. Those file formats generally specify > which units they are in, and if your own scene is built using > millimeters (but assuming one unit is a meter) then it won't match the > imported file. Of course, if you're working with models created with different units/scales, you have to be careful with this. > But in short, I think we should probably do it right in the plugin, > because we cannot predict how users will have configured Maya. At the > very least we can apply a scale at the top of the graph, but I think it > would be better to export with the configured units, otherwise examining > the file will be confusing (why is this box 200 meters wide? Oh it's > really 2 meters wide if I take into account the scale at the root of the > graph...) Of course, doing things correctly is better. The scale at the root would be fine for me (maybe in the same transform that perform the Y-up to Z-up conversion), but if you are thinking about better ways, great. > I'm not suggesting you do anything about it. I'll work on it. I just > wanted to know if anyone had encountered this before, and now I know why > not :-) Now you know the reason. I think in the whole Maya2OSG community there are three people, and only about a 33% of them have a pipeline complex enough to find these kind of problems :) Cheers! -- Javier Taibo |
From: Jean-Sébastien G. <jea...@cm...> - 2011-10-17 20:12:36
|
Hi guys, I come back to this question, because it's pretty important to us... I would like to implement a way, when export starts, to set a global multiplier that would scale things correctly (vertex arrays, transforms mostly). The problem is, in the C++ API, I have no idea how to get the current units of the file / maya instance. In scripting I can do "currentUnit -query -linear" and I get "m" or "cm" so I know what to do, but in the C++ API I have no idea. I could add a setting in the GUI, but since this information should already be available from maya, I'd prefer not to. Can someone help with this? It would be cool if in the Mel command reference there was a link to find the equivalent command in the C++ API... Thanks, J-S -- ______________________________________________________ Jean-Sébastien Guay jea...@cm... http://www.cm-labs.com/ http://whitestar02.dyndns-web.com/ |
From: PP CG <pp...@cg...> - 2011-10-22 15:01:55
|
Hi Guys, I applied your patch j-S, but changed it a little. According to me the default unit should stay cm, as in Maya. Seems to work, but I don't have any real world testcase. Please test :-) Cheers, PP > Hello all, > > Maya is initially set to treat its units as centimeters (I don't know > why), and here we always set it to meters in Window - > Settings/Preferences - Preferences. However, when I export a file with > Maya2osg, the exported file's transforms seem to have gone back to > centimeters (or something). > > I have a transform which I've moved to (0 0.7 0), and it's exported as a > matrix with a translation of (0 70 0). > > I guess when exporting we would need to get the current units setup from > Maya and make sure we export in those units everywhere... But I'm > surprised no one has run into this before. > > Any suggestions? > > J-S |
From: Jean-Sébastien G. <jea...@cm...> - 2011-10-22 21:48:52
|
Hi Peter, > I applied your patch j-S, but changed it a little. According to me the > default unit should stay cm, as in Maya. OK, it doesn't affect us as we always set them to Meters. > Seems to work, but I don't have any real world testcase. Please test :-) I'll do that next week and let you know. Thanks a lot, J-S -- ______________________________________________________ Jean-Sebastien Guay jea...@cm... http://www.cm-labs.com/ http://whitestar02.dyndns-web.com/ |