   Vertex Color Animation - It's possible?
  Maybe this is a dumb question but, it's possible to export vertex color animations from 3dmax?I'm currently using collada as the format for the assets in my game and I managed to animate vertex colors in 3dmax(what i'm really animating is the opacity as explained here) but I can't get these animations exported into the collada file. This is the .max file I'm using http://www.mediafire.com/?nmznngjiccuAny info will be appreciated. And sorry for my crappy english.   
  I imagine it isn't supported in Collada, for reasons I shall explain..... The data is available in the max SDK, and I imagine it's also available from MaxScript. You'll be using those if you want to get at the data. You will need to find the INode for the object you are interested in, and query its DerivedObject (Max speak for object that is produced as a result of the Modifier Stack). From this derived object, you can start to iterate through the Modifier stack. One of these iterations will provide you with a pointer to the vertex paint modifier you want to export.Each Modifier type has it's own unique Class_ID. So first things first - you'll have to figure out what Class_ID is used for the vertex paint modifier. Printf statements are about the only thing that works here, 3ds max is awful at documenting this information....So. Once you have the Class_Id, you can safely cast the Modifier to the C++ class type for the vertex paint modifier. There is but one small problem.  VertexPaintModifier.h will not exist. Nor will a definition for the class you need (If you are extremely lucky, there may be a header tucked away in one of the plug-in samples, but don't count on it). Assuming you don't know the C++ type, the next step is to try hunting for Param blocks on the modifier and *hope* you can get the data from them. There are numerous ways to do this, however none of them actually work properly. You'll probably end up doing one of more of these:1. Query the ParamBlock on the Modifier. You can get the attrib names from the block, however there's a good chance they either return "" or NULL. So, the best bet is to simply guess which params are which with a bit of trial and error. Of course, the node may have not implemented the ParamBlocks at all, and it'll just crash.2. Query the ParamBlock2 on the modifier. The new improved version of the param blocks aren't any better than the original ones. If you are lucky, you'll get the attributes. There's a good chance it'll just crash though.3. Give up trying to get params, and just Look at the SubAnims on the modifier. These should contain the Controllers for the animated attributes, and the Control class can access these values. There are no guarantees though. It's entirely possible the plug-in writer decided to irritate everyone by not bothering to expose any of the data to any of the standard max ways of doing things (not that there are any). Most exporters I've come across just evaluate the world state of the object, and spit out the result. This is simply because getting data out of 3ds Max is like stabbing your eyes out with a fork. Yes you could do it, but why would you want to go through the pain?You could of course just try importing the collada into Maya, animate the colours, and then re-export. Chances are they'll be exported from Maya and XSI....   ;  Thanks a lot RobTheBloke. Very informative answer. I'm going to try exporting from Maya to collada as soon as I can install it and see what happens.   ;Quote:Original post by GameDevWannabeThanks a lot RobTheBloke. Very informative answer. I'm going to try exporting from Maya to collada as soon as I can install it and see what happens.If collada doesn't export the colour animation, it's pretty easy to grab via mel script or in the API. A very lame example.... proc printMeshColours(string $parentTransform, string $meshname, int $startFrame, int $endFrame){  if($endFrame < $startFrame)   {    $temp = $endFrame;    $endFrame = $startFrame;    $startFrame = $temp;  }  // grab colour count  $numColours = `polyEvaluate -v $meshname`;  // iterate over frames  for($i=$startFrame; $i<=$startFrame; ++$i)  {    // set frame time and print current time.currentTime $i;    print("frame " + $i + "\n");    // print each colour in the mesh    for($j=0; $j<$numColours[0]; ++$j)    { string $info = $i; $info += "   "; $rgb = `polyColorPerVertex -q -rgb ($parentTransform + ".vtx[ " + $j + "]")`; $info += ($rgb[0] + " " + $rgb[1] + " " + $rgb[2] + "\n"); print ($info);    }  }}// usage!printMeshColours("pCone1", "pConeShape1", 1, 24);and for the API, see:http://nccastaff.bournemouth.ac.uk/jmacey/RobTheBloke/www/   