This doesn't work for me

posted to: Intro to Lists

I am trying to run the script at 13:17 in my blender v2.81a's python console and it doesn't do anything.

Do you know why ?

  • spikeyxxx replied

    Try typing it in the Text Editor instead of in the Python Console, just like Basam is doing it. (Still works in 2.82...)

  • Saif Farid(saif-farid) replied

    I tried it in 2.82. Now it does move but all the block just go down by -0.544021 m. It is not forming a wave like pattern just like the sine curve. 

    I am not using Bassam's cubes.blend file by the way. I just opened a new blender scene and  

    1. added a plane

    2. subdivided it multiple times

    3. edge splitted all the squares in the plane

     4. Separated them all into different objects by separation by loose parts

    5. Extruded all the squares down a bit so they form cubes

    6. Tried bassam's script in the text editor

    All the cubes just moved down by -0.544021 m, they still are in the same plane in the z axis. They did not form a wave pattern.

    Can you please help me.

  • spikeyxxx replied

    Hi Saif,

    sorry for the delay. The way you constructed the cubes, from a single plane, caused them to all have their Origins in the same place. So if you want the Z location to  be a function of the X and Y location of the objects, that Z location will be the same for all the cubes.

    Select all the cubes and go to Object > Set Origin > Origin to Geometry.

  • Saif Farid(saif-farid) replied

    Thank you, now it works