opdef woes

   1185   1   2
User Avatar
Member
731 posts
Joined: Dec. 2006
Offline
Hi,

I'm trying to refer to an embedded script in an HDA using an hscript callback.
opdef:.?foo.cmd

I want to pass on the full path to this node and the value of the widget that is calling the script:
opdef:.?foo.cmd `opfullpath(".")` `ch("parm")`

… this kind of works. If I go from entry 0->1, it works, but if I go from entry 1->2 it does not (script does not even get called according to my debug statements). If I go from 0->2 it gives me the right path to object but the wrong parm value.

I think there is some kind of fancy syntax built into the opdef expression that passes on both the full path and the parm value, but for the life of me I can't find it.

help?

Sean
Edited by mrCatfish - Dec. 13, 2018 17:30:14
Sean Lewkiw
CG Supervisor
Machine FX - Cinesite MTL
User Avatar
Member
731 posts
Joined: Dec. 2006
Offline
In the long tradition of answering my own question… the problem was in the script I wrote. I failed to properly construct the conditional statements. If the numbers are not in quotes, the script will break, (I guess the integers are being passed to the script as strings, and the tests sometimes don't evaluate). I don't know why sometimes they do evaluate, but coming out of the fog of my memory, I remember this as a long-standing hscript issue.

unix echo "----"
unix echo $argc
unix echo $arg1
unix echo $arg2

if ($arg2 == "0") then
    unix echo zero
endif

if ($arg2 == "1" ) then
    unix echo one
endif

if ($arg2 == "2") then
    unix echo two
endif
Edited by mrCatfish - Dec. 14, 2018 10:51:12
Sean Lewkiw
CG Supervisor
Machine FX - Cinesite MTL
  • Quick Links