bhbilbao Posted February 15, 2017 Share Posted February 15, 2017 (edited) Hi, need some help. After using duplicate node. I marked "Create Output Groups" for the copies as: zone$CY Now I have some groups inside primitives spreadsheet named group:zone1 | group:zone2 | group:zone3..etc, with values 0 or 1. I need to create a new intenger attribute named "zone" only with the number of the zone, and then finally delete the groups. all this with attribute wrangle. Thanks in advance. Edited February 15, 2017 by bhbilbao Quote Link to comment Share on other sites More sharing options...
Jero3d Posted February 15, 2017 Share Posted February 15, 2017 (edited) string groups[] = detailintrinsic(0, "primitivegroups"); foreach(string s; groups){ if (inprimgroup(0, s, @primnum)){ i@zone = opdigits(s); } } There is no way to delete groups in VEX as far as I know. You will need to add a Group SOP and go to the Edit tab, then Delete and type zone* Edited February 15, 2017 by Jero3d Updated so it works with any number of groups, it would break after 10 groups before, new code should be fine 2 Quote Link to comment Share on other sites More sharing options...
bhbilbao Posted February 15, 2017 Author Share Posted February 15, 2017 Thanks a lot Jero3D, I saw that solution before in the forums but I dont understand why didnt work before. I also solved in another ugly way, (except there is no value for zone0). nodes: name (group mask: zone*) + attribstringedit (From: zone . To: *empty*) Bye. Quote Link to comment Share on other sites More sharing options...
anim Posted February 16, 2017 Share Posted February 16, 2017 using Name SOP for that purpose it's not an ugly way, that's one of it's uses the ugly part is keeping the number as a string, why don' tyou just keep the name?, you can always extract int from is using opdigits() VEX function when needed Quote Link to comment Share on other sites More sharing options...
bhbilbao Posted February 24, 2017 Author Share Posted February 24, 2017 yes Tomas, I finally stayed with the method explained by Jero3D. More clean. Sorry about these questions but Im very newbie(1 week) with this software. I come here after more than 14 years with maya. Thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.