arjan_meerten
02-13-2004, 04:11 PM
Hi there
I have a problem when making a procedure of a smal script of mine and put it on an button.
The script is more like an action. The action makes a copy of my selected character, unlockes the channel attributes, and adds some attributes with information I want to use when I'm using these copies as blendshapes. First I select a bone and then I select the skin.
The script runs fine, but when I make a procedure from it, maya gives this error.
Error: Invalid call to "floor". Check number and types of arguments expected by the procedure.
This is the script:
global proc scriptA () {
$selec = `ls -sl`;
$gradenX = getAttr ($selec[0] + ".rotateX");
$gradenY = getAttr ($selec[0] + ".rotateY");
$gradenZ = getAttr ($selec[0] + ".rotateZ");
$gradenXflr = floor($gradenX);
$gradenXabs = abs($gradenXflr);
$gradenYflr = floor($gradenY);
$gradenYabs = abs($gradenYflr);
$gradenZflr = floor($gradenZ);
$gradenZabs = abs($gradenZflr);
gotoBindPose;
$newn = "lijf" + "_" + $selec[0] + "_" + "X" + $gradenXabs + "_" + "Y" + $gradenYabs + "_" + "Z" + $gradenZabs;
duplicate -n $newn $selec[1];
parent -w $newn;
setAttr -l false ($newn + ".translateX");
setAttr -l false ($newn + ".translateY");
setAttr -l false ($newn + ".translateZ");
setAttr -l false ($newn + ".rotateX");
setAttr -l false ($newn + ".rotateY");
setAttr -l false ($newn + ".rotateZ");
setAttr -l false ($newn + ".scaleX");
setAttr -l false ($newn + ".scaleY");
setAttr -l false ($newn + ".scaleZ");
setAttr ($newn + ".translateX") 15;
addAttr -ln blendinfo_rotX -at double;
setAttr -e -keyable true ($newn + ".blendinfo_rotX");
setAttr ($newn + ".blendinfo_rotX") $gradenX;
addAttr -ln blendinfo_rotY -at double;
setAttr -e -keyable true ($newn + ".blendinfo_rotY");
setAttr ($newn + ".blendinfo_rotY") $gradenY;
addAttr -ln blendinfo_rotZ -at double;
setAttr -e -keyable true ($newn + ".blendinfo_rotZ");
setAttr ($newn + ".blendinfo_rotZ") $gradenZ;
addAttr -ln jointname -dt "string";
setAttr ($newn + ".jointname") -type "string" $selec[0];
layerEditorAddObjects blends;
}
I hope you can help me with this problem
thanx in advance
I have a problem when making a procedure of a smal script of mine and put it on an button.
The script is more like an action. The action makes a copy of my selected character, unlockes the channel attributes, and adds some attributes with information I want to use when I'm using these copies as blendshapes. First I select a bone and then I select the skin.
The script runs fine, but when I make a procedure from it, maya gives this error.
Error: Invalid call to "floor". Check number and types of arguments expected by the procedure.
This is the script:
global proc scriptA () {
$selec = `ls -sl`;
$gradenX = getAttr ($selec[0] + ".rotateX");
$gradenY = getAttr ($selec[0] + ".rotateY");
$gradenZ = getAttr ($selec[0] + ".rotateZ");
$gradenXflr = floor($gradenX);
$gradenXabs = abs($gradenXflr);
$gradenYflr = floor($gradenY);
$gradenYabs = abs($gradenYflr);
$gradenZflr = floor($gradenZ);
$gradenZabs = abs($gradenZflr);
gotoBindPose;
$newn = "lijf" + "_" + $selec[0] + "_" + "X" + $gradenXabs + "_" + "Y" + $gradenYabs + "_" + "Z" + $gradenZabs;
duplicate -n $newn $selec[1];
parent -w $newn;
setAttr -l false ($newn + ".translateX");
setAttr -l false ($newn + ".translateY");
setAttr -l false ($newn + ".translateZ");
setAttr -l false ($newn + ".rotateX");
setAttr -l false ($newn + ".rotateY");
setAttr -l false ($newn + ".rotateZ");
setAttr -l false ($newn + ".scaleX");
setAttr -l false ($newn + ".scaleY");
setAttr -l false ($newn + ".scaleZ");
setAttr ($newn + ".translateX") 15;
addAttr -ln blendinfo_rotX -at double;
setAttr -e -keyable true ($newn + ".blendinfo_rotX");
setAttr ($newn + ".blendinfo_rotX") $gradenX;
addAttr -ln blendinfo_rotY -at double;
setAttr -e -keyable true ($newn + ".blendinfo_rotY");
setAttr ($newn + ".blendinfo_rotY") $gradenY;
addAttr -ln blendinfo_rotZ -at double;
setAttr -e -keyable true ($newn + ".blendinfo_rotZ");
setAttr ($newn + ".blendinfo_rotZ") $gradenZ;
addAttr -ln jointname -dt "string";
setAttr ($newn + ".jointname") -type "string" $selec[0];
layerEditorAddObjects blends;
}
I hope you can help me with this problem
thanx in advance
