[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18785] branches/blender2.5/blender/source /blender/editors: 2.5

Ton Roosendaal ton at blender.org
Sun Feb 1 19:07:05 CET 2009


Revision: 18785
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18785
Author:   ton
Date:     2009-02-01 19:07:02 +0100 (Sun, 01 Feb 2009)

Log Message:
-----------
2.5

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

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/editors/include/ED_screen.h
    branches/blender2.5/blender/source/blender/editors/mesh/editmesh_mods.c
    branches/blender2.5/blender/source/blender/editors/screen/screen_ops.c

Modified: branches/blender2.5/blender/source/blender/editors/include/ED_screen.h
===================================================================
--- branches/blender2.5/blender/source/blender/editors/include/ED_screen.h	2009-02-01 17:33:10 UTC (rev 18784)
+++ branches/blender2.5/blender/source/blender/editors/include/ED_screen.h	2009-02-01 18:07:02 UTC (rev 18785)
@@ -107,9 +107,12 @@
 
 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
 #define ED_KEYMAP_VIEW2D	2

Modified: branches/blender2.5/blender/source/blender/editors/mesh/editmesh_mods.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/mesh/editmesh_mods.c	2009-02-01 17:33:10 UTC (rev 18784)
+++ branches/blender2.5/blender/source/blender/editors/mesh/editmesh_mods.c	2009-02-01 18:07:02 UTC (rev 18785)
@@ -2265,7 +2265,7 @@
 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 @@
 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 @@
 	
 	
 /* 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 @@
 	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 @@
 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 @@
 	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 @@
 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 @@
 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 */

Modified: branches/blender2.5/blender/source/blender/editors/screen/screen_ops.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/screen/screen_ops.c	2009-02-01 17:33:10 UTC (rev 18784)
+++ branches/blender2.5/blender/source/blender/editors/screen/screen_ops.c	2009-02-01 18:07:02 UTC (rev 18785)
@@ -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 @@
 	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);





More information about the Bf-blender-cvs mailing list