View Single Post
# 1 09-08-2016 , 01:34 PM
Registered User
Join Date: Aug 2016
Posts: 2

need help >.< copying and pasting values!

Hello everyone

Im currently scripting a tool which will allow me to copy the transforms on all a models vertices and paste them onto a duplicate of the model.

The purpose of this is so I can sculpt on a rigs model to fix bad deformations ( aka: the elbow when the arm bends ) and then copy and Paste the changes onto a corrective blendshape after which i clear out the transforms on all the vertexes.

The problem i am having however is when i try to "getAttr" the vertexes transforms. I get one of two errors,

// Error: line 32: Cannot convert data of type float[] to type float. //
// Error: line 1: Cannot convert data of type float[] to type float.
Start of trace: (command window: line 32).


or

Error reading data element number 1


Im having trouble understanding what the issue is because to me this should be working :S

Code:
string $sel[] = `ls -sl`;

duplicate $sel[0];

string $dup = `rename ("bShp"+$sel[0]+"corrective")`;

move -15 0 0;

int $count[] = `polyEvaluate -v $sel[0]`;
 
int $verNumber = $count[0];

int $vertNum = 0;

select -cl;

float $dupCorrectiveVal;


for ($i=0; $i<$verNumber; ++$i){
    
    string $verts = ($sel[0]+".vtx["+ $vertNum +"]");
    
    
    string $dup_verts = ($dup +".vtx["+ $vertNum +"]");
    
    
    string $VertAttrs[] = {"pntx","pnty","pntz"};
    
     for ($attr in $VertAttrs){
            
           $dupCorrectiveVal = `getAttr ($verts + "." + $attr)`;
            
            setAttr ($dup_verts + "." + $attr) $dupCorrectiveVal;
            
            setAttr ($verts + "." + $attr) 0;
            
            
        }
    
    $vertNum = (1 + $vertNum); 
}

does anyone have any advice?


Last edited by NextDesign; 10-08-2016 at 01:00 AM.