PDA

View Full Version : Camerapanel bug between maya 2008 & 2009?


BigRoyNL
02-20-2009, 10:30 AM
Hey Guys,

The script below works in Maya 2008, but not in 2009.
global proc RN_UItest ()
{
if (`window -q -ex testUI`) deleteUI testUI;
window -w 650 -h 600 -title "Script test" testUI;
paneLayout -paneSize 3 100 30 -configuration "top3" "facialPaneLayout";
modelPanel -cam "persp" -mbv 0 -l facialInterfacePanel;
setParent..;
modelPanel -cam "side" -mbv 0 -l facialCamPanel;
setParent..;
showWindow testUI;
}
RN_UItest;

If I run this script in Maya 2008 it gives me a 3 panel User Interface with at the top 2 cams. If I run the script in Maya 2009 it gives me this error:
// Error: line 8: Too many children in layout: modelEditorIconBar //
I guess the problem is because of the new 'icon toolbar' in the viewport in 2009. Toggling it off before running doesn't fix the problem though.

If I duplicate both the setParent..; commands then it DOES run the script, but only the left side camera in the UI works...

How do I fix this in Maya 2009? What should I turn of in the script or what should I change?..

Hope somebody can help me out! I'm really stuck here!

Thanks in advance!

Roy

BigRoyNL
02-22-2009, 11:11 PM
What is the best way to contact autodesk about this kind of things?

goleafsgo
02-23-2009, 12:19 AM
I logged this bug for someone else a week or so ago...

To workaround the bug set the parent explicitly instead of with the "..".

So for your example would look like this:

global proc RN_UItest ()
{
if (`window -q -ex testUI`) deleteUI testUI;
window -w 650 -h 600 -title "Script test" testUI;
string $pl = `paneLayout -paneSize 3 100 30 -configuration "top3" "facialPaneLayout"`;
modelPanel -cam "persp" -mbv 0 -l facialInterfacePanel;
setParent $pl;
modelPanel -cam "side" -mbv 0 -l facialCamPanel;
showWindow testUI;
}

RN_UItest;

BigRoyNL
02-24-2009, 08:36 AM
Thanks for the tip! Worked great!

If you create such a panel. It comes in the panel list. But if you run the script again, there comes a new one. And a new one, and a new one... How can I delete the panel under the panel list when the window gets closes, or when ran again delete the previous once.

Roy

Ha. I got it with the panel -q -ex and the deleteUI -panel...
Thanks anyway.

goleafsgo
02-24-2009, 11:52 AM
Instead of using "modelPanel" in your script have you tried using "modelEditor"? That will probably give you want you want.

If you want your window to be able to go inside a panel then you should look at the docs for "scriptedPanel". This command lets you set up a type of UI and lets you provide callbacks for when you should create/edit the UI.

BigRoyNL
02-24-2009, 01:32 PM
The modelEditor was indeed more what I needed, thanks for the tip.. will be using that now.

Also I'll dig into the scriptedPanel in a while.

Thanks!

Roy

EDIT:
If I do something in the viewport created with the modelEditor and then I press CTRL + Z it doesn't work. Only when I first press in the 'normal' viewport and then press CTRL + Z it undos the action. How can I setup the camera in the UI that I can instantly press CTRL + Z to undo.

CGTalk Moderation
02-24-2009, 01:32 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.