How to select and move buttons or shapes in maya

How to select and move buttons or shapes in maya

christian.contreras.r
Explorer Explorer
576 Views
4 Replies
Message 1 of 5

How to select and move buttons or shapes in maya

christian.contreras.r
Explorer
Explorer

Hello, it’s me again, the one who is building an AnimPicker, is there any way to select a button or any shape on a GUI that I can assign a command to and move it in real time or idk if it’s called on design time, but anyways, is there a way or, do I need to insert coordinates for each button on a formLayout? If anyone knows, it would help me a lot, thanks.

0 Likes
Accepted solutions (1)
577 Views
4 Replies
Replies (4)
Message 2 of 5

mcw0
Advisor
Advisor

Are you saying that you want to select an existing button in a UI window and interactively move it within the formLayout?

Firstly, widgets are not interactively selectable.  So you'd have to write a tool that can overlay a polygon or curve over your UI.  Then you can select the poly or curve that represents that button and update the formLayout values based on the movement of your selection.

0 Likes
Message 3 of 5

christian.contreras.r
Explorer
Explorer

Yes, basically that’s what I want to, and, is there any tutorial on how to do this, since I’m new to Mel, or should I use python, I’m sorry it’s a bit confusing to me, so if you have any idea on how could I do this, I’d be glad if you shared it with me

0 Likes
Message 4 of 5

mcw0
Advisor
Advisor
Accepted solution

What you are asking to do is not trivial. 

First you have to get the location of your window in screen space.

Then convert that to camera space so that you can automatically build a geometry representation of your UI.

Then create a scriptJob that updates your formLayout values based on the translation of the geometry.

0 Likes
Message 5 of 5

christian.contreras.r
Explorer
Explorer

TYSM, that helped me a lot.

0 Likes