Maya To Indigo v0.6.2 (0.6)

Announcements, requests and support regarding the MAYA exporter
User avatar
yourdaftpunk
Posts: 27
Joined: Thu Nov 23, 2006 3:24 pm
Location: Houston
Contact:

Post by yourdaftpunk » Fri Dec 01, 2006 6:07 am

Someone needs to send me the 6.5 files so I can compile.

Also, turns out that creating and assigning shaders in mel doesn't work like you want. I think this will work in all versions of Maya:

Code: Select all

global proc meshLight() {
	// create poly plane
	string $lightPoly[] = `polyPlane -n emitter -sx 1 -sy 1 -w 5 -h 5 -ch 0`;

	// get the poly plane shape node and triangulate
	string $polyShape[] = `listRelatives -shapes $lightPoly[0]`;
	polyTriangulate -ch 0 $polyShape[0];

	// create lambert material
	float $eRGB[] = { 0.75, 0.75, 0.75 };
	string $lightLambert = `shadingNode -asShader lambert -name emitterMaterial`;
	setAttr ($lightLambert+".incandescence") -type double3 $eRGB[0] $eRGB[1] $eRGB[2];
	//string $lightSG = `shadingNode -asShader shadingEngine -name emitterMaterialSG`;
	sets -renderable true -noSurfaceShader true -empty -name ($lightLambert+"SG");
	connectAttr -f ($lightLambert+".outColor") ($lightLambert+"SG"+".surfaceShader");

	// assign shader group
	//connectAttr -f ($polyShape[0]+".instObjGroups[0]") ($lightSG+".dagSetMembers[0]");
	select -r $polyShape[0];
	sets -e -forceElement emitterMaterialSG;
	
	// create curve arrow
	string $curveName = `curve -ws -d 1 -p 0 0 0 -p 0 4 0 -p 1 3 0 -p -1 3 0 -p 0 4 0 -p 0 3 1 -p 0 3 -1 -p 0 4 0`;
	string $curveShape[] = `listRelatives -shapes $curveName`;
	
	// make the arrow a child of the emitter
	parent $curveName $lightPoly[0];
	
	// make curve transform and shape nodes reference objects so they can't be selected
	setAttr ($curveName+".overrideEnabled") 1;
	setAttr ($curveName+".overrideDisplayType") 2;
	setAttr ($curveShape[0]+".overrideEnabled") 1;
	setAttr ($curveShape[0]+".overrideDisplayType") 2;
	
	// select emitter
	select -r $lightPoly[0];
} 

meshLight();

User avatar
yourdaftpunk
Posts: 27
Joined: Thu Nov 23, 2006 3:24 pm
Location: Houston
Contact:

Post by yourdaftpunk » Fri Dec 01, 2006 11:37 am

The part of mtiGen.mel that creates the model xml is what is causing grief in Maya 8, no? So Arne or Matt, could one of you try this as way of getting to the materials from the shaderEngines. I don't think it will throw the unpredictable lightLinker.incandesence error:

Code: Select all

global proc materialIterator() {
	string $shapes[] = `ls -s`;
	
	// iterate shape nodes
	for ($shape in $shapes) {
		if (`objectType $shape` == "mesh") {
			print ("Mesh: "+$shape+"\n");
			
			 // list connections of type "shadingEngine"
			string $connections[] = `listConnections -t "shadingEngine" $shape`;
			
			// find the connection going into shadingEngine.surfaceShader
			string $shaderOutConnection = `connectionInfo -sourceFromDestination ($connections[0]+".surfaceShader")`;
			
			// tokenize to get just the name, not the full connection ("lambert1.outColor" becomes "lambert1")
			string $shader[];
			tokenize $shaderOutConnection "." $shader;
			print ("Shader: "+$shader[0]+"\n");
			
			if (size($shader[0]) != 0) {
				// check to see if we emit light
				float $inc[] = `getAttr ($shader[0]+".incandescence")`;
				if ($inc[1]+$inc[2]+$inc[0] == 0){
					print "We are dark!\n";
				} else {
					print "See the light!\n";
				}
			}
		}
	}
} materialIterator();
Edit: Added a null string check. Someone please test these new mtiGen and mtiMain scripts. Try creating a rectangular light from the menu (all versions of maya) and exporting of course (maya 8 especially). http://www.shawnlipowski.com/scripts/ma ... _20_06.zip

User avatar
CTZn
Posts: 7240
Joined: Thu Nov 16, 2006 4:34 pm
Location: Paris, France

Post by CTZn » Fri Dec 01, 2006 4:09 pm

Good job, tested and working with Maya 8 (rectangle light creation and exporting), camera is fine, in both 4/3 and square ratio.

Still got an error when calling the Object Editor:

Code: Select all

mtiObjectEditor;
// Error: file: C:/Documents and Settings/Administrateur.ZNCT/Mes documents/maya/8.0/scripts/mtiObjectEditor.mel line 16: Object's name is not unique:  objEdi062 //
This one is quite new tho :)

My dummy test:
Image
76.68889 mutations/pixel, 20m, 11s

I'm learning materials now, that's gonna be fun !

:D

User avatar
arneoog
Indigo 100
Posts: 504
Joined: Sun Jun 25, 2006 2:19 am
Location: Norway
Contact:

Post by arneoog » Sat Dec 02, 2006 10:59 am

Cool, Shawn!
Everything works :)
The Rectangle Light isn't exported as a RectangleLight yet, but that is easy to fix.
This works perfect in Maya 8.0, yes? Then, Yay!

CTZn, that should be solved by restarting Maya, maybe you need a PC reboot..
Arne OOG - My Portfolio

User avatar
CTZn
Posts: 7240
Joined: Thu Nov 16, 2006 4:34 pm
Location: Paris, France

Post by CTZn » Sat Dec 02, 2006 12:35 pm

No problem, Arne, I've been stupid to report that anyway, that was not the current point.
Am I right when I assume this is the most recent state of the doc ?

And another illustration of 300 000 tris export, rendered with only one "pseudo" rectangle light: Howard Bryan's Room with its native mismatched normals !!!
Image

Code: Select all

Time elapsed: 7h, 59m, 53s
Done 171748000.00000 mutations  (559.07552 mutations per pixel)
I have a cleaned version of it, normals wise, but it has nonmanifold topology and couldn't be exported (or some pseudo history nodes that couldn't be deleted even by hand :?: :evil: )... not a wip nor finished atrwork, just a test so it's fine here I think :)

User avatar
yourdaftpunk
Posts: 27
Joined: Thu Nov 23, 2006 3:24 pm
Location: Houston
Contact:

Post by yourdaftpunk » Sat Dec 02, 2006 12:37 pm

The Rectangle Light isn't exported as a RectangleLight yet
What's the difference between a rectangle light and a rectangular mesh light?

Also, for the camera fov (because nobody replied to the question in the general forum), we can just do this:

Code: Select all

float $mFocalLength = `getAttr cameraShape1.focalLength` / 1000;
float $mFrameSize  = (`getAttr cameraShape1.horizontalFilmAperture` * 25.4) / 1000;
float $iFocalLength  = $mFocalLength * 1.12857143; // camera hack

$write1 += "\t<sensor_width>"+$mFrameSize+"</sensor_width>\r\n"; //0.036 default
$write1 += "\t<lens_sensor_dist>"+$iFocalLength+"</lens_sensor_dist>\r\n"; //0.0523314 default

User avatar
CTZn
Posts: 7240
Joined: Thu Nov 16, 2006 4:34 pm
Location: Paris, France

Post by CTZn » Mon Dec 04, 2006 8:38 pm

Heya people, please stop using telepathy I can't catch the frequency !

:wink:

User avatar
homafloek
Posts: 24
Joined: Thu Nov 09, 2006 3:30 am

Post by homafloek » Wed Dec 13, 2006 1:19 am

homafloek wrote:When i try to load the IndigoMeshExport in the plugin window i get this message:
Error: Plug-in, "indigoMeshExport" was compiled against too old a version of the Maya API and is thus incompatible with the current Maya version. (indigoMeshExport) //
I use maya 6.5 and used the maya 6 version of the MLL file.
anyone?

User avatar
CTZn
Posts: 7240
Joined: Thu Nov 16, 2006 4:34 pm
Location: Paris, France

Post by CTZn » Wed Dec 13, 2006 4:48 am

I use maya 6.5 and used the maya 6 version of the MLL file.
Well, the error message is quite self-explanatory, you can't do that :( If you own Maya 6.5 I believe you are entitled to use Maya 6 as well, ask Autodesk... or if you already have Maya 6 on cd just install it !

Maybe yourdaftpunk could compile against v6.5 but he is the only one to know if he can...

User avatar
yourdaftpunk
Posts: 27
Joined: Thu Nov 23, 2006 3:24 pm
Location: Houston
Contact:

Post by yourdaftpunk » Wed Dec 13, 2006 6:20 am

Homafloek, you can send me the files I need to compile for Maya 6.5 if you want. In the Maya folder is "devkit", "include" and "lib." Zip all three together and email me at (slipowski ..at.. gmail.com) and we can try sending it over AIM or something. That's what I did with arne, worked fine :)

Sorry that I only use 8 now! Used to have the academic version of 6 and 6.5 though. Just can't find it after several moves!

-shawn

Post Reply
25 posts

Who is online

Users browsing this forum: No registered users and 1 guest