[Robotics] Part 2 IK Armature Chains in GameEngine?

Benoit Bolsee benoit.bolsee at online.be
Fri Jun 5 17:49:05 CEST 2009


If you post a blend somewhere, I can have a look. 
I repeat what I said before: in the GE the IK solver will only follow
the target if it is a bone of the same armature. 

This is for 2 reasons: 1) the GE doesn't have its own IK solver, it uses
Blender's 2) the constraint system that computes the IK target is
ineffective in the GE: it is based on Blender's Object data (position,
bones, etc.) that are not updated by the GE. 
Only actions are supported explicitely in the GE: while the GE is
running an action, the Blender pose information is swapped to GE
computed pose values to force Blender IK solver to use them. This
swapping is effective only for the armature running the action. This is
why the target must belong to the armature.

Note that I'm working on a new IK solver for which some of these
limitations will be lifted, if I have time. 

If you're not planning to use the game player, you should be able to get
around these limitations by directly controlling the Blender objects
inside the GE, using the Blender python API (versus the GE python API).
The Blender objects are still present and fully accessible during the GE
session.

Benoit

> -----Original Message-----
> From: robotics-bounces at blender.org 
> [mailto:robotics-bounces at blender.org] On Behalf Of Florian Lier
> Sent: vendredi 5 juin 2009 16:23
> To: robotics at blender.org
> Subject: [Robotics] Part 2 IK Armature Chains in GameEngine?
> 
> 
> Hello Benoit,
> 
> "> > > Yes, IK solver is fully supported in the game engine, at 
> > > least if you
> > > > take a bone of the same armature as target. Add a floating
> > > bone, make
> > > > it the target of the IK chain, create Actions to control it
> > > and play"
> 
> Okay that's what I tried first, to avoid confusions I'll 
> describe my approach:
> 
> Very simple:
> 
> 1) I created 4 cubes
> 2) Added 4 Armatures/Bones to the cubes (1 per cube) and 
> parented the bones to the cubes in PoseMode (Ctrl+P) - the 
> chain is calles "Armature"
> 3) I added another "floating" bone to the 3D scene which is 
> not part of the chain mentioned before, let's call it "floater"
> 4) Added a constraint to the last bone of the chain -> IK 
> Solver / ChainLen: 4 (orange line through all bones)
> 5) I targeted (OB:floater) the IK Solver to the "floater" 
> bone (BO: Armature)
> 6) By moving the floater bone in ObjectMode the IK Chain 
> follows perfectly 
> 
> 
> In ObjectMode
> 
> A) Select the floater bone, press I
> B) Go 50 frames forward move the floater bone (G) to another 
> position (Press I again)
> C) Now I can replay the recorded action in the 3D window with 
> alt+a, the Action is called ObAction
> 
> 
> In LogicPanel:
> 
> D) Add a sensor (always), controller (AND), actor (Action) 
> E) Combine them and add an action Actuator (AC: ObAction)
> F)Press P in 3D Window == NOTHING HAPPENS :/
> 
> 
> 2nd Scenario
> 
>  "That's why you must go
> > through an action that moves one target bone of the 
> armature itself."
> 
> This is similar to the frist scenario, just without the 
> "floater" target, I'm moving the tip of the
> IK chain, the rest is following, I can also record actions 
> similar to the first scenario.
> The problem here is: I can play the action in GE but ONLY the 
> tip bone, which should be
> the IK Solver moves, the rest of the chain doesn't move...
> 
> 
> That's been a lot of text I hope I was precise enough. To 
> focus it: It's still a mystery to use
> IK in GE - I'll do some research on using phyton this weekend - 
> 
> I appreciate EVERY consideration concerning IK and GE...
> 
> 
> ---
> MA
> 
> 
> ----- Original Message -----
> From: benoit.bolsee at online.be
> To: robotics at blender.org
> Date: 03.06.2009 17:40:08
> Subject: Re: [Robotics] IK Armature Chains in GameEngine?
> 
> 
> > 
> > 
> > > -----Original Message-----
> > > From: robotics-bounces at blender.org
> > > [mailto:robotics-bounces at blender.org] On Behalf Of Florian Lier
> > > Sent: mercredi 3 juin 2009 14:00
> > > To: robotics at blender.org
> > > Subject: Re: [Robotics] IK Armature Chains in GameEngine?
> > > 
> > > 
> > > Hey Benoit,
> > > 
> > > First things first, thanks!
> > > 
> > > Okay, as far as I understood you can "play" actions in the
> > > GE... Maybe I wasn't precise enough: What I want is to 
> > > controll the IK chain "live" in the GE with a keyboard or 
> mouse....
> > > 
> > > I have an empty object which is the target for the IK chain,
> > > when I create 
> > > a Sensor, Controller, Actuator for moving the empty object in 
> > > the GE the chain/arm doesn't move at all...
> > > 
> > 
> > That's correct: the IK solver uses the Blender's object position to
> > solve the chain, but this position is not changed during 
> the GE session
> > (GE converts blender object to GE object). That's why you must go
> > through an action that moves one target bone of the armature itself.
> > It's possible that you can change the bone position by Python but I
> > don't know. 
> > You can do something a bit tricky: create 3 actions that 
> only drive one
> > coordinate of the target bone: X, Y, Z. Make these actions strictly
> > linear (1 frame = 1 meter + linear extension) and bind them to
> > properties in the GE. Now you can control the bone in x,y,z by
> > activating the 3 actions at the same time (same priority and no
> > blending) and writing to the 3 properties the coordinates 
> you would like
> > to put the target. 
> > I didn't test but I think it can work.
> > 
> > > Is there any tuorial or howTo?
> > > 
> > > 
> > > Cheers, Florian
> > > 
> > > ---
> > > MA
> > > 
> > > 
> > > ----- Original Message -----
> > > From: benoit.bolsee at online.be
> > > To: robotics at blender.org
> > > Date: 03.06.2009 12:13:45
> > > Subject: Re: [Robotics] IK Armature Chains in GameEngine?
> > > 
> > > 
> > > > Yes, IK solver is fully supported in the game engine, at 
> > > least if you 
> > > > take a bone of the same armature as target. Add a floating 
> > > bone, make 
> > > > it the target of the IK chain, create Actions to control it 
> > > and play 
> > > > the actions in the GE with the Action actuator: the IK 
> solver will 
> > > > compute the chain in real time in the GE.
> > > > 
> > > > Benoit
> > > > 
> > > > > -----Original Message-----
> > > > > From: robotics-bounces at blender.org
> > > > > [mailto:robotics-bounces at blender.org] On Behalf Of 
> Florian Lier
> > > > > Sent: mercredi 3 juin 2009 11:37
> > > > > To: robotics at blender.org
> > > > > Subject: [Robotics] IK Armature Chains in GameEngine?
> > > > > 
> > > > > 
> > > > > Hello everybody,
> > > > > 
> > > > > I've modelled a robot arm including an IK Solver  which works
> > > > > quite well. The next step would be, moving the robot arm with 
> > > > > some input device in the GameEngine - my questions is: Is it 
> > > > > possible to include the IK Chain in the GameEngine?
> > > > > 
> > > > > cheers,
> > > > > 
> > > > > Florian
> > > > > 
> > > > > ---
> > > > > MA
> > > > > 
> > > > > 
> > > > > 
> > > > > _______________________________________________
> > > > > Robotics mailing list
> > > > > Robotics at blender.org
> > > > > http://lists.blender.org/mailman/listinfo/robo> tics
> > > > > 
> > > > 
> > > > _______________________________________________
> > > > Robotics mailing list
> > > > Robotics at blender.org 
> > > > http://lists.blender.org/mailman/listinfo/robotics
> > > > 
> > > 
> > > 
> > > 
> > > 
> > > _______________________________________________
> > > Robotics mailing list
> > > Robotics at blender.org 
> > > http://lists.blender.org/mailman/listinfo/robo> tics
> > > 
> > 
> > _______________________________________________
> > Robotics mailing list
> > Robotics at blender.org
> > http://lists.blender.org/mailman/listinfo/robotics
> > 
> 
> 
> 
> 
> _______________________________________________
> Robotics mailing list
> Robotics at blender.org
> http://lists.blender.org/mailman/listinfo/robotics
> 



More information about the Robotics mailing list