setting a mesh's vertex alpha through code?

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 06 June 2011   #1
setting a mesh's vertex alpha through code?

Is there an accurate way to set a selected verts vertex alpha amount through code?

meshop.setvertalpha uses the map channel, so you could be assigning to any number of verts, so its not very accurate.

Does someone have a more accurate solution?


Thanks
 
Old 06 June 2011   #2
Quote:
Originally Posted by Hobbs
Is there an accurate way to set a selected verts vertex alpha amount through code?

meshop.setvertalpha uses the map channel, so you could be assigning to any number of verts, so its not very accurate.

Does someone have a more accurate solution?


why setvertalpha is not accurate for you? build default map faces for alpha channel and use geo vertex indexes to set the alpha values.
 
Old 06 June 2011   #3
basically we are creating new faces through

meshop.extrudefaces

then taking those new verts, and attempting to put alpha on them. The problem is, that since there is no mapping etc on those verts, the mapping channel verts do not align with geo verts, causing undesired results.

An easier solution, would be if we could get the actual vert indice that corrisponds to the face data of the newly created faces and apply the vertex alpha to them directly, like you would in an engine/exporter. But i'm not sure how to accomplish that in max without rebuilding the whole mesh? Which is not an option unfortunately.
 
Old 06 June 2011   #4
I wrote a script last week that did that exact thingy:
Code:
fn SetVertexColor targetColor mapChannel = ( target = selection[1] vertlist = target.selectedverts polyop.setVertColor target mapchannel vertlist targetColor )

the mapChannel value for vertex alpha is -2
simples
 
Old 06 June 2011   #5
Thanks slimeburger, i am already using a similar technique though.

The problem i was running into is that since we were creating new verts, the mapping verts of channel -2 was not matching up with the mesh verts, as mapping and geo verts do not align indexly. We found a work around with detatching the object, so our chance for error was minimal.
 
Old 06 June 2011   #6
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.
 
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 06:54 AM.


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