Jump to content

SOLVED - CHOPs - Accessing Channel Names


DeeLan

Recommended Posts

My Original Question is still posted bellow, but i have since figured out a solution to get what I want. Basically in CHOPs I have a null with a string parameter with a multi line python expression on it. This expression produces a string with all the channel names in it.

refNode = hou.node('/ch/ch1/noise1')

tracks = "__TEMPSTRING__"
iteration = 0
trackTuple = refNode.tracks()

for track in trackTuple:    
    curTrackString = str(track).split(" in ")[0]
    curTrackString = curTrackString.split("<hou.Track ")[1]
    
    if iteration == 0:
        tracks = curTrackString
    else:
        tracks = "{0} {1}".format(tracks, curTrackString)
    iteration += 1

return(tracks)

Just make sure that "refNode" is referencing the node you want to get the channels from and this should work for you as well :)

-- ORIGINAL QUESTION -- 

Hey guys. I need to be able to the names of all the channels that exist on a particular CHOP into a string parameter field (as shown below). There is a VEX Function called "chnames" which gets me the names but then I don't know what to do with it. I've promoted the names to a clip attribute but I have absolutely no idea how to access said attribute in an expression. 

So my two ideas are either to...

1) Stick with the Clip Attribute and somehow reference that in an expression

OR
2) Somehow execute the "chnames" VEX function in an expression/parameter field (which I don't even think is possible but putting it out there just in case)

If anyone knows how to do either of these things or has another method that'd work please let me know. I'm about to explode from the frustration of trying to figure this out! :(

CHOPs_Names_To_String.thumb.png.8a35d2412b43fd90e17e4255cc672028.png

Edited by DeeLan
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...