MJGaiser Posted February 3, 2017 Share Posted February 3, 2017 So I have a prim wrangle with an input that has all its primitives in a group called "allPrims". I am doing a loop where each time, I need to reset the group and make sure it contains all the primitives as I am removing certain ones within the loop. I thought that I could just make a copy of the initial group ("current") and remove the primitives from that copy then for each prim in the wrangle it would just refresh the the group based on the initial "allPrims" group. The only problem is that I cannot seem to copy the group. I am trying to do so like this: s@group_current = s@group_allPrims; This will create a group called current, but it will not have the primitives from the "allPrims" in it. How do you copy the contents of one group to another in vex? And as an alternative method which might just be easier, How do you assign all primitives from input 0 to a group as this could be done to refresh the group for each loop? Thanks! Quote Link to comment Share on other sites More sharing options...
f1480187 Posted February 3, 2017 Share Posted February 3, 2017 Groups accessed as integer attributes: i@group_current = i@group_allPrims; 1 Quote Link to comment Share on other sites More sharing options...
dchow1992 Posted February 3, 2017 Share Posted February 3, 2017 (edited) nvm Edited February 3, 2017 by dchow1992 Quote Link to comment Share on other sites More sharing options...
MJGaiser Posted February 3, 2017 Author Share Posted February 3, 2017 Thanks. Is there an easy way to group all the input prims into a group without having to loop through each prim and assign them individually to the group? Quote Link to comment Share on other sites More sharing options...
f1480187 Posted February 3, 2017 Share Posted February 3, 2017 @group_newgroup = 1; You mean something like this? Quote Link to comment Share on other sites More sharing options...
MJGaiser Posted February 3, 2017 Author Share Posted February 3, 2017 Im not sure. Doesn't that only assign the current prim to @group_newgroup? That would after all the prims have been looped through, result in all of them being in the group, but I am looking for a way to assign all the prims to that group during the evaluation of the first prim. Basically each prim would see that group get recreated ("Refreshed") with all the prims from input 0. Quote Link to comment Share on other sites More sharing options...
f1480187 Posted February 3, 2017 Share Posted February 3, 2017 You can set membership in for loop by setprimgroup() and same functions, but you still cannot create group within same wrangle for expanding or membership testing later. When you try to use newly created group, you will get nothing, because such functions always look on input geometry. // Primitive wrangle. for (int i = 0; i < @numprim; i++) { setprimgroup(0, "newgroup", @primnum, true); } i@ingroup1 = inprimgroup(0, "newgroup", @primnum); i@ingroup2 = @group_newgroup; i[]@prims_in_group = expandprimgroup(0, "newgroup"); It will create group correctly (you may add condition to run for loop only on first primitive for speed, it does not matter here), but membership tests will fail and the group will expand into an empty array. Look at arrays for storing some data to access it later in wrangle. Or simply make several wrangles. input_limitation.hipnc Quote Link to comment Share on other sites More sharing options...
MJGaiser Posted February 4, 2017 Author Share Posted February 4, 2017 Ah ok. I see the problem now. Time to learn a bit more about vex arrays. 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.