- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone,
after copying (manually) a MEL script I've tried to run it (it should create a joint at the center of the selected vertices), but each time I receive this error:
//---------------------------------------------------------------------------------------
select -cl ;
select -r pSphere1.vtx[0:381] ;
////Create a Joint at the center of selected vertices
// Convert selection to vertices:
ConvertSelectionToVertices;hilite; selectType -ocm -alc false;selectType -ocm -polymeshVertex true;
// Find selection of components:
string $selVert[] = `ls -sl -fl`;
// Create a cluster
string $cl[] = `newCluster " -relative -envelope l"`;
// Create a world joint
select -cl;
string $jnt = `joint`;
// Point constraint the point to the cluster
string $ptCnsJnt[] = `pointConstraint $cl $jnt`;
// Find the point constraint:
string $findPtCns[] = `listRelatives -type pointConstraint $jnt`;
// Select and delete the point constrain and cluster:
select $findPtCns[0] $cl[0]; doDelete;
// Select the joint:
select -cl; select $jnt;
select -d pSphere1.vtx[0:381] ;
select -add pSphere1.vtx[0:381] ;
// Error: line 0: Error while parsing arguments. //
//---------------------------------------------------------------------------------------
This is the script:
//---------------------------------------------------------------------------------------
////Create a Joint at the center of selected vertices
// Convert selection to vertices:
ConvertSelectionToVertices;hilite; selectType -ocm -alc false;selectType -ocm -polymeshVertex true;
// Find selection of components:
string $selVert[] = `ls -sl -fl`;
// Create a cluster
string $cl[] = `newCluster " -relative -envelope l"`;
// Create a world joint
select -cl;
string $jnt = `joint`;
// Point constraint the point to the cluster
string $ptCnsJnt[] = `pointConstraint $cl $jnt`;
// Find the point constraint:
string $findPtCns[] = `listRelatives -type pointConstraint $jnt`;
// Select and delete the point constrain and cluster:
select $findPtCns[0] $cl[0]; doDelete;
// Select the joint:
select -cl; select $jnt;
//---------------------------------------------------------------------------------------
I can't really understand what's wrong with this, can anyone help me?
Thanks
Maya 2018, Mac Edition, latest update, MacBook PRO (mid 2015), OS Sierra
Solved! Go to Solution.