Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Mel Noob...
Trying to duplicate a bone at the location of each vertices of a selected object.
Trying to cast vertex selection to an array, and i think that works, but then when trying to match transforms i get 'need to have two objects selected' error.
Was trying to modify an earlier script that works ok when replacing other objects, but i think im missing something with how vertex names are stored.
here is the code
//Duplicate joint0 at Selected vert Locations
if (`objExists joint0`)
{
// Cast the vertices of selected into an array
string $selVerts[] = `polyListComponentConversion -tv -fe`;
// See if nothing is selected
if ($selVerts[0] != "")
{
// Perform for each selected
for ( $i=0; $i<size($selVerts); $i++ )
{
//Selects and duplicates joint0
select -r joint0;
duplicate -n newJoint;
//Moves duplicate joint to selected pin location
matchTransform -pos newJoint $selVerts[$i];
print ("Duplicated successfully. \n");
}// end of for
}// // end of if
else
{
string $s ="Error: Something went Wrong! \n";
print $s;
}// // end of if objExists
}
else
{
print "joint0 object is missing. \n";
}
I feel like im close but missing something probably obvious.
Solved! Go to Solution.