Call Back scripts with Menu Items in Otl

   5155   4   1
User Avatar
Member
63 posts
Joined: July 2005
Offline
How can I trigger a specific callback script based upon which item is selected from a Menu Item? For example, if Item#1 in the Menu is selected, it will trigger this callback script:

viewdisplay -N all l on *; viewdisplay -N all n on *; viewdisplay -N all m on *;

Then when I select Item#2, it will trigger this callback script:

viewdisplay -N all l off *; viewdisplay -N all n off *; viewdisplay -N all m off *;

Any ideas?
User Avatar
Staff
3456 posts
Joined: July 2005
Offline
make a callback script that uses the menu value as an argument…then does the logic based on that…
Michael Goldfarb | www.odforce.net
Training Lead
SideFX
www.sidefx.com
User Avatar
Member
63 posts
Joined: July 2005
Offline
Ok I am def going in the right direction now, but I am having some syntax issues I think. So far my script looks like this:

if(“ch(”display“)” == “0”)
then
message `on`
else
message `off`
endif


So this says that if I have Item#1 selected from the pulldown menu, it should return a message saying “on” and it should say “off” if #2 is selected. Well what is happening is that no matter which item i have selected, it is only returning “off.”

As a test that it is indeed finding ch(“display”), I added to the bottom:

message `ch(“display”)`

And it returned the correct 0 or 1. I guess I am just not writing the if/then/else statement correctly?
User Avatar
Member
12527 posts
Joined: July 2005
Offline
vrljc
if(“ch(”display“)” == “0”)
then
message `on`
else
message `off`
endif

Hey there,
You're only suffering from bad syntax as far I can see:

Use backquotes to evaluate expressions - and not in the message commands either:
if(`ch(“display”)` == 0)
message ‘on’
else
message ‘off’
endif
Jason Iversen, Technology Supervisor & FX Pipeline/R+D Lead @ Weta FX
also, http://www.odforce.net [www.odforce.net]
User Avatar
Member
63 posts
Joined: July 2005
Offline
cool thanx jason
  • Quick Links