Pivots to and from Houdini

   566   3   2
User Avatar
Member
19 posts
Joined: Dec. 2016
Offline
I'm using Houdini Engine to adjust an object I have in Maya. The problem is that Houdini can't seem to handle pivot points. So when an object's pivot is moved to some place in Maya, Houdini resets it, and moves the pivot to the world origin (and the object along with it).

Neither can I move the pivot point in Houdini and output it with Houdini Engine - if I transform an object (also tried pivot transform and pre-transform), the pivot in Maya always ends up in the world origin.

So as far as I see I can't read the pivot position in Houdini. And I can't output the pivot. … or am I missing something?

Specifically my goal is to duplicate an object, and move the copies to various locations, but keep their local pivot. Does anyone have an idea how to go about it?
User Avatar
Staff
51 posts
Joined: Oct. 2017
Offline
Right now, we only use the world transform of the input object to initialize the transform on the input in Houdini, so the local pivots are lost. I guess you could promote a pivot parm and connect the upstream xform's pivot directly to access to the pivot. We don't provide output pivots either. You could potentially output the modified pivots as custom attributes, but output pivot is more problematic cause if we're effectively freezing xforms on the output mesh, then we'd want the world pivot exported as the local pivot.

I will enter a bug to bring in local pivots for objects, and to provide output pivots in some form - maybe both local and world. Not sure what to do if you have an object output in parts that you need to re-assemble. Any thoughts?
User Avatar
Member
19 posts
Joined: Dec. 2016
Offline
juliap
I will enter a bug to bring in local pivots for objects, and to provide output pivots in some form - maybe both local and world. Not sure what to do if you have an object output in parts that you need to re-assemble. Any thoughts?

Thanks. Sounds good. I'm not an expert of what happens under the hood in Maya. As far as I see, what's needed is the information of the offset from the world origin (for position and rotation). Once it's parented that offset counts from the pivot of the parent. So that should work for assembled elements.
Maya has an additional weirdness with “FreezeTransformations” where it hides that information (so the object says it's at transform 0,0,0), but the real offset is still there somewhere (resetPivot reveals it).

Anyways, it's one of the things that got me a bit by surprise that it was missing - pivot points are so essential in game development.

juliap
You could potentially output the modified pivots as custom attributes, but…

Do I understand it correctly that this means I would then see these params in Maya and could fix it there?

BTW: On the “object merge” node I found a “transform” setting, that seems to accept the pivot/offset from origin. I guess that gets at least the position offset into Houdini.
User Avatar
Staff
51 posts
Joined: Oct. 2017
Offline
Yes. If you look at the maya transform node, you can see and edit the pivot in local space or in world space (internally it's stored in local space) If the local space pivot is at the origin, the world pivot is just the origin transformed by the xforms above the shape. If you set the local pivot, either by hand, or by doing center pivot, you'll see that the local and world pivots are kept in sync, and the local pivot is no longer at the origin.

When you bring that object into houdini, look at the input object, you'll see that it has the world transform, but the pivot positions are at the origin, and that any local modification to the pivot was ignored. If you used the transform setting on your objectMerge, that transform is carried over, but there is no pivot to copy/ That's the input problem. If you don't ever modify the localPivot on your object then it's not a problem.

As for the output, I was thinking more of adding a float vector detail attr on your geo, setting the attr in your asset from the world space pivot position, and on output the plugin turn that detail attr into an attribute on the maya shape. I'm not sure how well it would work as a parm, because we sync the parm values with the maya attrs at the start of the compute for the frame. I haven't tried this myself yet though.
  • Quick Links