Notifications
Clear all

[Closed] Updating a helpers rollout when it is moved?

How do I update a helpers rollout every time it is moved or rotated?

I want to display an x, y, z offset in a label on my custom helpers rollout, but I can’t seem to figure out how to get it to update every time the object is moved. Is there any event I can check like “on update do ()”?

6 Replies

I would say probably use a script controller to handle it. Check the Maxscript FAQ for “How do I change the text in a Text Shape dynamically?” This may give you some ideas on how to handle it. It uses the dependson command, but in Max 8+ you can assign nodes to user variables instead.

-Eric

How do you assign a node to a user variable and get the updating to work. I read the help document and it says exactly what you said, but it doesn’t link to a sample or anything.

You should be able to do it by creating a variable, select the created variable and choose Assign Node. Select the rotating object. Then do something like the Helper Label equal to the X, Y, Z rotation of the variable.

-Eric

I still can’t figure this out.

I’ve found these types of controllers:
float_script : floatController
point3_script : point3Controller
position_script : positionController
rotation_script : rotationController
scale_script : scaleController

but there doesn’t seem to be anything that would allow me to change a labels text (So I can’t attach it to the label).

If I attach it to the custom helpers position, then how do I return the value that it would have been, but also update the label?

$foo.position.controller.script = “[?, ?, ?]; rollout.lblPosition.text = “[?, ?, ?]””

How do I fill in the question marks with the proper values?

Look at the Tutorial in the FAQ section. The script is applied to the Kerning of the Text object, but is setting the value of the Text. They are setting value of the text inside the script controller based on the boxes height. You need to do the same thing, assign the script controller to a track that won’t be animated, have it set the label value based on the rotation of the object. If you need more help post a simplified scene and maybe someone can look at it and show you how to do it.

    You should be able to use some code like this:
dependsOn $foo.position -- this is the premax 8 dependson though it will work in later versions
rollout.lblPosition.text = $foo.position as string --set the label text based on the position
0 --set a value for the track the controller is applied to
    

-Eric

Ok did some testing. This should work just fine. Assign the script to a controller not being used, ie the scale controller on the helper.

  1. Assign a Scale Script.
  2. Create Variable: PosObj > Select PosObj from list > Assign Node $foo.
  3. Expression:
rollout.lblPosition.text = PosObj.pos as string -- update text as object moves
[1,1,1] -- set the scale to 100%

That is it, I tested this with an animated Sphere and changing the name on a Dummy. The steps were slightly altered, since you have to assign the Dummy node to a variable as well in my test as its name was being constantly changed. If you have problems please post a sample scene so that I can test it in there.

-Eric