2.5
authorTon Roosendaal <ton@blender.org>
Sun, 1 Feb 2009 18:07:02 +0000 (18:07 +0000)
committerTon Roosendaal <ton@blender.org>
Sun, 1 Feb 2009 18:07:02 +0000 (18:07 +0000)
Hrmf, I try to make a local operator-only commit possible, but I
keep finding other small todos :)

- added two more standard poll callbacks for pose and armature
- fixed operator naming in editmesh_mods.c

source/blender/editors/include/ED_screen.h
source/blender/editors/mesh/editmesh_mods.c
source/blender/editors/screen/screen_ops.c

index 5c3e0272677eb26fb4fa54ecebb565cc82cd453b..00740b20b4c4cff03a24316e2b5bfa19e6bf9daf 100644 (file)
@@ -107,8 +107,11 @@ int                ED_operator_sequencer_active(struct bContext *C);
 
 int            ED_operator_object_active(struct bContext *C);
 int            ED_operator_editmesh(struct bContext *C);
+int            ED_operator_editarmature(struct bContext *C);
 int            ED_operator_editcurve(struct bContext *C);
 int            ED_operator_uvedit(struct bContext *C);
+int            ED_operator_posemode(struct bContext *C);
+
 
 /* default keymaps, bitflags */
 #define ED_KEYMAP_UI           1
index 76866a259b0bf4c896e72a0006af754e75e8a414..6d445245ae8be543925371619aa357acc248f5e5 100644 (file)
@@ -2265,7 +2265,7 @@ static int select_linked_exec(bContext *C, wmOperator *op)
 void MESH_OT_select_linked(wmOperatorType *ot)
 {
        /* identifiers */
-       ot->name= "Select All of the Connected Mesh";
+       ot->name= "Select Linked All";
        ot->idname= "MESH_OT_select_linked";
        
        /* api callbacks */
@@ -2361,7 +2361,7 @@ static int select_linked_pick_invoke(bContext *C, wmOperator *op, wmEvent *event
 void MESH_OT_select_linked_pick(wmOperatorType *ot)
 {
        /* identifiers */
-       ot->name= "Select Connected Mesh";
+       ot->name= "Select Linked";
        ot->idname= "MESH_OT_select_linked_pick";
        
        /* api callbacks */
@@ -2482,7 +2482,7 @@ void selectconnected_delimit_mesh_all(ViewContext *vc)
        
        
 /* swap is 0 or 1, if 1 it hides not selected */
-void hide_mesh(EditMesh *em, int swap)
+static void hide_mesh(EditMesh *em, int swap)
 {
        EditVert *eve;
        EditEdge *eed;
@@ -2589,11 +2589,7 @@ static int hide_mesh_exec(bContext *C, wmOperator *op)
        Object *obedit= CTX_data_edit_object(C);
        EditMesh *em= ((Mesh *)obedit->data)->edit_mesh;
        
-       /* 'standard' behaviour - check if selected, then apply relevant selection */
-       if (RNA_boolean_get(op->ptr, "swap"))
-               hide_mesh(em,1);
-       else
-               hide_mesh(em,0);
+       hide_mesh(em, RNA_boolean_get(op->ptr, "invert"));
                
        WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
        return OPERATOR_FINISHED;       
@@ -2602,7 +2598,7 @@ static int hide_mesh_exec(bContext *C, wmOperator *op)
 void MESH_OT_hide(wmOperatorType *ot)
 {
        /* identifiers */
-       ot->name= "Hide vertice or Hide All of the Mesh";
+       ot->name= "Hide Selection";
        ot->idname= "MESH_OT_hide";
        
        /* api callbacks */
@@ -2613,7 +2609,7 @@ void MESH_OT_hide(wmOperatorType *ot)
        ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* props */
-       RNA_def_boolean(ot->srna, "swap", 0, "Swap", "");
+       RNA_def_boolean(ot->srna, "invert", 0, "Invert", "");
 }
 
 void reveal_mesh(EditMesh *em)
@@ -2666,7 +2662,7 @@ static int reveal_mesh_exec(bContext *C, wmOperator *op)
 void MESH_OT_reveal(wmOperatorType *ot)
 {
        /* identifiers */
-       ot->name= "Reveal the Mesh";
+       ot->name= "Reveal Hidden";
        ot->idname= "MESH_OT_reveal";
        
        /* api callbacks */
@@ -4165,7 +4161,7 @@ static int righthandfaces_exec(bContext *C, wmOperator *op)
 void MESH_OT_consistant_normals(wmOperatorType *ot)
 {
        /* identifiers */
-       ot->name= "Make Normals consistant";
+       ot->name= "Make Normals Consistant";
        ot->idname= "MESH_OT_consistant_normals";
        
        /* api callbacks */
index 66eda54f3da91db063e762ddc82fe134972ed98c..5473fdf101e94a97c4a072562e4e60fb0af6d5a4 100644 (file)
@@ -38,6 +38,7 @@
 #include "BKE_screen.h"
 #include "BKE_utildefines.h"
 
+#include "DNA_armature_types.h"
 #include "DNA_object_types.h"
 #include "DNA_mesh_types.h"
 #include "DNA_curve_types.h"
@@ -164,6 +165,23 @@ int ED_operator_editmesh(bContext *C)
        return 0;
 }
 
+int ED_operator_editarmature(bContext *C)
+{
+       Object *obedit= CTX_data_edit_object(C);
+       if(obedit && obedit->type==OB_ARMATURE)
+               return NULL != ((bArmature *)obedit->data)->edbo;
+       return 0;
+}
+
+int ED_operator_posemode(bContext *C)
+{
+       Object *obact= CTX_data_active_object(C);
+       if(obact && obact->type==OB_ARMATURE)
+               return (obact->flag & OB_POSEMODE)!=0;
+       return 0;
+}
+
+
 int ED_operator_uvedit(bContext *C)
 {
        Object *obedit= CTX_data_edit_object(C);