Python Ragdoll setup

Python Ragdoll setup

jps
Advocate Advocate
1,246 Views
6 Replies
Message 1 of 7

Python Ragdoll setup

jps
Advocate
Advocate

I would like to know if there is way to assign a ragdoll to a control rig in python?

As well, do I have to create all the primitives needed as rigid body for that ragdoll?

 

Thanks

0 Likes
Accepted solutions (2)
1,247 Views
6 Replies
Replies (6)
Message 2 of 7

jps
Advocate
Advocate

After some research here are my results:

 

#1-Add a Ragdoll Physical property:
lRagdoll = FBCreateObject("Browsing/Templates/Physical Properties", "Ragdoll",ragdollName)

#2-Assign ragdol to character (drag and drop the ragdoll physical property to controll rig hipsEffector):
#??? no idea...

#3-Create the ragdoll
lRagdoll.PropertyList.Find("Create",False)()
return True

 

I'm still stuck with step 2.

Any help is welcome.

 

Thanks

0 Likes
Message 3 of 7

Anonymous
Not applicable
Accepted solution

Hi,

 

 you can simply connect them with FBConnect function, like

 

lApp = FBApplication()

currChar = lApp.CurrentCharacter

 

FBConnect( currChar, ragdoll )

FBConnect( ragdoll, currChar )

 

 Maybe one direction will be enough.

After that run ragdoll Create property.

0 Likes
Message 4 of 7

jps
Advocate
Advocate

Thanks a lot,

Looks like both connections are needed...

 

I still have some oddities when executing some functions sequencialy like:

setSolverLive(False,lSolver)
lSolver.PropertyList.Find("Reset to start",False)()
return True
setSolverOnline(False,lSolver)

 It doesn't stop the solver with start pose. I have to call these lines in separated functions linked to dedicated UI buttons and press these buttons one after the other.

 

My last question is how to use the recorder from FBPlayerControl() (lPlayer = FBPlayerControl()  lPlayer.Record(True,True) lPlayer.Play(False)) to stop at the end of my current take instead of pressing the stop button?

0 Likes
Message 5 of 7

Anonymous
Not applicable
Accepted solution

> It doesn't stop the solver with start pose. I have to call these lines in separated functions linked to dedicated UI buttons and press these buttons one after the other.

 

 Sometimes helps to evaluate a scene like FBSystem().Scene.Evaluate()

 

 It can be simular to when you press two different buttons in UI.

 

> My last question is how to use the recorder from FBPlayerControl() (lPlayer = FBPlayerControl()  lPlayer.Record(True,True) lPlayer.Play(False)) to stop at the end of my current take instead of pressing the stop button?

 

 Brief idea is to bind some event which is calling each frame and then check current frame FBSystem().LocalTime to determine where to run stop command for player control.

 

0 Likes
Message 6 of 7

Anonymous
Not applicable

Hi,

after assigning a ragdoll to a character, is there a way to load its characteristics from a .txt file ? Like you would do with the save and load buttons from the ragdoll solver pane ?

0 Likes
Message 7 of 7

Anonymous
Not applicable
0 Likes