Use UI Button#1 Trigger to Set Position of UI Butting#2: Possible?

CaveGentleman

Member
Messages
50
Reactions
35
Points
18
Hi VAM Fam:

I am trying to make a UI Button (let's call it UI Button#1) that contains a trigger that sets the position/rotation of different UI Button (let's call it UI Button#2). I cannot figure out how to do this. Can someone provide guidance? Assume that UI Button#2 already exists in the scene pre-click.

Things I've tried/thought of:
1) Loading saved preset of UI Button#2 upon click
This does not work because the only way to save the position of a UI Button (and many other non-Person atoms) is through the legacy "Pose Preset." And, alas, there is currently no way to load the legacy Pose Preset of a UI Button via trigger (please correct me if I'm wrong).

2) "Rubber Leashing" UI Button#2 to an atom whose position can be controlled via UI Button Trigger
The idea would be clicking UI Button#1, setting the new position of different atom ("GuideAtom"), and then having the second trigger in UI Button#1 activate the Rubber Leash plugin in UI Button#2, shooting it over to GuideAtom. I haven't tried this because it smacks of tedium and inefficiency.

Thanks for any help!
 
It might be overkill but since that's the way I would do it, I'll suggest it anyway.

If you have multiple buttons it'd make more sense to use a technique like this.

What I would do is use Timeline and create an "animation" for each "position". In Timeline you'll be able to position all buttons, determine which ones are on or off, change their colors and whatnot using triggers and controls. So, when you click on your button 1, you simply trigger "Play MyButtonSetup1" and everything will fall into place. It'll also be easier and faster to add setups in the future and make updates to your setups (simple move the button and Timeline will save the updated position). You might want to set blend time to zero, but having the buttons move around might also be something you'd like to take advantage of.

Since version 6, it's possible to animate other atoms, so you don't have to add one Timeline per button or anything like that. Just have one instance on an Empty atom (something like ButtonControl) and you should be fine.

Keep in mind, since I made Timeline I tend to do everything with it, there might be simpler solutions out there that I'm not aware of :D
 
It might be overkill but since that's the way I would do it, I'll suggest it anyway.

If you have multiple buttons it'd make more sense to use a technique like this.

What I would do is use Timeline and create an "animation" for each "position". In Timeline you'll be able to position all buttons, determine which ones are on or off, change their colors and whatnot using triggers and controls. So, when you click on your button 1, you simply trigger "Play MyButtonSetup1" and everything will fall into place. It'll also be easier and faster to add setups in the future and make updates to your setups (simple move the button and Timeline will save the updated position). You might want to set blend time to zero, but having the buttons move around might also be something you'd like to take advantage of.

Since version 6, it's possible to animate other atoms, so you don't have to add one Timeline per button or anything like that. Just have one instance on an Empty atom (something like ButtonControl) and you should be fine.

Keep in mind, since I made Timeline I tend to do everything with it, there might be simpler solutions out there that I'm not aware of :D
Wow, thanks a lot! I will give this a try and report back.
 
I saved the "animation" of button 2 being where it would end up. I exported the animation and opened up the JSON. Could you please explain what the letters t, v, c, i, and o represent here? I see there is a relation to the position of the atom, but my feeble brain no quite understandy. Thanks!
1658515014679.png
1658515355164.png
 
Haha you're technically not supposed to have to know any of that to use Timeline, but if you need (or want) to know:

- X, Y, Z are Vector3 for position relative to the current parent (usually, the root joint, or the specified parent)
- RotX, RotY, RotZ and RotW are Quaternion for the relative rotation
- t is "time"
- v is "value" at this keyframe for the current curve
- c is the curve type (for re-processing)
- i and o are the bezier handles values in one dimension
 
i think this would be easily done with VAMs built-in animation pattern. That might be easier than using timeline.
 
i made a plugin for easier stuff like this in DynamicPosition from

1. add dynamicposition to the atom you want to move/rotate
2. trigger the plugin, set the value you want and then pick an operation to do with that value

SetPosition expects x,y,z coords

 
Back
Top Bottom