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 » Sun Nov 19, 2006 8:32 am

hmmm... very odd that the 8.0 version is blowing stuff up this badly. however, you should try doing this.

1. open up the mtiGen.mel script

2. go down about 4/5 of the way down to where it has the following :

Code: Select all

//Models
string $trans[] =`ls -s`;
for ($one in $trans) {
	if (`objectType $one` == "mesh"){	
		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";
		}
			
		float $inc[] = `getAttr ($amat[2]+".incandescence")`;
		print($one + "/:con " + $amat[2]+"\r\n");
...more stuff here 
3. Add this code:

Code: Select all

 if ($amat[2] == "lightLinker1"){$amat[2] = $amat[4];}	
right after this code:

Code: Select all

 if ($amat[2] == "defaultShaderList1"){
$amat[2]="lambert1";
}
so it becomes

Code: Select all

 if ($amat[2] == "defaultShaderList1"){
$amat[2]="lambert1";
}
 if ($amat[2] == "lightLinker1"){$amat[2] = $amat[4];}	
select everything in the mtiGen.mel file and save it :) now restart Maya and try running the script. should work with 8.0! :)

and yes, the icons are under development ;)
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 9:14 am

anyway, I have a BIG update! all materials are controlled from the object editor now, and specular materials are supported! all you have to do is assign a blinn material to an objcet and edit the parameters throught hte object editor :)

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 -onc "sTransparentOn" -ofc "sTransparentOff" sTransparent;
   floatSliderGrp -h 25 -label "Ior" -field true
      -fieldMinValue 1 -fieldMaxValue 3.5
      -minValue 1 -maxValue 3.5 -en 0 -cc "sIorChange" -dc "sIorChange" -pre 2 sIor;
   floatSliderGrp -h 25 -label "Dispersion Coefficient" -field true
      -fieldMinValue 0.000 -fieldMaxValue 0.1
      -minValue 0.000 -maxValue 0.1 -en 0 -pre 3 -dc "sDispersionChange" -cc "sDispersionChange" sDispersion;
   colorSliderGrp -h 25 -label "Color" -rgb 0 0 0 -en 0 -dc "sAbsorbChange" -cc "sAbsorbChange" 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 == "blinn"){$matType = "specular";}
   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;
	checkBox -e -en 0 sTransparent;
	floatSliderGrp -e -en 0 sIor;
	floatSliderGrp -e -en 0 sDispersion;
	colorSliderGrp -e -en 0 sAbsorbed;
   }
   if ($matType == "phong"){
	getPhongSettings();
   colorSliderGrp -edit -enable 0 dDiffuse;
   colorSliderGrp -edit -enable 1 pDiffuse;
   colorSliderGrp -edit -enable 1 pSpecular;
   floatSliderGrp -edit -enable 1 pExponent;
   checkBox -e -en 0 sTransparent;
	floatSliderGrp -e -en 0 sIor;
	floatSliderGrp -e -en 0 sDispersion;
	colorSliderGrp -e -en 0 sAbsorbed;
	}
	 if ($matType == "specular"){
getSpecularSettings();
   colorSliderGrp -edit -enable 0 dDiffuse;
   colorSliderGrp -edit -enable 0 pDiffuse;
   colorSliderGrp -edit -enable 0 pSpecular;
   floatSliderGrp -edit -enable 0 pExponent;
   checkBox -e -en 1 sTransparent;
	floatSliderGrp -e -en 1 sIor;
	floatSliderGrp -e -en 1 sDispersion;
	colorSliderGrp -e -en 1 sAbsorbed;
	}
	getNormalSmoothed();
}
global proc sAbsorbChange(){
	float $col[] = `colorSliderGrp -query -rgb sAbsorbed`;   	
	 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", $col[0], $col[1], $col[2]);
}
global proc sIorChange(){
	$ior = `floatSliderGrp -q -v sIor`;
   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]+".refractiveIndex", $ior);
}
global proc sDispersionChange(){
  float $disp = `floatSliderGrp -query -v sDispersion`;   
   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]+".surfaceThickness", $disp);
}
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 sTransparentOn(){
	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]+".transparency", .5,.5,.5);
}
global proc sTransparentOff(){
	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]+".transparency", 0,0,0);
}
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;
}
global proc getSpecularSettings(){
	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] sAbsorbed;
	float $i = getAttr($amat[2]+".refractiveIndex");
	floatSliderGrp -e -v $i sIor;
	float $c = getAttr($amat[2]+".surfaceThickness");
	floatSliderGrp -e -v $c sDispersion;
	float $t[] = getAttr($amat[2]+".transparency");
	if ($t[0]+$t[1]+$t[2] == 0){
		checkBox -e -v 0 sTransparent;
	}
	if ($t[0]+$t[1]+$t[2] > 0){
		checkBox -e -v 1 sTransparent;
	}
}
global proc getNormalSmoothed(){
	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 $dif = getAttr($amat[2]+".diffuse");
	if ($dif == 0){
	checkBox -e -v 0 normalCb;}
	if ($dif > 0){
	checkBox -e -v 1 normalCb;}
}
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 10:30 am

Great ! I'm just amazed by the rate of updates you make !

But I'm on my way out now (note this is exceptional :D ), I'll give you my feedback within 48h.

Cheers

MattMR2
Posts: 28
Joined: Sun Sep 24, 2006 4:28 am

Post by MattMR2 » Sun Nov 19, 2006 10:39 pm

Hello,

I tried your new exporter with the object editor, who work good but when I start indigo, it says :
SceneLoaderExcep: The Mesh 'pSphereShape2' tried to use the material 'blinn1', which has not been defined.
Fatal Error: SceneLoaderExcep: The Mesh 'pSphereShape2' tried to use the material 'blinn1', which has not been defined.
and in the xml file all material are declare but not the blinn "specular" material, but it's connect in the object.

Code: Select all


---scene data---

<material>
	<name>lambert1</name>
	<diffuse>
		<colour>0.5 0.5 0.5</colour>
	</diffuse>
</material>

<material>
	<name>lambert2</name>
	<diffuse>
		<colour>0.5 0.5 0.5</colour>
	</diffuse>
</material>

<material>
		<name>phong1</name>
	<phong>
		<diffuse>1 0.5758699775 0.1700000167</diffuse>
		<specular>0.5 0.5 0.5</specular>
		<exponent>200</exponent>
		<fresnel_scale>0.5</fresnel_scale>
	</phong>
</material>

<material>
	<name>lambert4</name>
	<diffuse>
		<colour>0.4617530107 0.6849779487 0.8289999962</colour>
	</diffuse>
</material>

---scene data---


<mesh>
	<name>pSphereShape2</name>
	<embedded>
		<vertex pos='-6.223970164 0.01999376755 -0.09329130458' normal='0.1658086777 -0.9850808978 -0.04607818648' uv0='0 0.05000000075'/>
---etc---
		<vertex pos='-6.511091267 3.855956797 0' normal='4.48451809e-009 1 -2.405757193e-008' uv0='0.02500000037 1'/>
	<triangle_set>
	<material_name>blinn1</material_name>
		<tri>21 20 1 </tri>
                --- etc ---
		<tri>379 360 381 </tri>
	</triangle_set>
	</embedded>
</mesh>

Without this error all working good. Just an other question, are your script support uv conversion at this moment ? because I tried textures with the code whose paste in an other message but indigo didn't found uv :?

Best regards

Matt.

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

Post by arneoog » Mon Nov 20, 2006 12:22 am

MattMR2, that's beacuse blinn/specular isn't supported by the exporter engine yet :)

I was bored, I could not resist, had to do something about the UI :lol:

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 380 -align "left" -font "boldLabelFont" matName; 
   separator -h 10 -w 380; 

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 "" -align "left"; 
   swatchDisplayPort -wh 256 0 -borderWidth 2 mtiMatPrev;

   colorSliderGrp -h 25 -label "Diffuse" -rgb 0.5 0.5 0.5 -vis 0 -cc "dDiffuseChange" -dc "dDiffuseChange" dDiffuse ; 

   colorSliderGrp -h 25 -label "Diffuse" -rgb 0.5 0.5 0.5 -vis 0 -cc "pDiffuseChange" -dc "pDiffuseChange" pDiffuse; 

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

   floatSliderGrp -h 25 -label "Exponent" -field true 
                -fieldMinValue 20 -fieldMaxValue 10000 
                -minValue 20 -maxValue 50000 -value 10000 -vis 0 -pre 0 -cc "pExponentChange" -dc "pExponentChange" pExponent; 

   checkBoxGrp -numberOfCheckBoxes 1 -label "" -label1 "Transparent" -vis 0  -onc "sTransparentOn" -ofc "sTransparentOff" sTransparent;

   floatSliderGrp -h 25 -label "Ior" -field true 
      -fieldMinValue 1 -fieldMaxValue 3.5 
      -minValue 1 -maxValue 3.5 -vis 0 -cc "sIorChange" -dc "sIorChange" -pre 2 sIor; 
   floatSliderGrp -h 25 -label "Dispersion Coefficient" -field true 
      -fieldMinValue 0.000 -fieldMaxValue 0.1 
      -minValue 0.000 -maxValue 0.1 -vis 0 -pre 3 -dc "sDispersionChange" -cc "sDispersionChange" sDispersion; 
   colorSliderGrp -h 25 -label "Color" -rgb 0 0 0 -vis 0 -dc "sAbsorbChange" -cc "sAbsorbChange" sAbsorbed; 

text -label "" -align "left"; 
text -label "Object settings" -w 380 -align "left" -font "boldLabelFont"; 
   separator -h 10 -w 380; 
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"; 
      }      

    $nsVal = getAttr($sel[0]+".smoothShading");
    checkBox -edit -value $nsVal normalCb;

   select $sel[0];
    
   string $matType = `objectType $amat[2]`; 
   if ($matType == "blinn"){$matType = "specular";} 
   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(); 
   text -edit -label "Diffuse Material Settings" -w 380 matName;
   swatchDisplayPort -edit -sn $amat[2] -wh 256 64 mtiMatPrev;
   colorSliderGrp -edit -visible 1 dDiffuse; 
   colorSliderGrp -edit -visible 0 pDiffuse; 
   colorSliderGrp -edit -visible 0 pSpecular; 
   floatSliderGrp -edit -visible 0 pExponent; 
   checkBoxGrp -e -visible 0 sTransparent; 
   floatSliderGrp -e -visible 0 sIor; 
   floatSliderGrp -e -visible 0 sDispersion; 
   colorSliderGrp -e -visible 0 sAbsorbed; 
   } 
   if ($matType == "phong"){ 
   getPhongSettings(); 
   text -edit -label "Phong Material Settings" -w 380 matName;
   swatchDisplayPort -edit -sn $amat[2] -wh 256 64 mtiMatPrev;
   colorSliderGrp -edit -visible 0 dDiffuse; 
   colorSliderGrp -edit -visible 1 pDiffuse; 
   colorSliderGrp -edit -visible 1 pSpecular; 
   floatSliderGrp -edit -visible 1 pExponent; 
   checkBoxGrp -e -visible 0 sTransparent; 
   floatSliderGrp -e -visible 0 sIor; 
   floatSliderGrp -e -visible 0 sDispersion; 
   colorSliderGrp -e -visible 0 sAbsorbed; 
   } 
    if ($matType == "specular"){ 
getSpecularSettings(); 
   text -edit -label "Specular Material Settings" -w 380 matName;
   swatchDisplayPort -edit -sn $amat[2] -wh 256 64 mtiMatPrev;
   colorSliderGrp -edit -visible 0 dDiffuse; 
   colorSliderGrp -edit -visible 0 pDiffuse; 
   colorSliderGrp -edit -visible 0 pSpecular; 
   floatSliderGrp -edit -visible 0 pExponent; 
   checkBoxGrp -e -visible 1 sTransparent; 
   floatSliderGrp -e -visible 1 sIor; 
   floatSliderGrp -e -visible 1 sDispersion; 
   colorSliderGrp -e -visible 1 sAbsorbed; 
   } 
} 
global proc sAbsorbChange(){ 
   float $col[] = `colorSliderGrp -query -rgb sAbsorbed`;       
    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", $col[0], $col[1], $col[2]); 
} 
global proc sIorChange(){ 
   $ior = `floatSliderGrp -q -v sIor`; 
   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]+".refractiveIndex", $ior); 
} 
global proc sDispersionChange(){ 
  float $disp = `floatSliderGrp -query -v sDispersion`;    
   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]+".surfaceThickness", $disp); 
} 
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 sTransparentOn(){ 
   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]+".transparency", .5,.5,.5); 
} 
global proc sTransparentOff(){ 
   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]+".transparency", 0,0,0); 
} 
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`; 
   setAttr($obj[0]+".smoothShading", 1); 
} 
global proc offNormalSmoothing(){ 
   string $obj[] = `textScrollList -query -selectItem TextBox`; 
   setAttr($obj[0]+".smoothShading", 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; 
} 
global proc getSpecularSettings(){ 
   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] sAbsorbed; 
   float $i = getAttr($amat[2]+".refractiveIndex"); 
   floatSliderGrp -e -v $i sIor; 
   float $c = getAttr($amat[2]+".surfaceThickness"); 
   floatSliderGrp -e -v $c sDispersion; 
   float $t[] = getAttr($amat[2]+".transparency"); 
   if ($t[0]+$t[1]+$t[2] == 0){ 
      checkBoxGrp -e -value1 0 sTransparent; 
   } 
   if ($t[0]+$t[1]+$t[2] > 0){ 
      checkBoxGrp -e -value1 1 sTransparent; 
   } 
} 
Arne OOG - My Portfolio

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

Post by ThatDude33 » Mon Nov 20, 2006 2:11 am

cool 8-)

but blinn-specular IS supported!!!!!!!! i put it in!!!!!!!!! :evil: :evil: :twisted:
the reason it doesnt work is because i forgot to post the mtiGen.mel file :x.
here it is ;)

http://www.filefactory.com/file/dd26cb/

that's the mtiGen file :)

put that in and NOW it'll work ;)
Last edited by ThatDude33 on Mon Nov 20, 2006 2:14 am, edited 1 time in total.
Matt B. >>Maya To Indigo<<
Image

MattMR2
Posts: 28
Joined: Sun Sep 24, 2006 4:28 am

Post by MattMR2 » Mon Nov 20, 2006 2:14 am

Oki, sorry :wink:

I found my error for the texture now it's working, uv are oki... so uv are nicely convert... (I pasted the uv name and index in the wrong place... :cry: )

Thanks.

Matt.

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

Post by ThatDude33 » Mon Nov 20, 2006 2:15 am

i put in a link for the mtiGen file with specular support enabled ;)

http://www.filefactory.com/file/dd26cb/
Matt B. >>Maya To Indigo<<
Image

MattMR2
Posts: 28
Joined: Sun Sep 24, 2006 4:28 am

Post by MattMR2 » Mon Nov 20, 2006 2:21 am

Yeah cool... :wink:

Matt

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

Post by arneoog » Mon Nov 20, 2006 2:40 am

Nice 8)

I have done some small changes to where the normalsmooting info is stored and stuff :)

mtiGen.mel
mtiMain.mel
mtiObjectEditor.mel

(also better hosting :wink: )
Arne OOG - My Portfolio

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

Post by ThatDude33 » Mon Nov 20, 2006 3:00 am

ill test it out soon 8)
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 » Mon Nov 20, 2006 6:19 am

Excellent ! I'll play myself with these in a few hours, in a rush now !
was bored, I could not resist, had to do something about the UI :lol:
:lol:

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

Post by CTZn » Mon Nov 20, 2006 12:42 pm

Mmm, still the same error as before when I try exporting the scene, but now the line number is not 446 anymore (because file was updated of course).

Code: Select all

envset1-null
lambert1
lightLinker1
initialMaterialInfo
lightLinker1
renderPartition
pPlane1
pCube1
lambert1
lightLinker1
initialMaterialInfo
lightLinker1
renderPartition
pPlane1
pCube1
lightLinker1
materialInfo1
lightLinker1
renderPartition
lambert2
pPlane2
pCubeShape1/:con lambert1
pPlaneShape1/:con lambert1
// Error: file: C:/Documents and Settings/Administrateur.ZNCT/Mes documents/maya/8.0/scripts/mtiGen.mel line 461: No object matches name: lightLinker1.incandescence //
By the way, the lightLinker don't hold such attribute ! Something regarding pPlaneShape2 was expected (like pPlaneShape2/:con lambert2), and I guess the attribute should be Lambert2.incandescence instead. pPlaneShape2 is the shape wich has Lambert2 material, wich material has no color (thus is black) and incadescence set to approximatively 0.5.

I was not able to apply the correction you suggested before, Dude, coz the code has changed since; I couldn't find

Code: Select all

string $trans[]
at all for instance.

---

However, I found that a previous error I had was caused when reversing normals of a shape. It would prevent further opening of the Object Editor, even after deleting History:

Code: Select all

// Error: file: C:/Documents and Settings/Administrateur.ZNCT/Mes documents/maya/8.0/scripts/mtiObjectEditor.mel line 45: No object matches name:  //
I just rotate the copy of first plane 180° instead of reversing its normals, that's fine so ;)

MattMR2
Posts: 28
Joined: Sun Sep 24, 2006 4:28 am

Post by MattMR2 » Mon Nov 20, 2006 10:54 pm

Hello,

Be carefull with maya 8, it's release too much early... it is very very unstable because all the core was rewrite, so manies of your bug can provide only from internal mel error from maya 8... an example, mentalray 3.5 isn't implented well, in renderglobals manies options are not implented, and many other features are broken... wait maya 8.1 or 8.5 to really work with it... under maya 7.0/7.1 no trouble with the maya indigo exporter script...

Maya 8.0 was released for the siggraph only to show that autodesk can be something good :wink: ... In our studio we wait maya 8.5 or 8.1 stable to go to the next generation of maya... to unstable with many plugins...

Matt

PS : also, maya 7.0 with maya 8.0 on the same computer can make big bug also, because maya 8.0 do the job for maya 7.0 and make maya 7.0 and mentalray unstable and maya 7.0 can make maya 8.0 unstable...some mel command change also...

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

Post by CTZn » Tue Nov 21, 2006 4:42 am

Very few mel commands (6) are *new* ones, almost none has changed and that's only by adding flags, and even if I agree on why Maya 8 was released too early I don't think it is involved in my errors. IMHO No errors were reported concerning MEL. This may not be the place for such debate. You are reporting words, I'm not sure you experienced yourself any disfunction on Maya 8.

Or please provide me a simple scene wich works with the exporter... that's the point here.
it is very very unstable because all the core was rewrite
Are you using it anyway ? I have absolutely NO PROBLEM in my pipeline.
an example, mentalray 3.5 isn't implented well, in renderglobals manies options are not implented, and many other features are broken
Again that is not right. These features you are mentionning were not activated because they are just not ready, ok ? And then some ppl have forced them and then they said: "Oh, wtf ? That doesn't work !"

We are not talking about mr nor render settings here. The point is Maya to Indigo exporter. Don't worry for me I'm a CGTalk advised user.

All that jazz was sentimental and specific, a mass reaction not a clever one, agree ? Me too was pissed off Autodesk bought A|W. And please don't bump my words here, there are many other places for that. Or go mp, that'll be fine to me.

Back to the subject, please.

Post Reply
66 posts

Who is online

Users browsing this forum: No registered users and 1 guest