Code archives/3D Graphics - Mesh/Make EntityAlpha etc. work with animated Meshes

This code has been declared by its author to be Public Domain code.

Download source code

Make EntityAlpha etc. work with animated Meshes by jfk EO-111102004
Ever wondered why EntityAlpha don't works with animated Meshes that have multiple children meshes, or EntityPickmode and so on? The reason why is: you need to execute those Commands on all Children, as well as on the children of the children. To make this a simple task you can use a collection of recursively working Functions, I give you two examples, it should then be easy for you to create a working recursive version for every Entity Manipulation command you need.
usage:

EntityAnimColor(mesh,red,green,blue)
or
EntityAnimAlpha(mesh,alpha#)




Function EntityAnimColor(m,r,g,b)
 If EntityClass$(m)="Mesh"
  EntityColor m,r,g,b
 Endif
 For i=1 to CountChildren(m)
  ww=GetChild(m,i)
  EntityAnimColor(ww,r,g,b)
 Next
End Function

Function EntityAnimAlpha(m,a#)
 If EntityClass$(m)="Mesh"
  EntityAlpha m,a#
 Endif
 For i=1 to CountChildren(m)
  ww=GetChild(m,i)
  EntityAnimAlpha(ww,a#)
 Next
End Function

Comments

None.

Code Archives Forum