Maya To Indigo XML Converter v0.6 beta1 (0.6t6 & 0.6)

Announcements, requests and support regarding the MAYA exporter
User avatar
ThatDude33
Posts: 216
Joined: Wed Jul 05, 2006 1:26 pm
Contact:

Post by ThatDude33 » Sat Nov 18, 2006 8:08 am

actually, what I posted above already has a UI. can you start working on a light editor though (like material editor but for the 3 kinds of lights)? I'm almost done with the object editor and I'd really like to finish it :)
Matt B. >>Maya To Indigo<<
Image

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

Post by arneoog » Sat Nov 18, 2006 8:30 am

okay, I won't do very much for a while... Need a break from this, heh :)
Want to do some other stuff too.. (like really get started on my new 3D short)

You have had your time off, now it's my turn 8) hihi :D

Good Luck!

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

Post by CTZn » Sat Nov 18, 2006 11:14 am

omg ! :cry:

What's your feeling now, Dude ?

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

Post by arneoog » Sat Nov 18, 2006 11:10 pm

I've been working on this, and only this, for something like two monthes.. or more.. :)
While Matt B has been too busy ;)
So I need a two week break, an almost scripting free break that is :lol:
I think Matt B will be working on it though, so be happy 8) heh

User avatar
ThatDude33
Posts: 216
Joined: Wed Jul 05, 2006 1:26 pm
Contact:

Post by ThatDude33 » Sun Nov 19, 2006 2:27 am

yeah lol it may look like arne is the only developer, but I'm the one that started writing this script and got the main export part working... and then I stepped out and he did the UI and a bunch more. Now I'm coming back in :twisted:
Matt B. >>Maya To Indigo<<
Image

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

Post by CTZn » Sun Nov 19, 2006 3:31 am

So I need a two week break
Oh, that sounds ok to me ! I was affraid it could be months ! Telling to myself: " :twisted: Anyhow :twisted: , one day he will need a break from working on his short too..."
Anyone need a break sometimes ;)


Me happy to read you want more, Dude !

I think we (Maya users) should go in more testing anyway, instead of just waiting for something. I need a break this w-e too (3d wise), I'll post some images in the coming week, sticking with simpler geos ;)

Cheers !

User avatar
ThatDude33
Posts: 216
Joined: Wed Jul 05, 2006 1:26 pm
Contact:

Post by ThatDude33 » Sun Nov 19, 2006 3:36 am

here is the mtiObjectEditor- it works for diffuse and phong materials! :)

http://www.sharebigfile.com/file/21997/ ... r.mel.html
Matt B. >>Maya To Indigo<<
Image

User avatar
ThatDude33
Posts: 216
Joined: Wed Jul 05, 2006 1:26 pm
Contact:

Post by ThatDude33 » Sun Nov 19, 2006 3:48 am

never mind... that hoster botched up my file :x :evil: :evil:

just open up the mtiObjectEditor.mel file in the script editor and copy-paste this over everything else :)

Code: Select all

//-----------------MAYA TO INDIGO XML CONVERTER------------------
//Version: BETA 0.6 (0.6)
//---------------------------------------------
//Credits:
//Matt B. (aka MattTheMan or ThatDude33) (converter engine and more)
//Arne OOG (aka arneoog) (interface and more)
//XML Output in Script Window and Auto Save
//No edits should be neccesary
//Start Writing:


//-----------------OBJECT EDITOR------------------

global proc mtiObjectEditor() 
{ 
window -title "Object Editor" -h 340 -w 570;

rowLayout -numberOfColumns 2 -columnWidth2 174 310;
 	textScrollList -width 160 -height 500 -numberOfRows 8 -allowMultiSelection false -selectCommand "objSelect" TextBox;

 			                setParent ..;
 			setParent ..;
columnLayout;
text -label "Material Settings" -w 400 -align "left" -font "boldLabelFont";
	separator -h 10 -w 400;
 			shelfLayout -width 390 -cellWidth 34 -cellHeight 34;
shelfButton -annotation "Diffuse Shader" -image "mtiIcons/indigo_diffuce.bmp" -command "diffuce";
shelfButton -annotation "Phong Shader" -image "mtiIcons/indigo_phong.bmp" -command "phong";
shelfButton -annotation "Specular Shader" -image "mtiIcons/indigo_specular.bmp" -command "specular";
shelfButton -annotation "Mesh Light Shader" -image "mtiIcons/indigo_meshLight.bmp" -command "meshlight";
shelfButton -annotation "Metal Shader" -image "mtiIcons/indigo_metal.bmp" -command "metal";

 				setParent ..;

rowLayout -numberOfColumns 2 -columnWidth2 170 230;
text -label "Material Name Appears Here" -w 200 -align "left" tName;
text -label "Material Type Appears Here" -w 200 -align "left" tType;
string $shapes[] = `ls -s`;
for ($one in $shapes){
	if(`objectType $one` == "mesh"){
	textScrollList -edit -append $one TextBox;
	string $sg[] = `listConnections -t shadingEngine $one`;
		if ($sg[0] == "initialShadingGroup"){
			$sg[0] = "lambert1";	
		}
		string $amat[] = `listConnections $sg[0]`;
		if ($amat[2] == "renderPartition"){
			$amat[2] = $amat[3];
		}
		if ($amat[2] == "defaultShaderList1"){
			$amat[2] = "lambert1";
		}		
	if ($amat[2] == "lambert"){$amat[2] = "diffuse";}
	text -edit -label $amat[2] tName;		
	}
}
 			                setParent ..;
	text -label "Diffuse Material Settings" -w 200 -align "left";
	colorSliderGrp -h 25 -label "Diffuse" -rgb 0.5 0.5 0.5 -en 0 -cc "dDiffuseChange" -dc "dDiffuseChange" dDiffuse ;
	separator -w 400 -h 10;
	text -label "Phong Material Settings" -w 200 -align "left";
	colorSliderGrp -h 25 -label "Diffuse" -rgb 0.5 0.5 0.5 -en 0 -cc "pDiffuseChange" -dc "pDiffuseChange" pDiffuse;

	colorSliderGrp -h 25 -label "Specular" -rgb 0 0 0 -en 0 -cc "pSpecularChange" -dc "pSpecularChange" pSpecular;

	floatSliderGrp -h 25 -label "Exponent" -field true 
                -fieldMinValue 20 -fieldMaxValue 10000 
                -minValue 20 -maxValue 50000 -value 10000 -en 0 -pre 0 -cc "pExponentChange" -dc "pExponentChange" pExponent;
	separator -h 10 -w 400;
	text -label "Specular Material Settings" -w 200 -align "left";
	checkBox -label "Transparent" -align "left" -en 0 sTransparent;
	floatSliderGrp -h 25 -label "Ior" -field true
		-fieldMinValue 1 -fieldMaxValue 3.5
		-minValue 1 -maxValue 3.5 -en 0 sIor;
	floatSliderGrp -h 25 -label "Dispersion Coefficient" -field true
		-fieldMinValue 0.000 -fieldMaxValue 0.1
		-minValue 0.000 -maxValue 0.1 -en 0 sDispersion;
	colorSliderGrp -h 25 -label "Absorbed Color" -rgb 0 0 0 -en 0 sAbsorbed;
	separator -h 10 -w 400;
text -label "" -h 20 -align "left";

optionMenu -label "Add Existing Materials";
		menuItem -label "?????";
text -label "" -align "left";
text -label "Object settings" -w 400 -align "left" -font "boldLabelFont";
	separator -h 10 -w 400;
checkBox -label "Normal Smoothing" -value 1;
 			                setParent ..;
 			setParent ..;

			showWindow;
}

global proc objSelect (){
    string    $sel[] = `textScrollList                 //define an array for the selection
            -query                                 //put the command in query mode
            -selectItem                             //get the string of the item the user selected
            TextBox`;                        //naming controls makes this a snap
    string $sg[] = `listConnections -t shadingEngine $sel[0]`;
		if ($sg[0] == "initialShadingGroup"){
			$sg[0] = "lambert1";	
		}
		string $amat[] = `listConnections $sg[0]`;
		if ($amat[2] == "renderPartition"){
			$amat[2] = $amat[3];
		}
		if ($amat[2] == "defaultShaderList1"){
			$amat[2] = "lambert1";
		}		
	
	string $matType = `objectType $amat[2]`;
	if ($matType == "lambert"){$matType = "diffuse";}	
    text                                     //put the name of the selection in the field 
        -edit                                     //put the command in edit mode
        -label $amat[2]                         //text is what we're editing. $sel is that text
        tName;                            //name of the text field
	text -edit -label $matType tType;
	if ($matType == "diffuse"){
	colorSliderGrp -edit -enable 1 dDiffuse;
	colorSliderGrp -edit -enable 0 pDiffuse;
	colorSliderGrp -edit -enable 0 pSpecular;
	floatSliderGrp -edit -enable 0 pExponent;
	}
	if ($matType == "phong"){
	colorSliderGrp -edit -enable 0 dDiffuse;
	colorSliderGrp -edit -enable 1 pDiffuse;
	colorSliderGrp -edit -enable 1 pSpecular;
	floatSliderGrp -edit -enable 1 pExponent;
	}
}
global proc dDiffuseChange(){
	float $dDrgb[] = `colorSliderGrp -query -rgb dDiffuse`;
	string $obj[] = `textScrollList -query -selectItem TextBox`;
	string $sg[] = `listConnections -t shadingEngine $obj[0]`;
		if ($sg[0] == "initialShadingGroup"){
			$sg[0] = "lambert1";	
		}
		string $amat[] = `listConnections $sg[0]`;
		if ($amat[2] == "renderPartition"){
			$amat[2] = $amat[3];
		}
		if ($amat[2] == "defaultShaderList1"){
			$amat[2] = "lambert1";
		}
	setAttr($amat[2]+".color", $dDrgb[0], $dDrgb[1], $dDrgb[2]);
}
global proc pDiffuseChange(){
	float $pDrgb[] = `colorSliderGrp -query -rgb pDiffuse`;
	string $obj[] = `textScrollList -query -selectItem TextBox`;
	string $sg[] = `listConnections -t shadingEngine $obj[0]`;
		if ($sg[0] == "initialShadingGroup"){
			$sg[0] = "lambert1";	
		}
		string $amat[] = `listConnections $sg[0]`;
		if ($amat[2] == "renderPartition"){
			$amat[2] = $amat[3];
		}
		if ($amat[2] == "defaultShaderList1"){
			$amat[2] = "lambert1";
		}
	setAttr($amat[2]+".color", $pDrgb[0], $pDrgb[1], $pDrgb[2]);
}
global proc pSpecularChange(){
	float $pSrgb[] = `colorSliderGrp -query -rgb pSpecular`;
	string $obj[] = `textScrollList -query -selectItem TextBox`;
	string $sg[] = `listConnections -t shadingEngine $obj[0]`;
		if ($sg[0] == "initialShadingGroup"){
			$sg[0] = "lambert1";	
		}
		string $amat[] = `listConnections $sg[0]`;
		if ($amat[2] == "renderPartition"){
			$amat[2] = $amat[3];
		}
		if ($amat[2] == "defaultShaderList1"){
			$amat[2] = "lambert1";
		}
	setAttr($amat[2]+".reflectivity", 0);
	setAttr($amat[2]+".specularColor", $pSrgb[0], $pSrgb[1], $pSrgb[2]);
}
global proc pExponentChange(){
	float $exp = `floatSliderGrp -query -v pExponent`;	
	string $obj[] = `textScrollList -query -selectItem TextBox`;
	string $sg[] = `listConnections -t shadingEngine $obj[0]`;
		if ($sg[0] == "initialShadingGroup"){
			$sg[0] = "lambert1";	
		}
		string $amat[] = `listConnections $sg[0]`;
		if ($amat[2] == "renderPartition"){
			$amat[2] = $amat[3];
		}
		if ($amat[2] == "defaultShaderList1"){
			$amat[2] = "lambert1";
		}
	setAttr($amat[2]+".cosinePower", $exp/10);
}enderPartition"){
			$amat[2] = $amat[3];
		}
		if ($amat[2] == "defaultShaderList1"){
			$amat[2] = "lambert1";
		}		
	
	string $matType = `objectType $amat[2]`;
	if ($matType == "lambert"){$matType = "diffuse";}	
    text                                     //put the name of the selection in the field 
        -edit                                     //put the command in edit mode
        -label $amat[2]                         //text is what we're editing. $sel is that text
        tName;                            //name of the text field
	text -edit -label $matType tType;
	if ($matType == "diffuse"){
	colorSliderGrp -edit -enable 1 dDiffuse;
	colorSliderGrp -edit -enable 0 pDiffuse;
	colorSliderGrp -edit -enable 0 pSpecular;
	floatSliderGrp -edit -enable 0 pExponent;
	}
	if ($matType == "phong"){
	colorSliderGrp -edit -enable 0 dDiffuse;
	colorSliderGrp -edit -enable 1 pDiffuse;
	colorSliderGrp -edit -enable 1 pSpecular;
	floatSliderGrp -edit -enable 1 pExponent;
	}
}
global proc dDiffuseChange(){
	float $dDrgb[] = `colorSliderGrp -query -rgb dDiffuse`;
	string $obj[] = `textScrollList -query -selectItem TextBox`;
	string $sg[] = `listConnections -t shadingEngine $obj[0]`;
		if ($sg[0] == "initialShadingGroup"){
			$sg[0] = "lambert1";	
		}
		string $amat[] = `listConnections $sg[0]`;
		if ($amat[2] == "renderPartition"){
			$amat[2] = $amat[3];
		}
		if ($amat[2] == "defaultShaderList1"){
			$amat[2] = "lambert1";
		}
	setAttr($amat[2]+".color", $dDrgb[0], $dDrgb[1], $dDrgb[2]);
}
global proc pDiffuseChange(){
	float $pDrgb[] = `colorSliderGrp -query -rgb pDiffuse`;
	string $obj[] = `textScrollList -query -selectItem TextBox`;
	string $sg[] = `listConnections -t shadingEngine $obj[0]`;
		if ($sg[0] == "initialShadingGroup"){
			$sg[0] = "lambert1";	
		}
		string $amat[] = `listConnections $sg[0]`;
		if ($amat[2] == "renderPartition"){
			$amat[2] = $amat[3];
		}
		if ($amat[2] == "defaultShaderList1"){
			$amat[2] = "lambert1";
		}
	setAttr($amat[2]+".color", $pDrgb[0], $pDrgb[1], $pDrgb[2]);
}
global proc pSpecularChange(){
	float $pSrgb[] = `colorSliderGrp -query -rgb pSpecular`;
	string $obj[] = `textScrollList -query -selectItem TextBox`;
	string $sg[] = `listConnections -t shadingEngine $obj[0]`;
		if ($sg[0] == "initialShadingGroup"){
			$sg[0] = "lambert1";	
		}
		string $amat[] = `listConnections $sg[0]`;
		if ($amat[2] == "renderPartition"){
			$amat[2] = $amat[3];
		}
		if ($amat[2] == "defaultShaderList1"){
			$amat[2] = "lambert1";
		}
	setAttr($amat[2]+".reflectivity", 0);
	setAttr($amat[2]+".specularColor", $pSrgb[0], $pSrgb[1], $pSrgb[2]);
}
global proc pExponentChange(){
	float $exp = `floatSliderGrp -query -v pExponent`;	
	string $obj[] = `textScrollList -query -selectItem TextBox`;
	string $sg[] = `listConnections -t shadingEngine $obj[0]`;
		if ($sg[0] == "initialShadingGroup"){
			$sg[0] = "lambert1";	
		}
		string $amat[] = `listConnections $sg[0]`;
		if ($amat[2] == "renderPartition"){
			$amat[2] = $amat[3];
		}
		if ($amat[2] == "defaultShaderList1"){
			$amat[2] = "lambert1";
		}
	setAttr($amat[2]+".cosinePower", $exp/10);
}
Matt B. >>Maya To Indigo<<
Image

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

Post by arneoog » Sun Nov 19, 2006 4:18 am

ehm.. I'm getting alot of errors while executing this script... :?

User avatar
ThatDude33
Posts: 216
Joined: Wed Jul 05, 2006 1:26 pm
Contact:

Post by ThatDude33 » Sun Nov 19, 2006 4:26 am

the last one that I posted? let me try...
Matt B. >>Maya To Indigo<<
Image

User avatar
ThatDude33
Posts: 216
Joined: Wed Jul 05, 2006 1:26 pm
Contact:

Post by ThatDude33 » Sun Nov 19, 2006 4:30 am

try this one (UPDATED with a handy feature ;))

Code: Select all

//-----------------MAYA TO INDIGO XML CONVERTER------------------
//Version: BETA 0.6 (0.6)
//---------------------------------------------
//Credits:
//Matt B. (aka MattTheMan or ThatDude33) (converter engine and more)
//Arne OOG (aka arneoog) (interface and more)
//XML Output in Script Window and Auto Save
//No edits should be neccesary
//Start Writing:


//-----------------OBJECT EDITOR------------------

global proc mtiObjectEditor()
{
window -title "Object Editor" -h 340 -w 570;

rowLayout -numberOfColumns 2 -columnWidth2 174 310;
    textScrollList -width 160 -height 500 -numberOfRows 8 -allowMultiSelection false -selectCommand "objSelect" TextBox;

                          setParent ..;
          setParent ..;
columnLayout;
text -label "Material Settings" -w 400 -align "left" -font "boldLabelFont";
   separator -h 10 -w 400;
          shelfLayout -width 390 -cellWidth 34 -cellHeight 34;
shelfButton -annotation "Diffuse Shader" -image "mtiIcons/indigo_diffuce.bmp" -command "diffuce";
shelfButton -annotation "Phong Shader" -image "mtiIcons/indigo_phong.bmp" -command "phong";
shelfButton -annotation "Specular Shader" -image "mtiIcons/indigo_specular.bmp" -command "specular";
shelfButton -annotation "Mesh Light Shader" -image "mtiIcons/indigo_meshLight.bmp" -command "meshlight";
shelfButton -annotation "Metal Shader" -image "mtiIcons/indigo_metal.bmp" -command "metal";

             setParent ..;

rowLayout -numberOfColumns 2 -columnWidth2 170 230;
text -label "Material Name Appears Here" -w 200 -align "left" tName;
text -label "Material Type Appears Here" -w 200 -align "left" tType;
string $shapes[] = `ls -s`;
for ($one in $shapes){
   if(`objectType $one` == "mesh"){
   textScrollList -edit -append $one TextBox;
   string $sg[] = `listConnections -t shadingEngine $one`;
      if ($sg[0] == "initialShadingGroup"){
         $sg[0] = "lambert1";   
      }
      string $amat[] = `listConnections $sg[0]`;
      if ($amat[2] == "renderPartition"){
         $amat[2] = $amat[3];
      }
      if ($amat[2] == "defaultShaderList1"){
         $amat[2] = "lambert1";
      }      
   if ($amat[2] == "lambert"){$amat[2] = "diffuse";}
   text -edit -label $amat[2] tName;      
   }
}
                          setParent ..;
   text -label "Diffuse Material Settings" -w 200 -align "left";
   colorSliderGrp -h 25 -label "Diffuse" -rgb 0.5 0.5 0.5 -en 0 -cc "dDiffuseChange" -dc "dDiffuseChange" dDiffuse ;
   separator -w 400 -h 10;
   text -label "Phong Material Settings" -w 200 -align "left";
   colorSliderGrp -h 25 -label "Diffuse" -rgb 0.5 0.5 0.5 -en 0 -cc "pDiffuseChange" -dc "pDiffuseChange" pDiffuse;

   colorSliderGrp -h 25 -label "Specular" -rgb 0 0 0 -en 0 -cc "pSpecularChange" -dc "pSpecularChange" pSpecular;

   floatSliderGrp -h 25 -label "Exponent" -field true
                -fieldMinValue 20 -fieldMaxValue 10000
                -minValue 20 -maxValue 50000 -value 10000 -en 0 -pre 0 -cc "pExponentChange" -dc "pExponentChange" pExponent;
   separator -h 10 -w 400;
   text -label "Specular Material Settings" -w 200 -align "left";
   checkBox -label "Transparent" -align "left" -en 0 sTransparent;
   floatSliderGrp -h 25 -label "Ior" -field true
      -fieldMinValue 1 -fieldMaxValue 3.5
      -minValue 1 -maxValue 3.5 -en 0 sIor;
   floatSliderGrp -h 25 -label "Dispersion Coefficient" -field true
      -fieldMinValue 0.000 -fieldMaxValue 0.1
      -minValue 0.000 -maxValue 0.1 -en 0 sDispersion;
   colorSliderGrp -h 25 -label "Absorbed Color" -rgb 0 0 0 -en 0 sAbsorbed;
   separator -h 10 -w 400;
text -label "" -h 20 -align "left";

optionMenu -label "Add Existing Materials";
      menuItem -label "?????";
text -label "" -align "left";
text -label "Object settings" -w 400 -align "left" -font "boldLabelFont";
   separator -h 10 -w 400;
checkBox -label "Normal Smoothing" -value 1 -onc "onNormalSmoothing" -ofc "offNormalSmoothing" normalCb;
                          setParent ..;
          setParent ..;

         showWindow;
}

global proc objSelect (){
    string    $sel[] = `textScrollList                 //define an array for the selection
            -query                                 //put the command in query mode
            -selectItem                             //get the string of the item the user selected
            TextBox`;                        //naming controls makes this a snap
    string $sg[] = `listConnections -t shadingEngine $sel[0]`;
      if ($sg[0] == "initialShadingGroup"){
         $sg[0] = "lambert1";   
      }
      string $amat[] = `listConnections $sg[0]`;
      if ($amat[2] == "renderPartition"){
         $amat[2] = $amat[3];
      }
      if ($amat[2] == "defaultShaderList1"){
         $amat[2] = "lambert1";
      }      
   
   string $matType = `objectType $amat[2]`;
   if ($matType == "lambert"){$matType = "diffuse";}   
    text                                     //put the name of the selection in the field
        -edit                                     //put the command in edit mode
        -label $amat[2]                         //text is what we're editing. $sel is that text
        tName;                            //name of the text field
   text -edit -label $matType tType;
   if ($matType == "diffuse"){
	getDiffuseSettings();
   colorSliderGrp -edit -enable 1 dDiffuse;
   colorSliderGrp -edit -enable 0 pDiffuse;
   colorSliderGrp -edit -enable 0 pSpecular;
   floatSliderGrp -edit -enable 0 pExponent;
   }
   if ($matType == "phong"){
	getPhongSettings();
   colorSliderGrp -edit -enable 0 dDiffuse;
   colorSliderGrp -edit -enable 1 pDiffuse;
   colorSliderGrp -edit -enable 1 pSpecular;
   floatSliderGrp -edit -enable 1 pExponent;
   }
}
global proc dDiffuseChange(){
   float $dDrgb[] = `colorSliderGrp -query -rgb dDiffuse`;
   string $obj[] = `textScrollList -query -selectItem TextBox`;
   string $sg[] = `listConnections -t shadingEngine $obj[0]`;
      if ($sg[0] == "initialShadingGroup"){
         $sg[0] = "lambert1";   
      }
      string $amat[] = `listConnections $sg[0]`;
      if ($amat[2] == "renderPartition"){
         $amat[2] = $amat[3];
      }
      if ($amat[2] == "defaultShaderList1"){
         $amat[2] = "lambert1";
      }
   setAttr($amat[2]+".color", $dDrgb[0], $dDrgb[1], $dDrgb[2]);
}
global proc pDiffuseChange(){
   float $pDrgb[] = `colorSliderGrp -query -rgb pDiffuse`;
   string $obj[] = `textScrollList -query -selectItem TextBox`;
   string $sg[] = `listConnections -t shadingEngine $obj[0]`;
      if ($sg[0] == "initialShadingGroup"){
         $sg[0] = "lambert1";   
      }
      string $amat[] = `listConnections $sg[0]`;
      if ($amat[2] == "renderPartition"){
         $amat[2] = $amat[3];
      }
      if ($amat[2] == "defaultShaderList1"){
         $amat[2] = "lambert1";
      }
   setAttr($amat[2]+".color", $pDrgb[0], $pDrgb[1], $pDrgb[2]);
}
global proc pSpecularChange(){
   float $pSrgb[] = `colorSliderGrp -query -rgb pSpecular`;
   string $obj[] = `textScrollList -query -selectItem TextBox`;
   string $sg[] = `listConnections -t shadingEngine $obj[0]`;
      if ($sg[0] == "initialShadingGroup"){
         $sg[0] = "lambert1";   
      }
      string $amat[] = `listConnections $sg[0]`;
      if ($amat[2] == "renderPartition"){
         $amat[2] = $amat[3];
      }
      if ($amat[2] == "defaultShaderList1"){
         $amat[2] = "lambert1";
      }
   setAttr($amat[2]+".reflectivity", 0);
   setAttr($amat[2]+".specularColor", $pSrgb[0], $pSrgb[1], $pSrgb[2]);
}
global proc pExponentChange(){
   float $exp = `floatSliderGrp -query -v pExponent`;   
   string $obj[] = `textScrollList -query -selectItem TextBox`;
   string $sg[] = `listConnections -t shadingEngine $obj[0]`;
      if ($sg[0] == "initialShadingGroup"){
         $sg[0] = "lambert1";   
      }
      string $amat[] = `listConnections $sg[0]`;
      if ($amat[2] == "renderPartition"){
         $amat[2] = $amat[3];
      }
      if ($amat[2] == "defaultShaderList1"){
         $amat[2] = "lambert1";
      }
   setAttr($amat[2]+".cosinePower", $exp/10);
}
global proc onNormalSmoothing(){
	string $obj[] = `textScrollList -query -selectItem TextBox`;
   string $sg[] = `listConnections -t shadingEngine $obj[0]`;
      if ($sg[0] == "initialShadingGroup"){
         $sg[0] = "lambert1";   
      }
      string $amat[] = `listConnections $sg[0]`;
      if ($amat[2] == "renderPartition"){
         $amat[2] = $amat[3];
      }
      if ($amat[2] == "defaultShaderList1"){
         $amat[2] = "lambert1";
      }
	setAttr($amat[2]+".diffuse", 1.0);
}
global proc offNormalSmoothing(){
	string $obj[] = `textScrollList -query -selectItem TextBox`;
   string $sg[] = `listConnections -t shadingEngine $obj[0]`;
      if ($sg[0] == "initialShadingGroup"){
         $sg[0] = "lambert1";   
      }
      string $amat[] = `listConnections $sg[0]`;
      if ($amat[2] == "renderPartition"){
         $amat[2] = $amat[3];
      }
      if ($amat[2] == "defaultShaderList1"){
         $amat[2] = "lambert1";
      }
	setAttr($amat[2]+".diffuse", 0);
}
global proc getDiffuseSettings(){
	string $obj[] = `textScrollList -query -selectItem TextBox`;
   string $sg[] = `listConnections -t shadingEngine $obj[0]`;
      if ($sg[0] == "initialShadingGroup"){
         $sg[0] = "lambert1";   
      }
      string $amat[] = `listConnections $sg[0]`;
      if ($amat[2] == "renderPartition"){
         $amat[2] = $amat[3];
      }
      if ($amat[2] == "defaultShaderList1"){
         $amat[2] = "lambert1";
      }
	float $d[] = getAttr($amat[2]+".color");
	colorSliderGrp -e -rgb $d[0] $d[1] $d[2] dDiffuse;
}
global proc getPhongSettings(){
	string $obj[] = `textScrollList -query -selectItem TextBox`;
   string $sg[] = `listConnections -t shadingEngine $obj[0]`;
      if ($sg[0] == "initialShadingGroup"){
         $sg[0] = "lambert1";   
      }
      string $amat[] = `listConnections $sg[0]`;
      if ($amat[2] == "renderPartition"){
         $amat[2] = $amat[3];
      }
      if ($amat[2] == "defaultShaderList1"){
         $amat[2] = "lambert1";
      }
	float $d[] = getAttr($amat[2]+".color");
	colorSliderGrp -e -rgb $d[0] $d[1] $d[2] pDiffuse;
	float $s[] = getAttr($amat[2]+".specularColor");
	colorSliderGrp -e -rgb $s[0] $s[1] $s[2] pSpecular;
	float $e = getAttr($amat[2]+".cosinePower");
	$e = $e*10;
	floatSliderGrp -e -v $e pExponent;
}
Matt B. >>Maya To Indigo<<
Image

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

Post by arneoog » Sun Nov 19, 2006 4:52 am

Cool :cool:
Now to Blinn/Specular :D hehe

Remember: Higher rgb_absorptivity = less transparent/harder color (duh) :wink:

EDIT: connect the normal smoothing to the objects Smooth Shading attribute!
The mtiGen.mel is now using that :)

User avatar
ThatDude33
Posts: 216
Joined: Wed Jul 05, 2006 1:26 pm
Contact:

Post by ThatDude33 » Sun Nov 19, 2006 4:59 am

I already did... ;)
Matt B. >>Maya To Indigo<<
Image

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

Post by CTZn » Sun Nov 19, 2006 6:15 am

wow ! didn't I tell I wanted a break too !? :lol:

Look, the exporter is stopping with a simple scene:

1 plane divided 2x2, triangualted with default Lambert1

Duplicated, copy moved up a bit, assigned new Lambert with Incandescence set to 0.5, reversed normals (so both objects have facing normals)

Deleted all history, created and placed camera. Hit generate. Hers comes the log:

Code: Select all

envset1-null
lambert1
lightLinker1
initialMaterialInfo
lightLinker1
renderPartition
pPlane1
lightLinker1
materialInfo1
lightLinker1
renderPartition
lambert2
pPlane2
pPlaneShape1/:con lambert1
// Error: file: C:/Documents and Settings/Administrateur.ZNCT/Mes documents/maya/8.0/scripts/mtiGen.mel line 446: No object matches name: lightLinker1.incandescence //
I missed smthing I guess...

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

Post by CTZn » Sun Nov 19, 2006 6:18 am

Code: Select all

mtiObjectEditor;
diffuce;
// Error: line 1: Cannot find procedure "diffuce". //
phong;
// Error: line 1: Cannot find procedure "phong". //
specular;
// Error: line 1: Cannot find procedure "specular". //
meshlight;
// Error: line 1: Cannot find procedure "meshlight". //
metal;
// Error: line 1: Cannot find procedure "metal". //
This is still in dev I assume :)

Beware the spelling of "diffuse", don't make my english even worst :lol:

Post Reply
66 posts

Who is online

Users browsing this forum: No registered users and 18 guests