PDA

View Full Version : Newbie need help on this code...


rhoffm22
08-11-2003, 07:50 AM
string $relocate[]=`ls -sl`;
$goal = getAttr ($relocate[0]+".translateX");
setAttr ($relocate[1]+".translateX") $goal;
// Error: Error reading data element number 1: 8.9595971 //

what is the data element that is not right?

Thanks
Ricky Hoffman

wrend
08-11-2003, 09:49 AM
gotta capture goal, just like you did the selection list.

rhoffm22
08-11-2003, 09:53 AM
//-----------------------------Starts-------------------------------
//Stores the selections
string $relocate[]=`ls -sl`;

//Gets Attr from Object
$tranX = `getAttr ($relocate[0]+".translateX")`;
$tranY = `getAttr ($relocate[0]+".translateY")`;
$tranZ = `getAttr ($relocate[0]+".translateZ")`;
$rotX = `getAttr ($relocate[0]+".rotateX")`;
$rotY = `getAttr ($relocate[0]+".rotateY")`;
$rotZ = `getAttr ($relocate[0]+".rotateZ")`;

//Data type converter
float $convertdata[];
$convertdata[0] = $tranX;
$convertdata[1] = $tranY;
$convertdata[2] = $tranZ;
$convertdata[3] = $rotX;
$convertdata[4] = $rotY;
$convertdata[5] = $rotZ;

//Relocates the Object
setAttr ($relocate[1]+".translateX") $convertdata[0];
setAttr ($relocate[1]+".translateY") $convertdata[1];
setAttr ($relocate[1]+".translateZ") $convertdata[2];
setAttr ($relocate[1]+".rotateX") $rotX;
setAttr ($relocate[1]+".rotateY") $rotY;
setAttr ($relocate[1]+".rotateZ") $rotZ;
//--------------------------------Errors----------------------------

rhoffm22
08-11-2003, 10:00 AM
//-----------------------------Starts-------------------------------
//Stores the selections
string $relocate[]=`ls -sl`;

//------------------------------Add On-------------------------------
//Moves down the string
string $recolorize[]=`pickWalk -d down`;

//Gets Attr from sub-string
$clrR = `getAttr ($recolorize[0]+".colorR")`;
$clrG = `getAttr ($recolorize[0]+".colorG")`;
$clrB = `getAttr ($recolorize[0]+".colorB")`;
float $inten = 'getAttr ($recolorize[0]+".intensity")`;
//getAttr -type ($recolorize[0]+".intensity");
//------------------------------Errors-------------------------------;
// Error: float $inten = 'getAttr ($recolorize[0]+".intensity")`;
//
// Error: Syntax error //

rhoffm22
08-11-2003, 11:00 AM
//-----------------------------Starts-------------------------------
//Stores the selections
string $relocate[]=`ls -sl`;

//------------------------------Add On-------------------------------
//Moves down the string
string $recolorize[]=`pickWalk -d down`;

//Gets Attr from sub-string
$clrR = `getAttr ($recolorize[0]+".colorR")`;
$clrG = `getAttr ($recolorize[0]+".colorG")`;
$clrB = `getAttr ($recolorize[0]+".colorB")`;
$intsity = `getAttr ($recolorize[0]+".intensity")`;

//Data type converter
float $convertdata2[];
$convertdata2[0] = $clrR;
$convertdata2[1] = $clrG;
$convertdata2[2] = $clrB;
$convertdata2[3] = $intsity;

//Recolorize the sub-string
setAttr ($recolorize[1]+".colorR") $convertdata2[0];
setAttr ($recolorize[1]+".colorG") $convertdata2[1];
setAttr ($recolorize[1]+".colorB") $convertdata2[2];
setAttr ($recolorize[1]+".intensity") $convertdata2[3];
//------------------------------Errors-------------------------------

CGTalk Moderation
01-15-2006, 09:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.