How to obtain the properties of the selected controllers using MaxScript?

How to obtain the properties of the selected controllers using MaxScript?

xhw8506
Observer Observer
338 Views
3 Replies
Message 1 of 4

How to obtain the properties of the selected controllers using MaxScript?

xhw8506
Observer
Observer

20241128-120503.jpg
As shown in the figure, in the 3ds Max interface, I have selected a controller by dragging a selection box. I can view the properties of the selected controller by right - clicking on the timeline and choosing "Controller Properties". However, I haven't found the corresponding access interface in the development documentation. I have looked for other similar interfaces, but they output a lot of irrelevant content, such as the properties of the square selection box.

0 Likes
339 Views
3 Replies
Replies (3)
Message 2 of 4

MartinBeh
Advisor
Advisor

Just a small comment: In the trackbar you are not selecting a "controller". You are selecting a key. So maybe you have to use the current selection and then iterate through its controllers and use isKeySelected to find the selected ones?

 

Edit: Maybe this MXS function can be used to get the selected keys?

<index><trackbar_Interface>.registerFilter <value>callbackFilterFunction <value>callbackAdditionFunction <string>name <integer>id active:<boolean> stopTraversal:<boolean> 

See https://help.autodesk.com/view/MAXDEV/2023/ENU/?guid=GUID-45E2F1A9-AFBB-413F-AEAD-7C9816BA94E5 for an example

Martin B   EESignature
→ please 'Like' posts that are helpful; if a post answers your question please click the "Accept Solution" button.
0 Likes
Message 3 of 4

xhw8506
Observer
Observer

20241129-145144.jpg

What I want is to be able to filter out the invalid controller objects when selecting some, leaving a list of controller properties that are actually used for animation: As shown, it automatically filters out the others, leaving Ctrl_Brows and Ctrl_Brows01 are two controller properties of objects that can be animated. . However, since the purpose of getting these controllers is to animate, what I actually want to get are these filtered results in controllers that have animatable values. How to say this? Layer controllers? (I don't know if this description is accurate), like this: ['$Ctrl_Brows.pos.controller.Zero_Pos_XYZ.controller.X_Position.controller', '$Ctrl_Brows.pos.controller.Zero_Pos_XYZ.controller.Y_Position.controller.Limited_Controller__Bezier_Float.controller', '$Ctrl_Brows.pos.controller.Zero_Pos_XYZ.controller.Z_Position.controller', '$Ctrl_Brows.rotation.controller.Frozen_Rotation.controller.X_Rotation.controller', '$Ctrl_Brows.rotation.controller.Frozen_Rotation.controller.Y_Rotation.controller']

 

Because I can get its value directly, I can also change it directly: $Ctrl_Brows.pos.controller.Zero_Pos_XYZ.controller.X_Position.controller.value

result: 0.0

 

This is the effect I want.

0 Likes
Message 4 of 4

xhw8506
Observer
Observer

Dear @MartinBeh ,
Could you, please, take a look on that question? Many thanks in advance!

0 Likes