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 Tools Search this Thread Display Modes
  10 October 2009
How to set skinweight value according uv coordinates


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]

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.

  10 October 2009
`getAttr ("pPlane1.vtx["+$i+8 +"]")`

not this!

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....
  10 October 2009
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
Society of Digital Artists

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

All times are GMT. The time now is 02:11 AM.

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