Reader small image

You're reading from  Python Scripting in Blender

Product typeBook
Published inJun 2023
PublisherPackt
ISBN-139781803234229
Edition1st Edition
Right arrow
Author (1)
Paolo Acampora
Paolo Acampora
author image
Paolo Acampora

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.
Read more about Paolo Acampora

Right arrow

Scripting a lattice armature

Armatures are the recommended way for animating in Blender as they support linking across different .blend files and other advanced animation features.

Binding a lattice to an armature allows you to animate deformations without switching to Edit Mode to edit grid vertices.

Adding an armature condition

We want armatures to be an optional feature, so we can add another property for that. We set its default value to True, so an armature is created unless it’s set otherwise:

    add_armature: bpy.props.BoolProperty(default=True)

Inside the execute method, we check for this value and proceed accordingly.

Adding an armature to the scene

Armatures are created in the same way as lattices and other objects:

  1. Create new data.
  2. Create a new object using the data created.

Even if it is not strictly required, we set the new armature as the parent of the lattice to ensure consistency between their transforms...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Python Scripting in Blender
Published in: Jun 2023Publisher: PacktISBN-13: 9781803234229

Author (1)

author image
Paolo Acampora

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.
Read more about Paolo Acampora