pense-bête de bruno sanchiz

Accueil > Blender > rigid body

rigid body

Publié le 10 novembre 2020, dernière mise-à-jour le 11 novembre 2020, 1 visites, 23644 visites totales.

Un rigid body est un objet solide , qui rebondit, interagit avec les autres objets du même monde.

Quand on crée un objet rigid body, on crée aussi "un monde" dans lequels tous les objets de ce type peuvent interagir.

exemple :

un monde objet rigid world :

bpy.ops.rigidbody.world_add() #création d’un rigid body ( automatique si on crée un objet )

rigidbody_world= bpy.data.scenes[’Scene’].rigidbody_world
bpy.data.scenes[’Scene’].rigidbody_world.steps_per_second # nb de simulation pas seconde
bpy.data.scenes[’Scene’].rigidbody_world.solver_iterations # iterations pour chaque pas
bpy.data.scenes[’Scene’].rigidbody_world.solver_iterations # speed, échelle de temps )

#CACHE
bpy.data.scenes[’Scene’].rigidbody_world.point_cache.frame_end
bpy.data.scenes[’Scene’].rigidbody_world.point_cache.frame_start
bpy.data.scenes[’Scene’].rigidbody_world.point_cache.frame_step

un objet rigid body a des caractéristiques :

o= bpy.data.objects[’Sphere’]
o.rigid_body
o.rigid_body.type=’ACTIVE’ # ’PASSIVE’
o.rigid_body.mesh_source=’FINAL’ # (’BASE’, ’DEFORM’, ’FINAL’)
o.rigid_body.collision_shape="MESH" # (’BOX’, ’SPHERE’, ’CAPSULE’, ’CYLINDER’, ’CONE’, ’CONVEX_HULL’, ’MESH’)
o.rigid_body.mass = 1.0 # résistance de l’objet au mouvement
o.rigid_body.friction=0.5 #
o.rigid_body.restitution =1 # bounciness , tendance à rebondir après une collision ( 0 = rien , 1 = collision élastique )
o.rigid_body.linear_damping= 0 # 0 à 1
o.rigid_body.angular_damping = 0 # 0 à 1

[bruno sanchiz]