How to set skinweight value according uv coordinates

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 10 October 2009   #1
How to set skinweight value according uv coordinates

Hi,

Having a bit of a problem over here. Don't know too much about MEL, and I wan't to make something.

I have a cube with some subdivisions skinned to two bones and i want the v-position of a uv to determine the influence of a vertex to one of those bones.

What i figured out so far from maya help:

// To query the u and v values of selected uvs:
polyEditUV -query ;


// Assign weights to a large number of vertices, several at a time to
// reduce the number of calls to the skinPercent command.
//
for ( $i = 0; $i <= 675; $i +=10 ) {
skinPercent -transformValue joint1 0.5
-transformValue joint2 0.5 skinCluster1 pPlane1.vtx[$i] pPlane1.vtx[$i+1] pPlane1.vtx[$i+2]
pPlane1.vtx[$i+3] pPlane1.vtx[$i+4] pPlane1.vtx[$i+5]
pPlane1.vtx[$i+6] pPlane1.vtx[$i+7] pPlane1.vtx[$i+8]
pPlane1.vtx[$i+9];
}

And at that time i also figured out i didn't know enough about MEL to make it work.

So if anyone has a few suggestions, they would make me a happy man.

Cheers
 
Old 10 October 2009   #2
This:
`getAttr ("pPlane1.vtx["+$i+8 +"]")`


not this!
pPlane1.vtx[$i+8]


The latter is for *good* OOP languages, and mel is most certainly not one of those! You must construct a text string of the attribute to query that value via getAttr....
 
Old 10 October 2009   #3
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 08:51 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.