Maya,MEL,执行整个脚本时出错

时间:2017-01-03 18:41:55

标签: maya mel

首先,大家新年快乐!

今年的第一个错误如下:

当我执行整个mel脚本时出错,但是当我分别执行每一行时,我的脚本工作正常。我的代码链接属性与connectAttr,对象和运算符之间。

我希望有人已经遇到过这种错误,请提前感谢您的帮助!

int $x;
int $y;
int $z;
string $selection[];
spaceLocator -n ("CTRL_HP_ID") -p 0 0 0;
addAttr -ln "Range"  -at double  -min 1 -max 2000 -dv 1 |CTRL_HP_ID;
setAttr -e-keyable true |CTRL_HP_ID.Range;
addAttr -ln "Influence_y"  -at double  -min 0 -max 2000 -dv 1 |CTRL_HP_ID;
setAttr -e-keyable true |CTRL_HP_ID.Influence_y;
for ( $x = 1; $x < 10; $x++){
    for ( $z = 1; $z < 10; $z++){
        polyCube;
        string $selectionTwo[] = `ls -sl`;
        move (2*$x) (2*$y) (2*$z);
        spaceLocator -n ("IDLocator_" + $x + $z) -p 0 0 0;
        string $selectionOne[] = `ls -sl`;
        move (2*$x) (2*$y) (2*$z);
        group -name ("IDLocator_" + $x + $z + "_GRP");
        select ("IDLocator_" + $x + $z + "_GRP");
        select -add $selectionTwo[0];
        parent;
        //NODES :::

        string $nameDistanceNode = ("distance_node_" + $x + $z);
        string $nameRemapValNode = ("remapVal_node_" + $x + $z);
        string $addDoublNode = ("addDoubl_" + $x + $z);
        string $MultDivNode = ("MultDiv_" + $x + $z);
        string $MultDivTwoNode = ("MultDivTwo_" + $x + $z);
        shadingNode -asUtility distanceBetween -name $nameDistanceNode;
        connectAttr -f CTRL_HP_ID.translate ($nameDistanceNode + ".point1");
        connectAttr -f ($selectionOne[0] + ".translate") ($nameDistanceNode + ".point2");
        shadingNode -asUtility remapValue -name $nameRemapValNode;
        connectAttr -f ($nameDistanceNode + ".distance") ($nameRemapValNode + ".inputValue");
        connectAttr -f CTRL_HP_ID.Range ($nameRemapValNode + ".outputMin");
        connectAttr -f CTRL_HP_ID.Range ($nameRemapValNode + ".inputMax");
        shadingNode -asUtility addDoubleLinear -name $addDoublNode;
        connectAttr -f ($nameRemapValNode + ".outValue") ($addDoublNode + ".input1");
        shadingNode -asUtility multiplyDivide -name $MultDivNode;
        shadingNode -asUtility multiplyDivide -name $MultDivTwoNode;
        connectAttr -f ($addDoublNode + ".output") ($MultDivNode + ".input1X");
        connectAttr -f ($MultDivNode + ".outputX") ($MultDivTwoNode + ".input1X");
        connectAttr -f ($MultDivTwoNode + ".outputX") ($selectionTwo[0] + ".translateY");

        //set multipliers (and to divide)*********************
        setAttr ($MultDivNode + ".operation") 2;
        connectAttr -f CTRL_HP_ID.Range ($MultDivNode + ".input2X");
        connectAttr -f CTRL_HP_ID.Influence_y ($MultDivTwoNode + ".input2X")


        //set range
        //string $nameRemapValNode = ("remapVal_node_" + $x + $z);
        //connectAttr -f CTRL_HP_ID.Range ("remapVal_node_" + $x + $z + ".outputMin");
        //connectAttr -f CTRL_HP_ID.Range ("remapVal_node_" + $x + $z + ".inputMax");
    }
};
// Error:     }
 // 
// Error: Line 57.5: Syntax error // 
// Error:  // 
// Error: Line 59.0: Syntax error //

1 个答案:

答案 0 :(得分:1)

它很棘手;)你错过了;在第47行

connectAttr -f CTRL_HP_ID.Influence_y ($MultDivTwoNode + ".input2X") 

connectAttr -f CTRL_HP_ID.Influence_y ($MultDivTwoNode + ".input2X");