Blender V5.0
interface_template_constraint.cc File Reference
#include "BKE_constraint.h"
#include "BKE_context.hh"
#include "BKE_library.hh"
#include "BKE_screen.hh"
#include "BLI_listbase.h"
#include "BLI_string_utils.hh"
#include "BLT_translation.hh"
#include "DNA_constraint_types.h"
#include "ED_object.hh"
#include "RNA_access.hh"
#include "RNA_prototypes.hh"
#include "WM_api.hh"
#include "UI_interface_layout.hh"
#include "interface_intern.hh"
#include "interface_templates_intern.hh"

Go to the source code of this file.

Functions

static void constraint_active_func (bContext *, void *ob_v, void *con_v)
static void constraint_ops_extra_draw (bContext *C, uiLayout *layout, void *con_v)
Constraint Header Template
static void draw_constraint_header (uiLayout *layout, Object *ob, bConstraint *con)
void uiTemplateConstraintHeader (uiLayout *layout, PointerRNA *ptr)

Constraints Template

Template for building the panel layout for the active object or bone's constraints.

#define CONSTRAINT_TYPE_PANEL_PREFIX   "OBJECT_PT_"
#define CONSTRAINT_BONE_TYPE_PANEL_PREFIX   "BONE_PT_"
static bool constraint_panel_is_bone (Panel *panel)
static void constraint_reorder (bContext *C, Panel *panel, int new_index)
static short get_constraint_expand_flag (const bContext *, Panel *panel)
static void set_constraint_expand_flag (const bContext *, Panel *panel, short expand_flag)
static void object_constraint_panel_id (void *md_link, char *r_idname)
static void bone_constraint_panel_id (void *md_link, char *r_idname)
void uiTemplateConstraints (uiLayout *, bContext *C, bool use_bone_constraints)

Detailed Description

Template for building the panel layout for the active object or bone's constraints.

Definition in file interface_template_constraint.cc.

Macro Definition Documentation

◆ CONSTRAINT_BONE_TYPE_PANEL_PREFIX

#define CONSTRAINT_BONE_TYPE_PANEL_PREFIX   "BONE_PT_"

Definition at line 178 of file interface_template_constraint.cc.

Referenced by bone_constraint_panel_id().

◆ CONSTRAINT_TYPE_PANEL_PREFIX

#define CONSTRAINT_TYPE_PANEL_PREFIX   "OBJECT_PT_"

For building the panel UI for constraints.

Definition at line 177 of file interface_template_constraint.cc.

Referenced by object_constraint_panel_id().

Function Documentation

◆ bone_constraint_panel_id()

void bone_constraint_panel_id ( void * md_link,
char * r_idname )
static

◆ constraint_active_func()

void constraint_active_func ( bContext * ,
void * ob_v,
void * con_v )
static

◆ constraint_ops_extra_draw()

◆ constraint_panel_is_bone()

bool constraint_panel_is_bone ( Panel * panel)
static

Check if the panel's ID starts with 'BONE', meaning it is a bone constraint.

Definition at line 183 of file interface_template_constraint.cc.

References Panel::panelname.

Referenced by constraint_reorder().

◆ constraint_reorder()

◆ draw_constraint_header()

◆ get_constraint_expand_flag()

short get_constraint_expand_flag ( const bContext * ,
Panel * panel )
static

Get the expand flag from the active constraint to use for the panel.

Definition at line 213 of file interface_template_constraint.cc.

References PointerRNA::data, bConstraint::ui_expand_flag, and UI_panel_custom_data_get().

Referenced by uiTemplateConstraints().

◆ object_constraint_panel_id()

void object_constraint_panel_id ( void * md_link,
char * r_idname )
static

Function with void * argument for uiListPanelIDFromDataFunc.

Note
Constraint panel types are assumed to be named with the struct name field concatenated to the defined prefix.

Definition at line 237 of file interface_template_constraint.cc.

References BKE_constraint_typeinfo_from_type(), BKE_ST_MAXNAME, BLI_string_join, CONSTRAINT_TYPE_PANEL_PREFIX, bConstraintTypeInfo::struct_name, and bConstraint::type.

Referenced by uiTemplateConstraints().

◆ set_constraint_expand_flag()

void set_constraint_expand_flag ( const bContext * ,
Panel * panel,
short expand_flag )
static

Save the expand flag for the panel and sub-panels to the constraint.

Definition at line 224 of file interface_template_constraint.cc.

References PointerRNA::data, bConstraint::ui_expand_flag, and UI_panel_custom_data_get().

Referenced by uiTemplateConstraints().

◆ uiTemplateConstraintHeader()

◆ uiTemplateConstraints()