3d Manipulation/view In Mel Gui?

Hey.

I'm just wondering whether it's at all possible to mimic (or literally redirect) the 3D viewing pane to a screen inside a MEL GUI. I'm writing an app in MEL which should look stand-alone, but I want the user to be able to view the objects he is creating without having to use the actual Maya screen.

Thanks,

Will

Theres something wrong about the question. But yes and no it depends on how you look at it. Mel does not actualy ever create a gui maya does mel just instructs maya to do so. This said everything you see on your screen IS issued with mel more or less. Since maya does not have any other means to do so (even via or the api python ist still just a binding to mel). Also theres nothing that states you cant override the entire gui.

But yes you can open your own viewports maya calls them modelEditors, but thing is theres only one shared buffer for data in viewports so youd have to filter the data out for all others if you want it to be exclusive.

But yes its rather simple to open just a viewport off your own read the mel reference entry (hit f1) for modelEditor command it has a good example. That opens a window with some buttons to controll the editor.

Thanks for the info. What I meant was that I'm writing a script which opens a window. This script generates random objects, and I want the user to be able to view them in 3D, to pan and rotate..etc But I don't want them to have to minimize the window and use the maya viewport. So from what you tell me I'll just open a modelEditor in my window and hopefully that will work.

Thanks again.

I've been reading Complete Maya Programming: An Extensive Guide to MEL... by David Gould.
If you do any MEL scripting, you should read this book. He covers a lot of the basics, including this topic.
I found it to be a fast read - the second half of the book covers C++. You can't just purchase the first half, but its easily worth the price of the book.

Actually the goulds book is a bit crappy. it dont actually teach mel very well at all, because mel isnt straightforward as just typing code theres a trick to it that gould doesn't go into. It approaches mel like a reference guide. Theres only about 6 pages on the entire book thats worth anything and half of them are api related.

Most of the examples in the book are badly structured, hell he doest even go into how you really use. Unfortunately a beginner wouldn't know this. But its the far way around.