How to procedurally rename the CHOP channels?

   1428   4   0
User Avatar
Member
339 posts
Joined: June 2013
Online
I'm running a bunch of transforms on points and want to then output them to several objects but need to rename them to prefix them with the appropriate object object:channelin order for the export to work.
I don't see how I can rename the channels in a data driven way either already inside chops or on import.

Anyone tackled this?
Thanks.
User Avatar
Member
8597 posts
Joined: July 2007
Offline
have you tried Rename CHOP?
rename from: *
rename to: object:*

or Channel Wrangle CHOP
chrename() [www.sidefx.com] VEX function
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
339 posts
Joined: June 2013
Online
tamte
have you tried Rename CHOP?
rename from: *
rename to: object:*

or Channel Wrangle CHOP
chrename() [www.sidefx.com] VEX function

Rename CHOP does not help because it's not a single object to rename to but multiple objects names.
I did not see chrename() when I checked VEX functions, that might be the approach I was looking for initially. Maybe it works in a newer version (I'm in 18.5.351) since I just tested it by prefixing with "box:" before the transform channel name and did not work but... there's a __name__ attribute there when MMB the wrangle... I'll test it further, thanks for the pointer!

I ended up using the Geometry CHOP parameter, "Point Name Attribute" which uses a string attribute to prefix the channel names instead of suffixing them with enumeration (tx0, tx1, etc..)

Cheers




Edited by probiner - Sept. 8, 2021 23:31:53

Attachments:
unknown.png (16.8 KB)
chrename.png (241.8 KB)

User Avatar
Member
8597 posts
Joined: July 2007
Offline
probiner
I just tested it by prefixing with "box:" before the transform channel name and did not work
to make it work change your Iterate parameter to Over Channels for example (help page contains more info)
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
339 posts
Joined: June 2013
Online
tamte
probiner
I just tested it by prefixing with "box:" before the transform channel name and did not work
to make it work change your Iterate parameter to Over Channels for example (help page contains more info)
Right, thanks! This is indeed the procedural way I was looking for, bit more work but may be worth it!

int digits = floor(log10(opdigits(CN))) + 1 ;
chrename(CN, point("op:../../ToCHOPS3", "chop_prefix", C/9) + CN[:-digits]) ;

Reorder was also needed to facilitate the access to the correct point.




Cheers
Edited by probiner - Sept. 9, 2021 07:10:51

Attachments:
CHOP.png (26.9 KB)

  • Quick Links