I’m starting with a simple script which adds a couple of objects to a scene:
import bpy
def add_prim(segs,r1,r2,h,x,y,z):
# add primitive mesh object
bpy.ops.mesh.primitive_cone_add(vertices=segs, radius1=r1, radius2=r2, depth=h)
# set basic properties
o= bpy.context.active_object
o.location[0]=x
o.location[1]=y
o.location[2]=z
o.game.physics_type = 'RIGID_BODY'
o.game.use_collision_bounds = 1
# set: bounce, friction, damping, etc
return o
def apply_impulse(o,x,y,z):
# *** apply impulse force vector to the object o
pass
o1=add_prim(4,1,2,1, 0,0,0)
o2=add_prim(4,1,2,1, 5,0,0)
apply_impulse(o1,0,0,1)
STEP 1:
What are the ways to apply an initial impulse to an object
def apply_impulse(o,x,y,z):
# *** apply impulse force vector to the object o
pass
ALSO: automatically play, record keyframes