Jump to content

create unique id on changing ptnum points VEX


WLVL

Recommended Posts

Hello everyone,

 

I have several different pop sim, merged in sop.   

since the pop id starts at zero for each sim, i have multiple points with same id values.

i need a unique id.

 

i'd like to create a name attribute based on the "stream group + id".

 

how would i do this with vex?

i am missing how to get the name of the group the point belongs to

s@name= itoa(@id)+"how do i get my group name here?";

Thank you in advance!

 

 

 

PS. one way i did it was to drop an attr create, shift the id value by a big number (i.e. $ID+500000), different for each stream, but this is not very pratical

 

 

PS. the nameSOP does get the group name somehow but it's not possibile to unlock its content to see how

Edited by WLVL
Link to comment
Share on other sites

As the first step:

string pointgroups[] = detailintrinsic(0, "pointgroups");
s@name = pointgroups[0] + "_" + itoa(@id);

It will take first point's group in alphabetical order. Name SOP chooses group differently, probably the last group in the order they was created. It's probably impossible to recreate such behavior inside VEX and completely replace Name SOP in such corner cases.

  • Like 1
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...