Morphing & vertex colors

Scratching my head with this one...

I have 2 morph targets with identical poly counts which morph just fine. They have however different vertex color information which isn't being taken over into the morph. The morph object just keeps the vertex color information of the original object.

Is there any way to have the morph object inherit the vertex color information of the morph targets & actually morph between them?

Any help gratefully received!

Eric

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
pacermike's picture

Hi Eric, Vertex color is not

Hi Eric,

Vertex color is not a "morphable" property as far as I know, correct me if I'm wrong anybody. I'm not even sure vertex color is animatable. However, starting in Max 2010 a "getvertexcolor" function became available for editable poly objects. I used that property to write a messy script that will morph vert colors for you, but it's just a proof of concept.

It's got a bunch of limitations as it's written now but you could use the ideas and adapt them to get it to do what you need. For one, it will only work in Max 2010 and newer because of the getvertexcolor function. Second, your morph targets with vertex color information need to be present in the scene. Also, because I'm using a when/change handler the colors will only morph with manual manipulation of the morph sliders, animated changes will have no effect. You could fix that by either using a timecallback or by using a custom attribute event handler in place of the existing change handler. Lastly, the code will throw a handler exception when you exit the scene because it loses sight of the morpher object. Again, just a proof of concept so I didn't go nuts writing in error checking and stuff.

To see how it works just open a scene, select an object with a morpher modifier on it (and make sure it's "vertex channel display" checkbox is checked in Object Properties) that has morph targets with different vertex colors, and run the script. Slide the channel sliders up and down and you should see the colors start mixing together. Eh, kinda cool.

Anyway, hope that's enough to get you started :)

AttachmentSize
morphvertcolor.ms 4.09 KB

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.