APEX: Transform Object per primitives in group

   276   8   3
User Avatar
Member
32 posts
Joined: 5月 2016
オンライン
Hi;

I'm trying to read grouped primitives on the incoming Base.shp stream in an Apex Graph SOP that is connected to an ARC-Fuse SOP and create Transform Objects per primitive in the group; ie. if there are 6 primitives in the group, I want to create 6 Transform objects.

I looked for a relevant Apex Graph node that outputs the grouped primitives as an Array that I wanted to iterate over but to no avail :-/

What I ultimately (hopefully) aim to accomplish is to create n number of Transform objects per prims in a prim group and constrain them to the center of each primitive in the group via the primconstraint node. This I need to do within the bounds of APEX. not upstream of it, as the generated joints need to be constrained to the prims post-deformation.

Any help would be wildly appreciated.

Cheers;

AJ
Edited by noc2 - 2026年2月1日 19:34:21
User Avatar
Member
8104 posts
Joined: 7月 2005
オフライン
Can't you use geo::ForEachPrimBegin/End to loop over the primitives of your group?
User Avatar
Member
32 posts
Joined: 5月 2016
オンライン
Hi Edward;

Yes, therein lies my wee problem I should be doing something wrong, bu can't quite wrap my head around what it may be

Here's a screenshot from my test scene. I expect 2 transform objects to be created as there are 2 prims in the group that is being iterated over yet a single Tr objects is being generated. What do you think I'm doing wrong here?

Edited by noc2 - 2026年2月2日 11:41:46

Attachments:
SS.png (1.0 MB)

User Avatar
Member
8104 posts
Joined: 7月 2005
オフライン
Ah but you can't do it this way because the number of controllers in a rig is not procedural at animation time. You would need to create these controllers in your component as part of the rig itself.
User Avatar
Member
32 posts
Joined: 5月 2016
オンライン
edward
Ah but you can't do it this way because the number of controllers in a rig is not procedural at animation time. You would need to create these controllers in your component as part of the rig itself.

Ah, so there it is! Thank you Ed, much appreciated! So, I take it that what I need to do is to do this using a component script. Should I do so before deformation is computed or after you think?
User Avatar
Member
8104 posts
Joined: 7月 2005
オフライン
Your component shape modifies the rig procedurally so it will just put these controllers in a place that feeds into the bone deform. So doing it in the place where you currently have it in your screenshot works. It's just that you cannot use the graph fuse workflow for this.
User Avatar
スタッフ
118 posts
Joined: 10月 2023
オフライン
Hi, here is a component script that will set up a control per prim in a group and then constrain it to the prims, post bonedeform.
Hope this helps.

Attachments:
controls_on_prims.hip (577.2 KB)
Screencast_from_2026-02-04_13-08-31.gif (23.3 MB)

User Avatar
Member
32 posts
Joined: 5月 2016
オンライン
william_harley
Hi, here is a component script that will set up a control per prim in a group and then constrain it to the prims, post bonedeform.
Hope this helps.
Image Not Found
This nothing short of pure gold William! Thanx a million! I am studying it atm and I'm sure it'll open up so many doors for me (Your master class already did btw)

Lotsa cheers;

AJ
User Avatar
Member
32 posts
Joined: 5月 2016
オンライン
So now here's another challenge that I couldn't get over Let's say that these generated ctrls are supposed to pack-deform certain geometries that are close by their positions. How is that possible to accomplish? Since the ctrls are generated through a snippet, the geometry can't be fed as captured packed geo upstream.

I tried unpacking the character after your code generates the transform objects so as to get to them and set up a capture packed geometry relationship between them and the extra geometry they're supposed to deform but the generated Transform objects just don't appear in the unpacked skeleton :-/
  • Quick Links