Python SOP get channel data CHOP

   7399   21   1
User Avatar
Member
21 posts
Joined: May 2013
Offline
Hi all!
Im completely stuck writing my second Python SOP. What I want to do is in my py sop get data from a specific chops channel that the user specifies with an absolut path. I want to be able to sample the chops channel on different frames (current, previous and next).
If someone could point me in the right direction, maybe with a line of code for how to point to this chop node, that would be much appreciated!
I've been trying with hou.ChopNode and hou.Track but couldn't figure out how to init / set it up.
My chop network is really simple, starts with a file, followed by a filter and a trigger and ends with a null containing one channel, amplitude.
Thanks for your time
/John
User Avatar
Member
7725 posts
Joined: July 2005
Offline
chopnode.tracks().evaluateAtFrame(hou.frame() - 1)
chopnode.tracks().evaluateAtFrame(hou.frame() + 1)
… etc … ?
User Avatar
Member
21 posts
Joined: May 2013
Offline
Hi! Thanks for you reply!

For some reason I can't figure this out

Is the chopnode in your example the same as


>>> chopnode = hou.node('/obj/music/OUT_AMPLITUDE')


because when I run the code in the python shell for testing purposes

I get this error


>>> chopnode = hou.node('/obj/music/OUT_AMPLITUDE')
>>> chopnode.tracks().evaluateAtFrame(100)
Traceback (most recent call last):
File “<console>”, line 1, in <module>
AttributeError: ‘Track’ object has no attribute ‘evaluateAtFrame’
>>>


I've attached my hip file with my python sop in it, but if I could get the code working in the python shell i think I could take it from there.

Attachments:
eqTest_v01_01.hip (72.1 KB)

User Avatar
Member
1908 posts
Joined: Nov. 2006
Offline
I believe it is “evalAtFrame”, not “evaluateAtFrame”.
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
21 posts
Joined: May 2013
Offline
Oh that worked, now its just the rest!

Thank you so much edward and graham!
User Avatar
Member
7725 posts
Joined: July 2005
Offline
Oops, sorry! ops:
User Avatar
Member
21 posts
Joined: May 2013
Offline
User Avatar
Member
21 posts
Joined: May 2013
Offline
User Avatar
Member
21 posts
Joined: May 2013
Offline
User Avatar
Member
21 posts
Joined: May 2013
Offline
User Avatar
Member
21 posts
Joined: May 2013
Offline
User Avatar
Member
21 posts
Joined: May 2013
Offline
User Avatar
Member
21 posts
Joined: May 2013
Offline
User Avatar
Member
21 posts
Joined: May 2013
Offline
User Avatar
Member
21 posts
Joined: May 2013
Offline
User Avatar
Member
21 posts
Joined: May 2013
Offline
User Avatar
Member
21 posts
Joined: May 2013
Offline
User Avatar
Member
1 posts
Joined: May 2013
Offline
User Avatar
Member
1 posts
Joined: May 2013
Offline
User Avatar
Member
21 posts
Joined: May 2013
Offline
  • Quick Links