Stack and Spin animation loop created with Python in Blender
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
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).
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!
Great to hear!
I hope you will find what you are looking for in my tutorials! 😊
Now i can freely express my thoughts with programming in another app. thanks
That's so cool! 🎉💖
This whole setup is extremely useful. There are so many potential parameters to play with. Nice.
Your way of presenting the full coding step by step from the beginning is really great. I've learned a lot, Thx
You are welcome! 🙂
Always look forward to new CGPython tutorials. Will get on to this when I get home later this evening 🤓
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!
I'm excited to hear that!
Welcome!
That looks great!
Great stuff! Exactly what I needed for the quick start with scripting and animation. Cheers!
It brings me joy to have been of help! 😊
great work bro!
Beautiful!
Thank you! Cheers!
I enjoyed it a lot! Thanks !
Glad you enjoyed it!
looks good thankyou
No problem 👍
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
Thank you! 💖
Cheers
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?
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.
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 🤩🤩
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
@@CGPythonstill not coming 4.2blendee version
help the start code does not work in blender 4.0
I updated the code, please try again
@@CGPython thank you very much, now it works
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
What version of blender are you using?
The latest code was updated to work in Blender 4.0
Oh wow! Horrible, he starts with 300 lines of code, we want to see the full process.
Otherwise don't make a tutorial.
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
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.