Maya exporter code suggestions

A few bug fixes & suggestions. I should probably setup CVS and enter these on sourceforge…


DaeDoc.cpp line 219 : instead of using mel, you could just replace that with :


MDistance temp(1.0f,MDistance::uiUnit());
float conversionFactor = temp.as( MDistance::kMeters );

the same goes for line 155.


line 1090, DaeGeometryLibrary.cpp : I’m not sure why (still looking into it) but occasionally there can be less shader groups than there are polygons. I’ve added this temporary fix to stop it crashing.


          if(shaderGroups.length()>i)
          {
					  MFnSet shaderGroupFn(shaderGroups[i]);
					  shaderGroupFn.addMembers(componentList);
          }

I guess it would be better in the long run to assign the default lambert1 on import. (possibly)


DaeTranslator.h : If you add the following code into the DaeTranslator class, then the import/export file dialog will correctly filter *.dae files :

MString filter() const { return "*.dae"; }

CSceneWalker.cpp, line 139: this is a bit nasty, since it does not check to see if the invisible node has an effect on the scene data. For example, create a simple skinned mesh, then set the bones “isVisible” flags to false. The skin cluster will save out references to the invisible bones, however those bones will not be present in the DAE file since the exporter skips them.


The exporter fails to save out animation for identical rigs imported into a scene and animated. It seems to remove the “model1:” & “model2:” prefixes to imported data, so when re-importing it gets confused by there being 2 “root” bones in a scene. I’ve not had a chance to find the exact bits of code as yet.

Hi Rob,

Thanks for the suggestions. I’m going to fix these tomorrow, before the next Weekly Development Build release.

About MEL, I’ll verify, but there are a few places were we use MEL because Maya 5.0 didn’t have an API that was as developed as Maya 7.0. I’ll check to make sure, though, with respect to the UI units.

Sincerely,