Beginner Blender Python Exercise: Easy cube rotation animation

preview_player
Показать описание

This is a video exercise for Blender Python beginners.
We will write a Python script that animates a Cube's rotation.

Final Code:

Beginner Python Exercise in Blender: Simple cube location animation

00:00 - Intro
00:14 - Setup Workspace
01:20 - Think through the steps
02:10 - Write down the steps
04:00 - Import bpy
04:26 - Add a cube
05:00 - Get reference to cube
06:20 - Insert first keyframe
10:45 - Set the rotation of the cube
15:45 - Insert last keyframe
16:56 - Summary
17:20 - Exercise #1
19:05 - Exercise #2
20:54 - Outro

Intro Music
Fiery Trails - Silent Partner

Background Music
Where To - Birocratic

Outro Music
Geographer - Easy Shake

#blender #python #scripting
Рекомендации по теме
Комментарии
Автор

I'm noticing from looking at other channels such as this that aim to teach python and blender that this one is the most beginner friendly, the pacing and the material and the steps are best for the new experience and learning, others are too fast or too eager to jump into too advanced ideas. I am very satisfied with this channel ♥

ArisTheInquring
Автор

Thank you so much for posting this. Direct feedback is great for understanding what the code is doing.

digitaldragondamnati
Автор

This is gem for learners of Blender python scripting possibilities. Thank you very much Victor. Good pace, clear explanations and clear language!!

nijataliyev
Автор

Fantastic video! You wouldnt happen to have a tutorial on how to generate say a line of cubes and then move the camera so it pans over the first one to the last one?
After watching this video I think I understand how to generate cubes in blender, but I'm not so sure how I would be able to move the camera through the scene

So glad I found your channel, I'm definitely subscribing!

CrazyFanaticMan
Автор

You are a legend, Victor! Thank you so much for doing this.

ClassicalContrarian
Автор

Thanks again for Lesson 2, CG! I didn't expect my mid_frame axis change would work they way I entered it, but I was pleased it was functional before seeing the solution. I had two entries for mid_frame one 0-90 frames and one 90-180 frames. I will have to go back and simplify it and understand why they both function.

jmfs
Автор

thank you, it is the best channel about python-blender.

federicoramirez
Автор

Hi Victor, I just found your channel and I wanted to thank you for your work in advance. I studied Python in university and I enjoied coding, now I can use that to understand Blender and the code behind 3D visualization. I will start following all your tutorial videos so i can brush off the dust from my coding skill!!

radar
Автор

Continue working with them! Pretty cool

daniellunazapata
Автор

fantastic video, I added new basic skills in blender python. and many to go 😀
Thanks again Victor.

jessiecampanero
Автор

Could you create video for Blender Python script Rubik's cube (creation and rotation of faces ..)

WahranRai
Автор

Thank you for making these tutorials, you do a great job explaining what certain things do, however some of things get overlooked...for example (bpy.context.active_object) bpy makes sense, active object makes sense, by why "context", why did you choose that? what is it referring to? and how and when to choose these (modules...I think they're called that)? It would be great to understand when to use certain (modules) and why.

ivanb
Автор

Absolutely wonderful for beginners, so thank you!! I do have a question though; is line spacing (i.e. 1 is code, 2 is blank, 3 is code) especially important? I understand having everything in order, but does having blank lines affect anthing?

Nuberax
Автор

Thanks for your video ! - can you please explain how to determine the channel index number for the corresponding object in the NLA editor? I can code animations fine, I can push animations down with but I don't always have the index number? I can't figure out how, using code, you get the channel index #? Thanks

stephen
Автор

hey fan from egypt good tutorial .. thanks

sasastudio
Автор

Hi, I’m just starting using script editor in blender. I’d like to make a data based 3d animation. I spend some time finding what kind of tool would work. Finally, I’ve arrived here. Your video is amazing. It’s gonna be a huge help for my project. I’m planning to follow your video and figure out how to get my project work. May I ask a question. In your console, I can see suggestions in green letter but I can’t see it in mine. How could I get it?

hyekyungchoi
Автор

Hi Victor!
I'm watching this part 4th or 5th time to "solidify my knowledge" 😅 and this time I saw something weird (at least to me).
When you showing radians and rotate manualy around Y axis (green line) this looks correct but I've noticed something at the second exercise.
In this exercise after rotate around Z axis your code is saying that next rotation will be around X axis but I clearly see (or I'm blind 😅) is again rotating around Y.
Only explornation which I got is that all this code is about local axis of cube. Thats why first Z rotation is changing X and Y axis positions and another rotation around X axtually looks like Y on global.
Tell me if Im right or wrong.
Maybe it should be like this but I was looking at global axis and got confused 🙂
EDIT I've just checked this animation with using Transform tool. Clearly see this is local axis.
Im gonna try to set this in global axis. Thanks for your videos :)

Idler
Автор

this is a great vid!! I am using 4.2 now and I did have some crashes with using the bpy.context.active_object.. I did notice in the python console that it seams that active_object was not there. However, the script works with bpy.context.object to get active object. Is this a bad idea - am i using this incorrectly?

gordonmccrary
Автор

How Do I make console, text editor in a single screen, generally I tried but I couldn't open side by side?

sudhanrimal
Автор

why i cant get the autofill or siggestions am usin blender 2.93

cvrvcvs_beats