how spawn skinned ragdolls in bge?have .blend a video Please Help me

(linuxfree) #21

friend just open my .blend file and look this code i think will help you to make bone by bone working to retarget constraints to instanced group for we can spawn my model please look used channels for bones

31-Aug-14, 18:00
I tried to do a similar thing just recently actually,

I found this code will work for the transforms constraints and I am pretty sure the tracking constraints:

sense = cont.sensors[‘Keyboard’]

armature = own.scene.objects[‘Armature’]
constraint = armature.constraints[0]

if sense.positive: = False

To access different constraints, just change the array position from 0 to whatever. 0 being the first slot of course.

An alternative method would be to use a loop and assign the desired constraints into variables by name using a loop through all of a bones constraints. This will also work for all transform and tracking constraints.

if cont.sensors[0].positive:
bone = own.channels[“top”]
for i in own.constraints:
if == “transforms”:
storage = i

Which ever on you choose, you could then edit influence (enforce), target, active state, ect.

However, I could get neither of these codes to work for the relationships constraints sadly. Maybe I did something wrong for them. If somebody can see why they would not work with my code, feel free to fix it and use it.

(edderkop) #22

i modified your blend a little, and it sort of works.

(BluePrintRandom) #23

yeah, I think even if you get the code to work it’s doomed because each armature is a duplicate copy, without it’s own unique datablocks,

so when you change 1 armature constraint, I think it changes all armature instance constraints.

I will see if it’s fixied in upbge*

(linuxfree) #24

you dont use any code?

Can explain better how you make that?

(linuxfree) #25

but where he made that?

(edderkop) #26

i put another modifier after the “Armature” modifier on the mesh.

(linuxfree) #27

yes but when i move the ragid body now dont move the armature bone or mesh this is caused per your modifier?

and in dont see armature and mesh in instanced group.I need know how you made for i put in my game.YOUR CREDITS will stay on my game beleive
i go just try remake and will send results and if have doubts i will contact you.thank you very much

(linuxfree) #28

you discover a new method and save blender game engine now more realistic 3D models will appear in games beleive!

thanks in advance

(BluePrintRandom) #29


ragdemo.blend (1000 KB)

(linuxfree) #30

Done! its modifiers in mesh blender have many secrets you are man! thanks a lot go put solved!

“Next step will be when the zombie die immediately put this ragdoll with empty parent / remove parent will try before with logic bricks if not work good will try via python. everything is already done on the same scale.I will only give a track to player to rotate facing the player”

(BluePrintRandom) #31

you need empties parented to the zombies bones oriented the right direction.

when you spawn in the zombie ragdoll, you must move and rotate the ragdoll bones to match the zombies pose he is replacing.

for ragbone in RagDollBones:
     for child in zombie.childrenRecursive:
         if in child:
             ragbone.worldTransform= child.worldTransform

this has a property in each empty that is the name of the ragdoll bone that is to match its pos/rot

(linuxfree) #32

thanks for help.I’m in midium level on python yet and i think the modifier to mesh created and had a secret in blender(may be in C language) now work perfectly on my project.

thanks in advance

(linuxfree) #33

A video on youtube your name is there thanks a lot

(linuxfree) #34

i need make this now cause ragdoll defroming mesh i need stable dead ragdoll effect like in start angle 0.0 Z axis. the empty spawn not 0.0 but can stay in any angle from 0.0 to 360 degrees.
in this case i need use your code for one by one bone name to set transformations?
RagDollBones = Armature name?

(linuxfree) #35

please look my new topic.

deforming mesh about rotate Z axis of empty spawn point he got the hitobject.orientation_to_euler()
can you help please friend for i get same effect zombie doll tomb like in 0.0 axis