Community
Maya Programming
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya SDK topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

(MEL)Syntax issue with polyColorPerVertex script

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
absoluteKelvin
753 Views, 3 Replies

(MEL)Syntax issue with polyColorPerVertex script

absoluteKelvin
Collaborator
Collaborator

 

{
    polySelectConstraint -m 3 -t 0x0001 -w 1;
    string $openBorderVtx[] = `ls -sl -fl`;
    polySelectConstraint -m 0 -w 0;
    dR_modeVert;
    string $storeBorderVtx[];
    for {$verts in $openBorderVtx)
    {
        select -r $verts;
        float $colorQuery[] = `polyColorPerVertex -q -g`;
        if ($colorQuery[0] == 1)
        {
            $storeBorderVtx[`size($storeBorderVtx)`] = (`ls -sl`);
        }
    }
    select -r $storeBorderVtx;
}

 

I have no idea why is wrong with this code. Im just trying to query vertices that are green. the syntax error is driving me nuts.

https://www.artstation.com/kelvintam
0 Likes

(MEL)Syntax issue with polyColorPerVertex script

 

{
    polySelectConstraint -m 3 -t 0x0001 -w 1;
    string $openBorderVtx[] = `ls -sl -fl`;
    polySelectConstraint -m 0 -w 0;
    dR_modeVert;
    string $storeBorderVtx[];
    for {$verts in $openBorderVtx)
    {
        select -r $verts;
        float $colorQuery[] = `polyColorPerVertex -q -g`;
        if ($colorQuery[0] == 1)
        {
            $storeBorderVtx[`size($storeBorderVtx)`] = (`ls -sl`);
        }
    }
    select -r $storeBorderVtx;
}

 

I have no idea why is wrong with this code. Im just trying to query vertices that are green. the syntax error is driving me nuts.

https://www.artstation.com/kelvintam
3 REPLIES 3
Message 2 of 4
mspeer
in reply to: absoluteKelvin

mspeer
Consultant
Consultant
Accepted solution

Hi!

 

In line 7 there is a wrong bracket used "{", but it should be "(".

 

Corrected:

 

for ($verts in $openBorderVtx)

 

 

0 Likes

Hi!

 

In line 7 there is a wrong bracket used "{", but it should be "(".

 

Corrected:

 

for ($verts in $openBorderVtx)

 

 

Message 3 of 4
absoluteKelvin
in reply to: mspeer

absoluteKelvin
Collaborator
Collaborator

D'oooh Im such an idiot. I have been staring at it for the longest time and couldn't see it. Thanks

https://www.artstation.com/kelvintam
0 Likes

D'oooh Im such an idiot. I have been staring at it for the longest time and couldn't see it. Thanks

https://www.artstation.com/kelvintam
Message 4 of 4
mspeer
in reply to: absoluteKelvin

mspeer
Consultant
Consultant

Hi!

Something like this happens to everyone from time to time.

0 Likes

Hi!

Something like this happens to everyone from time to time.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report