Found a bug in MayaExport

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply
Coyl
Gnoblar
Posts: 1
Joined: Thu Oct 13, 2005 8:57 am
Contact:

Found a bug in MayaExport

Post 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
User avatar
bisco
OGRE Contributor
OGRE Contributor
Posts: 235
Joined: Wed Nov 03, 2004 5:01 pm
Location: London, United Kingdom

Post by bisco »

Thanks, for the patch
I'll apply it right away ;)
Post Reply