APEX: Transform Object per primitives in group

   250   7   3
User Avatar
Member
30 posts
Joined: May 2016
Offline
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 - Feb. 1, 2026 19:34:21
User Avatar
Member
8104 posts
Joined: July 2005
Offline
Can't you use geo::ForEachPrimBegin/End to loop over the primitives of your group?
User Avatar
Member
30 posts
Joined: May 2016
Offline
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 - Feb. 2, 2026 11:41:46

Attachments:
SS.png (1.0 MB)

User Avatar
Member
8104 posts
Joined: July 2005
Offline
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
30 posts
Joined: May 2016
Offline
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: July 2005
Offline
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
Staff
118 posts
Joined: Oct. 2023
Offline
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
30 posts
Joined: May 2016
Offline
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
  • Quick Links