[WIP] Bullet Constraints Tools 0.3.7


Addon for creating Constraints for Blender 2.66

download

I have implemented a KDTree for faster neighbour seach and to be able to generate X-Constraints/multiple Constraints. (Atm it does only compare Object Pivot/Center)

This Addon is by no mean complete and finished. It works quite well, but there are a lot of Area’s to be improved, after all i started it 5 Days ago and i’m not a programmer at all. (But i recommend every Blender user to have a look at Python :wink: So, where should i start… The Addon currently does only make one Constraint per Object, ideally there should be a System to make X-Constraints/Multiple Constraints per Object. I need to do some more research on this, and test Bullet’s performance for a couple thousands of Constraints :wink:

There should be as well a Visual Feedback System. I have to check with Sergof (probably) if there are some Plans for Visualize Constraint in the Viewport. That’s the one thing, beeing able to see Constraints. Ideally the Tools should be more Interactive/Instant Visual Feedback, like show where Constrains are gone be built. Might be possible with OpenGL.

Together with the Feedback, there are some ideas for the Grease Pencil. Atm it uses only Point location of Stroke, but there are way more possibilities… Use distance from Stroke to Influence, for Example Break Threshold/Friction. Or use Colors to determine Strong and Weak Constraints? But how does it get mapped, and how can you set it up? For this i need some Feedback. I’d like to keep it as simple and powerful as possible.

It could be as well possible to have Object Groups? Not sure about this, somehow the selection approach is pretty straight forward…

Having spent a couple of Days now with this Tool, and the Idea behind it: You could possibly extend a Constraints Generator like insane, but it get’s very fast very complicated, thinking about all the Ways of how a Scene/Objects could be analyzed together with what is the best way to intuitively set Up Constraints. The Grease Pencil, actually more of a “oh yeah, that could be fun, let’s try” thing kind of demonstrates this. The moment i realized that you can draw Constraints inside a Object… Think about :wink:

What i would need know from you is some Feedback. Is the Tool usable at all? What do you miss? What is complete BS? What would you like to see?

I hope you have some fun with it. I certainly had, the last couple of days :wink:

Update 0.3.7.4
Add Enable Deactivation/Start Deactivated
Linear/Angular Velocity
Update 0.3.7.3
Fix GPencil
Update 0.3.7
Ground Connect uses KD-Tree. Faster.
Update 0.3.5
X Constraints now makes only 1 Constraint per 2 Objects (Double Avoid).
GPencil Mode, separated GPencil Distance from Search Radius
Added Constraint Limits & Springs.
Empty Constraints Type now different Appearance for different Constraints.
Option only gets updated if Checkbox left is activated.

Update 0.3.3
GPencil uses KD-Tree now. Delete Constraints works much faster too.

Update 0.3.2
Implemented KD-Tree

Usage:

The Tool is mostly selection based.

X Constraints
Generate multiple Constraints between Objects. (Atm it does compare Object Pivot/Center)

Neighbour Limit
Max Number of Constraints for X-Constraints

Search Radius
Max Distance Objects can have to still make Constraint between.

Generate Constraints
The Main Function of the Addon is to generate Constraints between Objects, usually pre-fractured (see Cell Fracture Addon or Destructibility Editor). It uses currently a simple nearest search and doesn’t do multiple Constraints. The Way it works is, for each selected Object it looks up its nearest Mesh and makes a Constraint (if distance within Search Radius), then makes the same procedure for this nearest Mesh. This means there is some kind of logic to it, but not much.

GPencil Mode
Disabled = Edit constraints, Enabled = Edit and Generate Constraints
GPencil

Allows to Draw/Edit Constraints with Grease Pencil Strokes. Uses Search Radius and Neighbour Limit.
Can be used to draw Ropes (See Video)

Distance for GPencil
Set distance for GPencil to take effect

Constraint Selected 2 Active
Connects all the selected Object to the Active Object.

Collision Margin
Collsion Margin

Friction
Friction of Objects

Enable Deactivation/Start Deactivated
Set Rigid Body dynamics Deactivation

Breakable
Enables Breakable for Constraints

Break Threshold
Force needed to break Constraint. Like Strength/Integrity. The Value for each Object gets calculated by it’s Mass, so:
Object Break Threshold = Object Mass * Bullet Tool Break Threshold (The Reason for this is simple, heavy Objects need stronger Constraints)

Absolut
In some cases you might want to set Absolute Break Threshold Values. This will skip Mass from calculation so:
Object Break Threshold = Bullet Tool Break Threshold

Multiply
In some cases you might want to make a Setup of different Constraints (different Break Values!) or edit Objects with different Break Values. So:
Object Break Threshold = Object Break Threshold * Bullet Tool Break Threshold

Ground Connect (WIP)
Connects selected Objects to active Object Vertices (usually Ground). Currently it uses the active Objects vertices, so you need some Vertices there in order to it to work. This feature is, like anything else, not yet finished.

Remove Constraints
Removes all Constraints on selected Objects. (includes Empties made from Ground Connect)

1 Like

a blender in Blender!! how cool is that! I guess poor Suzanne knew that this time would come…

wow very cool… looks like making a 2012 movie even easier… just watched yesterday lol…

bashi
congratulation!
I downloaded the http://graphicall.org/973, have attached Bullet Constraints Tool Viewport-032-KDTree addons to 2.64, but when I went on user preferences / addons addon was not there. I tried to install from file and nothing. Could you confirm if this script only works with Mac, or I’m doing something wrong. I would love to be able to experiment and collaborate.

that sounds not right… OS should not have to do anything with it.
isn’t this build 2.65 already?
Can you supply the Console-Output please?
Does it show up if you run the code from a Blender Text Editor?

bashi
is a compilation of Blender 2.64. When I run the text editor of Blender it appears normally. And addons can now also be viewed and selected.
Thanks for the tip, now I can work with this tool.

2012 used Bullet Physics Engine :wink: Film is crap but effects are nice :wink:

wow looks really cool! I will try it soon! Thanks! :slight_smile:

That’s really impressive. There’s a plan to implement this in the near future?

First we need Bullet Viewport integration in Trunk… We will see from there…

The Script still needs a good amount of work…

Wow, Bashi, this comes unexpected and is a good base to build upon for the future. Thank you so much for your work!

Thank you! This will help a LOT!

Thanks Bashi! This is a fantastic tool for simulating destruction. But I have one quick question: Why don’t the X-Constraints use the “breaking threshold” amount when generating constraints?

have you checked the checkbox left? it only updates what’s enabled there.

Yes, I have. It doesn’t seem to use the “override iterations” option either. The “generate constraints” button works fine with these, so it’s only the X-Constraints that don’t seem to take these values into account.

I will look into it. Thanks for reporting it.

EDIT: It’s fixed

Thanks! Where can I get the latest version?

same place, it’s still called 0.3.7

great and amazing work, bashi! Thanks very much!

@all

i still would be happy about some feedback, mainly usability…

is it usable? Grease Pencil? Update checkbox’s?

btw, i’m currently working on connecting Verts, but i have to find a way somehow to make it faster than just iterate through all verts…