Page 1 of 1

Found a bug in MayaExport

Posted: Thu Oct 13, 2005 9:26 am
by Coyl
MayaExport/src/paramlist.cpp

find:

Code: Select all

		// Read options from exporter window
		//output directory
		MGlobal::executeCommand("textField -query -text OutputDirectory",outputDir);
		//neutral pose
		int neutralPoseType;
		MGlobal::executeCommand("radioButtonGrp -q -select NeutralPoseRadio",neutralPoseType);
		switch (neutralPoseType)
		{
		case 1:
			neutralPoseType = 0;
			break;
		case 2:
			neutralPoseType = 1;
			break;
		case 3:
			neutralPoseType = 2;
			MGlobal::executeCommand("intField -q -v NeutralPoseFrame",neutralPoseFrame);
			break;
		}
		//material options
		//lighting off
replace with:

Code: Select all

		// Read options from exporter window
		//output directory
		MGlobal::executeCommand("textField -query -text OutputDirectory",outputDir);
		//neutral pose
		int NeutralPoseType_loc;
		MGlobal::executeCommand("radioButtonGrp -q -select NeutralPoseRadio", NeutralPoseType_loc);
		switch ( NeutralPoseType_loc )
		{
		case 1:
			neutralPoseType = 0;
			break;
		case 2:
			neutralPoseType = 1;
			break;
		case 3:
			neutralPoseType = 2;
			{
				int neutralPoseFrame_loc;
				MGlobal::executeCommand("intField -q -v NeutralPoseFrame", neutralPoseFrame_loc);
				neutralPoseFrame = neutralPoseFrame_loc;
			}
			break;
		}
Comments:

1. int neutralPoseType; - This line declares a variable with the same name as in ParamList class definition. The local variable does override the one declared in class, that's why the value of radio-group for NeutralPose is not saved ( ie ignored ) to use it during animation export.

2. Strange behaviour in

Code: Select all

MGlobal::executeCommand("intField -q -v NeutralPoseFrame",neutralPoseFrame);
The executeCommand call does not seem to return the appropiate value stored in the textbox. Using the temporary local variable as buffer solves the problem

Posted: Sat Oct 15, 2005 5:44 pm
by bisco
Thanks, for the patch
I'll apply it right away ;)