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:
authorCampbell Barton <ideasman42@gmail.com>2010-10-15 07:24:47 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-10-15 07:24:47 +0400
commitd3fcc2d0b4a02438f7e1ffa0bbdd9426d8dd0659 (patch)
tree01b5817eebe2d263a8ddc2fe2ee245725e32b4bc /source/blender/editors/armature
parent201fd16df98dd1ad2a7b511edc96c338911dc1eb (diff)
bugfix [#24256] Wrong bone subdivision number in tweak panel.
there were 3 operators for armature subdivision, now only have 1 (as with mesh). + remove unused warnigns.
Diffstat (limited to 'source/blender/editors/armature')
-rw-r--r--source/blender/editors/armature/armature_intern.h4
-rw-r--r--source/blender/editors/armature/armature_ops.c4
-rw-r--r--source/blender/editors/armature/editarmature.c128
-rw-r--r--source/blender/editors/armature/poselib.c4
-rw-r--r--source/blender/editors/armature/poseobject.c19
5 files changed, 39 insertions, 120 deletions
diff --git a/source/blender/editors/armature/armature_intern.h b/source/blender/editors/armature/armature_intern.h
index 2d28d3cb9e5..acbfec125e0 100644
--- a/source/blender/editors/armature/armature_intern.h
+++ b/source/blender/editors/armature/armature_intern.h
@@ -51,9 +51,7 @@ void ARMATURE_OT_align(struct wmOperatorType *ot);
void ARMATURE_OT_calculate_roll(struct wmOperatorType *ot);
void ARMATURE_OT_switch_direction(struct wmOperatorType *ot);
-void ARMATURE_OT_subdivs(struct wmOperatorType *ot);
-void ARMATURE_OT_subdivide_simple(struct wmOperatorType *ot);
-void ARMATURE_OT_subdivide_multi(struct wmOperatorType *ot);
+void ARMATURE_OT_subdivide(struct wmOperatorType *ot);
void ARMATURE_OT_parent_set(struct wmOperatorType *ot);
void ARMATURE_OT_parent_clear(struct wmOperatorType *ot);
diff --git a/source/blender/editors/armature/armature_ops.c b/source/blender/editors/armature/armature_ops.c
index 78b0b2e5e0d..ff4accfd066 100644
--- a/source/blender/editors/armature/armature_ops.c
+++ b/source/blender/editors/armature/armature_ops.c
@@ -57,9 +57,7 @@ void ED_operatortypes_armature(void)
WM_operatortype_append(ARMATURE_OT_align);
WM_operatortype_append(ARMATURE_OT_calculate_roll);
WM_operatortype_append(ARMATURE_OT_switch_direction);
- WM_operatortype_append(ARMATURE_OT_subdivs);
- WM_operatortype_append(ARMATURE_OT_subdivide_simple);
- WM_operatortype_append(ARMATURE_OT_subdivide_multi);
+ WM_operatortype_append(ARMATURE_OT_subdivide);
WM_operatortype_append(ARMATURE_OT_parent_set);
WM_operatortype_append(ARMATURE_OT_parent_clear);
diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c
index f786b50fcf9..c8c0a4e6980 100644
--- a/source/blender/editors/armature/editarmature.c
+++ b/source/blender/editors/armature/editarmature.c
@@ -1075,7 +1075,7 @@ static void separated_armature_fix_links(Object *origArm, Object *newArm)
* sel: remove selected bones from the armature, otherwise the unselected bones are removed
* (ob is not in editmode)
*/
-static void separate_armature_bones (Scene *scene, Object *ob, short sel)
+static void separate_armature_bones(Object *ob, short sel)
{
bArmature *arm= (bArmature *)ob->data;
bPoseChannel *pchan, *pchann;
@@ -1176,8 +1176,8 @@ static int separate_armature_exec (bContext *C, wmOperator *UNUSED(op))
/* 3) remove bones that shouldn't still be around on both armatures */
- separate_armature_bones(scene, oldob, 1);
- separate_armature_bones(scene, newob, 0);
+ separate_armature_bones(oldob, 1);
+ separate_armature_bones(newob, 0);
/* 4) fix links before depsgraph flushes */ // err... or after?
@@ -2087,7 +2087,7 @@ float ED_rollBoneToVector(EditBone *bone, float new_up_axis[3])
/* Set roll value for given bone -> Z-Axis Point up (original method) */
-static void auto_align_ebone_zaxisup(Scene *scene, View3D *v3d, EditBone *ebone)
+static void auto_align_ebone_zaxisup(Scene *UNUSED(scene), View3D *UNUSED(v3d), EditBone *ebone)
{
float delta[3], curmat[3][3];
float xaxis[3]={1.0f, 0.0f, 0.0f}, yaxis[3], zaxis[3]={0.0f, 0.0f, 1.0f};
@@ -3632,10 +3632,7 @@ static int armature_subdivide_exec(bContext *C, wmOperator *op)
int numcuts, i;
/* there may not be a number_cuts property defined (for 'simple' subdivide) */
- if (RNA_property_is_set(op->ptr, "number_cuts"))
- numcuts= RNA_int_get(op->ptr, "number_cuts");
- else
- numcuts= 1;
+ numcuts= RNA_int_get(op->ptr, "number_cuts");
/* loop over all editable bones */
// XXX the old code did this in reverse order though!
@@ -3690,26 +3687,11 @@ static int armature_subdivide_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
-
-void ARMATURE_OT_subdivide_simple(wmOperatorType *ot)
-{
- /* identifiers */
- ot->name= "Subdivide Simple";
- ot->idname= "ARMATURE_OT_subdivide_simple";
-
- /* api callbacks */
- ot->exec = armature_subdivide_exec;
- ot->poll = ED_operator_editarmature;
-
- /* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
-}
-
-void ARMATURE_OT_subdivide_multi(wmOperatorType *ot)
+void ARMATURE_OT_subdivide(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Subdivide Multi";
- ot->idname= "ARMATURE_OT_subdivide_multi";
+ ot->idname= "ARMATURE_OT_subdivide";
/* api callbacks */
ot->exec = armature_subdivide_exec;
@@ -3719,65 +3701,7 @@ void ARMATURE_OT_subdivide_multi(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* Properties */
- RNA_def_int(ot->srna, "number_cuts", 2, 1, INT_MAX, "Number of Cuts", "", 1, 10);
-}
-
-
-
-static int armature_subdivs_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(event))
-{
- uiPopupMenu *pup;
- uiLayout *layout;
-
- pup= uiPupMenuBegin(C, "Subdivision Type", 0);
- layout= uiPupMenuLayout(pup);
- uiItemsEnumO(layout, "ARMATURE_OT_subdivs", "type");
- uiPupMenuEnd(C, pup);
-
- return OPERATOR_CANCELLED;
-}
-
-static int armature_subdivs_exec(bContext *C, wmOperator *op)
-{
- switch (RNA_int_get(op->ptr, "type"))
- {
- case 0: /* simple */
- RNA_int_set(op->ptr, "number_cuts", 1);
- armature_subdivide_exec(C, op);
- break;
- case 1: /* multi */
- armature_subdivide_exec(C, op);
- break;
- }
-
- return OPERATOR_FINISHED;
-}
-
-void ARMATURE_OT_subdivs(wmOperatorType *ot)
-{
- static EnumPropertyItem type_items[]= {
- {0, "SIMPLE", 0, "Simple", ""},
- {1, "MULTI", 0, "Multi", ""},
- {0, NULL, 0, NULL, NULL}};
-
- /* identifiers */
- ot->name= "subdivs";
- ot->idname= "ARMATURE_OT_subdivs";
-
- /* api callbacks */
- ot->invoke= armature_subdivs_invoke;
- ot->exec= armature_subdivs_exec;
-
- ot->poll= ED_operator_editarmature;
-
- /* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
-
- /* props */
- RNA_def_enum(ot->srna, "type", type_items, 0, "Type", "");
-
- /* this is temp, the ops are different, but they are called from subdivs, so all the possible props should be here as well*/
- RNA_def_int(ot->srna, "number_cuts", 2, 1, INT_MAX, "Number of Cuts", "", 1, 10);
+ RNA_def_int(ot->srna, "number_cuts", 1, 1, INT_MAX, "Number of Cuts", "", 1, 10);
}
/* ----------- */
@@ -4552,7 +4476,7 @@ void ED_pose_deselectall (Object *ob, int test)
arm->act_bone= NULL;
}
-static int bone_skinnable(Object *ob, Bone *bone, void *datap)
+static int bone_skinnable_cb(Object *ob, Bone *bone, void *datap)
{
/* Bones that are deforming
* are regarded to be "skinnable" and are eligible for
@@ -4601,7 +4525,7 @@ static int bone_skinnable(Object *ob, Bone *bone, void *datap)
return 0;
}
-static int ED_vgroup_add_unique_bone(Object *ob, Bone *bone, void *data)
+static int vgroup_add_unique_bone_cb(Object *ob, Bone *bone, void *UNUSED(ptr))
{
/* This group creates a vertex group to ob that has the
* same name as bone (provided the bone is skinnable).
@@ -4616,7 +4540,7 @@ static int ED_vgroup_add_unique_bone(Object *ob, Bone *bone, void *data)
return 0;
}
-static int dgroup_skinnable(Object *ob, Bone *bone, void *datap)
+static int dgroup_skinnable_cb(Object *ob, Bone *bone, void *datap)
{
/* Bones that are deforming
* are regarded to be "skinnable" and are eligible for
@@ -4672,7 +4596,7 @@ static int dgroup_skinnable(Object *ob, Bone *bone, void *datap)
return 0;
}
-static void add_vgroups__mapFunc(void *userData, int index, float *co, float *no_f, short *no_s)
+static void add_vgroups__mapFunc(void *userData, int index, float *co, float *UNUSED(no_f), short *UNUSED(no_s))
{
/* DerivedMesh mapFunc for getting final coords in weight paint mode */
@@ -4755,7 +4679,7 @@ void add_verts_to_dgroups(ReportList *reports, Scene *scene, Object *ob, Object
looper_data.list= NULL;
/* count the number of skinnable bones */
- numbones = bone_looper(ob, arm->bonebase.first, &looper_data, bone_skinnable);
+ numbones = bone_looper(ob, arm->bonebase.first, &looper_data, bone_skinnable_cb);
if (numbones == 0)
return;
@@ -4764,7 +4688,7 @@ void add_verts_to_dgroups(ReportList *reports, Scene *scene, Object *ob, Object
* and fill it with all of the skinnable bones */
bonelist = MEM_callocN(numbones*sizeof(Bone *), "bonelist");
looper_data.list= bonelist;
- bone_looper(ob, arm->bonebase.first, &looper_data, bone_skinnable);
+ bone_looper(ob, arm->bonebase.first, &looper_data, bone_skinnable_cb);
/* create an array of pointers to the deform groups that
* coorespond to the skinnable bones (creating them
@@ -4773,7 +4697,7 @@ void add_verts_to_dgroups(ReportList *reports, Scene *scene, Object *ob, Object
dgroupflip = MEM_callocN(numbones*sizeof(bDeformGroup *), "dgroupflip");
looper_data.list= dgrouplist;
- bone_looper(ob, arm->bonebase.first, &looper_data, dgroup_skinnable);
+ bone_looper(ob, arm->bonebase.first, &looper_data, dgroup_skinnable_cb);
/* create an array of root and tip positions transformed into
* global coords */
@@ -4907,7 +4831,7 @@ void create_vgroups_from_armature(ReportList *reports, Scene *scene, Object *ob,
/* Traverse the bone list, trying to create empty vertex
* groups cooresponding to the bone.
*/
- bone_looper(ob, arm->bonebase.first, NULL, ED_vgroup_add_unique_bone);
+ bone_looper(ob, arm->bonebase.first, NULL, vgroup_add_unique_bone_cb);
if (ob->type == OB_MESH)
ED_vgroup_data_create(ob->data);
@@ -4964,7 +4888,7 @@ static int pose_clear_scale_exec(bContext *C, wmOperator *UNUSED(op))
/* now recalculate paths */
if ((ob->pose->avs.path_bakeflag & MOTIONPATH_BAKE_HAS_PATHS))
- ED_pose_recalculate_paths(C, scene, ob);
+ ED_pose_recalculate_paths(scene, ob);
}
DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
@@ -5033,7 +4957,7 @@ static int pose_clear_loc_exec(bContext *C, wmOperator *UNUSED(op))
/* now recalculate paths */
if ((ob->pose->avs.path_bakeflag & MOTIONPATH_BAKE_HAS_PATHS))
- ED_pose_recalculate_paths(C, scene, ob);
+ ED_pose_recalculate_paths(scene, ob);
}
DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
@@ -5186,7 +5110,7 @@ static int pose_clear_rot_exec(bContext *C, wmOperator *UNUSED(op))
/* now recalculate paths */
if ((ob->pose->avs.path_bakeflag & MOTIONPATH_BAKE_HAS_PATHS))
- ED_pose_recalculate_paths(C, scene, ob);
+ ED_pose_recalculate_paths(scene, ob);
}
DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
@@ -5356,7 +5280,7 @@ void POSE_OT_select_parent(wmOperatorType *ot)
/* ************* hide/unhide pose bones ******************* */
-static int hide_selected_pose_bone(Object *ob, Bone *bone, void *ptr)
+static int hide_selected_pose_bone_cb(Object *ob, Bone *bone, void *UNUSED(ptr))
{
bArmature *arm= ob->data;
@@ -5371,7 +5295,7 @@ static int hide_selected_pose_bone(Object *ob, Bone *bone, void *ptr)
return 0;
}
-static int hide_unselected_pose_bone(Object *ob, Bone *bone, void *ptr)
+static int hide_unselected_pose_bone_cb(Object *ob, Bone *bone, void *UNUSED(ptr))
{
bArmature *arm= ob->data;
@@ -5393,11 +5317,9 @@ static int pose_hide_exec(bContext *C, wmOperator *op)
bArmature *arm= ob->data;
if(RNA_boolean_get(op->ptr, "unselected"))
- bone_looper(ob, arm->bonebase.first, NULL,
- hide_unselected_pose_bone);
+ bone_looper(ob, arm->bonebase.first, NULL, hide_unselected_pose_bone_cb);
else
- bone_looper(ob, arm->bonebase.first, NULL,
- hide_selected_pose_bone);
+ bone_looper(ob, arm->bonebase.first, NULL, hide_selected_pose_bone_cb);
/* note, notifier might evolve */
WM_event_add_notifier(C, NC_OBJECT|ND_BONE_SELECT, ob);
@@ -5422,7 +5344,7 @@ void POSE_OT_hide(wmOperatorType *ot)
RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "");
}
-static int show_pose_bone(Object *ob, Bone *bone, void *ptr)
+static int show_pose_bone_cb(Object *ob, Bone *bone, void *UNUSED(ptr))
{
bArmature *arm= ob->data;
@@ -5442,7 +5364,7 @@ static int pose_reveal_exec(bContext *C, wmOperator *UNUSED(op))
Object *ob= ED_object_pose_armature(CTX_data_active_object(C));
bArmature *arm= ob->data;
- bone_looper(ob, arm->bonebase.first, NULL, show_pose_bone);
+ bone_looper(ob, arm->bonebase.first, NULL, show_pose_bone_cb);
/* note, notifier might evolve */
WM_event_add_notifier(C, NC_OBJECT|ND_BONE_SELECT, ob);
diff --git a/source/blender/editors/armature/poselib.c b/source/blender/editors/armature/poselib.c
index 3a90f75d2a1..a595396b15d 100644
--- a/source/blender/editors/armature/poselib.c
+++ b/source/blender/editors/armature/poselib.c
@@ -268,7 +268,7 @@ static KeyingSet *poselib_ks_locrotscale = NULL; /* the only keyingset we'll ne
/* ----- */
-static void poselib_add_menu_invoke__replacemenu (bContext *C, uiLayout *layout, void *arg)
+static void poselib_add_menu_invoke__replacemenu (bContext *C, uiLayout *layout, void *UNUSED(arg))
{
Object *ob= ED_object_pose_armature(CTX_data_active_object(C));
bAction *act= ob->poselib;
@@ -402,7 +402,7 @@ void POSELIB_OT_pose_add (wmOperatorType *ot)
/* ----- */
-static EnumPropertyItem *poselib_stored_pose_itemf(bContext *C, PointerRNA *ptr, int *free)
+static EnumPropertyItem *poselib_stored_pose_itemf(bContext *C, PointerRNA *UNUSED(ptr), int *free)
{
Object *ob= ED_object_pose_armature(CTX_data_active_object(C));
bAction *act= (ob) ? ob->poselib : NULL;
diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c
index fa7f01da7b9..ecb34609b2d 100644
--- a/source/blender/editors/armature/poseobject.c
+++ b/source/blender/editors/armature/poseobject.c
@@ -71,9 +71,9 @@
#include "armature_intern.h"
/* ************* XXX *************** */
-static int pupmenu(const char *dummy) {return 0;}
-static void error(const char *dummy) {};
-static void BIF_undo_push(const char *dummy) {}
+static int pupmenu(const char *UNUSED(dummy)) {return 0;}
+static void error(const char *UNUSED(dummy)) {};
+static void BIF_undo_push(const char *UNUSED(dummy)) {}
/* ************* XXX *************** */
@@ -226,7 +226,7 @@ int ED_pose_channel_in_IK_chain(Object *ob, bPoseChannel *pchan)
*
* To be called from various tools that do incremental updates
*/
-void ED_pose_recalculate_paths(bContext *C, Scene *scene, Object *ob)
+void ED_pose_recalculate_paths(Scene *scene, Object *ob)
{
ListBase targets = {NULL, NULL};
@@ -267,7 +267,7 @@ static int pose_calculate_paths_exec (bContext *C, wmOperator *UNUSED(op))
/* calculate the bones that now have motionpaths... */
// TODO: only make for the selected bones?
- ED_pose_recalculate_paths(C, scene, ob);
+ ED_pose_recalculate_paths(scene, ob);
/* notifiers for updates */
WM_event_add_notifier(C, NC_OBJECT|ND_POSE, ob);
@@ -1895,9 +1895,9 @@ void POSE_OT_quaternions_flip (wmOperatorType *ot)
/* ********************************************** */
/* context: active channel */
+#if 0
void pose_special_editmenu(Scene *scene)
{
-#if 0
Object *obedit= scene->obedit; // XXX context
Object *ob= OBACT;
short nr;
@@ -1920,7 +1920,7 @@ void pose_special_editmenu(Scene *scene)
pose_clear_paths(ob);
}
else if(nr==5) {
- pose_clear_user_transforms(scene, ob);
+ pose_clear_user_transforms(ob);
}
else if(nr==6) {
pose_relax();
@@ -1928,11 +1928,11 @@ void pose_special_editmenu(Scene *scene)
else if(ELEM3(nr, 7, 8, 9)) {
pose_autoside_names(nr-7);
}
-#endif
}
+
/* Restore selected pose-bones to 'action'-defined pose */
-void pose_clear_user_transforms(Scene *scene, Object *ob)
+static void pose_clear_user_transforms(Object *ob)
{
bArmature *arm= ob->data;
bPoseChannel *pchan;
@@ -1964,3 +1964,4 @@ void pose_clear_user_transforms(Scene *scene, Object *ob)
BIF_undo_push("Clear User Transform");
}
+#endif