Hi all,
I’m trying to get a small script working via my userSetup.mel.
So far the following code works when starting Maya, giving me a dialog box with two buttons:
// This script warns you when you open a scene file that is not in PAL - 25fps
global proc FrameRateWarningPAL() {
string $currentfps = currentTimeUnitToFPS;
string $currentfpsName = currentUnit -q -time;
if ($currentfpsName!=“pal”) {
// create a confirm dialog with a yes and no button.
$response = confirmDialog -title "WARNING! Frame rate issue!!" -message ("This scene is not in 25 fps!! Reset Scene? (currently " + $currentfps + " fps)") -button "Yes" -button "No" -defaultButton "Yes" -cancelButton "No" -dismissString "No";
}
}
What I want is to check the response and start additional things, by adding this code:
// check response
if( $response == "Yes" )
{
print("Scene reset to cm, 25fps, timeline and render 0-500
");
}
else if( $response == “No” )
{
print("Really?? 30fps???
");
This will not work, probably due to the second if statement.
Can someone help me out here to solve this.
What I want in the end is to set some of the preferences via this startup script for scenes.
The response check works via the script editor in Maya, so it’s MEL correct.
cheers!
rob