Get vertex alpha channel values?

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 02 February 2004   #1
Question Get vertex alpha channel values?

Hi there,

I'm writing a script to export the vertex color and alpha values from a selected mesh to a text file. I can get the color values fine, but can't find a way to get the alpha values.

The code is currently:

Code:
-- Pick the mesh to export colors from target_mesh = pickObject message:"Pick Target Surface:" filter:g_filter if isValidNode target_mesh then ( -- Snapshot mesh tmesh = snapshotAsMesh target_mesh -- Save file dialog out_name = getSaveFileName \ caption:"Save vertex color text file" \ types:"Text(*.txt)" if out_name != undefined then ( out_file = createfile out_name num_verts = tmesh.numverts for v = 1 to num_verts do ( -- Get vertex color vc = getVertColor tmesh v format "%\t%\t%\t%\n" v vc.r vc.g vc.b to:out_file ) -- Close file close out_file ) )


I'm guessing I need a line similar to the vc = getVertColor, but for the vertex alphas. In the import script (opposite of this one), I use "meshOp.setVertAlpha target_mesh -2 vert alpha" to set the vertex alpha, which works fine. It uses channel -2 which is Max's built in vertex alpha channel.

If anyone could help, that would be great. Thanks.
 
Old 02 February 2004   #2
Re: Get vertex alpha channel values?

Please read the topic "Accessing the Viewport Vertex Alpha Values" in the MAXScript 6 Online Reference (I think I wrote it for the PFlow Extension update to 5.1, so you could download the MAXScript Help 5.1.1 from discreet's support site if you are still using Max 5)

It shows an example of accessing the viewport alpha channel (-2) and discusses related questions...

Please let me know if you cannot find it.
(In the 6th version, there is also a topic called "How do I access the Alpha values shown in the viewport?" in the "Frequently Asked Questions" chapter which links to the actual page)

Hope this helps.

Bobo


Quote:
Originally posted by ed-it
Hi there,

I'm writing a script to export the vertex color and alpha values from a selected mesh to a text file. I can get the color values fine, but can't find a way to get the alpha values.

The code is currently:

Code:
-- Pick the mesh to export colors from target_mesh = pickObject message:"Pick Target Surface:" filter:g_filter if isValidNode target_mesh then ( -- Snapshot mesh tmesh = snapshotAsMesh target_mesh -- Save file dialog out_name = getSaveFileName \ caption:"Save vertex color text file" \ types:"Text(*.txt)" if out_name != undefined then ( out_file = createfile out_name num_verts = tmesh.numverts for v = 1 to num_verts do ( -- Get vertex color vc = getVertColor tmesh v format "%\t%\t%\t%\n" v vc.r vc.g vc.b to:out_file ) -- Close file close out_file ) )


I'm guessing I need a line similar to the vc = getVertColor, but for the vertex alphas. In the import script (opposite of this one), I use "meshOp.setVertAlpha target_mesh -2 vert alpha" to set the vertex alpha, which works fine. It uses channel -2 which is Max's built in vertex alpha channel.

If anyone could help, that would be great. Thanks.
 
Old 01 January 2006   #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.
 
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 11:02 AM.


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