EntityColor does not work on animated .3ds meshes

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

Rad Gravity(Posted 2003) [#1]
Hey everyone, I just imported a fairly comlex animated mesh from 3ds max 5 into blitz and although EntityColor works with the static model it does nothing on the animated one. This was a really useful function in my project as the lighting was spot on before and now the main character looks way too bright.

Any ideas?

Also, ScaleMesh doesn't work with animated meshes, not that I need it because I use ScaleEntity which does work, but I noticed it anyway.

Another also (sorry about the length of this post), I use EntityTexture with the frame parameter to texture the different parts of my model and it only textures the sub-objects that aren't part of the object hierarchy in 3ds..


Binary_Moon(Posted 2003) [#2]
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


Rad Gravity(Posted 2003) [#3]
Hey Mr Moon, thanks for that. Guess I should have worked that out by myself!