Hey all,
I'm trying to selectively rename pieces from a voronoi fracture so that they essentially get merged into the same piece. The way I'm going about it is to create a new attribute called ‘name’ and setting the value of input pieces to an existing piece name.
Example: voronoi fracture has 3 pieces: {piece0, piece1, piece2}. I want to rename all of the primitives from piece1 to be piece2, while keeping the existing piece2 primitives. The result of this should be that I now have two fracture pieces, one named ‘piece0’ and another named ‘piece2.’
I'm running into trouble getting it to work in an OTL foreach loop and I'm not sure why. When I manually set the groups to rename it works flawlessly, but when I use a multiparm block OTL and some opdigits(stamps, forvalue) trickery to pass the correct strings in, it doesn't work. It's weird in that when you hit the parameter name to hide the expression and show the result, the resulting strings are correct, they just aren't renaming the pieces.
Best way to understand what I'm trying to do and where its failing is to look at the attached example. Any and all help is appreciated!
Piece* rename merging
4905 5 1- mattv
- Member
- 21 posts
- Joined: Feb. 2012
- Offline
- sadhu
- Member
- 112 posts
- Joined: Feb. 2010
- Offline
opdigits(stamps(“..”, “FORVALUE”,0) will output 0 then 1 then 2
so out put of
chs(“../../attrib_name_string1” + opdigits(stamps(“..”, “FORVALUE”,0))
will be
chs(“../../attrib_name_string10”) it will work for forvalue piece0
then it will change to
chs(“../../attrib_name_string11”) for forvalue piece1 IT WILL NOT WORK as there is nothing like ../../attrib_name_string11 (WRONG ADDRESS)
Same is applicable to Group.
Your opdigits(stamps(“..”, “FORVALUE”,0)) should always return zero so that you can always look at address
chs(“../../attrib_name_string10”)
chs(“../../attrib_name_group10”)
so replace it by zero.
Following expressions will work
chs(“../../attrib_name_group1” + 0) for specifying group name
chs(“../../attrib_name_string1” + 0) for string value
so out put of
chs(“../../attrib_name_string1” + opdigits(stamps(“..”, “FORVALUE”,0))
will be
chs(“../../attrib_name_string10”) it will work for forvalue piece0
then it will change to
chs(“../../attrib_name_string11”) for forvalue piece1 IT WILL NOT WORK as there is nothing like ../../attrib_name_string11 (WRONG ADDRESS)
Same is applicable to Group.
Your opdigits(stamps(“..”, “FORVALUE”,0)) should always return zero so that you can always look at address
chs(“../../attrib_name_string10”)
chs(“../../attrib_name_group10”)
so replace it by zero.
Following expressions will work
chs(“../../attrib_name_group1” + 0) for specifying group name
chs(“../../attrib_name_string1” + 0) for string value
- mattv
- Member
- 21 posts
- Joined: Feb. 2012
- Offline
- mattv
- Member
- 21 posts
- Joined: Feb. 2012
- Offline
Hmmm, I'm actually still super confused. I thought I had it because the first entry in my multiparm asset works with what you said. As I add more values to my multiparm, it only works for the “0” case.
It seems to me that instead of hardcoding “+0” I need to access the FORVALUE to add in a number. I've tried the following without much success:
chs(“../../attrib_name_group1” + stamp(“..”, “FORVALUE”,0))
chs(“../../attrib_name_string1” + stamp(“..”, “FORVALUE”,0))
I can't figure out how to access the FORVALUE integer from within my foreach. I want to iterate over specific groups so I've set the FOR mode to be ‘each group’ and the group mask to be piece*. Seems like this should be super simple. If I add 3 elements to my multi parm I should have channels ‘attrib_name_group10’, ‘attrib_name_group11’, ‘attrib_name_group12’. I should also have similar variants for my string.
Not sure why stamping the FORVALUE doesn't seem to build those channel names. Seems like it can't access the actual value because when I change the default from 0 to something like 1 or 2, it changes which of my multiparm assets work, which tells me that its falling back to the default.
It seems to me that instead of hardcoding “+0” I need to access the FORVALUE to add in a number. I've tried the following without much success:
chs(“../../attrib_name_group1” + stamp(“..”, “FORVALUE”,0))
chs(“../../attrib_name_string1” + stamp(“..”, “FORVALUE”,0))
I can't figure out how to access the FORVALUE integer from within my foreach. I want to iterate over specific groups so I've set the FOR mode to be ‘each group’ and the group mask to be piece*. Seems like this should be super simple. If I add 3 elements to my multi parm I should have channels ‘attrib_name_group10’, ‘attrib_name_group11’, ‘attrib_name_group12’. I should also have similar variants for my string.
Not sure why stamping the FORVALUE doesn't seem to build those channel names. Seems like it can't access the actual value because when I change the default from 0 to something like 1 or 2, it changes which of my multiparm assets work, which tells me that its falling back to the default.
- asnowcappedromance
- Member
- 512 posts
- Joined: July 2009
- Offline
- mattv
- Member
- 21 posts
- Joined: Feb. 2012
- Offline
-
- Quick Links