I made some changes and now it works somewhat in Maya 5.0. The progress bar does not show up and the compass can't be turned off - but all the model exporting features work exactly the same now.
I want to export the colors on the surface of an object from Maya into Google Earth. I beleive I can modify the mel so I average vetrtex colors into a facet color for a vertex painted object in Maya. Near as I can tell kml only supports facet colors. I'd like use an average of the 3 vertex colors found by:
vector $r;
$r =`polyColorPerVertex -q -r -g -b Mesh.vtx[$i]`;
Does this make sense? Is there an easier way?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
it should work - the only thing is that we are grabbing the color of the face and then setting it and then accessing the vtxs afterwards in a loop so you probably will have to make sure that you are looking at the vtxs in a new loop before the colors gets written for that face.
please let me know how it goes - the guy who did the face color code for the plugin is going to check it out too.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I did exactly as you suggested and I get just wghat I expected, BUT I get <outline>1<outline> when I want and I think specify <outline>0<outline>.
I could use a bit of help with this part.
here is the section I changed//change color stuff from facet shader query to vertex color query
// Color Stuff
string $faceShader = `getFacetShader $face`;
fprint $fileId "<Placemark>";
string $style;
// string $defaultShader = ("<Style><PolyStyle><color>" + $matHexColor + "</color></PolyStyle><LineStyle><color>" + $lineHexColor + "</color><width>1</width></LineStyle></Style>");
string $defaultShader = ("<Style><PolyStyle><color>" + $matHexColor + "</color><fill>1</fill><outline>" + "0" + "</outline></PolyStyle></Style>");
if ($faceShader != "none") {
$matHexColor =`materialToHexString $faceShader`;
// $style = ("<Style><PolyStyle><color>" + $matHexColor + "</color><fill>1</fill><outline>0</outline></PolyStyle><LineStyle><color>" + $lineHexColor + "</color><width>1</width></LineStyle></Style>");
$style = ("<Style><PolyStyle><color>" + $matHexColor + "</color><fill>1</fill><outline>" + "0" + "</outline></PolyStyle></Style>");
Please post all help requests here, they are continually monitored.
Appears that this doesn't work with Maya 5.01. Has anyone else tried? I'm using a simple geometric primitive for a test and getting this:
onSave "E:/_GLInterceptandPrint/test.kml" "";
// Result: 1 //
// Error: Invalid flag: -n //
I made some changes and now it works somewhat in Maya 5.0. The progress bar does not show up and the compass can't be turned off - but all the model exporting features work exactly the same now.
Check it here
http://production.eyebeam.org/tools/maya2google
Excellent. I was just getting ready to give the script a looking over to see if I could determine the problem.
Many thanks.
Beauty. See my post for some info and screenshots: http://blog.rebang.com/?p=676
Cheers for the post man!!!
Glad you are getting some use out of it.
Please keep me updated on your work
All the best
Theo
I want to export the colors on the surface of an object from Maya into Google Earth. I beleive I can modify the mel so I average vetrtex colors into a facet color for a vertex painted object in Maya. Near as I can tell kml only supports facet colors. I'd like use an average of the 3 vertex colors found by:
vector $r;
$r =`polyColorPerVertex -q -r -g -b Mesh.vtx[$i]`;
Does this make sense? Is there an easier way?
it should work - the only thing is that we are grabbing the color of the face and then setting it and then accessing the vtxs afterwards in a loop so you probably will have to make sure that you are looking at the vtxs in a new loop before the colors gets written for that face.
please let me know how it goes - the guy who did the face color code for the plugin is going to check it out too.
I did exactly as you suggested and I get just wghat I expected, BUT I get <outline>1<outline> when I want and I think specify <outline>0<outline>.
I could use a bit of help with this part.
here is the section I changed//change color stuff from facet shader query to vertex color query
// Color Stuff
string $faceShader = `getFacetShader $face`;
fprint $fileId "<Placemark>";
string $style;
// string $defaultShader = ("<Style><PolyStyle><color>" + $matHexColor + "</color></PolyStyle><LineStyle><color>" + $lineHexColor + "</color><width>1</width></LineStyle></Style>");
string $defaultShader = ("<Style><PolyStyle><color>" + $matHexColor + "</color><fill>1</fill><outline>" + "0" + "</outline></PolyStyle></Style>");
if ($faceShader != "none") {
$matHexColor =`materialToHexString $faceShader`;
// $style = ("<Style><PolyStyle><color>" + $matHexColor + "</color><fill>1</fill><outline>0</outline></PolyStyle><LineStyle><color>" + $lineHexColor + "</color><width>1</width></LineStyle></Style>");
$style = ("<Style><PolyStyle><color>" + $matHexColor + "</color><fill>1</fill><outline>" + "0" + "</outline></PolyStyle></Style>");
} else {
$ss=`size $tokens`;
int $num = 0;
float $r=0,$g=0,$b=0,$a=0,$c[4];
for( $j = 2; $j < $ss; $j++)
{
$num ++;
string $vtx = ($input_OBJ+".vtx["+int($tokens[$j])+"]");
$c=`polyColorPerVertex -q -r -g -b -a $vtx`;
$r+=$c[0];$g+=$c[1];$b+=$c[2];$a+=$c[3];
}
$r/=$num;$g/=$num;$b/=$num;$a/=$num;
$matHexColor = argb2hex($a, $r, $g, $b);
$style = ("<Style><PolyStyle><color>" + $matHexColor + "</color><fill>" +"1" + "</fill><outline>" + "0" + "</outline></PolyStyle></Style>");
fprint $fileId $style;
}