Notifications
Clear all

[Closed] Question about the When Construct

Pre Searches RnD:
Help and this post. Still stuck…


clearlistener()
resetmaxfile #noprompt
mybox = box ()
select mybox

mybox.pos.controller = position_list () 					-- I give a selection a position_list () controller
mybox.pos.controller.Available.controller = Position_XYZ () 	-- Then another arbitrary controller... say another position xyz
mybox.pos.controller.weight[2]  = 50.0 					-- i now have the option to edit weight [1] or [2]

x = mybox.pos.controller.weight[2] 
print x

--when transform mybox changes do (print "there was a change in transform") -- <-- working fine but

when x mybox changes  do (print "there was a change in controller's weight" ) -- < not working


this just a simple create box script where I am doing testing with the “When” construct.
So, I commented out the when transform, but i put it there to show that the construct is working.

I was following the…

when <attribute> <objects> change[s] do

… syntax as taught in the help, but I keep getting a syntax error when I simply change out transform for a different attribute… in this case, the weight attribute under the transform controller.

why this is so?
is (obj’s.position.transform.controller.weight) not an attribute in this context?

the syntax error is telling me it expects a while clause… but, I know that’s not what i need.

1 Reply

ok, after running around in circles,
i didn’t realize that in the help

topology geometry name[s] transform select parameters subAnimStructure controller children

that these were the literally the args that you can put in. (facepalm) I thought theye were examples of what you can put in.

(studying in progress, sorry to waste space on the forum)