Jump to content

Renaming Groups


petz

Recommended Posts

hi there,

i have a little problem here and hope someone can help me.

i have used the partition sop for grouping prims depending on $TZ. so i got 68 groups like prim_0_188833. for later use i need groups like prim_0, prim_1.....in acending order. i have tried to use some expression like prim_`int(fit($BBZ, 0, 1, 0, 67))`, but it did not work by reason of rounding.

i

Link to comment
Share on other sites

Hey Petz

take a look at this example file,

I used the foreach sop to rename each group, using a group SOP.

The key expressions are

prim/pointgrouplist : this returns garbage the list generated from the partition based off color.

arg : this is used to extract a particular string out of a list.

stamp : to extract the FORVALUE when inside the foreach sop.

What I did : within the foreach sop:

I use the primgrouplist to return the groups in the partition sop. ie color_9 color_6 color_4 color_5 bla bla.

u can test that with a font sop, just too see what u get.

then i wrap that within an arg expression, which returns any string within the list.

ie if u give arg this string ("color_9 color_6 color_4 color_5",1)

it returns color_6.

So I ask for arg(FORVALUE) of all the groups that are within the partition sop.

Then I rename that group with the same number i use to index the arg,

I hope this helps

But its actually really simple.

renameGroup.hipnc

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...