Python Tutorial for Beginners - Unlocking the Animation Power of Python in Blender

  Рет қаралды 129,359

CG Cookie

CG Cookie

Күн бұрын

Interested in learning Blender? Grab your free copy of PRESS START - b3d.cgcookie.com/aDBmV5
CG Cookie contributor Chris Bailey @CBaileyFilm takes you step-by-step to unlock the power of Python animation in Blender with this Python beginner tutorial. If you've never touched code before, or even if you have, this is the video for you!
Start from scratch and learn how to make your very own programs and scripts in Blender to create crazy animation effects!
Chapters:
0:00 Intro & CG Cookie
0:40 Accessing the windows to begin working in Python in Blender
1:35 Import BPY
9:25 Arrays in Python
14:20 The for loop
24:44 Getting around the context error
This Blender tutorial covers:
Python Programming
Animating with Python
Beginner python tutorial
Python in Blender
Using Python to Animate in Blender, 2.81, 2.82, 2.83, 2.9, 2.91, 2.92
"WHERE SHOULD I START LEARNING BLENDER?"
For Blender beginners, we have a free tutorial series, "Getting Started with Blender" - b3d.cgcookie.com/GNu1Ja
"I WANT MORE CG COOKIE IN MY LIFE!"
Got it. Here's where you can reach us!
/ cgcookie
/ cgcookie
/ cgcookieinc
Want Blender news in your mailbox?
Sign up here for spam-free newsletter b3d.cgcookie.com/X2qr9a
#CGCookie #blendertutorial #b3d

Пікірлер: 210
@Plaagfluit
@Plaagfluit 3 жыл бұрын
Thanks a lot for this, I'll finally come to a point of combining my bad coding with my bad blender skills to create awesome new things
@racket136
@racket136 2 жыл бұрын
Bruh I relate to this so hard I was just thinking about this today ahhahahaa
@shssndndndn6638
@shssndndndn6638 2 жыл бұрын
combined enough bad skills you might make somthing good eventually right?
@pratiushpant2951
@pratiushpant2951 Жыл бұрын
Us moment🤣
@toonzdanceparty
@toonzdanceparty Жыл бұрын
I love u
@lornemalvoo
@lornemalvoo 3 жыл бұрын
PLEASSEEE, MAKE A TUTORIAL SERIES MAN, PLEASEEEE
@Etalon-JBI
@Etalon-JBI 3 жыл бұрын
Please
@janklingner2694
@janklingner2694 3 жыл бұрын
please
@BboyRitzy
@BboyRitzy 3 жыл бұрын
pretty please 😁
@alenaltai96
@alenaltai96 3 жыл бұрын
PLEAAAAAAAAAAAAASE
@ahmed3d73
@ahmed3d73 3 жыл бұрын
Please
@GeoffCoope
@GeoffCoope 3 жыл бұрын
Loved it, thanks for making this video. Reminds me of my Max script days when technical animators were called in for the strange effects that would take days if not weeks manually.
@gravnine
@gravnine 2 жыл бұрын
I've been trying to learn programming for a while. But this was the best tutorial I've seen for python, and its in a video about blender...
@mamadshonazaramonov3010
@mamadshonazaramonov3010 3 жыл бұрын
Feeling blessed! This is liberating! Thank You so much!
@MariaAltmann
@MariaAltmann 3 жыл бұрын
Yep... the "context" issue had me baffled for hours. So brave... but rewarded to finally have someone explain. Thanks a million. Hope to connect through your course soon. Awesome CG Cookie.
@XiagraBalls
@XiagraBalls 3 жыл бұрын
This is quite brilliantly explained. I was putting off looking at Python scripting, but it looks like it's much simpler than I thought. 👍🏻
@weeliano
@weeliano 3 жыл бұрын
Excellent Python demonstration! Straight to the point and using actual examples.
@JakeDownsWuzHere
@JakeDownsWuzHere 2 жыл бұрын
i was looking for a quick primer and this was the perfect amount of info. thanks for putting this video together
@bluephoenix624
@bluephoenix624 2 жыл бұрын
chris this is amazing ...thank you for this step-by-step instruction on how to use python in blender
@LuminousWatcher
@LuminousWatcher Жыл бұрын
Thank you for an excellent tutorial. I love that you used the animations for the section titles and thumbnail
@christophepelletier2901
@christophepelletier2901 2 жыл бұрын
Un très grand merci ! This course is really great. Your explanations are crystal clear.
@konradswart4069
@konradswart4069 3 жыл бұрын
This is GREAT! Thank you very much for putting in the effort to make this video.
@worldother2080
@worldother2080 2 жыл бұрын
Muchas gracias hace 3 meses empecé a estudiar python y hace 2 meses empecé con blender esto es perfecto, muchas gracias por compartir su conocimiento
@sennabullet
@sennabullet 2 жыл бұрын
Amazing tutorial! Really well presented. Thank you for sharing your knowledge.
@dpm2213
@dpm2213 3 жыл бұрын
The way that you teach this topic is excellent. Keep it up!
@TedBarnett197
@TedBarnett197 2 жыл бұрын
Excellent tutorial, with clear explanations for each step. A good way to learn Python at the same time!
@maggallery6124
@maggallery6124 2 жыл бұрын
Love this Tutorial great work just what I needed
@user-ll9ln1uu4b
@user-ll9ln1uu4b 2 жыл бұрын
This is absolutely fantastic simple explanation. I think i'll finally get to python scripting today:) Thank you!
@wagwagdude
@wagwagdude 3 жыл бұрын
This is the first video I've seen showing introduction to Python in Blender. Very educational!
@TT-yz7pz
@TT-yz7pz 2 жыл бұрын
there are actually quite a few out there now
@takuyasato3717
@takuyasato3717 Жыл бұрын
Thank you very much for the inspiration video for me. This is all enough blender python tutorial.
@silverman1438
@silverman1438 3 жыл бұрын
thank you for great tutorials 🙏🏻
@andresleguizamon5300
@andresleguizamon5300 Жыл бұрын
Thank you so much! I had a lot of fun doing this
@MrPimonani
@MrPimonani 2 жыл бұрын
Inspiring tutorial! Thanks!
@zephaniahdejene1746
@zephaniahdejene1746 3 жыл бұрын
Finally I understand python praize the lord its a miracle XD
@waylenamccully8863
@waylenamccully8863 3 жыл бұрын
Thanks for this, it was fun!
@SheepYT
@SheepYT 3 жыл бұрын
You are killing it man. Great videos!
@TimothyTocci
@TimothyTocci 2 жыл бұрын
Really liked this - Thank you!
@adoniswalmsley-mccarthy6571
@adoniswalmsley-mccarthy6571 2 жыл бұрын
Amazing! Very well done!
@stephen285
@stephen285 Жыл бұрын
thanks for your vid - huge help!!!
@rlcmark
@rlcmark 2 жыл бұрын
Absolutely great stuff !!
@binyaminbass
@binyaminbass Жыл бұрын
It's really cool to understand python. I am living in 2022 with Blender 3.2 so this particular function is better suited for geometry nodes. But as an intro to python, this was nice.
@alwaysCuriousOne
@alwaysCuriousOne Жыл бұрын
Clearly explained! Thanks!
@indiecorner246
@indiecorner246 Жыл бұрын
This was a great help. Thanks a million.
@thoughtFormMax
@thoughtFormMax 2 жыл бұрын
Awesome tutorial. Thank you.
@__leoayres__
@__leoayres__ 3 жыл бұрын
Thank you very much! This was very useful.
@femiadeniran8910
@femiadeniran8910 3 жыл бұрын
this is gorgeous
@m00nshi
@m00nshi 3 жыл бұрын
very helpful, thank you you're great
@billsequins1490
@billsequins1490 2 жыл бұрын
Loved the soundtrack!
@BOSSdesigns
@BOSSdesigns 2 жыл бұрын
we need more of this python tuts .. AWESOME
@nimnim5149
@nimnim5149 2 жыл бұрын
loved the way you explained this ... :)
@LoporianIndustries
@LoporianIndustries 2 жыл бұрын
Very enlightening.
@Tom-ef1mz
@Tom-ef1mz 3 жыл бұрын
awesome video, thanks!
@swig_gigolo
@swig_gigolo 3 жыл бұрын
Ever since school I’ve wanted to do GUIs in python but the packets and libraries never worked in pycharm if blender has stuff like this baked in I can’t wait to try this more just got into doing 2d animation with blender this looks a lot more welcoming to me as a coder first now days
@Technofier
@Technofier 2 жыл бұрын
Very nice, wonderful introduction!
@szczesny1229
@szczesny1229 2 жыл бұрын
Thanks Bro... you help me
@savergenio
@savergenio Жыл бұрын
Excellent
@HarimaKentaro
@HarimaKentaro 2 жыл бұрын
finally i can use my meagre coding skills somewhere and a good refresher for the syntax while actually using it somewhere practical :P
@riccardomotter5706
@riccardomotter5706 Жыл бұрын
awesome!
@tonybamm
@tonybamm 2 жыл бұрын
@26:00 This is exactly what I was trying to do and was running into same error. THANK YOU a lot..!!
@sinankuniyilathoot5188
@sinankuniyilathoot5188 3 жыл бұрын
super awsome
@timomuller4400
@timomuller4400 3 жыл бұрын
Great colors, by the way...
@amateurbeatsofficial7702
@amateurbeatsofficial7702 Жыл бұрын
Background music is good. Makes video entertaining
@zhongs.l.3932
@zhongs.l.3932 2 жыл бұрын
Thanks
@Balbeees
@Balbeees 3 жыл бұрын
The best!!!👍👍👍
@qarwill
@qarwill 3 жыл бұрын
Sweet!! More stuff on scripting plzzz!!!
@hilkokriel5659
@hilkokriel5659 2 жыл бұрын
What a Legend!!
@nyilonelycompany
@nyilonelycompany 3 жыл бұрын
thank you
@darshan_dodia
@darshan_dodia 2 жыл бұрын
Very Interesting.
@mostafaghobashy2724
@mostafaghobashy2724 9 ай бұрын
Its good and I love it.... BECAUSE I AM A PY DEV a guy who never touched code in his life will not understand python YOU ARE SCARING PEOPLE FROM PYTHON
@mcmv3040
@mcmv3040 Жыл бұрын
That's so so good you're a great artist,but to be honnest,(about the project) I made the whole animation without any scripting just some dope sheet,and with my weak computer I still working with blender 2.79,but that's a perfect course about python,I didn't use it ever.
@deadlymax887
@deadlymax887 3 жыл бұрын
You are awesome.🤍🔥
@MM-24
@MM-24 2 жыл бұрын
This is an awesome tutorial, thank you for this One question: alot of this is now possible with nodes right? Where does python scripting still become more or less helpful with the "everything nodes"?
@RaveYoda
@RaveYoda 3 жыл бұрын
YAAAAAAAAASSSSSSSSS QUEEN!!!!!
@Levendo
@Levendo 2 жыл бұрын
Holy shit thanks this was really informative!
@JorgeGonzalez-cs2io
@JorgeGonzalez-cs2io 2 жыл бұрын
damn!!! power unlocked!!!!!!
@heshjohans5331
@heshjohans5331 Жыл бұрын
Nice Stuff ..!
@alejo_3d_art
@alejo_3d_art 3 жыл бұрын
Holy!
@USAIsrUKEUVngrdBLRckOccupiedUA
@USAIsrUKEUVngrdBLRckOccupiedUA 3 жыл бұрын
Also someone can use dir() Example 1, dir(bpy) Example 2, dir(bpy.context) and so on.
@jsogman
@jsogman 2 жыл бұрын
this is so goddamn great
@moyeramoyer8478
@moyeramoyer8478 3 жыл бұрын
Can you make follow along tutorials? To learn the tools of blender and the scripting? How to draw and color in blender also using scripts?
@blenderzone5446
@blenderzone5446 3 жыл бұрын
like it!
@illmarten1073
@illmarten1073 3 жыл бұрын
Great tutorial, What it helped me most was the last tip, on how to toggle to the correct context view !!! Thank you... A full tutorial on the other usual error situations is greatly needed, so this way the full path on how to script 3d blender will be open and an explosion of new, complete and supper powerful scripts can be achieved. The problem right now is that even that anyone wants to READ and look up the documentation, BECAUSE we don't have the full understanding of python we JUST cannot understand the documentation or the instructions given, In addition the documentation for python and 3d blender lacks SIMPLICITY and CLARITY, The current short and technical error reports JUST INCREASE the frustration when something is not working, These lack of ease in troubleshooting is STOPPING and KILLING experimentation and development for python and 3d blender. STRESS BOMBS: Right now in 3d blender when an error occurs it tells you "look in to the console for now" ... First problem "Where is the console" Then, the console gives you a short and technical report and on the last line it says " Look in the console for now" ... BUT we are in the console !!! For example: Yesterday I was trying to add a material color to the cube and I typed this line of code: ....code ...code mat_red.diffuse_color = (0.0, 0.8, 0.0) this code gives the cube a red color. When I run this code the ERROR said .... bs..bs four parameters are needed and only three are given !!! GTF!!! A better and helpful error report could be: To defuse material color needs the rgb parameters PLUS the Alpha parameter ... your code should look like this mat_red.diffuse_color = (0.0, 0.8, 0.0, 1.0 ) the last parameter of 1.0 sets the alpha to full opacity and these four parameters are needed to set a new diffuse color for you object, in addition if you set the alpha to less than one (0.6) the color will look semi transparent. For your convenience here are some links to other color related code, ... DON'T worry 3d blender got your ass cover! www.some cool and helpful 3d blender documentation.com Something like this will open up python and 3d blender to the masses and the development and the benefits will be infinite,.... and best of all, YOU Chris Bailey right now have the OPPORTUNITY to be the GREAT CREATOR of the path to full 3d blender scripting !!!! PLEASE MAKE this tuts!!! Thank You again. Marten.
@gower1973
@gower1973 3 жыл бұрын
You know Blender is open source right? You can just rewrite the documentation and submit it to be evaluated by the devs and if yours is a better job of it it will get added into the master branch. Having a rant about it in a company not related to Blender isn’t going to change anything
@illmarten1073
@illmarten1073 3 жыл бұрын
@@gower1973 I made it clear that I do not know how to code, so According to you how can I rewrite the full documentation?
@MarcoFadini
@MarcoFadini 3 жыл бұрын
@@illmarten1073 Documentation is not code. Also, as a coder, I can assure you that the template "N parameters expected, N given" is used for all languages I know. It's a pretty common convention for that kind of messages. On top of that, python has one of the best documentation in the entire industry. Calling what error messages say "bs" says more about you and your willingness to learn and adapt, honestly
@AnkitChoudhary-st2is
@AnkitChoudhary-st2is 2 жыл бұрын
This is superpower.
@NggFinn
@NggFinn 3 жыл бұрын
Can I do the "arrays" collection on 2.68 v. as a group or I have other option to do it on this Blender version ? I've serach and can't find any solutions. Thanks for the tutorial, its so cool to learn a thing that is new for me !
@grodarh
@grodarh 2 жыл бұрын
How to create 10x10 blocks area: import bpy div = 2 for i in range(10): for j in range(10): bpy.ops.mesh.primitive_cube_add(size=2, enter_editmode=False, align='WORLD', location=(i * div, j * div, 0), scale=(1, 1, 1))
@ratus69
@ratus69 3 жыл бұрын
ahahah, the context is incorrect ! I've seen this error so often that I finally found out what it was about...but it's nicely explained, congrats ;)
@stephen285
@stephen285 Жыл бұрын
Thanks for your video ! Can you answer a simple question? what about interactive scripts? ones that prompt the user for input? or say I have a dog character and I want to be able to control which direction it goes interactively by moving a switch? how do I have a script process running waiting for something to happen so that it can react without freezing the blender UI??
@USAIsrUKEUVngrdBLRckOccupiedUA
@USAIsrUKEUVngrdBLRckOccupiedUA 3 жыл бұрын
17:19 it could be confused with X axis. Maybe better to use "for cube in cubes: cube.scale(x,y,z)"? ;)
@MrFeli100
@MrFeli100 2 жыл бұрын
thank you for this tutorial, if you dont mind some constructive criticism: for me with headphones the background music was a tad to loud
@xaviervicens5217
@xaviervicens5217 3 жыл бұрын
Nice but i had to use a lot my brain to flow it due to the lack of steps. Please do more
@abhishekmanhotra7177
@abhishekmanhotra7177 Жыл бұрын
Thanks for this much much helpful, how we can control timeline using python commands ? I need a character doing live lipsync by reading the str from file or a variable, pls help.
@mastart4971
@mastart4971 8 ай бұрын
Hallo, at 22.02 you copy paste "+ offset" to the next lines.... how did you do that.... ? that is amazing.... and a question on the side... are you coming back to the bcon this year....? hope to see you again...
@akarabdallatyf8422
@akarabdallatyf8422 2 жыл бұрын
wizards of blender indeed
@balajisofficialutube
@balajisofficialutube 2 жыл бұрын
Hi Chris, I am python-dev and just started to learn blender last week, I am interested to learn animation could you please recommend any best tutorial for me. It would be great if you guide me on this, And one small doubt is that Cubes isn't part of the Collections, based on UI it should be like Collections[Cubes[Cube, cube 001, cube 002....]]. Thanks
@sameralhanbaly6877
@sameralhanbaly6877 2 жыл бұрын
Thank you for your informative videos. How can I make python script runs automatically when I export Blender file by using game engine add on?
@jimmytheskateboarder
@jimmytheskateboarder 2 жыл бұрын
Great tutorial and thank you! I'm stuck on the texture coordinate part at 23:43. The texture coordinate isn't changing the cubes as it does on your screen.
@sjduranh
@sjduranh 2 жыл бұрын
Did you solved it?, I'm stuck at same point, I do the link but when all cubes are selected and i try to do a modification just one cube change
@kylejennings819
@kylejennings819 Жыл бұрын
he switches over to render view (whereas the previous portions of the tutorial are using solid viewport shading).
@cosmosraven
@cosmosraven 3 жыл бұрын
Thank you ever so much. The first time this has made sense to me. I'm totally hooked. Was subbed long time back though.
@hunter8980
@hunter8980 2 жыл бұрын
Wow! Very impressive!!!! I One question. I am a beginner, and this is my first lesson in Python. All commands under bpy.context. etc. - Are they same commands in Maya, Unity, Unreal Engine, Houdini and Cinema 4D OR these are exclusive python commands for Blender?
@scritorr
@scritorr 3 жыл бұрын
Can we add two variables based on odd and even directory of the objects in the collection?? Like for eg. Cube cube1 Cube2 cube3 Cube4 cube5 . . . . . . Any advice ??
@minthu6955
@minthu6955 Жыл бұрын
I strongly suggest ,top view is very useful and many ...( i mean , made a lot different game on a story sences)..
@YeTianlinguist
@YeTianlinguist 2 жыл бұрын
Thanks for the great tutorial! When I did the "for x in Cubes: x.scale = [0.5, 0.5, 0.5]" bit, if the original 100 cubes were created using duplicating objects, after running that line the cubes look exactly like the video (all resized smaller, but separated). However if the original 100 cubes were created using an array modifier and then separated by loose parts, after running that line the cubes all got smaller but were still stuck together. Why is that?
@ingvargrans2484
@ingvargrans2484 2 жыл бұрын
My guess. Different origin point. When sticking together origin is at 0 0 0 for all.
@A_Train
@A_Train 3 жыл бұрын
Awesome tutorial! My only critique would be to turn down or completely remove that music in the background.
@AmitKumar-xw5gp
@AmitKumar-xw5gp 3 жыл бұрын
Can Manim (developed by Grant Sanderson) be used in Blender.?
@jasmeetsingh2666
@jasmeetsingh2666 2 жыл бұрын
can you tell me how to get vertices into camera view as pixel coordinates.
@CraigHollabaugh
@CraigHollabaugh 2 жыл бұрын
Hey, I learned a lot from this video but I have a question. You accomplished animation using with a py script that adds keyframes to the timeline. This is a fine. I want to perform an operation that calculates and sets force field values on every frame. Is there a blender pre-frame render callback that I can utilize to perform calculations on every frame? Thanks.
@stephenhumble7627
@stephenhumble7627 2 жыл бұрын
Yes there is you can add a frame callback to a function that run every frame like this bpy.app.handlers.frame_change_pre.append( myframefunction ) But i found that I cant get write access to global variables
@CraigHollabaugh
@CraigHollabaugh 2 жыл бұрын
@@stephenhumble7627 hey thanks for the pointer.
@guy_roh
@guy_roh Жыл бұрын
Thanks for the video. I would lower the music next time though, it can be distracting at times.
@melbendigo
@melbendigo 3 жыл бұрын
I selected all the cubes and linked the modifiers, then with all selected, I change the wireframe thickness, but it still only effects the brightest one in the selection. It seems I can't select them all equally, one is always brighter. Does anyone have any suggestions? Thank you!
@ProjectDataHub
@ProjectDataHub Ай бұрын
Can you run the code in an non blender external ide and have a render as the output?
@rishabhanand5563
@rishabhanand5563 3 жыл бұрын
When the part 2 will come?
白天使和小丑帮助黑天使。#天使 #超人不会飞 #超人夫妇
00:42
Monster dropped gummy bear 👻🤣 #shorts
00:45
Yoeslan
Рет қаралды 9 МЛН
All 54 Modifiers in Blender Explained in 10 Minutes
11:31
Blender Bash
Рет қаралды 1,7 МЛН
5 Steps to setup VSCode for Blender Python (on macOS)
13:04
CG Python
Рет қаралды 2,1 М.
How to Create 3D Terrain with Google Maps and Blender!
12:17
CG Geek
Рет қаралды 1,9 МЛН
Change Your Understanding of Topology In Six Minutes
6:58
DECODED
Рет қаралды 898 М.
Tutorial: My New Rigging Workflow in Blender
12:39
Polyfjord
Рет қаралды 635 М.
The Power of CONSTRAINTS in Blender!
12:43
Kaizen
Рет қаралды 280 М.
How to Make Meshes with Python in Blender!
16:26
Curtis Holt
Рет қаралды 44 М.
白天使和小丑帮助黑天使。#天使 #超人不会飞 #超人夫妇
00:42