Custom node in Houdini containing multiple Xform nodes

   4539   7   3
User Avatar
Member
22 posts
Joined: 7月 2016
Offline
I need to create a custom node (digital asset?) in Houdini. It should include multiple Xform SOPs connected one after the other but it's count will varry. This is useful to move individual shapes in an Alembic SOP to different positions by using a single node, other than connecting Xform nodes in chain. Any help?

Thanks
Joj
User Avatar
Member
1799 posts
Joined: 10月 2010
Offline
if you need the contents of your digital asset to change, you can add a subnet under your asset, and when generating a digital asset (under the nodes tab), make your subnet editable. That would allow a python module embedded on your digital asset to simply generate xform nodes under your digital asset

if you are bringing all your shapes from an alembic node, however, you can also go the route of using a single alembic SOP node to bring all your shapes in as packed primitives, then simply use a primitive VOP or Wrangle node to transform each packed prim in parallel (MUCH more efficient as it is SIMD)
-G
User Avatar
Member
22 posts
Joined: 7月 2016
Offline
Yes, all shapes will come through Alembic node.

Did you mean by using VEXpression? Can you add a simple code to pick a shape/prim from the input Alembic SOP and translate/rotate it using Primitive/Attribute Wrangle node, if possible? I'm new to VEX :-)
Edited by jojanpm - 2016年8月5日 04:22:41
User Avatar
Member
1799 posts
Joined: 10月 2010
Offline
here it an example using a VOP. It does not have to be a wrangle, the point is that if you are passing packed prims or alembic packed prims, you should be able to process each packed object in parallel.

I did forget to mention that you do indeed need to store your transformation as an attribute then use either a primitive SOP or a point VOP to transform it as you cannot change primitive positions in VOPs (at least that I know…)

Here is an example using a copy SOP to generate a collection of packed prims. I did not have an alembic to show you, but if you are importing your objects as Delayed Load primitives, this should work the same

Attachments:
primTransformExample.hiplc (91.2 KB)

-G
User Avatar
Member
22 posts
Joined: 7月 2016
Offline
Opened your hiplc file. But can the transformations of ALL primitives in a single alembic node be done using a SINGLE (python/wrangle/vop?) node connected to the alembic node? This is my need. Otherwise I can do it by connecting xforms to the alembic SOP one-by-one.
User Avatar
Member
483 posts
Joined: 12月 2006
Offline
Do you mean a combined move?
Example shows a multiparam cumulative move…

You can use something similar to add individual moves
to given alembic parts, if you extend the “My Move” with a Group Input
field…

Maybe I've misunderstood your idea totally, then simply ignore it.
Edited by matthias_k - 2016年8月8日 02:48:08

Attachments:
multiparam_move.hip (71.6 KB)
multiparam_move_better.hip (71.2 KB)

English is not my native language, sorry in advance for any misunderstanding :-)
User Avatar
Member
1799 posts
Joined: 10月 2010
Offline
hey jojanpm, yes. Assuming your transformations are stored by attribute (on a per primitive basis) you can either

a- use a point vop/wrangle instead of a prim vop, and use the prim num to fetch the transformation attribute, then apply it to the points in one shot
b - if they are attributes, you can also simply use the primitive SOP that I have in my example without having to even use a VOP/wrangle

where does your transformation come from?
-G
User Avatar
Member
22 posts
Joined: 7月 2016
Offline
Sorry, forgot to update here:
I used a Python node to apply the transform to each shape in the .abc. Matrix multiplication was needed in the logic to achieve it, i.e. something like transformMatrix * scaleVals * rotateVals * translateVals.. Don't remember the exact code.

Thanks all.
  • Quick Links