Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Syntax for whatever keys are selected

Syntax for whatever keys are selected

scott.hortonVFEUU
Observer Observer
290 Views
0 Replies
Message 1 of 1

Syntax for whatever keys are selected

scott.hortonVFEUU
Observer
Observer

Hi all!

 

This should be a slam dunk easy thing for you, but "what would be the syntax for the selected keys on a selected object, be a group or single object?

 

For example, I just want to make a script that changes two values on the TCB position controller.  I go to the Listener and find what lines are being run for the values I want to use.   After changing the values, I grabbed these...

 

$.pos.controller.keys[2].easeTo = 20
$.pos.controller.keys[2].continuity = 0

 

So there is a "2" in the array because I was manipulating the 2nd key on that object.   I want to be able to replace the "2" with something so the script can be used on say the fourth key or the sixth key.   Is it the $?

 

A second question that I just thought of...what would the syntax be to check if the object selected even had the correct controller, like     

 

if($selected.pos == null)

{

     return;

}

 

else

{

$.pos.controller.keys[2].easeTo = 20
$.pos.controller.keys[2].continuity = 0

}

 

Thanks for looking (and hopefully having an answer).

0 Likes
291 Views
0 Replies
Replies (0)