[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [56305] trunk/blender: Fix a few more cases where an operator should not show in the search menu.

Brecht Van Lommel brechtvanlommel at pandora.be
Fri Apr 26 04:44:22 CEST 2013


Revision: 56305
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=56305
Author:   blendix
Date:     2013-04-26 02:44:21 +0000 (Fri, 26 Apr 2013)
Log Message:
-----------
Fix a few more cases where an operator should not show in the search menu.

Modified Paths:
--------------
    trunk/blender/release/scripts/startup/bl_operators/console.py
    trunk/blender/release/scripts/startup/bl_operators/freestyle.py
    trunk/blender/source/blender/editors/animation/drivers.c
    trunk/blender/source/blender/editors/animation/keyframing.c
    trunk/blender/source/blender/editors/space_image/image_ops.c
    trunk/blender/source/blender/editors/space_logic/logic_ops.c

Modified: trunk/blender/release/scripts/startup/bl_operators/console.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_operators/console.py	2013-04-26 02:29:31 UTC (rev 56304)
+++ trunk/blender/release/scripts/startup/bl_operators/console.py	2013-04-26 02:44:21 UTC (rev 56305)
@@ -34,6 +34,10 @@
     bl_idname = "console.execute"
     bl_label = "Console Execute"
 
+    @classmethod
+    def poll(cls, context):
+        return (context.area and context.area.type == 'CONSOLE')
+
     def execute(self, context):
         sc = context.space_data
 
@@ -54,6 +58,10 @@
     bl_idname = "console.autocomplete"
     bl_label = "Console Autocomplete"
 
+    @classmethod
+    def poll(cls, context):
+        return (context.area and context.area.type == 'CONSOLE')
+
     def execute(self, context):
         sc = context.space_data
         module = _lang_module_get(sc)
@@ -72,6 +80,10 @@
     bl_idname = "console.copy_as_script"
     bl_label = "Copy to Clipboard (as script)"
 
+    @classmethod
+    def poll(cls, context):
+        return (context.area and context.area.type == 'CONSOLE')
+
     def execute(self, context):
         sc = context.space_data
 
@@ -91,6 +103,10 @@
     bl_idname = "console.banner"
     bl_label = "Console Banner"
 
+    @classmethod
+    def poll(cls, context):
+        return (context.area and context.area.type == 'CONSOLE')
+
     def execute(self, context):
         sc = context.space_data
 
@@ -119,6 +135,10 @@
             maxlen=32,
             )
 
+    @classmethod
+    def poll(cls, context):
+        return (context.area and context.area.type == 'CONSOLE')
+
     def execute(self, context):
         sc = context.space_data
 

Modified: trunk/blender/release/scripts/startup/bl_operators/freestyle.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_operators/freestyle.py	2013-04-26 02:29:31 UTC (rev 56304)
+++ trunk/blender/release/scripts/startup/bl_operators/freestyle.py	2013-04-26 02:44:21 UTC (rev 56305)
@@ -27,6 +27,7 @@
     """(either a user-specified object or the active camera)"""
     bl_idname = "scene.freestyle_fill_range_by_selection"
     bl_label = "Fill Range by Selection"
+    bl_options = {'INTERNAL'}
 
     type = EnumProperty(name="Type", description="Type of the modifier to work on",
                         items=(("COLOR", "Color", "Color modifier type"),

Modified: trunk/blender/source/blender/editors/animation/drivers.c
===================================================================
--- trunk/blender/source/blender/editors/animation/drivers.c	2013-04-26 02:29:31 UTC (rev 56304)
+++ trunk/blender/source/blender/editors/animation/drivers.c	2013-04-26 02:44:21 UTC (rev 56305)
@@ -513,7 +513,7 @@
 	//op->poll = ??? // TODO: need to have some animatable property to do this
 	
 	/* flags */
-	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL;
 
 	/* properties */
 	RNA_def_boolean(ot->srna, "all", 1, "All", "Create drivers for all elements of the array");
@@ -563,7 +563,7 @@
 	//op->poll = ??? // TODO: need to have some driver to be able to do this...
 	
 	/* flags */
-	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL;
 
 	/* properties */
 	RNA_def_boolean(ot->srna, "all", 1, "All", "Delete drivers for all elements of the array");
@@ -610,7 +610,7 @@
 	//op->poll = ??? // TODO: need to have some driver to be able to do this...
 	
 	/* flags */
-	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL;
 }
 
 /* Paste Driver Button Operator ------------------------ */
@@ -654,7 +654,7 @@
 	//op->poll = ??? // TODO: need to have some driver to be able to do this...
 	
 	/* flags */
-	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL;
 }
 
 /* ************************************************** */

Modified: trunk/blender/source/blender/editors/animation/keyframing.c
===================================================================
--- trunk/blender/source/blender/editors/animation/keyframing.c	2013-04-26 02:29:31 UTC (rev 56304)
+++ trunk/blender/source/blender/editors/animation/keyframing.c	2013-04-26 02:44:21 UTC (rev 56305)
@@ -1663,7 +1663,7 @@
 	ot->poll = modify_key_op_poll;
 	
 	/* flags */
-	ot->flag = OPTYPE_UNDO;
+	ot->flag = OPTYPE_UNDO | OPTYPE_INTERNAL;
 
 	/* properties */
 	RNA_def_boolean(ot->srna, "all", 1, "All", "Insert a keyframe for all element of the array");
@@ -1733,7 +1733,7 @@
 	ot->poll = modify_key_op_poll;
 	
 	/* flags */
-	ot->flag = OPTYPE_UNDO;
+	ot->flag = OPTYPE_UNDO | OPTYPE_INTERNAL;
 
 	/* properties */
 	RNA_def_boolean(ot->srna, "all", 1, "All", "Delete keyframes from all elements of the array");
@@ -1802,7 +1802,7 @@
 	ot->poll = modify_key_op_poll;
 
 	/* flags */
-	ot->flag = OPTYPE_UNDO;
+	ot->flag = OPTYPE_UNDO | OPTYPE_INTERNAL;
 
 	/* properties */
 	RNA_def_boolean(ot->srna, "all", 1, "All", "Clear keyframes from all elements of the array");

Modified: trunk/blender/source/blender/editors/space_image/image_ops.c
===================================================================
--- trunk/blender/source/blender/editors/space_image/image_ops.c	2013-04-26 02:29:31 UTC (rev 56304)
+++ trunk/blender/source/blender/editors/space_image/image_ops.c	2013-04-26 02:44:21 UTC (rev 56305)
@@ -1091,7 +1091,7 @@
 	ot->exec = image_match_len_exec;
 
 	/* flags */
-	ot->flag = OPTYPE_REGISTER /* | OPTYPE_UNDO */; /* Don't think we need undo for that. */
+	ot->flag = OPTYPE_REGISTER | OPTYPE_INTERNAL/* | OPTYPE_UNDO */; /* Don't think we need undo for that. */
 }
 
 /******************** replace image operator ********************/

Modified: trunk/blender/source/blender/editors/space_logic/logic_ops.c
===================================================================
--- trunk/blender/source/blender/editors/space_logic/logic_ops.c	2013-04-26 02:29:31 UTC (rev 56304)
+++ trunk/blender/source/blender/editors/space_logic/logic_ops.c	2013-04-26 02:44:21 UTC (rev 56305)
@@ -269,7 +269,7 @@
 	ot->poll = edit_sensor_poll;
 	
 	/* flags */
-	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL;
 	edit_sensor_properties(ot);
 }
 
@@ -326,7 +326,7 @@
 	ot->poll = ED_operator_object_active_editable;
 	
 	/* flags */
-	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL;
 	
 	/* properties */
 	ot->prop = prop = RNA_def_enum(ot->srna, "type", DummyRNA_NULL_items, SENS_ALWAYS, "Type", "Type of sensor to add");
@@ -375,7 +375,7 @@
 	ot->poll = edit_controller_poll;
 	
 	/* flags */
-	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL;
 	edit_controller_properties(ot);
 }
 
@@ -446,7 +446,7 @@
 	ot->poll = ED_operator_object_active_editable;
 	
 	/* flags */
-	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL;
 	
 	/* properties */
 	ot->prop = RNA_def_enum(ot->srna, "type", controller_type_items, CONT_LOGIC_AND, "Type", "Type of controller to add");
@@ -494,7 +494,7 @@
 	ot->poll = edit_actuator_poll;
 	
 	/* flags */
-	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL;
 	edit_actuator_properties(ot);
 }
 
@@ -551,7 +551,7 @@
 	ot->poll = ED_operator_object_active_editable;
 	
 	/* flags */
-	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL;
 	
 	/* properties */
 	ot->prop = prop = RNA_def_enum(ot->srna, "type", DummyRNA_NULL_items, CONT_LOGIC_AND, "Type", "Type of actuator to add");
@@ -608,7 +608,7 @@
 	ot->poll = edit_sensor_poll;
 	
 	/* flags */
-	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL;
 	
 	/* properties */
 	edit_sensor_properties(ot);
@@ -653,7 +653,7 @@
 	ot->poll = edit_controller_poll;
 	
 	/* flags */
-	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL;
 	
 	/* properties */
 	edit_controller_properties(ot);
@@ -698,7 +698,7 @@
 	ot->poll = edit_actuator_poll;
 	
 	/* flags */
-	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL;
 	
 	/* properties */
 	edit_actuator_properties(ot);




More information about the Bf-blender-cvs mailing list