My Account Log in

3 options

Python scripting in Blender : extend the power of Blender using Python to create objects, animations, and effective add-ons / Paolo Acampora.

EBSCOhost Academic eBook Collection (North America) Available online

View online

Ebook Central College Complete Available online

View online

O'Reilly Online Learning: Academic/Public Library Edition Available online

View online
Format:
Book
Author/Creator:
Acampora, Paolo, author.
Language:
English
Subjects (All):
Video games--Development.
Video games.
Python (Computer program language).
Video games--Programming.
Physical Description:
1 online resource (xx, 339 pages) : illustrations (some color)
Edition:
First edition.
Distribution:
London : Bloomsbury Publishing (UK), 2025.
Place of Publication:
Birmingham : Packt Publishing, 2023.
System Details:
text file HTML
Biography/History:
Acampora Paolo: Paolo Acampora is a 3D artist and programmer, with experience in Animation, Visual Effects, and Real Time computer graphics. He provides tools that streamline the production workflow and let artists focus on the creative aspects of their craft. He has worked with several studios for more than a decade. He contributes to the blender development and releases his tools for the community.
Summary:
Learn how to use Python scripts in Blender 3.3 to automate tasks, optimize your workflow, think like a 3D programmer, and start creating your tools quickly Purchase of the print or Kindle book includes a free PDF eBook Key Features Discover ready-to-go scripts that provide a clear solution to your problems Find out how to automate repetitive tasks in an efficient way Extend Blender's actions and user interface with your code Book Description Blender, a powerful open source 3D software, can be extended and powered up using the Python programming language. This book teaches you how to automate laborious operations using scripts, and expand the set of available commands, graphic interfaces, tools, and event responses, which will enable you to add custom features to meet your needs and bring your creative ideas to life. The book begins by covering essential Python concepts and showing you how to create a basic add-on. You'll then gain a solid understanding of the entities that affect the look of Blender's objects such as modifiers, constraints, and materials. As you advance, you'll get to grips with the animation system in Blender and learn how to set up its behavior using Python. The examples, tools, patterns, and best practices present throughout the book will familiarize you with the Python API and build your knowledge base, along with enabling you to produce valuable code that empowers the users and is ready for publishing or production. By the end of this book, you'll be able to successfully design add-ons that integrate seamlessly with the software and its ecosystem. What you will learn Understand the principles of 3D and programming, and learn how they operate in Blender Build engaging and navigation-friendly user interfaces that integrate with the native look and feel Respect coding guidelines and deliver readable and compliant code without the loss of originality Package your extensions into a complete add-on, ready for installation and distribution Create interactive tools with a direct response to the user's action Code comfortably and safely using version control Who this book is for This book is for Blender users who want to expand their skills and learn scripting, technical directors looking to automate laborious tasks, and professionals and hobbyists who want to learn more about the Python architecture underlying the Blender interface. Prior experience with Blender is a prerequisite, along with a basic understanding of the Python syntax--however, the book does provide quick explanations to bridge potential gaps in your background knowledge.
Contents:
Cover
Title Page
Copyright and Credits
Contributors
Table of Contents
Preface
Part 1: Introduction to Python
Chapter 1: Python's Integration with Blender
Technical requirements
Installing Blender
Installing Blender on Windows
Installing multiple versions on macOS
The Scripting workspace - first steps with Python
The Python console
The Info Log
The Text Editor
External editor - Visual Studio Code
Loading our scripts folder
Keeping Blender's text blocks in sync
Version control and backup
Initializing the repository
Making changes
Summary
Questions
Chapter 2: Python Entities and API
Useful features of Python
Options for developers
Python console's utilities
Accessing Blender modules
The bpy module
API documentation
Accessing Blender data
Creating new objects
Removing elements
Understanding the user context
Chapter 3: Creating Your Add-Ons
Installing our add-ons in Blender
Add-on requirements
Installation
Uninstall
The scripts path
Creating our first add-on - object collector
Operators
Writing a basic operator
Loading operators in our add-on
Running our add-on
Refreshing the add-on list
Running from the Search Toolbar
Improving our code
Saving our edits automatically
Ignoring bytecode files (.pyc)
Fixing the operator logic
Reloading scripts
Avoiding re-assignment errors
Our final operator
Extending menus
Chapter 4: Exploring Object Transformations
Moving objects in space
Transforming objects
Transforming objects indirectly
Using Object Constraints
Using object hierarchies
Understanding the transform matrix
Accessing matrices.
Storing object matrices
Copying matrices
Restoring transformations using the world matrix
Creating rest offsets with the parent inverse matrix
Writing the Elevator add-on
Setting the environment
Writing the first draft
Using input properties
Setting the height in the world matrix
Avoiding duplicate transformations
Adding the constraints switch
Avoiding duplicate constraints
Chapter 5: Designing Graphical Interfaces
Areas, regions, and panels
Creating a simple panel
Drafting our panel add-on
Setting display attributes
Adding a panel to the Object Properties area
Using layouts in our panels
Arranging in columns and rows
Adding frames with box layouts
Using composite layouts
Providing color feedback
Checking whether an object has been selected
Checking whether an object is active
Drawing layouts in red or gray
Displaying buttons
Using the operator method
Setting the operator's text and visibility
Overriding an operator's settings
Setting operator properties
Adding buttons for our functions
Displaying the operator properties
Using different regions
Part 2: Interactive Tools and Animation
Chapter 6: Structuring Our Code and Add-Ons
Folders, packages, and add-ons
Creating a package folder and the init file
Writing the init file
Guidelines for separating modules
Writing the structured panel
Packing external images
Writing an icon library
Loading pictures from a folder
Unregistering icons
Getting the collection
Using relative imports
Adding a user interface
Writing the UI module
Importing the UI
Completing the Objects panel
Reloading cached modules
Reloading via importlib.
Implementing a refresh module
Reloading the package modules
Using Developer Extras as a condition
Using add-on preferences
Creating preferences
Populating the preferences
Using add-on preferences in code
Adding operators
Writing the operators module
Registering operator classes
Refreshing operators on reload
Adding operator buttons
Packaging and installing add-ons
Cleaning up bytecode
Creating a .zip file using 7-Zip
Creating a .zip file using Windows File Manager
Creating a .zip file on Mac using Finder
Creating a .zip file using Gnome
Installing .zip add-ons
Chapter 7: The Animation System
Understanding the animation system
Timeline and Current Frame
Duration and Frame Rate
Current frame and preview range
Animation keyframes
Writing the Action to Range add-on
Writing the Action to Range information
Writing the Action to Range operator
Writing the operator methods
Writing the menu function
Finishing the add-on
Enabling and running
Fixing context for other operators
Editing keyframes
Animation curves and the Graph Editor
Accessing animation data in Python
Adding keyframes in Python
Retrieving keyframes in Python
Writing the Vert Runner add-on
Writing the Vert Runner information
Writing the Vert Runner operator
Writing the menu and register functions
Creating cyclic animations
Adding rotations
Using Vert Runner
Chapter 8: Animation Modifiers
Using F-Curve Modifiers
Adding F-Curve Modifiers in the Graph Editor
Adding F-Curve Modifiers in Python
Writing the Shaker add-on
Setting up the environment.
Writing the Shaker add-on info
Writing the Add Object Shake operator class
Adding menu items
Finding the class names of context menus
Registering the Shaker add-on
Using the Shaker add-on
Chapter 9: Animation Drivers
Creating drivers
Creating quick drivers via the right-click menu
Setting up a wheel with the Drivers Editor
Creating driver expressions in properties
Driving a cyclic motion
Changing the rotation pivot via constraints
Controlling the period of the sin function
Implementing the pendulum equation
Controlling the amplitude
Writing the pendulum add-on
Writing the information
Writing the Operator class
Writing the menu and registering the class
Chapter 10: Advanced and Modal Operators
Understanding the operator flow
Steps of execution
Writing the "PunchClock" add-on
Creating the add-on script
Using invoke to initialize properties
Ensuring default invoke in pop-up menus
Adding modal behavior
Adding the operator to the modal handlers
Writing the modal method
Styling the operator panel
Writing the draw method
Part 3: Delivering Output
Chapter 11: Object Modifiers
Understanding object modifiers
Adding modifiers
Subdividing an object
Changing the object's shape using Cast
Adding modifiers in Python
Finding collection-type items
Using modifiers.new
Deformation objects
Using the Lattice modifier
Writing the Latte Express add-on
Writing the Latte Express information
Writing the Latte Express operator
Finding the center of a model
Adding a Create Lattice menu item.
Using the Latte Express add-on
Improving Latte Express options
Adding object subdivisions
Changing lattice resolution
Using armature deformers
Adding armature objects to the scene
Adding armature bones
Binding objects to armatures
Scripting a lattice armature
Adding an armature condition
Adding an armature to the scene
Creating edit bones
Assigning vertices to bones
Creating the armature modifier
Adding custom bone shapes
Creating mesh objects in Python
Finalizing the setup
Chapter 12: Rendering and Shaders
Render and materials
Setting the Render Engine
The Shading workspace
Understanding object materials
Setting Material Properties
The Shader Editor
Understanding the Node Tree
Writing the Textament add-on
Using texture images
Setting up the environment
Writing an import operator
Connecting nodes
Adding a header button
Using Load Textures
Improving Load Textures
Arranging shader nodes
Mixing the Base Color
Appendix
Part 1: An Introduction to Python
Chapter 1, Python's Integration with Blender
Chapter 2, Python Entities and API
Chapter 3, Creating Your Add-Ons
Chapter 4, Exploring Object Transformations
Chapter 5, Designing Graphical Interfaces
Chapter 6, Structuring Our Code and Add-Ons
Chapter 7, The Animation System
Chapter 8, Animation Modifiers
Chapter 9, Animation Drivers
Chapter 10, Advanced and Modal Operators
Chapter 11, Object Modifiers
Chapter 12, Rendering and Shaders
Index
Other Books You May Enjoy.
Notes:
Includes bibliographical references and index.
ISBN:
9781803243276
1803243279
OCLC:
1381093879

The Penn Libraries is committed to describing library materials using current, accurate, and responsible language. If you discover outdated or inaccurate language, please fill out this feedback form to report it and suggest alternative language.

Find

Home Release notes

My Account

Shelf Request an item Bookmarks Fines and fees Settings

Guides

Using the Find catalog Using Articles+ Using your account