Is there a way to know Maya's up axis?

   419   2   1
User Avatar
Member
2 posts
Joined: Jan. 2018
Offline
I am currently working on a project that has Maya's up axis set to Z. A simple transform node with a Y translation will move objects along the Y axis in Maya regardless of the up axis setting. While it is correct, I would like a way to move it along the host software's up axis. Is it possible to obtain the up axis of the current host software?

The issue extends to VEX code where I'm using intersect() to cast rays up or down.

The simple workaround I am currently using is having a simple “z-up” toggle on the HDA but obviously that is not the most practical of solutions.
User Avatar
Staff
33 posts
Joined: Oct. 2017
Offline
On the maya side optionVar -q “upAxisDirection” will get you direction. If you're running houdini engine in-process in maya, and if you've set your python path to include maya's python commands, you could add a callback that queried the option var and the extracted the result (which seems like a lot of work and would require customizing your assets) How would you like to see it made accessible - wrapped up in a convenient python script? Environment variable?
User Avatar
Member
2 posts
Joined: Jan. 2018
Offline
I'm still new to this but it seems most people wrap their HDA in a MEL/Python script in Maya. With that approach I can query the upAxisDirection like you mentioned and automatically switch the toggle on my HDA accordingly.

The solution I was expecting on the Houdini side was functions in VEX/VOP for up vector, and possibly right vector and forward vector too. The up vector function would return something like {0,1,0} when ran in Y-up, and {0,0,1} in Z-up.

I haven't had the chance to check it out yet, but the documentation for Houdini Engine for Unreal has a page on coordinate systems and it appears you can change the “Import Axis” in import settings. The doc says when it's set to Unreal, Houdini Engine will convert all vector3 parameters. Sounds like a viable option as well.

http://www.sidefx.com/docs/unreal/_coordinate_system.html [www.sidefx.com]
  • Quick Links