Python Scripting in Blender For Humans by Christopher Topalian
Python Scripting in Blender For Humans by Christopher Topalian
Python
Scripting
in
COLLEGEOFSCRIPTING.WEEBLY.COM
Blender
for
Humans
by
Christopher Topalian
Copyright 2021
All Rights Reserved
DEDICATED
TO
GOD THE FATHER
Left
Click
Here Left Click
Scripting
COLLEGEOFSCRIPTING.WEEBLY.COM
College of Scripting Music & Science
Console
Left Click
Window
COLLEGEOFSCRIPTING.WEEBLY.COM
Left Click
Toggle System Console
College of Scripting Music & Science
COLLEGEOFSCRIPTING.WEEBLY.COM
College of Scripting Music & Science
Left Click
New
To Hold
Type Make Ctrl +
COLLEGEOFSCRIPTING.WEEBLY.COM
this code Bigger Mouse
Font Wheel
Forwards
College of Scripting Music & Science
Run Script
Left Click
Run Script
COLLEGEOFSCRIPTING.WEEBLY.COM
Result of our Python Code
SHOWN in the
Blender System CONSOLE
COLLEGEOFSCRIPTING.WEEBLY.COM
Left Click
Text Left Click
Save As
1 Type
ourScript
Info window
College of Scripting Music & Science
COLLEGEOFSCRIPTING.WEEBLY.COM
Put Mouse On Horizontal Line
Hold Left Mouse Button
and Drag Downwards
COLLEGEOFSCRIPTING.WEEBLY.COM
Type this
code
import bpy
ourList = list(bpy.data.objects)
COLLEGEOFSCRIPTING.WEEBLY.COM
print(ourList)
Result
[bpy.data.objects['Camera'],
bpy.data.objects['Cube'],
bpy.data.objects['Lamp']]
We have 3 objects in our Scene
Lamp
Cube
name
Cube
COLLEGEOFSCRIPTING.WEEBLY.COM
Camera
Location Scale
Rotation
COLLEGEOFSCRIPTING.WEEBLY.COM
Returns the TYPE, which is a
bpy_struct, and that it is
an Object named "Cube"
COLLEGEOFSCRIPTING.WEEBLY.COM
Returns the TYPE, which is a
bpy_struct, and that it is
an Object named "Lamp"
COLLEGEOFSCRIPTING.WEEBLY.COM
Returns the TYPE, which is a
bpy_struct, and that it is
an Object named "Camera"
COLLEGEOFSCRIPTING.WEEBLY.COM
College of Scripting Music & Science
COLLEGEOFSCRIPTING.WEEBLY.COM
Returns the Vector Location
of Our Cube, which is located
at <0.0000, 0.0000, 0.0000>
Hover the
Mouse Arrow
COLLEGEOFSCRIPTING.WEEBLY.COM
Here
COLLEGEOFSCRIPTING.WEEBLY.COM
College of Scripting Music & Science
COLLEGEOFSCRIPTING.WEEBLY.COM
Returns the Vector Scale
of Our Cube, which is
<0.0000, 0.0000, 0.0000>
Hover
COLLEGEOFSCRIPTING.WEEBLY.COM
Mouse Arrow
Here
COLLEGEOFSCRIPTING.WEEBLY.COM
College of Scripting Music & Science
COLLEGEOFSCRIPTING.WEEBLY.COM
Returns the Euler Rotation
of Our Cube, which is
<Euler (x=0.0000, y=0.0000,
z=0.0000), order='XYZ'>
Hover
Mouse
COLLEGEOFSCRIPTING.WEEBLY.COM
Arrow
Here
Rotation in Eulers.
Radians: 0.000000
Python: Object.rotation_euler
bpy.data.objects["Cube"].rotation_euler[0]
COLLEGEOFSCRIPTING.WEEBLY.COM
Returns the Scene name
of Our Current Scene,
which is named Scene
COLLEGEOFSCRIPTING.WEEBLY.COM
Returns the Scene name
of Our Current Scene,
which is Scene
COLLEGEOFSCRIPTING.WEEBLY.COM
Hover
Mouse Arrow
Here
ourObject = bpy.data.objects['Cube']
ourObject.location = (5.0, 0.0, 0.0)
COLLEGEOFSCRIPTING.WEEBLY.COM
print(ourObject.location)
DEDICATED
TO
GOD THE FATHER
Presented by the
College of Scripting
Music & Science
We have taught over 2 million people
how to program computers, for free,
since March of 2007!
www.youtube.com/ScriptingCollege
www.github.com/ChristopherTopalian
www.CollegeOfScripting.weebly.com
www.CollegeOfScripting.wordpress.com
Christopher Topalian Copyright 2007-2021
All Rights Reserved. All content here is protected.