meshsmooth Posted November 24, 2004 Share Posted November 24, 2004 I would like to trigger a simple OPscrip when a parameter passes a set value. I have a null that has its x translation between 0 and 1 used to blend between kinematic solutions and I want to trigger an OPscript to set some values when the null moved past the x value of 2. I can see some issues when the null is past 2 that is may be constantly triggering the OPscript, so i may need a trigger that only works once each time it passes 2. Quote Link to comment Share on other sites More sharing options...
Jason Posted November 24, 2004 Share Posted November 24, 2004 I would like to trigger a simple OPscrip when a parameter passes a set value.I have a null that has its x translation between 0 and 1 used to blend between kinematic solutions and I want to trigger an OPscript to set some values when the null moved past the x value of 2. I can see some issues when the null is past 2 that is may be constantly triggering the OPscript, so i may need a trigger that only works once each time it passes 2. 15105[/snapback] Yip you can - look into the Logic CHOP. Quote Link to comment Share on other sites More sharing options...
malexander Posted November 24, 2004 Share Posted November 24, 2004 You can use a Math CHOP to subtract 'X' from the channel, and then pipe that into a Logic CHOP. The logic CHOP converts the channels to binary (0/1, on/off), and by default anything greater than zero is a '1', otherwise it's '0'. So by subtracting X from the channel, you're essentially programming in the v > X expression. A logic CHOP has 4 script parms for different conditions: - when a 0-1 transistion occurs (off->on) - when a 1-0 transistion occurs (on->off) - when 1 (on) - when 0 (off) It sounds like you'll want to use 'Off to on'. Incidently, in order for the script to be executed, the logic CHOP must be cooked - so you'll need to setup a dummy chopf() expression in another op which does cook to get logic to cook. Quote Link to comment Share on other sites More sharing options...
michael Posted November 24, 2004 Share Posted November 24, 2004 ...just wondering... why are you blending kinematic solutions with the translation of a null?....I can't seem to think of a reason that this would be a good idea... Quote Link to comment Share on other sites More sharing options...
meshsmooth Posted November 24, 2004 Author Share Posted November 24, 2004 When I started playing with this i had the issue that I was sampling the whole time line so when I made any changes it would trigger the script if I had it triggering at any time in the time line, so now I am going to switch the fetch to only grab the current frame. as for using a null to fiddle with kinematic solutions, well I want a handle in the view port that is handy. and i want to overload its functionality by having it behave as a button as well. it is to be done as a movement of the null that isn't key framed, just a movement that is deliberate with the available handles. Quote Link to comment Share on other sites More sharing options...
michael Posted November 24, 2004 Share Posted November 24, 2004 ah... I wish we could publish the rigging tools we built here to the codex and SESI Exchange (hmmm maybe I'll ask) - they're really simple but have lots of bells and whistles...sliders and other do-dads... Quote Link to comment Share on other sites More sharing options...
edward Posted November 25, 2004 Share Posted November 25, 2004 While you can do it, I can't recommend this approach. I think a better way is to just use if(ch("/obj/mynull/tx")>=2, some_value, some_other_value) expressions. Quote Link to comment Share on other sites More sharing options...
meshsmooth Posted November 25, 2004 Author Share Posted November 25, 2004 I have it worked out now. The logic chop with a one line opparm script. The reason for the script is I want it to be like a button click. It is meant to be a trigger. It worked out well. 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.