14
$\begingroup$

I'd like to position objects in the 3D view, but constrain them as to not intersect with another. I don't want to snap them together, rather have some fixed 3D object like a wall and be able to move cubes around and not allow them to penetrate other cubes or the wall when manipulating them.

$\endgroup$
2
$\begingroup$

I really wish Blender supported this out the box and it could be as easy as enabling/disabling 3D manipulator. But the simplest way I found is the following. Assuming you started with default scene with a cube:

  1. Enable Rigid Body for the cube in Properties > Physics and select the first Cube and Properties > Physics choose Passive for Rigid Body > Type.

  2. Duplicate it (ShiftD) and move (G, X) new cube somewhere so it does not touch original.

  3. Set End frame to big number, for example, 10000. Make sure Properties > Scene > Rigid Body World is enabled and set End in Rigid Body Cache to the same big number (10000 in this case). You also may want to disable Gravity.

  4. Select the second cube and duplicate it and in Edit mode with pivot set to Median Point scale up the third cube slightly (for example, 1.01), set its Maximum Draw Type (in Properties > Object > Display) to Wire. In Properties > Physics > Rigid Body Collisions choose Mesh as Shape and (assuming 1 BU = 1m) Margin to 3mm (if it fly away immediately when you start playing animation at step #6 - try smaller value and return to frame 1 to start again). Go back to Object Mode.

  5. Select the second Cube (the one you actually want to move) and in Properties > Physics choose Active for Rigid Body > Type.

  6. Click Play Animation. To manipulate, select the third cube (displayed as Wire) and move it. Second cube will follow and Rigid Body Physics will do its best to prevent collisions, but if you force it too much, it may fly away; if it does, press Esc and go back to first frame to try again. To put it on other object without intersection, move it slowly, when it start shaking it means slight intersection happened, move it away a bit and when it stops shaking, stop moving. When done moving/rotating, pause animation, select all, CtrlA to Apply and choose Visual Transform and then go back to Start frame.

Obvious drawbacks is that you have to enable Rigid Body on objects and create temporary object to move object you want to move, then delete temporary object, not to mention the temporary object introduces problems - direct manipulation would be much more convenient.

| improve this answer | |
$\endgroup$
0
$\begingroup$

In the latest version of Blender, right now it is 2.71, there is a selection called mesh in the collision tab. This seems to work very well for most active rigid body objects.

There is a tutorial by PHYMEC on YouTube addressing this very issue and he goes into great depth about the sphere of influence of an object on another object:
Great video on collisions for rigid bodies

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.