SUBSCRIBE The SideFX mailing list is a great place to make contact with Houdini users. To subscribe, send us an email with no subject and the word subscribe in the body.
[Sidefx-houdini-list] Get chop valueness
Thursday, 20 April 2006 Thu, 20 Apr '06
Yep - you need chop() - not ch(). If you're doing stuff in realtime then in general you don't want to use hscript. That generally forces a recook of your entire chopnet - which can take a while depending on what you are doing. Expressions in the expression chop are ok though. look at: exhelp ic() and related expressions for use in the expression chop. You can put switches in there using the expression if() syntax - exhelp if - (not to be confused with the hscript if() syntax - help if).
From what you describe though, and without having tested this idea,you might want to use a lookup CHOP or two. That will permit you to look up values from a long animation sequence. 1./ Create your counter. 2./ Create a "new" channel that has the start frame of each segment at each index. ie. at index 0 the value is the start frame of the first clip. At index 1 the value is the start frame of the second clip, etc. 3./ Use the count channel to index the "new" channel. That should give you the "value offset" you need to create the index for your next lookup. 4./ Create a linear ramp channel in which value=frame. 5./ Copy CHOP your linear ramp to whatever trigger you're counting so that the ramp's value goes back to zero every time the count increases. 6./ Use a math chop to add the "value offset" from step 3 to the index channel created in step 5. (This should work as an index to your long animation.) 7./ Use the channel from step 6 as an index in a second lookup chop to lookup values from your long animation. 8./ Try running the output through an envelope chop to smooth it out. Maybe a lag chop - depending on what effect you're after. I haven't tried this out - so it may not work, but may help anyway. Cheers On 20/04/06, Simon Barrick <simon at primalpictures.com> wrote:
Try chop(string channel) Or chopf or chopt if you want the value at a particular time -----Original Message----- From: Jason Lam [mailto:jason at mindfloss.com.au] Sent: 20 April 2006 17:09 To: sidefx-houdini-list at sidefx.com Subject: [Sidefx-houdini-list] Get chop valueness Hey dudes Thanks all for your help, I have yet another question Basically I want you to be able to walk up to a character, trigger it to perform say frames 1 - 150 of an animation, and then the next time it'll go do the next lot etc. I coould do it with a switch chop and have each clip loaded in sepereately, but I thought I could have it on one mega long sequence, and then play segments of it. So... I want to access the value of a count chop in a script so I can do nifty things based on how many times a given event has happened. So I figure I'll have a logic chop watching my count chop and then in the script I need to query the value of count and on various event numbers I would change the start and end of another count chop which fed into my lookup chop. Actually no I write it out it does seem kind of silly. Anyways, I'm sure it'll be handy to know, so if you could enlighten me as to how to acces the value of a chop that'd be tops. I did try chls which didn't seem to list the count channel for some reason, and ch("/ch/ch1/count3/count/") didn't work either. Cheers Jais-- ======================================= Andrew D Lyons | Digital Artist | http://www.tstex.com =======================================