Jump to content

Can you trigger an opscript...


Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

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...