Notifications
Clear all

[Closed] Script controller variables

 S-S

Hi!

I have a problem reading variables in script controller. I know how to get variable names inside script controller, and what number they have.
I have for example “controlY”, which is connected to object’s Y channel. What i can’t get is the full information about node, to which this variable is connected :

$Teapot01.pos.controller.‘Y Position’

So, i think it should be relatively easy to read this info, but i just couldn’t find out how.

  • I tried everything from Methods list, which i got with showInterfaces

  • I hope .PrintDetails() isn’t only way to read this thing? i guess i just missed the correct command…

4 Replies

You can add node’s as varaible references.

Create a varaible called TEA, click “node” and assign it to $Teapot01.

Now you can use TEA in your script.

 S-S

Thanks, but that isn’t what i asked. I want to get variable content, or whatever it is called from a separate script.

for example:
x = $Teapot01.rotation.controller.Y_Rotation.controller

x.PrintDetails()


  • Description:
    (null)

  • Expression:
    0

  • Variables
    Members: 5

    1. T, Constant = 0.0
    2. S, Constant = 0.0
    3. F, Constant = 0.0
    4. NT, Constant = 0.0
    5. myVar, Track: $Box01.rotation.controller.‘Y Rotation’, tick offset = 0
  • So, i’m looking for a way to read information on last line. It feels like not so good way to get the infromation, since it’s in string format when i use printDetails command… What i managed to do, is get other info, like name of variable and so on, using these commands:
    GetValue
    GetNode
    GetObject

  • But not the information on last line… $Box01.rotation.controller.‘Y Rotation’

oh, you can use the same methods as the “expression controller”.

y = x.getValue “Y Position”

EDIT: Sorry, misread your post. I don’t think you can get the full reference of the varaible. It’s not exposed in MaxScript.

 S-S

ok, thanks for info! I already made a script which reads the information from .printDetails output