Script: Blender Data Structure (Session 7)
Hello and welcome to our 7th session!
In this session, we’re going to explore the data structure in Blender.
Downloading the Resource File
For this session, I’ve provided you with a resource file.
To download it, go to the YouTube video or the LMS, scroll down
to the description, and click on the Patreon page link.
Once you’re on the Blender5 training Patreon page, scroll
down to the attachments section, and you’ll find a file named human_skeleton.blend.
Click on it, wait for it to download, then click the folder icon in your
browser to open the Downloads folder.
Right-click the file → Cut → go to the folder where
you’ve been organizing your Blender learning files (for example,
YourName_Blender_Learning > Chapter 1 Basics).
Paste the file there.
Now, copy the folder path from the top path field (Ctrl +
C).
Opening the File in Blender
Launch Blender 4.5 (either from your desktop icon or
by searching in the start menu).
Click on Open, paste the path into the address bar (Ctrl + V),
press Enter, and select the file human_skeleton.blend.
This will open the skeleton model.
Revisiting Collections
In our last session, we discussed collections.
Inside the Scene Collection, you’ll see one scene. Within it, there’s a Human
Skeleton Collection.
If you expand it, you’ll notice that all body parts are neatly grouped: head
section, spinal column, etc.
For this session, let’s focus on the head section.
Expand it, select the skull, and press Numpad Period to zoom in.
Objects as Containers
Every object you create in Blender acts like a container.
Inside this container, the very first thing you’ll find is the mesh data.
For example, this skull object has a mesh named skull_mesh.
Currently, this container only holds the mesh.
You can rotate around it with the middle mouse button to see
the structure.
Adding a Modifier
Now, let’s add a modifier to this mesh.
Go to the Properties panel → Modifier tab (spanner icon) → Add Modifier →
Generate → Decimate.
Before applying changes, let’s check the mesh statistics:
Go to Viewport Overlays → enable Statistics.
You’ll see this skull mesh has 32,315 vertices.
If you’re using this mesh in a game and want to reduce
complexity, change the Decimate ratio from 1 to 0.1.
Now you’ll notice the resolution reduces and the mesh triangulates. The
vertices count drops to 3,229.
This modifier is now part of the container, along with the
mesh.
Adding a Material
Next, let’s add a material.
Go to the Material tab, click New, and rename it Bones.
Set the Base Color to a slightly yellow tint.
Switch viewport shading from Solid View to Material
Preview to see the effect.
You’ll also notice in the Outliner, this material is attached to the
skull mesh.
Adding an Animation
Now, let’s animate the skull.
Switch to Numpad 3 (side view).
We want the skull to rotate. Currently, it rotates around
the wrong axis.
So, with the object selected: Object → Set Origin → Origin to Geometry.
- Go
to Frame 1. In the Transform panel → Rotation, insert a
keyframe (I).
A yellow diamond appears. - Go
to Frame 30, rotate the skull about 40° along the X-axis, and
insert another keyframe.
Now, when you scrub the timeline between frames 1 and 30,
the skull rotates.
In the Outliner, under the skull container, you’ll
now see Animation → Skull_Cranium_Action.
Open the Dope Sheet → Action Editor, and rename this to skull_rotate.
The Outliner updates automatically.
Understanding Blender’s Data Structure
So, the structure is like this:
- Every
object = container.
- Inside
it:
- Mesh
data
- Modifiers
- Materials
- Animations
Sharing Data Between Objects
Let’s try this:
Go to Add → Mesh → Cube. Zoom in (Numpad Period), move it, and
position it above the skeleton.
Now, in the Properties → Mesh Data tab, there’s a
dropdown.
Select skull_mesh for the cube.
Immediately, the cube takes the skull’s geometry, even
though its name is still “Cube.”
To share animation, open the Action Editor, select skull_rotate,
and apply it to the cube.
Now, the cube also rotates with the same animation.
This shows that data can be shared between objects,
either directly or by duplicating it (something we’ll dive into next session).
Delete the cube afterward to keep things clean.
Go to File → Save.
Wrap-Up
In this session, we learned:
- How Blender
structures objects as containers.
- How
mesh, modifiers, materials, and animations fit inside these containers.
- How
data can be shared between different objects.
In the next session, we’ll explore the various
display modes in the Outliner window.
No comments:
Post a Comment