Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/armature/armature_add.c')
-rw-r--r--source/blender/editors/armature/armature_add.c44
1 files changed, 20 insertions, 24 deletions
diff --git a/source/blender/editors/armature/armature_add.c b/source/blender/editors/armature/armature_add.c
index 8074182c395..fb94c55f3da 100644
--- a/source/blender/editors/armature/armature_add.c
+++ b/source/blender/editors/armature/armature_add.c
@@ -283,12 +283,8 @@ static EditBone *get_named_editbone(ListBase *edbo, const char *name)
* */
void preEditBoneDuplicate(ListBase *editbones)
{
- EditBone *eBone;
-
/* clear temp */
- for (eBone = editbones->first; eBone; eBone = eBone->next) {
- eBone->temp = NULL;
- }
+ ED_armature_ebone_listbase_temp_clear(editbones);
}
/*
@@ -328,8 +324,8 @@ void updateDuplicateSubtargetObjects(EditBone *dupBone, ListBase *editbones, Obj
* so, update the constraint to point at the
* duplicate of the old subtarget.
*/
- if (oldtarget->temp) {
- newtarget = (EditBone *) oldtarget->temp;
+ if (oldtarget->temp.ebone) {
+ newtarget = oldtarget->temp.ebone;
BLI_strncpy(ct->subtarget, newtarget->name, sizeof(ct->subtarget));
}
}
@@ -358,8 +354,8 @@ EditBone *duplicateEditBoneObjects(EditBone *curBone, const char *name, ListBase
/* Copy data from old bone to new bone */
memcpy(eBone, curBone, sizeof(EditBone));
- curBone->temp = eBone;
- eBone->temp = curBone;
+ curBone->temp.ebone = eBone;
+ eBone->temp.ebone = curBone;
if (name != NULL) {
BLI_strncpy(eBone->name, name, sizeof(eBone->name));
@@ -453,7 +449,7 @@ static int armature_duplicate_selected_exec(bContext *C, wmOperator *UNUSED(op))
if (EBONE_VISIBLE(arm, ebone_iter) &&
(ebone_iter->flag & BONE_SELECTED))
{
- EditBone *ebone = ebone_iter->temp;
+ EditBone *ebone = ebone_iter->temp.ebone;
if (!ebone_iter->parent) {
/* If this bone has no parent,
@@ -461,11 +457,11 @@ static int armature_duplicate_selected_exec(bContext *C, wmOperator *UNUSED(op))
*/
ebone->parent = NULL;
}
- else if (ebone_iter->parent->temp) {
+ else if (ebone_iter->parent->temp.ebone) {
/* If this bone has a parent that was duplicated,
* Set the duplicate->parent to the curBone->parent->temp
*/
- ebone->parent = (EditBone *)ebone_iter->parent->temp;
+ ebone->parent = ebone_iter->parent->temp.ebone;
}
else {
/* If this bone has a parent that IS not selected,
@@ -483,8 +479,8 @@ static int armature_duplicate_selected_exec(bContext *C, wmOperator *UNUSED(op))
}
/* correct the active bone */
- if (arm->act_edbone && arm->act_edbone->temp) {
- arm->act_edbone = arm->act_edbone->temp;
+ if (arm->act_edbone && arm->act_edbone->temp.ebone) {
+ arm->act_edbone = arm->act_edbone->temp.ebone;
}
/* Deselect the old bones and select the new ones */
@@ -560,7 +556,7 @@ static int armature_symmetrize_exec(bContext *C, wmOperator *op)
if (ebone) {
if ((ebone->flag & BONE_SELECTED) == 0) {
/* simple case, we're selected, the other bone isn't! */
- ebone_iter->temp = ebone;
+ ebone_iter->temp.ebone = ebone;
}
else {
/* complicated - choose which direction to copy */
@@ -590,7 +586,7 @@ static int armature_symmetrize_exec(bContext *C, wmOperator *op)
ebone_dst = ebone;
}
- ebone_src->temp = ebone_dst;
+ ebone_src->temp.ebone = ebone_dst;
ebone_dst->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
}
}
@@ -604,7 +600,7 @@ static int armature_symmetrize_exec(bContext *C, wmOperator *op)
if (EBONE_VISIBLE(arm, ebone_iter) &&
(ebone_iter->flag & BONE_SELECTED) &&
/* will be set if the mirror bone already exists (no need to make a new one) */
- (ebone_iter->temp == NULL))
+ (ebone_iter->temp.ebone == NULL))
{
char name_flip[MAX_VGROUP_NAME];
@@ -625,11 +621,11 @@ static int armature_symmetrize_exec(bContext *C, wmOperator *op)
/* Run though the list and fix the pointers */
for (ebone_iter = arm->edbo->first; ebone_iter && ebone_iter != ebone_first_dupe; ebone_iter = ebone_iter->next) {
- if (ebone_iter->temp) {
+ if (ebone_iter->temp.ebone) {
/* copy all flags except for ... */
const int flag_copy = ((int)~0) & ~(BONE_SELECTED | BONE_ROOTSEL | BONE_TIPSEL);
- EditBone *ebone = ebone_iter->temp;
+ EditBone *ebone = ebone_iter->temp.ebone;
/* copy flags incase bone is pre-existing data */
ebone->flag = (ebone->flag & ~flag_copy) | (ebone_iter->flag & flag_copy);
@@ -644,8 +640,8 @@ static int armature_symmetrize_exec(bContext *C, wmOperator *op)
else {
/* the parent may have been duplicated, if not lookup the mirror parent */
EditBone *ebone_parent =
- (ebone_iter->parent->temp ?
- ebone_iter->parent->temp : ED_armature_bone_get_mirrored(arm->edbo, ebone_iter->parent));
+ (ebone_iter->parent->temp.ebone ?
+ ebone_iter->parent->temp.ebone : ED_armature_bone_get_mirrored(arm->edbo, ebone_iter->parent));
if (ebone_parent == NULL) {
/* If the mirror lookup failed, (but the current bone has a parent)
@@ -680,15 +676,15 @@ static int armature_symmetrize_exec(bContext *C, wmOperator *op)
/* New bones will be selected, but some of the bones may already exist */
for (ebone_iter = arm->edbo->first; ebone_iter && ebone_iter != ebone_first_dupe; ebone_iter = ebone_iter->next) {
- EditBone *ebone = ebone_iter->temp;
+ EditBone *ebone = ebone_iter->temp.ebone;
if (ebone && EBONE_SELECTABLE(arm, ebone)) {
ED_armature_ebone_select_set(ebone, true);
}
}
/* correct the active bone */
- if (arm->act_edbone && arm->act_edbone->temp) {
- arm->act_edbone = arm->act_edbone->temp;
+ if (arm->act_edbone && arm->act_edbone->temp.ebone) {
+ arm->act_edbone = arm->act_edbone->temp.ebone;
}
ED_armature_validate_active(arm);