add templates menu for OSL, use preprocessor directive color for decorators in python.
authorCampbell Barton <ideasman42@gmail.com>
Sun, 30 Dec 2012 01:39:55 +0000 (01:39 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 30 Dec 2012 01:39:55 +0000 (01:39 +0000)
28 files changed:
release/scripts/startup/bl_ui/space_text.py
release/scripts/templates_py/addon_add_object.py [moved from release/scripts/templates/addon_add_object.py with 100% similarity]
release/scripts/templates_py/background_job.py [moved from release/scripts/templates/background_job.py with 100% similarity]
release/scripts/templates_py/batch_export.py [moved from release/scripts/templates/batch_export.py with 100% similarity]
release/scripts/templates_py/bmesh_simple.py [moved from release/scripts/templates/bmesh_simple.py with 100% similarity]
release/scripts/templates_py/bmesh_simple_editmode.py [moved from release/scripts/templates/bmesh_simple_editmode.py with 100% similarity]
release/scripts/templates_py/builtin_keyingset.py [moved from release/scripts/templates/builtin_keyingset.py with 100% similarity]
release/scripts/templates_py/driver_functions.py [moved from release/scripts/templates/driver_functions.py with 100% similarity]
release/scripts/templates_py/gamelogic.py [moved from release/scripts/templates/gamelogic.py with 100% similarity]
release/scripts/templates_py/gamelogic_module.py [moved from release/scripts/templates/gamelogic_module.py with 100% similarity]
release/scripts/templates_py/gamelogic_simple.py [moved from release/scripts/templates/gamelogic_simple.py with 100% similarity]
release/scripts/templates_py/operator_file_export.py [moved from release/scripts/templates/operator_file_export.py with 100% similarity]
release/scripts/templates_py/operator_file_import.py [moved from release/scripts/templates/operator_file_import.py with 100% similarity]
release/scripts/templates_py/operator_mesh_add.py [moved from release/scripts/templates/operator_mesh_add.py with 100% similarity]
release/scripts/templates_py/operator_modal.py [moved from release/scripts/templates/operator_modal.py with 100% similarity]
release/scripts/templates_py/operator_modal_draw.py [moved from release/scripts/templates/operator_modal_draw.py with 100% similarity]
release/scripts/templates_py/operator_modal_timer.py [moved from release/scripts/templates/operator_modal_timer.py with 100% similarity]
release/scripts/templates_py/operator_modal_view3d.py [moved from release/scripts/templates/operator_modal_view3d.py with 100% similarity]
release/scripts/templates_py/operator_modal_view3d_raycast.py [moved from release/scripts/templates/operator_modal_view3d_raycast.py with 100% similarity]
release/scripts/templates_py/operator_node.py [moved from release/scripts/templates/operator_node.py with 100% similarity]
release/scripts/templates_py/operator_simple.py [moved from release/scripts/templates/operator_simple.py with 100% similarity]
release/scripts/templates_py/operator_uv.py [moved from release/scripts/templates/operator_uv.py with 100% similarity]
release/scripts/templates_py/script_stub.py [moved from release/scripts/templates/script_stub.py with 100% similarity]
release/scripts/templates_py/ui_menu.py [moved from release/scripts/templates/ui_menu.py with 100% similarity]
release/scripts/templates_py/ui_menu_simple.py [moved from release/scripts/templates/ui_menu_simple.py with 100% similarity]
release/scripts/templates_py/ui_panel.py [moved from release/scripts/templates/ui_panel.py with 100% similarity]
release/scripts/templates_py/ui_panel_simple.py [moved from release/scripts/templates/ui_panel_simple.py with 100% similarity]
source/blender/editors/space_text/text_format_py.c

index b54fccf45f1853caf54bcd837b2e3554eaf408a8..5b7d6e69f4b6e305ed97855dcaf0b0e75a7c6877 100644 (file)
@@ -194,16 +194,35 @@ class TEXT_MT_text(Menu):
             layout.operator("text.run_script")
 
 
-class TEXT_MT_templates(Menu):
-    bl_label = "Templates"
+class TEXT_MT_templates_py(Menu):
+    bl_label = "Python"
+
+    def draw(self, context):
+        self.path_menu(bpy.utils.script_paths("templates_py"),
+                       "text.open",
+                       {"internal": True},
+                       )
+
+
+class TEXT_MT_templates_osl(Menu):
+    bl_label = "Open Shading Language"
 
     def draw(self, context):
-        self.path_menu(bpy.utils.script_paths("templates"),
+        self.path_menu(bpy.utils.script_paths("templates_osl"),
                        "text.open",
                        {"internal": True},
                        )
 
 
+class TEXT_MT_templates(Menu):
+    bl_label = "Templates"
+
+    def draw(self, context):
+        layout = self.layout
+        layout.menu("TEXT_MT_templates_py")
+        layout.menu("TEXT_MT_templates_osl")
+
+
 class TEXT_MT_edit_select(Menu):
     bl_label = "Select"
 
index a78dabbfb9b81664030d1c961551024785360935..d68d6ae0e7894758a57c0690424e57c60fee4806 100644 (file)
@@ -271,7 +271,7 @@ static void txtfmt_py_format_line(SpaceText *st, TextLine *line, const int do_ne
                                /* Special vars(v) or built-in keywords(b) */
                                if      ((i = txtfmt_py_find_specialvar(str))   != -1) prev = FMT_TYPE_SPECIAL;
                                else if ((i = txtfmt_py_find_builtinfunc(str))  != -1) prev = FMT_TYPE_KEYWORD;
-                               else if ((i = txtfmt_py_find_decorator(str))    != -1) prev = FMT_TYPE_SPECIAL;  /* could have a new color for this */
+                               else if ((i = txtfmt_py_find_decorator(str))    != -1) prev = FMT_TYPE_DIRECTIVE;
 
                                if (i > 0) {
                                        memset(fmt, prev, i);