0 1 2 3 4 5 6 7 8 9 10

import bpy bpy . ops . mesh . primitive _ plane _ add ( radius = 145 , location =( 0 , 0 , 0 )) bpy . ops . rigidbody . object _ add () bpy . context . object . rigid _ body . type = ' PASSIVE ' for i in range ( 0 , 25 ): bpy . ops . mesh . primitive _ cube _ add ( radius = 1 , location =( 6 * i , 0 , 10 )) bpy . ops . rigidbody . object _ add () bpy . ops . transform . resize ( value =( 1 , 6 , 10 ), constraint _ axis =( False , True , True )) if i == 0 : bpy . ops . transform . rotate ( value = 0 . 4 , axis =( 0 , 1 , 0 ))

Here's all the code you need to create the animation above:And here's how it works:(If you're completely new to Blender Python, click here to find out how to copy-paste the code. Blender's physics engine is very powerful, but at the same time very easy to handle programatically. If you're learning Python, playing with physics is a great way to practice. For the domino effect, all we need is a plane and several blocks.The plane, which will serve as a table on which the blocks stand [line 1], as well as the blocks are Rigid Bodies [2]. Once a Blender object is set as a Rigid Body, it behaves like, well, a rigid body, which means that other rigid bodies won't go through it, but rather push it away, bounce against it, etc. By default, Blender treats all objects as clouds or ghosts which do not interact when colliding. Turning them into Rigid Bodies is like changing them into stones and it's what gives them physical properties.The plane is a "passive" [3] Rigid Body, which means gravity won't pull it down. The blocks are active.A quick overview of the code:[0] load the Blender Python module[1-3] create the plane and set its physics[5-7] create the domino blocks - they are simply flat rectangular prisms[8] resize the blocks[9-10] rotate the first block so that it falls down and starts the chain reactionTry experimenting with different placement of the blocks - how about a sine curve or a circle?