|
Blender V5.0
|
#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) |
Template for building the panel layout for the active object or bone's constraints.
Definition in file interface_template_constraint.cc.
| #define CONSTRAINT_BONE_TYPE_PANEL_PREFIX "BONE_PT_" |
Definition at line 178 of file interface_template_constraint.cc.
Referenced by bone_constraint_panel_id().
| #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().
|
static |
Definition at line 249 of file interface_template_constraint.cc.
References BKE_constraint_typeinfo_from_type(), BKE_ST_MAXNAME, BLI_string_join, CONSTRAINT_BONE_TYPE_PANEL_PREFIX, bConstraintTypeInfo::struct_name, and bConstraint::type.
Referenced by uiTemplateConstraints().
|
static |
Definition at line 34 of file interface_template_constraint.cc.
References blender::ed::object::constraint_active_set().
Referenced by draw_constraint_header().
Definition at line 40 of file interface_template_constraint.cc.
References BLI_listbase_count(), BLT_I18NCONTEXT_OPERATOR_DEFAULT, C, uiLayout::column(), blender::ed::object::constraint_list_from_constraint(), blender::ed::object::context_active_object(), uiLayout::context_ptr_set(), CTX_IFACE_, uiLayout::enabled_set(), Object::id, IFACE_, blender::wm::InvokeDefault, bConstraint::next, uiLayout::op(), uiLayout::operator_context_set(), bConstraint::prev, ptr, RNA_int_set(), RNA_pointer_create_discrete(), uiLayout::separator(), UI_ITEM_NONE, and uiLayout::ui_units_x_set().
Referenced by draw_constraint_header().
|
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().
Move a constraint to the index it's moved to after a drag and drop.
Definition at line 192 of file interface_template_constraint.cc.
References C, constraint_panel_is_bone(), PointerRNA::data, blender::wm::InvokeDefault, bConstraint::name, ot, RNA_enum_set(), RNA_int_set(), RNA_string_set(), UI_panel_custom_data_get(), WM_operator_name_call_ptr(), WM_operator_properties_create_ptr(), WM_operator_properties_free(), and WM_operatortype_find().
Referenced by uiTemplateConstraints().
|
static |
Definition at line 101 of file interface_template_constraint.cc.
References uiLayout::block(), constraint_active_func(), CONSTRAINT_DISABLE, constraint_ops_extra_draw(), uiLayout::context_ptr_set(), blender::ui::Emboss, uiLayout::emboss_set(), bConstraint::flag, Object::id, blender::wm::InvokeDefault, uiLayout::label(), uiLayout::menu_fn(), blender::ui::None, uiLayout::op(), uiLayout::operator_context_set(), uiBlock::panel, uiLayout::prop(), ptr, uiLayout::red_alert_set(), RNA_pointer_create_discrete(), RNA_struct_ui_icon(), uiLayout::row(), uiLayout::separator(), UI_block_emboss_set(), UI_block_func_set(), UI_block_lock_clear(), UI_ITEM_NONE, and UI_panel_context_pointer_set().
Referenced by uiTemplateConstraintHeader().
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().
|
static |
Function with void * argument for uiListPanelIDFromDataFunc.
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().
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().
| void uiTemplateConstraintHeader | ( | uiLayout * | layout, |
| PointerRNA * | ptr ) |
Definition at line 147 of file interface_template_constraint.cc.
References uiLayout::block(), draw_constraint_header(), ERROR_LIBDATA_MESSAGE, GS, Object::id, ID_IS_EDITABLE, ID_OB, ID::name, ptr, RNA_struct_is_a(), RNA_warning, and UI_block_lock_set().
Check if the constraint panels don't match the data and rebuild the panels if so.
Definition at line 261 of file interface_template_constraint.cc.
References BLI_assert, bone_constraint_panel_id(), C, CONSTRAINT_IK_TEMP, constraint_reorder(), CONSTRAINT_TYPE_KINEMATIC, CONSTRAINT_TYPE_NULL, constraints, Object::constraints, blender::ed::object::context_active_object(), CTX_wm_region(), data, ListBase::first, PanelType::flag, get_constraint_expand_flag(), PanelType::get_list_data_expand_flag, Object::id, LISTBASE_FOREACH, MAX_NAME, bConstraint::next, Panel::next, object_constraint_panel_id(), PANEL_TYPE_INSTANCED, ARegion::panels, blender::ed::object::pose_constraint_list(), PanelType::reorder, RNA_pointer_create_discrete(), set_constraint_expand_flag(), PanelType::set_list_data_expand_flag, Panel::type, UI_panel_add_instanced(), UI_panel_custom_data_set(), UI_panel_list_matches_data(), and UI_panels_free_instanced().