Atom Posted February 23, 2016 Share Posted February 23, 2016 (edited) Hello All, I have a fracture that is generating pieces for groups. They are automatically named without zero padding. For frame numbers I know I can use $F4 for instance. Is there some similar mechanism for zero padding piece names? I would like my piece names to be something like this... piece_0001 piece_0002 etc... instead of... piece1 piece2 Edited February 23, 2016 by Atom Quote Link to comment Share on other sites More sharing options...
Pazuzu Posted February 23, 2016 Share Posted February 23, 2016 Hello All, I have a fracture that is generating pieces for groups. They are automatically named without zero padding. For frame numbers I know I can use $F4 for instance. Is there some similar mechanism for zero padding piece names? I would like my piece names to be something like this... piece_0001 piece_0002 etc... instead of... piece1 piece2 Hi! Not the most elegant way but works! Cheers! padding.hip Quote Link to comment Share on other sites More sharing options...
Atom Posted February 23, 2016 Author Share Posted February 23, 2016 (edited) Thanks Pazuzu. While not exactly a fit, it got me thinking about how to use the padzero. I used a FOREACH, running over groups, with a GROUP inside. However, instead of creating a group (turn that off) I used the Rename feature under the Edit Groups tab. Because the FOREACH supplies the index I could pass that to the padzero. piece_`padzero(3,stamps ("../", "FORIDXVALUE", 0))` ap_zero_padding.hipnc Edited February 23, 2016 by Atom Quote Link to comment Share on other sites More sharing options...
pezetko Posted February 23, 2016 Share Posted February 23, 2016 I would avoid slow for each loop whenever it's possible. Voronoi Pieces will generate name attribute. You can set group membership (with padding) with primitive wrangle like this: string group_name = sprintf("piece_%04d",opdigits(@name)); setprimgroup(0, group_name, @primnum, 1, "set"); s@name = group_name; //update name It's much faster. But if you don't have to, just use that attribute directly. 3 Quote Link to comment Share on other sites More sharing options...
Pazuzu Posted February 23, 2016 Share Posted February 23, 2016 I would avoid slow for each loop whenever it's possible. Voronoi Pieces will generate name attribute. You can set group membership (with padding) with primitive wrangle like this: string group_name = sprintf("piece_%04d",opdigits(@name)); setprimgroup(0, group_name, @primnum, 1, "set"); s@name = group_name; //update name It's much faster. But if you don't have to, just use that attribute directly. Nice solution as always!! 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.