PDA

View Full Version : Python: Simple "Rigg" style UI controls


cwisbg
12-19-2012, 12:00 AM
Im looking to build a simple (ha, probably not) gui control similar to a rig control. It is pretty much a square with a smaller circle in the middle, similar to a face rig to control blend shapes or whatever, but with a gui instead of crvs. Does anyone have any solutions/ideas on how to pulling off this type of UI?

Nyro
12-19-2012, 12:58 AM
I see you ended that statement with a question mark, which is why I feel compelled to inform you that, despite your punctuation choice, your sentence did not, in fact, form a question.

Thus, all I can say in terms of a reply is this:

Thank you for sharing your plans with us!

cwisbg
12-19-2012, 04:15 PM
I see you ended that statement with a question mark, which is why I feel compelled to inform you that, despite your punctuation choice, your sentence did not, in fact, form a question.

Thus, all I can say in terms of a reply is this:

Thank you for sharing your plans with us!

Yes it was a question, but terribly stated so I re-wrote it for you. thanks for keeping me on my toes :D

Nyro
12-19-2012, 04:46 PM
Maya's built-in UI elements do not allow for such a degree of user interaction (from what I understand, you want to be able to grab something in your UI and drag it around?). The only mouse interaction you get are drag-and-drop callbacks, which are bound to the middle mouse button.
With some crazy formLayout scripting and catching XY coordinates of dropCallbacks and stuff, I suppose you could script a UI that has a repositionable image or something in it, but at first thought that looks waaaay too complicated.

That said, you could look into Qt, or possibly PyQt, to see if you can take advantage of that to build a custom UI that can do what you need.

Now, if all you really want is a rig control that sits in a window as opposed to some viewPanel, then you could always create a window with a viewport in it that displays your 'classic' rig controls (read: Curves), which are infinitely easier to set up.

gmask
12-20-2012, 02:52 PM
I believe it's possible to write such a control with python and the API and OpenGL. I think I hve seen some examples of this but offhand I don't know if any public examples.

rgkovach123
12-20-2012, 11:16 PM
you can create this type of control with pyqt. you can create any kind of gui using their low-level paint and brush commands.

This tutorial is pretty good at covering the basics, but if you haven't used python or pyqt there is a rather steep learning curve.

http://zetcode.com/tutorials/pyqt4/customwidgets/

cwisbg
12-22-2012, 03:58 PM
Iv been looking into pyqt, and there is one thing catching me up. Its making me download a couple things, like the pyqt library, and another library called SIP which is fine. I just dont want other people that use the script to have to download this stuff. Is there a way ill be able to code it up, and then give the script to other team members without them having to download/install these libraries??

CGTalk Moderation
12-22-2012, 03:58 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.