EntityColor does not work on animated .3ds meshes

Blitz3D Forums/Blitz3D Programming/EntityColor does not work on animated .3ds meshes

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

It does work. You just need to understand how the loadanimmesh commands works.

Basically when you load an animated mesh you load the mesh and keep the hierachy intact. So the handle that gets returned byt hte loadanimmesh command is the parent, with all the meshes being children. Using the entitycolor command you only colour the parent (which could well be a pivot) and so nothing changes colour. What you need to do is write an entitycolor function that is recursive (gores through children as well)

;----------------------
;recursive entity color
;----------------------
Function entity_color(entity,r,g,b)

	EntityColor entity,r,g,b
	
	For i=1 To CountChildren(entity)
		child=GetChild(entity,i)
		entity_color(child,r,g,b)
	Next

End Function


NOTE : I haven't tested this but it should work fine