From e17a708dce17c2d85cfecb1330278a47b4d1be19 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 6 May 2012 12:13:45 +0000 Subject: add back pose specials menu, also add back the ability to clear user transforms on all bones (not just selected - mango request - was possible in 2.4x). - rename only_select op property to only_selected (both were used). - only do mingw workaround when building with FREE_WINDOWS defined. --- source/blender/blenkernel/intern/library.c | 3 ++- source/blender/editors/armature/armature_ops.c | 3 +++ source/blender/editors/armature/poseobject.c | 8 ++++++-- source/blender/editors/mesh/editmesh_knife.c | 4 ++-- source/blender/editors/mesh/mesh_ops.c | 4 ++-- source/blender/makesrna/intern/rna_object.c | 5 ++++- 6 files changed, 19 insertions(+), 8 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 20444045c1c..bdd314f52f5 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -945,7 +945,8 @@ void free_main(Main *mainvar) ID *BKE_libblock_find_name(const short type, const char *name) /* type: "OB" or "MA" etc */ { - ListBase *lb= which_libbase(G.main, type); + ListBase *lb = which_libbase(G.main, type); + BLI_assert(lb != NULL); return BLI_findstring(lb, name, offsetof(ID, name) + 2); } diff --git a/source/blender/editors/armature/armature_ops.c b/source/blender/editors/armature/armature_ops.c index d7814e1eb4c..ab8bfb2b98a 100644 --- a/source/blender/editors/armature/armature_ops.c +++ b/source/blender/editors/armature/armature_ops.c @@ -402,5 +402,8 @@ void ED_keymap_armature(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "POSE_OT_push", EKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "POSE_OT_relax", EKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "POSE_OT_breakdown", EKEY, KM_PRESS, KM_SHIFT, 0); + + /* menus */ + WM_keymap_add_menu(keymap, "VIEW3D_MT_pose_specials", WKEY, KM_PRESS, 0, 0); } diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c index 2ed5421e8ba..8cc0251e024 100644 --- a/source/blender/editors/armature/poseobject.c +++ b/source/blender/editors/armature/poseobject.c @@ -2302,11 +2302,12 @@ void POSE_OT_quaternions_flip(wmOperatorType *ot) /* ********************************************** */ /* Clear User Transforms */ -static int pose_clear_user_transforms_exec (bContext *C, wmOperator *UNUSED(op)) +static int pose_clear_user_transforms_exec (bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Object *ob = CTX_data_active_object(C); float cframe = (float)CFRA; + const short only_select = RNA_boolean_get(op->ptr, "only_selected"); if ((ob->adt) && (ob->adt->action)) { /* XXX: this is just like this to avoid contaminating anything else; @@ -2329,7 +2330,7 @@ static int pose_clear_user_transforms_exec (bContext *C, wmOperator *UNUSED(op)) /* copy back values, but on selected bones only */ for (pchan = dummyPose->chanbase.first; pchan; pchan = pchan->next) { - pose_bone_do_paste(ob, pchan, 1, 0); + pose_bone_do_paste(ob, pchan, only_select, 0); } /* free temp data - free manually as was copied without constraints */ @@ -2373,5 +2374,8 @@ void POSE_OT_user_transforms_clear(wmOperatorType *ot) /* flags */ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; + + /* properties */ + RNA_def_boolean(ot->srna, "only_selected", TRUE, "Only Selected", "Only visible/selected bones"); } diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c index 57d7869d3db..5a99ddb9332 100644 --- a/source/blender/editors/mesh/editmesh_knife.c +++ b/source/blender/editors/mesh/editmesh_knife.c @@ -2785,7 +2785,7 @@ static int knifetool_init(bContext *C, wmOperator *op, int UNUSED(do_cut)) DerivedMesh *cage, *final; SmallHash shash; void *data[3]; - const short only_select = RNA_boolean_get(op->ptr, "only_select"); + const short only_select = RNA_boolean_get(op->ptr, "only_selected"); /* alloc new customdata */ kcd = op->customdata = MEM_callocN(sizeof(KnifeTool_OpData), "knifetool Modal Op Data"); @@ -3086,5 +3086,5 @@ void MESH_OT_knife_tool(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING; RNA_def_boolean(ot->srna, "use_occlude_geometry", TRUE, "Occlude Geometry", "Only cut the front most geometry"); - RNA_def_boolean(ot->srna, "only_select", FALSE, "Only Selected", "Only cut selected geometry"); + RNA_def_boolean(ot->srna, "only_selected", FALSE, "Only Selected", "Only cut selected geometry"); } diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c index e57285cca25..9789fd03222 100644 --- a/source/blender/editors/mesh/mesh_ops.c +++ b/source/blender/editors/mesh/mesh_ops.c @@ -353,11 +353,11 @@ void ED_keymap_mesh(wmKeyConfig *keyconf) kmi = WM_keymap_add_item(keymap, "MESH_OT_knife_tool", KKEY, KM_PRESS, 0, 0); RNA_boolean_set(kmi->ptr, "use_occlude_geometry", TRUE); - RNA_boolean_set(kmi->ptr, "only_select", FALSE); + RNA_boolean_set(kmi->ptr, "only_selected", FALSE); kmi = WM_keymap_add_item(keymap, "MESH_OT_knife_tool", KKEY, KM_PRESS, KM_SHIFT, 0); RNA_boolean_set(kmi->ptr, "use_occlude_geometry", FALSE); - RNA_boolean_set(kmi->ptr, "only_select", TRUE); + RNA_boolean_set(kmi->ptr, "only_selected", TRUE); WM_keymap_add_item(keymap, "OBJECT_OT_vertex_parent_set", PKEY, KM_PRESS, KM_CTRL, 0); diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index ca18eac8e60..3a1bf78ea29 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -384,8 +384,11 @@ static void rna_Object_parent_set(PointerRNA *ptr, PointerRNA value) Object *ob = (Object*)ptr->data; Object *par = (Object*)value.data; +#ifdef FREE_WINDOWS /* NOTE: this dummy check here prevents this method causing weird runtime errors on mingw 4.6.2 */ - if (ob) { + if (ob) +#endif + { ED_object_parent(ob, par, ob->partype, ob->parsubstr); } } -- cgit v1.2.3