diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-01-13 07:53:55 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-01-13 07:53:55 +0300 |
commit | 8227b3d463955d887a987fe546d8eefa2757a982 (patch) | |
tree | 47be10b02d3418b579dc95ca796f2d7c596571e9 /source/blender/editors/armature | |
parent | 57ce3072d191480ab8bdfcb1f4b841452819467a (diff) |
remove/comment unused vars
also removed unnecessary NULL checks (where the pointer was used later without checking).
Diffstat (limited to 'source/blender/editors/armature')
-rw-r--r-- | source/blender/editors/armature/editarmature.c | 2 | ||||
-rw-r--r-- | source/blender/editors/armature/editarmature_retarget.c | 9 | ||||
-rw-r--r-- | source/blender/editors/armature/poseobject.c | 19 | ||||
-rw-r--r-- | source/blender/editors/armature/reeb.c | 10 |
4 files changed, 16 insertions, 24 deletions
diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index f62fb83deca..2252c926c71 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -1209,12 +1209,10 @@ static int separate_armature_exec (bContext *C, wmOperator *UNUSED(op)) Object *obedit= CTX_data_edit_object(C); Object *oldob, *newob; Base *oldbase, *newbase; - bArmature *arm; /* sanity checks */ if (obedit == NULL) return OPERATOR_CANCELLED; - arm= obedit->data; /* set wait cursor in case this takes a while */ WM_cursor_wait(1); diff --git a/source/blender/editors/armature/editarmature_retarget.c b/source/blender/editors/armature/editarmature_retarget.c index d4f25c10e30..cabf81ea85e 100644 --- a/source/blender/editors/armature/editarmature_retarget.c +++ b/source/blender/editors/armature/editarmature_retarget.c @@ -2730,8 +2730,6 @@ static void retargetGraphs(bContext *C, RigGraph *rigg) BIF_flagMultiArcs(reebg, ARC_FREE); /* return to first level */ - reebg = rigg->link_mesh; - inode = rigg->head; matchMultiResolutionStartingNode(rigg, reebg, inode); @@ -2887,7 +2885,6 @@ void BIF_retargetArc(bContext *C, ReebArc *earc, RigGraph *template_rigg) Object *ob; RigGraph *rigg; RigArc *iarc; - bArmature *arm; char *side_string = scene->toolsettings->skgen_side_string; char *num_string = scene->toolsettings->skgen_num_string; int free_template = 0; @@ -2895,14 +2892,12 @@ void BIF_retargetArc(bContext *C, ReebArc *earc, RigGraph *template_rigg) if (template_rigg) { ob = template_rigg->ob; - arm = ob->data; } else { free_template = 1; - ob = obedit; - arm = ob->data; - template_rigg = armatureSelectedToGraph(C, ob, arm); + ob = obedit; + template_rigg = armatureSelectedToGraph(C, ob, ob->data); } if (template_rigg->arcs.first == NULL) diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c index cae6491378e..6c1adcb2ccb 100644 --- a/source/blender/editors/armature/poseobject.c +++ b/source/blender/editors/armature/poseobject.c @@ -667,7 +667,7 @@ void pose_copy_menu(Scene *scene) { Object *obedit= scene->obedit; // XXX context Object *ob= OBACT; - bArmature *arm= ob->data; + bArmature *arm; bPoseChannel *pchan, *pchanact; short nr=0; int i=0; @@ -680,7 +680,8 @@ void pose_copy_menu(Scene *scene) if (pchan==NULL) return; pchanact= pchan; - + arm= ob->data; + /* if proxy-protected bones selected, some things (such as locks + displays) shouldn't be changable, * but for constraints (just add local constraints) */ @@ -1241,7 +1242,6 @@ static int pose_group_assign_exec (bContext *C, wmOperator *op) { ScrArea *sa= CTX_wm_area(C); Object *ob; - bArmature *arm; bPose *pose; short done= 0; @@ -1254,7 +1254,7 @@ static int pose_group_assign_exec (bContext *C, wmOperator *op) /* only continue if there's an object, and a pose there too */ if (ELEM(NULL, ob, ob->pose)) return OPERATOR_CANCELLED; - arm= ob->data; + pose= ob->pose; /* set the active group number to the one from operator props @@ -1306,8 +1306,6 @@ static int pose_group_unassign_exec (bContext *C, wmOperator *UNUSED(op)) { ScrArea *sa= CTX_wm_area(C); Object *ob; - bArmature *arm; - bPose *pose; short done= 0; /* since this call may also be used from the buttons window, we need to check for where to get the object */ @@ -1319,8 +1317,6 @@ static int pose_group_unassign_exec (bContext *C, wmOperator *UNUSED(op)) /* only continue if there's an object, and a pose there too */ if (ELEM(NULL, ob, ob->pose)) return OPERATOR_CANCELLED; - pose= ob->pose; - arm= ob->data; /* find selected bones to remove from all bone groups */ CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pose_bones) @@ -1561,16 +1557,17 @@ void POSE_OT_autoside_names (wmOperatorType *ot) void pose_activate_flipped_bone(Scene *scene) { Object *ob= OBACT; - bArmature *arm= ob->data; - + if(ob==NULL) return; if(ob->mode & OB_MODE_WEIGHT_PAINT) { ob= modifiers_isDeformedByArmature(ob); } + if(ob && (ob->mode & OB_MODE_POSE)) { bPoseChannel *pchanf; - + bArmature *arm= ob->data; + if(arm->act_bone) { char name[32]; flip_side_name(name, arm->act_bone->name, TRUE); diff --git a/source/blender/editors/armature/reeb.c b/source/blender/editors/armature/reeb.c index 780dc8827c4..29ba72ce604 100644 --- a/source/blender/editors/armature/reeb.c +++ b/source/blender/editors/armature/reeb.c @@ -2558,10 +2558,10 @@ ReebGraph * generateReebGraph(EditMesh *em, int subdivisions) EditVert *eve; EditFace *efa; int index; - int totvert; - int totfaces; + /*int totvert;*/ #ifdef DEBUG_REEB + int totfaces; int countfaces = 0; #endif @@ -2569,8 +2569,10 @@ ReebGraph * generateReebGraph(EditMesh *em, int subdivisions) rg->resolution = subdivisions; - totvert = BLI_countlist(&em->verts); + /*totvert = BLI_countlist(&em->verts);*/ /*UNUSED*/ +#ifdef DEBUG_REEB totfaces = BLI_countlist(&em->faces); +#endif renormalizeWeight(em, 1.0f); @@ -2641,7 +2643,7 @@ void renormalizeWeight(EditMesh *em, float newmax) eve = em->verts.first; minimum = weightData(eve); maximum = minimum; - for(eve = em->verts.first; eve; eve = eve->next) + for(; eve; eve = eve->next) { maximum = MAX2(maximum, weightData(eve)); minimum = MIN2(minimum, weightData(eve)); |