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

Styling the operator panel

We know that the operator panel is displayed in these circumstances:

  • When context.window_manager.invoke_props_dialog is called explicitly.
  • When bl_options is set to {'REGISTER', 'UNDO'} and the operator has finished.
  • When Edit | Adjust Last Operation is called. This circumstance too requires the presence of bl_options = {'REGISTER', 'UNDO'}.

By default, all properties are displayed in a column layout. Most property types can be declared with a hidden=True flag, but that’s not the case for BoolProperty, so we cannot do it with set_hours.

As a workaround, we could change set_hours to IntProperty, with a 0 to 1 range and hidden set to True, but by implementing the draw method for our operator, we can just omit the properties that we don’t want to display.

Writing the draw method

We want to change two things in the Create Hour/Minutes Text panel:

  • The hour and minutes...
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