How to correctly pre-orient Python state xform handles?

   243   1   2
User Avatar
Member
403 posts
Joined: April 2017
Offline
Let's say I'm building a Python state that has a few objects that need to rotate in their own local spaces, driven by handles. We have the handy "xform" handle for this. However, the various parameters of the handle are undocumented and it's not always easy to know how they work.

I'm running into a problem where I need the output parameters to be in local space, but the handle's parameters are always in world space. I can do a little matrix math to extract Eulers from the object in question, but if I map those values to r[xyz]on the handle, now when the user drags the handle the values are all in world space instead of local.

I can see that there's rpre[xyz]and roffset[xyz]and rpivot[xyz]but regardless of which one I abuse, the output values for the r[xyz]parms that I'm using the handle for are always coming out in world space. So how is this supposed to work under the hood? Am I supposed to compute a transform from the Eulers and multiply it by the inverse parent matrix and then extract the Eulers back from the result to bind the handle values? Is there not a more direct way to do this with the xform handle?
Edited by toadstorm - Sept. 15, 2025 21:19:25
MOPs (Motion Operators for Houdini): http://www.motionoperators.com [www.motionoperators.com]
User Avatar
Member
132 posts
Joined: Aug. 2013
Offline
I just got a chill down my spine... This is one of those things that I (silently) requested, maybe more hoped for for H21.
  • Quick Links