I am facing a problem with the "polyExtrudeFacet" command. I have a polygonal mesh "pCube1". Now I duplicate the geometry "pCube1" as "copy" parented under "world" to create another identical geometry "pCube2" without any transformations. I extrude face on the original geometry "pCube1" and using the local manipulator tool that appears, I translate, rotate and scale the newly extruded face. This gives me the following series of commands.
polyExtrudeFacet -ch 1 -kft 1 -pvx 0.5 -pvy 0 -pvz -0.25 -tx 0 -ty 0 -tz 0 -rx 0 -ry 0 -rz 0 -sx 1 -sy 1 -sz 1 -ran 0 -divisions 1 -twist 0 -taper 1 -off 0 -ltz 0 -ws 0 -ltx 0 -lty 0 -lrx 0 -lry 0 -lrz 0 -lsx 1 -lsy 1 -lsz 1 -ldx 1 -ldy 0 -ldz 0 -w 0 -gx 0 -gy -1 -gz 0 -att 0 -mx 0 -my 0 -mz 0 -sma 30 pCube1.f[4];
setAttr "polyExtrudeFace1.localTranslate" -type double3 0 0 0.86538 ;
setAttr "polyExtrudeFace1.localScale" -type double3 1.848825 1 1 ;
setAttr "polyExtrudeFace1.localRotate" -type double3 -0.649465 0 0 ;
setAttr "polyExtrudeFace1.localRotate" -type double3 -0.729703 0.434298 -0.359939 ;
setAttr "polyExtrudeFace1.localRotate" -type double3 -0.0470129 0.434298 -0.359939 ;
setAttr "polyExtrudeFace1.localScale" -type double3 1.848825 1.951747 1 ;
Now I want is to automate the extrusion process on the "pCube2" just by using MEL script to create a structure similar to the original one "pCube1". So I execute the below given script(apart from red text rest all is same as the above command sequence)
string $m[];
$m = polyExtrudeFacet -ch 1 -kft 1 -pvx 0.5 -pvy 0 -pvz -0.25 -tx 0 -ty 0 -tz 0 -rx 0 -ry 0 -rz 0 -sx 1 -sy 1 -sz 1 -ran 0 -divisions 1 -twist 0 -taper 1 -off 0 -ltz 0 -ws 0 -ltx 0 -lty 0 -lrx 0 -lry 0 -lrz 0 -lsx 1 -lsy 1 -lsz 1 -ldx 1 -ldy 0 -ldz 0 -w 0 -gx 0 -gy -1 -gz 0 -att 0 -mx 0 -my 0 -mz 0 -sma 30 pCube2.f[4];
setAttr ($m[0] + ".localTranslate") -type double3 0 0 0.86538 ;
setAttr ($m[0] + ".localScale") -type double3 1.848825 1 1 ;
setAttr ($m[0] + ".localRotate") -type double3 -0.649465 0 0 ;
setAttr ($m[0] + ".localRotate") -type double3 -0.729703 0.434298 -0.359939 ;
setAttr ($m[0] + ".localRotate") -type double3 -0.0470129 0.434298 -0.359939 ;
setAttr ($m[0] + ".localScale") -type double3 1.848825 1.951747 1 ;
But the final structure of pCube2 does not match that of pCube1. Also I found out if there is no scaling and rotation involved, it works. Probably it has got some thing to do with the pivot of rotation and scaling. Is there a way to get this done. Basically all I want to do is save the transformations on one geometry as sequence of MEL instructions and later on apply them on a similar geometry to create a desired structure. The one at the center of the grid is "pCube2".
http://www.imagehosting.com