0
$\begingroup$

I'm working on a Python script for Blender to generate 3D objects based on SVG files.

One thing I'm trying to automate is dropping various objects to a floor.

Each object can have varying dimensions, and rotation based on the contents of the SVG file. Most are bezier curves extruded to different heights, that are put onto groups and referenced. I need to makes sure some of these lay on a flat floor plane.

I also have a few text objects that copy the rotation of the camera to always be aligned with the viewing X axis - I need to make sure these touch the floor, but not intersect with it.

I'm usually doing this manually, but I'd like to automate as much as I can to save myself time spent on repetitive tasks.

If I could just setup some rigid body collision, lock rotation and drop it with Bullet physics - that'd be cool. I don't think I can do that with Blender groups.

Could I maybe replace the groups with some Animation Nodes sheningans? And use that to drop the stuff to floor, while obeying the object geometry?

What would you try?

$\endgroup$
1
$\begingroup$

I don't know much about Python scripting so I can't help with that part but this may help you with the workflow and concepts, then you maybe able to extrapolate hot to automate this.

Group Instances are generally created from Empty type of objects, but it doesn't have to be so, Dupligroups are the underlying feature that makes group instancing possible, and can in fact be used on any object type.

You can for example use a mesh as duplicator for a random group consisting of many other objects. It will override the "renderable geometry" of the object and replace it whatever group is being duplicated.

It also has the added benefite of allowing using physics on object types that would not support them otherwise like Bezier Curves, by assigning them to the duplicating mesh instead.

Just create any mesh object shaped as desired. If you care about detailed collision physics for complex geometries, make it so the mesh is shaped roughly as a simplified bounding volume of the group it will contain.

Add the desired curves to a new group (don't forget to set up group center, sanely placed relative to the object positions), then pick that group as Dupligroup for the previously created mesh.

You can now assign any physics desired to the mesh, virtualy looking like they are applied to the group instead.

enter image description here

Have in mind that in this case I made a randomly shaped mesh that has nothing to do with the underlying group shape, ideally they would roughly match.

$\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.