CGTalk > Software > Autodesk 3ds max > 3dsMax SDK and MaxScript
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 02-02-2004, 06:06 AM   #1
ed-it
New Member
Technical Artist
 
Join Date: Jun 2002
Posts: 8
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-03-2004, 12:43 AM   #2
Bobo
Krakatoa Guy
 
Bobo's Avatar
Borislav Petrov
Product Specialist
Thinkbox Software
Vancouver, Canada
 
Join Date: Mar 2002
Posts: 5,321
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-17-2006, 09:00 AM   #3
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 01:41 AM.


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