I use the following code in my game to retexture animated meshes.
Function retexture_anim_mesh (mesh,texture,shin#=0)
For f=1 To CountChildren (mesh)
child=GetChild (mesh,f)
EntityTexture (child,texture)
EntityShininess child,shin
If CountChildren (child) Then retexture_anim_mesh (child,texture,shin)
Next
End Function
It applies the same texture to every child within the entity. This works on multi-part objects I have (tanks with turrets and guns etc.).
On a 'skinned' model built in max I get an error "entity is not a model' and the game exits.
Any ideas?
Is there any way I can predict whether a child will cause that error?
|