coccosoids c
coccarolla
About Me
Connect
LOCATION
is,
Not Specified
ウェブサイト
Houdini Engine
Availability
Not Specified
Recent Forum Posts
How to correctly pre-orient Python state xform handles? 2026年1月6日7:54
mabelzileUnfortunately I can't share it publicly. But I guess the most difficulty I'm having right now is understanding what should be the correct flow of transformations within a handle, where should you update parms and where should apply xforms etccoccarolla
I hope I can get an answer because I've been experimenting for a long time without any results.
I am trying to orient a python handle based on incoming geometry normals. The way I am trying to accomplish this is by extracting the position and the normal and building transforms from them in onDrawSetup. Then I am trying to multiply these with the gadgets' xform but results are not stable. Is there a proper order or place for doing this? Or am I doing something fundamentally wrong?
Could you provide a working Python handle that demonstrates the issues you are encountering?
Houdini Cookbook 2026年1月5日6:33
kif11
Hi everyone,
We built a page and tool that lets you copy and paste Houdini node recipes from the website directly into any Houdini context. So far we've compiled a small collection of recipes we use in our projects. Check it out here: https://codercat.xyz/cookbook/ [codercat.xyz]
This is amazing! Wish more would contribute!
How to correctly pre-orient Python state xform handles? 2026年1月5日5:38
rayhanm
If I am understanding correctly, you have some local space, which is some translation and axis rotation, defined as a 4x4 matrix.
What you can do is use the handle's preform parameters to express the local space transformation. If you explode your local space matrix, you can shove the resulting translate, rotate, scale, and shear into pivot_comp_t*, pivot_comp_r*, pivot_comp_s*, and pivot_comp_shear_*, respectively. This can be done in onStateToHandle.
With this, the handle should be oriented based on the local space you used. If you interactively move the handle, the value you receive in onHandleToState will be in the local space. So for example, if you simply move the handle's red "x-axis" translation component, the handle will effectively experience displacement in all 3 world space axes, due to it being oriented to your local space. But you'd only receive meaningful updates to "tx" in onHandleToState (the updates to "ty" and "tz" will be 0, or some negligibly small value).
I am assuming you have node parameters that match those within the handle (similar to the Transform or Edit SOP, which have node parms for translate, rotate, etc, that are bound to the handle). Because you've shoved your local space information into the preform, which is the first step in the handle's matrix sequence computation, the remaining parms will all be applied in the local space.
For instance, in onStateToHandle, say you shove your node's translate parms directly into the handle's tx, ty, and tz. If you start adjusting your node's tx parm in the parm dialogue, the handle will begin to move that amount in the local space x-axis (since the preform will have been applied by the time the handle applies tx).
So, if you treat the handle's preform parms I mentioned above as representative of the local space, the remaining parms can just be bound directly in onStateToHandle and onHandleToState, without needing any special matrix manipulation or extraction.
Things might get more complex if your node also has options for user-defined preforms, like the Edit SOP has. Because then your handle's preform parms will have to be a combination of the local space, and the true preform.
But please let me know if you have further questions.
I hope I can get an answer because I've been experimenting for a long time without any results.
I am trying to orient a python handle based on incoming geometry normals. The way I am trying to accomplish this is by extracting the position and the normal and building transforms from them in onDrawSetup. Then I am trying to multiply these with the gadgets' xform but results are not stable. Is there a proper order or place for doing this? Or am I doing something fundamentally wrong?