Oluphant
11-02-2011, 12:49 AM
Hello interwebs. I sincerely hope you can help me with this issue, I've been going through this script forever and each time I solve a problem a new one arises. Long story short, I created this procedure to create a simple building shape but when I tried to call the procedure I get this error message:
p, li { white-space: pre-wrap; } // Error: Line 0.16: Syntax error //
Now this may be a very noob thing to say, but doesn't the script start on Line 1? So where is Line 0? Anyway, I pasted the script I am trying to work with here. If you know of a simpler way to do this please please please (really please) direct me to it.
p, li { white-space: pre-wrap; } proc building(string $parentBuilding, float $parentHeight)
{
global string $parentBuilding;
global float $parentHeight;
polyCube -name $parentBuilding -ch on -o on -w 4 -h $parentHeight -d 2.5 -cuv 4;
move -r 0 -12.160464 0 $parentBuilding.scalePivot $parentBuilding.rotatePivot ;
hilite $parentBuilding ;
//I had to use eval because Maya would not allow me to simple use:
//select -r $parentBuilding.f[1]; to select face 1
string $evalString1 = "select -r" + $parentBuilding + ".f[1]" ;
eval $evalString1;
PolyExtrude;
eval $evalString1;
string $evalString2 = "polyExtrudeFacet -constructionHistory 1 -keepFacesTogether 1 -pvx 0 -pvy 4 -pvz 0 -divisions 1 -twist 0 -taper 1 -off 0 -smoothingAngle 30" + $parentBuilding + ".f[1]";
eval $evalString2;
// Result: polyExtrudeFace1 //
setAttr "polyExtrudeFace1.localScale" -type double3 0.833333 0.833333 0.833333 ;
setAttr "polyExtrudeFace1.localTranslate" -type double3 0 0 0.266157 ;
PolyExtrude;
eval $evalString1;
eval $evalString2;
// Result: polyExtrudeFace2 //
setAttr "polyExtrudeFace2.localTranslate" -type double3 0 0 4.003235 ;
setAttr "polyExtrudeFace2.localTranslate" -type double3 0 0 4.534806 ;
PolyExtrude;
eval $evalString1;
eval $evalString2;
// Result: polyExtrudeFace3 //
setAttr "polyExtrudeFace3.localScale" -type double3 0.8 0.8 0.8 ;
setAttr "polyExtrudeFace3.localTranslate" -type double3 0 0 0.217914 ;
PolyExtrude;
eval $evalString1;
eval $evalString2;
// Result: polyExtrudeFace4 //
setAttr "polyExtrudeFace4.localTranslate" -type double3 0 0 4.770102 ;
PolyExtrude;
eval $evalString1;
eval $evalString2;
// Result: polyExtrudeFace5 //
setAttr "polyExtrudeFace5.localScale" -type double3 0.7 0.7 0.7 ;
setAttr "polyExtrudeFace5.localTranslate" -type double3 0 0 0.183136 ;
PolyExtrude;
eval $evalString1;
eval $evalString2;
// Result: polyExtrudeFace6 //
setAttr "polyExtrudeFace6.localTranslate" -type double3 0 0 2.777716 ;
PolyExtrude;
eval $evalString1;
eval $evalString2;
// Result: polyExtrudeFace7 //
setAttr "polyExtrudeFace7.localScale" -type double3 0.716667 0.716667 0.716667 ;
setAttr "polyExtrudeFace7.localTranslate" -type double3 0 0 0.214174 ;
PolyExtrude;
eval $evalString1;
eval $evalString2;
// Result: polyExtrudeFace8 //
setAttr "polyExtrudeFace8.localTranslate" -type double3 0 0 3.032533 ;
setAttr "polyExtrudeFace8.localScale" -type double3 0.866667 0.866667 0.866667 ;
select -cl ;
hilite -u $parentBuilding ;
select -r $parentBuilding ;
}
p, li { white-space: pre-wrap; } // Error: Line 0.16: Syntax error //
Now this may be a very noob thing to say, but doesn't the script start on Line 1? So where is Line 0? Anyway, I pasted the script I am trying to work with here. If you know of a simpler way to do this please please please (really please) direct me to it.
p, li { white-space: pre-wrap; } proc building(string $parentBuilding, float $parentHeight)
{
global string $parentBuilding;
global float $parentHeight;
polyCube -name $parentBuilding -ch on -o on -w 4 -h $parentHeight -d 2.5 -cuv 4;
move -r 0 -12.160464 0 $parentBuilding.scalePivot $parentBuilding.rotatePivot ;
hilite $parentBuilding ;
//I had to use eval because Maya would not allow me to simple use:
//select -r $parentBuilding.f[1]; to select face 1
string $evalString1 = "select -r" + $parentBuilding + ".f[1]" ;
eval $evalString1;
PolyExtrude;
eval $evalString1;
string $evalString2 = "polyExtrudeFacet -constructionHistory 1 -keepFacesTogether 1 -pvx 0 -pvy 4 -pvz 0 -divisions 1 -twist 0 -taper 1 -off 0 -smoothingAngle 30" + $parentBuilding + ".f[1]";
eval $evalString2;
// Result: polyExtrudeFace1 //
setAttr "polyExtrudeFace1.localScale" -type double3 0.833333 0.833333 0.833333 ;
setAttr "polyExtrudeFace1.localTranslate" -type double3 0 0 0.266157 ;
PolyExtrude;
eval $evalString1;
eval $evalString2;
// Result: polyExtrudeFace2 //
setAttr "polyExtrudeFace2.localTranslate" -type double3 0 0 4.003235 ;
setAttr "polyExtrudeFace2.localTranslate" -type double3 0 0 4.534806 ;
PolyExtrude;
eval $evalString1;
eval $evalString2;
// Result: polyExtrudeFace3 //
setAttr "polyExtrudeFace3.localScale" -type double3 0.8 0.8 0.8 ;
setAttr "polyExtrudeFace3.localTranslate" -type double3 0 0 0.217914 ;
PolyExtrude;
eval $evalString1;
eval $evalString2;
// Result: polyExtrudeFace4 //
setAttr "polyExtrudeFace4.localTranslate" -type double3 0 0 4.770102 ;
PolyExtrude;
eval $evalString1;
eval $evalString2;
// Result: polyExtrudeFace5 //
setAttr "polyExtrudeFace5.localScale" -type double3 0.7 0.7 0.7 ;
setAttr "polyExtrudeFace5.localTranslate" -type double3 0 0 0.183136 ;
PolyExtrude;
eval $evalString1;
eval $evalString2;
// Result: polyExtrudeFace6 //
setAttr "polyExtrudeFace6.localTranslate" -type double3 0 0 2.777716 ;
PolyExtrude;
eval $evalString1;
eval $evalString2;
// Result: polyExtrudeFace7 //
setAttr "polyExtrudeFace7.localScale" -type double3 0.716667 0.716667 0.716667 ;
setAttr "polyExtrudeFace7.localTranslate" -type double3 0 0 0.214174 ;
PolyExtrude;
eval $evalString1;
eval $evalString2;
// Result: polyExtrudeFace8 //
setAttr "polyExtrudeFace8.localTranslate" -type double3 0 0 3.032533 ;
setAttr "polyExtrudeFace8.localScale" -type double3 0.866667 0.866667 0.866667 ;
select -cl ;
hilite -u $parentBuilding ;
select -r $parentBuilding ;
}
