PDA

View Full Version : Export VertColor


countag
04-08-2006, 07:21 AM
Hi all,

i think i have a little problem, i try to get the VertColor, i think it's that, i want to get the color when you create a new objet, it will be maybe blue or green or red or pink but i want to know if its possible to get this color ? :/

i try to code an easy exporter (because im noob in Maxscript)


tmesh = snapshotAsMesh selection[1]

out_name = ((GetDir #export)+"\exportation.ag")

out_file = createfile out_name

num_verts = tmesh.numverts

num_faces = tmesh.numfaces

format "vecteur : %\n" num_verts to:out_file

format "face : %\n" num_faces to:out_file

format "\n" to:out_file

for v = 1 to num_verts do

(

vert = getVert tmesh v

format "%,%,%," vert.x vert.y vert.z to:out_file

format "\n" to:out_file

)

format "\n" to:out_file

for f = 1 to num_faces do

(

face = getFace tmesh f

format "%,%,%," (face.x as integer) (face.y as integer) (face.z as integer) to:out_file

format "\n" to:out_file

)

format "\n" to:out_file

for v = 1 to num_verts do

(

vc = getVertColor tmesh v

format "% % % " vc.r vc.g vc.b to:out_file

)



close out_file

edit out_name



this code :


for v = 1 to num_verts do

(

vc = getVertColor tmesh v

format "% % % " vc.r vc.g vc.b to:out_file

)



do nothing

mobeen
04-08-2006, 10:30 AM
Do u mean the current viewport color, if so use wirecolor property.

Thanks
Mobeen

countag
04-08-2006, 10:52 AM
yes i thought to that too but i dont know how to get the wirecolor :/ i know to set wirecolor but to get >< there is no command like : getWireColor ?

mobeen
04-10-2006, 07:34 AM
yes i thought to that too but i dont know how to get the wirecolor :/ i know to set wirecolor but to get >< there is no command like : getWireColor ?
Its a public property.
Make sure that obj is a valid object reference, If u want to get it use something like this
oldColor = obj.wirecolor

to set it use
obj.wirecolor = oldColor

Example:
This line sets the color of current selected geometry to red
$.wirecolor = color 255 0 0

Hope this helps
Mobeen

CGTalk Moderation
04-10-2006, 07:34 AM
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.