PDA

View Full Version : Converting material diffuse color to vertex color; if elements selected, VC go black


j83
11-30-2010, 08:00 PM
Hello,

Currently if I assign the diffuse color of a standard material to the objects vertex colors it seems to work fine. However, if I go into sub-object mode and select everything (via element mode or face mode), all vertex colors turn to black.

Is the data not being saved or something? If an individual face is selected, it shows the expected vertex color for that face, however, if in sub-object mode Ctrl+A (select all) is pressed, all vertex colors disappear.

Here is an example that shows the problem,
Edit: This does NOT occur in Max 2008
Edit: This does NOT occur in Max 2009
Edit: Does occur in Max 2010

Edit: Things that do not work to fix this in 2010:
-attaching this mesh to another mesh, vertex colors on new object just turn black as well when all sub-elements are selected
-converting the object to mesh/patch/poly
-assigning a vertex color modifier and "picking" up the vertex colors (which you can then edit via the Vertex Paint modifier), still turns black if you select all the subelements
-if you assign an Editable Poly modifier to the stack, then select all elements, this does NOT happen, however, if you collapse the stack, select all subelements, the problem resumes


(
resetMaxFile()
delete objects /*just makes sure we have a simple scene to test this, as there may have been a maxstart.max file with objects in it*/

local objArray = #()
for i = 1 to 10 do /*here we create some teapots to use for the test*/
(
aTeapot = convertToPoly(teapot pos:[0,(-50 + (i * 50)),(20 * sin(i*300+0))] material:(Standard diffuse:(random black white)))
append objArray aTeapot
)

for obj in objArray do
(
modpanel.setCurrentObject obj
local verts = #{1..(obj.numverts)}
polyop.setVertColor obj 0 verts obj.material.diffuse

setShadeCVerts obj true
SetCVertMode obj true
obj.material = undefined /*remove the material from the object when we're done, as it's no longer needed*/
obj.wirecolor = black
)

tempObject = objArray[1] /*Grab the first object in the array, and we'll attach the other objects to it*/

for j = 1 to objArray.count do
(
if (j != 1) then
(
objArray[1].EditablePoly.attach objArray[j] objArray[1]
)
)
ResetXform tempObject
convertToPoly tempObject
)

http://forums.cgsociety.org/attachment.php?attachmentid=158042

j83
12-01-2010, 11:39 AM
If a Max 2011 user has time, can you confirm if it works correctly or turns black (we haven't moved to 2011 at work yet)?

So far, 2008 and 2009 work fine, but 2010 exhibits this behavior. :wip:

CGTalk Moderation
12-01-2010, 11:39 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.