Direct Access to Bones

BlitzMax Modules Forums/MiniB3D/Direct Access to Bones

I have been attempting to directly access the bones in my .b3d file without success.

here is the .b3d file and code
www.bmaxbook.com/BoneTest.zip

it is a very simple file:
turretmesh: the 'skin'
bodybone: the bone that the lower part is attached to
headbone: the bone that the upper part is attached to.

i have animation in there so if you animate(turret) after load you will see it (don't forget to uncomment updateworld)

I want to control the headbone manually (i.e rotate it programmatically independent of the animation keys)

here is the code that I am using (same as in zip)
Import sidesign.MiniB3D
Strict

Graphics3D 800,600,32

Local turret:Tentity = LoadAnimMesh("turretbones.b3d")
Local  headbone:Tentity


'headbone = FindChild(turret , "headbone")
If CountChildren(turret) > 0
	For Local childcount:Int = 1 To CountChildren(turret)
		Local child:Tentity = GetChild(turret,childcount)
				Print EntityName(child)
					For Local childcount2:Int = 1 To CountChildren(child)
						headbone = GetChild(child,childcount2)
							Print EntityName(headbone)
		Next	
	Next	
EndIf 

Local cam:Tcamera = CreateCamera()
MoveEntity cam,0,10,-25

Local R# = 0.0
	Repeat
	
	R:+1
	'RotateEntity headbone,0,R#,0,1
	TurnEntity headbone,0,1,0,1



'UpdateWorld
RenderWorld
Flip

Until KeyDown(KEY_ESCAPE)


anyone have an idea?

Hi bill,
It seems you are "turning" the bone - You can verify this by putting the following line between RenderWorld and Flip.
Text 0,0,headbone.rx+": "+headbone.ry+":"+headbone.rz

The problem, I think, is that the mesh is not being deformed.
The function TAnimation.VertexDeform(ent1:TMesh,bent:TBone,vm[]) is only called when the mesh is actually animating. Probably requires a manual call to that function.

cool. I will check that out. Thanks