Fix oso extension detection in the text editor
authorCampbell Barton <ideasman42@gmail.com>
Thu, 31 Oct 2019 14:46:18 +0000 (01:46 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 31 Oct 2019 14:48:35 +0000 (01:48 +1100)
release/scripts/startup/bl_ui/space_text.py

index 9e9ddcf350547be12b1a6ace686629c58e9cd201..81ccc9216a14eb827a081ac09cf8e94191157560 100644 (file)
@@ -57,7 +57,8 @@ class TEXT_HT_header(Header):
         syntax.prop(st, "show_syntax_highlight", text="")
 
         if text:
-            is_osl = text.name.endswith((".osl", ".osl"))
+            text_name = text.name
+            is_osl = text_name.endswith((".osl", ".oso"))
 
             row = layout.row()
             if is_osl:
@@ -65,7 +66,7 @@ class TEXT_HT_header(Header):
                 row.operator("node.shader_script_update")
             else:
                 row = layout.row()
-                row.active = text.name.endswith(".py")
+                row.active = text_name.endswith(".py")
                 row.prop(text, "use_module")
 
                 row = layout.row()