CompositeMaterial HEADACHE

Software: Away3D 3.x

Avatar
Choons, Sr. Member
Posted: 05 August 2011 11:26 PM   Total Posts: 281

Hi guys,

having a hell of a time removing materials from a CompositeMaterial. The addMaterial calls were made inside of functions so the materials inside the composite material aren’t global. How do I remove a material the way it’s written? What is stored in the protected materials array and why the hell can’t I access that materials array property? All I need is something like a removeChildAt method to get to the materials. Otherwise I have to store everything globally. Help

   

Avatar
Choons, Sr. Member
Posted: 06 August 2011 04:51 AM   Total Posts: 281   [ # 1 ]

well this ought to win at least honorable mention for one of the weirder lines of Away3D code ever written. I changed the protected materials property in CompositeMaterial to public so I could access the materials by index instead of name. So if you have a composite material called cmat here’s how

cmat.removeMaterial(cmat.materials[cmat.materials.length - 1])

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X