Blender  V3.3
Classes
armature_relations.c File Reference
#include "MEM_guardedalloc.h"
#include "DNA_anim_types.h"
#include "DNA_armature_types.h"
#include "DNA_constraint_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "BLI_blenlib.h"
#include "BLI_ghash.h"
#include "BLI_math.h"
#include "BLT_translation.h"
#include "BKE_action.h"
#include "BKE_anim_data.h"
#include "BKE_animsys.h"
#include "BKE_armature.h"
#include "BKE_constraint.h"
#include "BKE_context.h"
#include "BKE_fcurve_driver.h"
#include "BKE_layer.h"
#include "BKE_main.h"
#include "BKE_report.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_build.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "WM_api.h"
#include "WM_types.h"
#include "ED_armature.h"
#include "ED_object.h"
#include "ED_outliner.h"
#include "ED_screen.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "armature_intern.h"

Go to the source code of this file.

Classes

struct  tJoinArmature_AdtFixData
 

Functions

Edit Armature Separate
static void separated_armature_fix_links (Main *bmain, Object *origArm, Object *newArm)
 
static void separate_armature_bones (Main *bmain, Object *ob, const bool is_select)
 
static int separate_armature_exec (bContext *C, wmOperator *op)
 
void ARMATURE_OT_separate (wmOperatorType *ot)
 

Edit Armature Parenting

#define ARM_PAR_CONNECT   1
 
#define ARM_PAR_OFFSET   2
 
#define ARM_PAR_CLEAR   1
 
#define ARM_PAR_CLEAR_DISCONNECT   2
 
static const EnumPropertyItem prop_editarm_make_parent_types []
 
static const EnumPropertyItem prop_editarm_clear_parent_types []
 
static void bone_connect_to_existing_parent (EditBone *bone)
 
static void bone_connect_to_new_parent (ListBase *edbo, EditBone *selbone, EditBone *actbone, short mode)
 
static int armature_parent_set_exec (bContext *C, wmOperator *op)
 
static int armature_parent_set_invoke (bContext *C, wmOperator *UNUSED(op), const wmEvent *UNUSED(event))
 
void ARMATURE_OT_parent_set (wmOperatorType *ot)
 
static void editbone_clear_parent (EditBone *ebone, int mode)
 
static int armature_parent_clear_exec (bContext *C, wmOperator *op)
 
static int armature_parent_clear_invoke (bContext *C, wmOperator *UNUSED(op), const wmEvent *UNUSED(event))
 
void ARMATURE_OT_parent_clear (wmOperatorType *ot)
 

Edit Armature Join

Note
No operator define here as this is exported to the Object-level operator.
typedef struct tJoinArmature_AdtFixData tJoinArmature_AdtFixData
 
static void joined_armature_fix_links_constraints (Main *bmain, Object *ob, Object *tarArm, Object *srcArm, bPoseChannel *pchan, EditBone *curbone, ListBase *lb)
 
static void joined_armature_fix_animdata_cb (ID *id, FCurve *fcu, void *user_data)
 
static void joined_armature_fix_links (Main *bmain, Object *tarArm, Object *srcArm, bPoseChannel *pchan, EditBone *curbone)
 
int ED_armature_join_objects_exec (bContext *C, wmOperator *op)
 

Detailed Description

Operators for relations between bones and for transferring bones between armature objects.

Definition in file armature_relations.c.

Macro Definition Documentation

◆ ARM_PAR_CLEAR

#define ARM_PAR_CLEAR   1

Definition at line 731 of file armature_relations.c.

◆ ARM_PAR_CLEAR_DISCONNECT

#define ARM_PAR_CLEAR_DISCONNECT   2

Definition at line 732 of file armature_relations.c.

◆ ARM_PAR_CONNECT

#define ARM_PAR_CONNECT   1

Definition at line 727 of file armature_relations.c.

◆ ARM_PAR_OFFSET

#define ARM_PAR_OFFSET   2

Definition at line 728 of file armature_relations.c.

Typedef Documentation

◆ tJoinArmature_AdtFixData

Function Documentation

◆ ARMATURE_OT_parent_clear()

void ARMATURE_OT_parent_clear ( wmOperatorType ot)

◆ ARMATURE_OT_parent_set()

void ARMATURE_OT_parent_set ( wmOperatorType ot)

◆ ARMATURE_OT_separate()

void ARMATURE_OT_separate ( wmOperatorType ot)

◆ armature_parent_clear_exec()

static int armature_parent_clear_exec ( bContext C,
wmOperator op 
)
static

◆ armature_parent_clear_invoke()

static int armature_parent_clear_invoke ( bContext C,
wmOperator UNUSEDop,
const wmEvent UNUSEDevent 
)
static

◆ armature_parent_set_exec()

static int armature_parent_set_exec ( bContext C,
wmOperator op 
)
static

◆ armature_parent_set_invoke()

static int armature_parent_set_invoke ( bContext C,
wmOperator UNUSEDop,
const wmEvent UNUSEDevent 
)
static

◆ bone_connect_to_existing_parent()

static void bone_connect_to_existing_parent ( EditBone bone)
static

◆ bone_connect_to_new_parent()

static void bone_connect_to_new_parent ( ListBase edbo,
EditBone selbone,
EditBone actbone,
short  mode 
)
static

◆ ED_armature_join_objects_exec()

int ED_armature_join_objects_exec ( struct bContext C,
struct wmOperator op 
)

Join armature exec is exported for use in object->join objects operator.

Definition at line 256 of file armature_relations.c.

References bArmature::adt, Object::adt, ADT_MERGECOPY_KEEP_DST, atan2f, BKE_animdata_copy(), BKE_animdata_merge_copy(), BKE_fcurves_main_cb(), BKE_pose_channels_hash_free(), BKE_report(), BLI_addtail(), BLI_assert, BLI_ghash_free(), BLI_ghash_insert(), BLI_ghash_str_new(), BLI_remlink(), BLI_strdup(), BLI_strncpy(), tJoinArmature_AdtFixData::bmain, C, copy_m4_m3(), CTX_data_active_object(), CTX_DATA_BEGIN, CTX_DATA_END, CTX_data_main(), CTX_data_scene(), Object::data, DEG_id_tag_update(), DEG_id_tag_update_ex(), DEG_relations_tag_update(), ED_armature_ebone_find_name(), ED_armature_ebone_to_mat3(), ED_armature_ebone_unique_name(), ED_armature_edit_free(), ED_armature_from_edit(), ED_armature_to_edit(), ED_object_base_free_and_unlink(), bArmature::edbo, bArmature::id, Object::id, Scene::id, ID_RECALC_GEOMETRY, ID_RECALC_SELECT, if(), invert_m4_m4(), invert_m4_m4_safe_ortho(), joined_armature_fix_animdata_cb(), joined_armature_fix_links(), MEM_freeN, Object::mode, mul_m4_m3m4(), mul_m4_m4m4(), mul_m4_v3(), tJoinArmature_AdtFixData::names_map, NC_SCENE, ND_LAYER_CONTENT, ND_OB_ACTIVE, NULL, OB_ARMATURE, OB_MODE_POSE, Object::obmat, OPERATOR_CANCELLED, OPERATOR_FINISHED, Object::pose, wmOperator::reports, RPT_WARNING, scene, tJoinArmature_AdtFixData::srcArm, tJoinArmature_AdtFixData::tarArm, Object::type, unit_m4(), and WM_event_add_notifier().

Referenced by object_join_exec().

◆ editbone_clear_parent()

static void editbone_clear_parent ( EditBone ebone,
int  mode 
)
static

◆ joined_armature_fix_animdata_cb()

static void joined_armature_fix_animdata_cb ( ID id,
FCurve fcu,
void user_data 
)
static

◆ joined_armature_fix_links()

static void joined_armature_fix_links ( Main bmain,
Object tarArm,
Object srcArm,
bPoseChannel pchan,
EditBone curbone 
)
static

◆ joined_armature_fix_links_constraints()

static void joined_armature_fix_links_constraints ( Main bmain,
Object ob,
Object tarArm,
Object srcArm,
bPoseChannel pchan,
EditBone curbone,
ListBase lb 
)
static

◆ separate_armature_bones()

static void separate_armature_bones ( Main bmain,
Object ob,
const bool  is_select 
)
static

Helper function for armature separating - remove certain bones from the given armature.

Parameters
obArmature object (must not be is not in edit-mode).
is_selectremove selected bones from the armature, otherwise the unselected bones are removed.

Definition at line 544 of file armature_relations.c.

References BKE_pose_channel_free(), BKE_pose_channels_hash_free(), BLI_freelinkN(), BONE_CONNECTED, bone_free(), BONE_SELECTED, bPose::chanbase, Object::data, EBONE_VISIBLE, ED_armature_ebone_find_name(), ED_armature_edit_deselect_all(), ED_armature_edit_free(), ED_armature_from_edit(), ED_armature_to_edit(), bArmature::edbo, ListBase::first, LISTBASE_FOREACH, bPoseChannel::name, bPoseChannel::next, NULL, and Object::pose.

Referenced by separate_armature_exec().

◆ separate_armature_exec()

static int separate_armature_exec ( bContext C,
wmOperator op 
)
static

◆ separated_armature_fix_links()

static void separated_armature_fix_links ( Main bmain,
Object origArm,
Object newArm 
)
static

Variable Documentation

◆ prop_editarm_clear_parent_types

const EnumPropertyItem prop_editarm_clear_parent_types[]
static
Initial value:
= {
{ARM_PAR_CLEAR, "CLEAR", 0, "Clear Parent", ""},
{ARM_PAR_CLEAR_DISCONNECT, "DISCONNECT", 0, "Disconnect Bone", ""},
{0, NULL, 0, NULL, NULL},
}
#define ARM_PAR_CLEAR_DISCONNECT
#define ARM_PAR_CLEAR

Definition at line 956 of file armature_relations.c.

Referenced by ARMATURE_OT_parent_clear().

◆ prop_editarm_make_parent_types

const EnumPropertyItem prop_editarm_make_parent_types[]
static
Initial value:
= {
{ARM_PAR_CONNECT, "CONNECTED", 0, "Connected", ""},
{ARM_PAR_OFFSET, "OFFSET", 0, "Keep Offset", ""},
{0, NULL, 0, NULL, NULL},
}
#define ARM_PAR_OFFSET
#define ARM_PAR_CONNECT

Definition at line 794 of file armature_relations.c.

Referenced by ARMATURE_OT_parent_set().