« Return to Thread: FOR TIM KNIP: Suggestion for Material handling in Collada and Max3DS

FOR TIM KNIP: Suggestion for Material handling in Collada and Max3DS

by andysk8er :: Rate this Message:

Reply to Author | View in Thread

Hey,
This is a suggestion for Tim, because I know he created and maintains the Max3DS, Collada and DAE parser classes in PV3d.

I was working with the Max3DS.as class the other day and noticed that if I didn't send it a materialsList in the constructor, it would create wireframe materials for the model, But then throw away the references to those wireframe materials. So, I couldn't do a replaceMaterialByName after the model had loaded because the model's materialsList was empty.

I dug into the parser and found the problem - I tweaked the code so that the Max3DS parser would add the new wireframe materials to the model's materialsList. This allowed me to replace them later. The side benefit of this is that I can load a model and not know anything about it's materials, but retrieve a complete materialsList after it has finished loading and replace the materials as needed.

Now, I am noticing that the Collada.as class has the same issue. If it can't find the materials in the collada file, it creates wireframe materials and then throws away the reference to those materials!

Anyway, I added an issue ticket on the papervision Google Code site about the Max3DS parser, but I guess I would like to see this change made to all of the model parsers. Unless, there is a reason why this change would be a problem. Tim, can you shed any light on this?

-Andy
===============================================
Check out my blog for Flash, AS3, and web development stuff:
http://www.wastedpotential.com

 « Return to Thread: FOR TIM KNIP: Suggestion for Material handling in Collada and Max3DS