breaking joints during simulation

Physics APIs, Physics file formats, Maya, Max, XSI, Cinema 4D, Lightwave, Blender, thinkingParticles™ and other simulation tools, exporters and importers
aws357
Posts: 9
Joined: Tue Jul 03, 2007 8:20 am

breaking joints during simulation

Post by aws357 »

as there is a "1 post before you can post link/URL" I take this opportunity to say hello :)

I usually roam the Blenderartist forum and didn't have much interest in the physic engine until I discovered the ability to bake IPO to make easy physics driven animations with Blender.

:wink: Ok. Now it's done, I can post links and URLs... * joy *
aws357
Posts: 9
Joined: Tue Jul 03, 2007 8:20 am

Post by aws357 »

this thread is the offspring of this thread I posted on blenderartist...
http://blenderartists.org/forum/showthread.php?t=99846

So I downloaded the demo with the ragdolls where you can break the joints with a mouse and managed to get a grip of what is currently happening...

I am currently trying to adapt this demo to my need.
Here is a small test I am doing. The goal is to press a key and the object OBCube.001 will fall...
http://uploader.polorix.net//files/265/ ... estc.blend

Here is the python script that is assigned as a controller to Cube.001.

Code: Select all

import GameLogic as gl
import PhysicsConstraints as pc

cont=gl.getCurrentController()
owner=cont.getOwner()

kpress=cont.getSensor("kpress")

if kpress.isPositive():
	pc.removeConstraint(#don't know how I can get the constraint ID from the Constraint stack...#)
The problem I have is to get the constraint ID from Cube.001 knowing that the constraint has been created using Blender GUI. My guess is, once I have this ID, this little script will sever the joint between Cube.001 and Cube making me a happy blenderist ---> :lol:

So the main question is, where can I get this ID when the constraint has been built with the GUI?

Optional question (only useful if there is no straight answer to the main question)
In the demo the joints are created in python using createConstraint. If I have no choice, I will do it that way, but in that case, what should I do to place the joint as I wish? (make it hinge, modifie the pivot position etc...)

Thanks :)