Stack and Spin animation loop created with Python in Blender

Sdílet
Vložit
  • čas přidán 25. 07. 2024
  • In this video, we will create a script that generates an abstract animation loop with stacked prisms.
    Start Code:
    github.com/CGArtPython/blende...
    Complete Code:
    github.com/CGArtPython/blende...
    00:00 - Intro
    00:21 - Get the code
    01:22 - Add a pentagonal prism
    04:02 - Add a for loop to create a stack
    07:35 - Change the radius on each iteration
    09:09 - Change the rotation on each iteration
    10:42 - Apply material with a random color
    11:23 - Move code into a function
    13:16 - Animate the rotation
    22:21 - Offset the start of the rotation animation
    24:35 - Move animation code into a function
    26:12 - Parameters to tweak and customize
    Intro Music
    Fiery Trails - Silent Partner
    Background Music
    Where To - Birocratic
    Outro Music
    Geographer - Easy Shake
    #blender #python #creativecoding

Komentáře • 36

  • @genevaspring8974
    @genevaspring8974 Před 2 dny +1

    Great video ! Thanks ! I noticed that when I switched to the 'scripting' layout, only the Python interactive console was visible. The window that usually shows the Python code corresponding to actions in Blender wasn't there. For those is same situation: you can fix it by splitting the Python interactive console window vertically. Then, set the newly created window to 'Info' by selecting it from the menu (click on the 'i' icon).

  • @mad-man.meowth
    @mad-man.meowth Před rokem +9

    I just finished a coding course and now I'm moving onto Blender as a hobby and I am so glad I found your tutorials to help me expand my Python and animation skills. Thank you very much!

    • @CGPython
      @CGPython  Před rokem +1

      Great to hear!
      I hope you will find what you are looking for in my tutorials! 😊

  • @Booma_1002
    @Booma_1002 Před 13 dny

    Now i can freely express my thoughts with programming in another app. thanks

  • @ericsguitar0
    @ericsguitar0 Před 4 měsíci

    This whole setup is extremely useful. There are so many potential parameters to play with. Nice.

  • @peterstrohmeier4666
    @peterstrohmeier4666 Před 5 měsíci +1

    Your way of presenting the full coding step by step from the beginning is really great. I've learned a lot, Thx

    • @CGPython
      @CGPython  Před 5 měsíci +1

      You are welcome! 🙂

  • @BrettKromkamp
    @BrettKromkamp Před 2 lety

    Always look forward to new CGPython tutorials. Will get on to this when I get home later this evening 🤓

  • @markomilenkovic2714
    @markomilenkovic2714 Před rokem +1

    This channel is gold! I want to start learning python through Blender! Thanks for creating this channel and appreciate all your work on this topic!

    • @CGPython
      @CGPython  Před rokem

      I'm excited to hear that!
      Welcome!

  • @lightningthebeast
    @lightningthebeast Před 2 lety

    That looks great!

  • @stonedrecluse2833
    @stonedrecluse2833 Před 10 měsíci

    Great stuff! Exactly what I needed for the quick start with scripting and animation. Cheers!

    • @CGPython
      @CGPython  Před 10 měsíci

      It brings me joy to have been of help! 😊

  • @Gettutorials123
    @Gettutorials123 Před 2 lety

    great work bro!

  • @Neoncrisisevangelion
    @Neoncrisisevangelion Před rokem

    Beautiful!

  • @daniellunazapata4984
    @daniellunazapata4984 Před 3 měsíci

    I enjoyed it a lot! Thanks !

  • @GyuFX
    @GyuFX Před 6 měsíci

    looks good thankyou

  • @AceFilmStudio
    @AceFilmStudio Před 6 měsíci +1

    I just love you way of explaining and everything love from India. Your heartly follower. I just tried this tutorial can I upload it on mine

    • @CGPython
      @CGPython  Před 6 měsíci

      Thank you! 💖
      Cheers

  • @seanwalker4868
    @seanwalker4868 Před 8 měsíci

    I made animated gif loops for a couple years in blender with Python scripting and I never found a good source of material to learn from. Especially for animation. I wanted to be able to use the blur functionality of Blender and other aspects of its animation. But could not find anything. So my code would construct all the objects and output a image each frame. Your videos are wonderful! I have not watched this one yet, but it appears to get into animations in Blender, so I am excited to watch it through.
    BTW, can you suggest a good book or other learning resource on scripting animations for Blender? Are you considering writing one?

    • @CGPython
      @CGPython  Před 8 měsíci

      Thank you for your kind words!
      I have yet to see a lot of material on the animation with Python in Blender. If you find any, please share.
      I will write a book on this someday. The catch is to make it withstand the test of time. The speed of Blender development and the introduction of breaking changes will make this project a challenge.
      Note: I don't think the speed of development/breaking changes is a bad thing.

  • @akuntugasAliyah
    @akuntugasAliyah Před 5 měsíci +1

    mr.teacher, can yau tell me why i cant apply_random_color_material(obj) it didnt work on me.. in the video 11:15 i really wanna try your tutorial because its really fun 🤩🤩

    • @CGPython
      @CGPython  Před 5 měsíci +1

      Yeah, that code was written before Blender 4.0 (if you open it in Blender 3.6 it should work)
      or you can replace
      `mat.node_tree.nodes["Principled BSDF"].inputs["Specular"].default_value = 0`
      with
      `mat.node_tree.nodes["Principled BSDF"].inputs["Specular IOR Level"].default_value = 0`
      I have an updated version here github.com/CGArtPython/blender_plus_python/blob/main/stack_spin/stack_spin_done.py

    • @althaf5846
      @althaf5846 Před 5 dny

      ​@@CGPythonstill not coming 4.2blendee version

  • @marianopietroski722
    @marianopietroski722 Před 6 měsíci

    help the start code does not work in blender 4.0

    • @CGPython
      @CGPython  Před 6 měsíci +1

      I updated the code, please try again

    • @marianopietroski722
      @marianopietroski722 Před 6 měsíci

      @@CGPython thank you very much, now it works

  • @l_sx8722
    @l_sx8722 Před 5 měsíci

    Python: Traceback (most recent call last):
    File "D:\_MY_ART_WORK\Blender\python2.blend\Text", line 353, in
    File "D:\_MY_ART_WORK\Blender\python2.blend\Text", line 348, in main
    File "D:\_MY_ART_WORK\Blender\python2.blend\Text", line 336, in gen_centerpiece
    File "D:\_MY_ART_WORK\Blender\python2.blend\Text", line 270, in apply_random_color_material
    KeyError: 'bpy_prop_collection[key]: key "Specular" not found'
    I only added apply_random_color_material(obj) following the toturial, I don;t know what happened

    • @CGPython
      @CGPython  Před 5 měsíci

      What version of blender are you using?
      The latest code was updated to work in Blender 4.0

  • @qozia1370
    @qozia1370 Před 9 měsíci

    Oh wow! Horrible, he starts with 300 lines of code, we want to see the full process.
    Otherwise don't make a tutorial.

    • @CGPython
      @CGPython  Před 9 měsíci

      Sorry, you feel that way.
      I use some helper code in every tutorial I do. If I explained it each time, my tutorials would be even longer.
      I do explain some of it at the end of the video czcams.com/video/mJU7owctel4/video.html

    • @genevaspring8974
      @genevaspring8974 Před 2 dny

      I understand your frustration but I kindly disagree with you : I find this method very appropriate. the startup code is also self explanatory, commented, reusable for other projects.