robot_designer_plugin.core.gui module

This submodule provides helper classes for creating blender guis.

class robot_designer_plugin.core.gui.CollapsibleBase[source]

Bases: object

By default, Blender does not offer collapsible boxes. For this, this create subclasses and use the pluginmanager.PluginManager.register() decorator. This decorator creates a boolean property that is stored with the scene object (and is therefore persistent with your current file) that is used for remembering the state of the box. The subclass needs to specify a unique identifier for a bpy.types.BoolProperty in the attribute property_name attribute, for instance:

@PluginManager.register_class
class ControllerBox(CollapsibleBase):
    property_name="controller_box"

This parameter is used in the pluginmanager.PluginManager.register() method which calls pluginmanager.PluginManager.register_collapsible()

classmethod get(layout, context, label, icon='NONE')[source]

Create a collapsible box element and adds it to the gui element

Parameters
  • layout – Blender gui element as passed to the robot_designer_plugin.interface.main.UserInterface.draw() method.

  • context – Blender context object (see above)

  • label – Label label of the box

  • icon – optionally place a label (must be a name known to Blender)

class robot_designer_plugin.core.gui.InfoBox(layout)[source]

Bases: object

This class collects messages (e.g., from operators.operators.RDOperator.poll()) and displays them with an info, either in a separated box or the current layout.

See gui_development for an example.

add_message(message)[source]

Adds a string message to the info box.

Parameters

message (str) – message

classmethod draw_global_info(layout)[source]
draw_info(additional_messages=[], icon='INFO')[source]

Draws the info box onto the layout.

Parameters

additional_messages – Additional messages can be appended.

global_messages = []