Pivots to and from Houdini

   876   8   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
79 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
79 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.
User Avatar
Member
326 posts
Joined: Feb. 2013
Offline
@juliap Is any of this working already?

From my point of view it should work like this:
By default, when a mesh from Maya comes into the Houdini Engine (through input, merge, on sop or object level) it should always have a (maya-)pivot primitive attribute that describes the local position and rotation of the object pivot. It should be per primitive, because you can put multiple meshes into one input.

The same pivot primitive attribute should be interpreted on export to put things back out. The output should create different objects for different pivot locations.

What do you think?
User Avatar
Staff
79 posts
Joined: Oct. 2017
Offline
I haven't done anything with the pivots yet :-(

Attaching the Maya pivot information could be useful for native Maya geo passing through the plugin. In general, we don't know what the asset's going to do to the geo, so the original pivots may or may not be relevent for the output. So the asset should be free to override those those attributes itself, and we could have options like preserve pivots or center pivots.

It seems like it would sometimes be useful for the pivots to be passed in to the houdini pivots, if it's an object asset. And it would be useful to get houdini pivots out for geo that originates in houdini.

We also need to consider what should happen to those attributes when doing an object merge or splitting primitives.

(I think that means that I'm still thinking about it)
User Avatar
Member
326 posts
Joined: Feb. 2013
Offline
I suggest you implement it as I described and then get feedback.
I am researching Houdini Engine viability for our pipeline right now and this a required feature. If I get some version of this, I can quickly give feedback. Otherwise I would have to cobble it together via scripts.

If it was up to me, I would make it enabled by default and make it possible to opt out. Also, if somebody does not want to use it, they can just remove the primitive attributes from the geo before output.
Edited by DASD - Nov. 23, 2018 06:22:26
User Avatar
Staff
79 posts
Joined: Oct. 2017
Offline
Could you enter an RFE for that? I could enter one based on the forum post, but you can provide more information about your requirements and workflow if you enter it yourself. Thanks.
User Avatar
Member
326 posts
Joined: Feb. 2013
Offline
Will do. I sent out an RFE.
Edited by DASD - Nov. 27, 2018 08:13:07
  • Quick Links