Pārlūkot izejas kodu

adding refresh_scripts.py

shuvit 6 gadus atpakaļ
vecāks
revīzija
e898994de4
1 mainītis faili ar 9 papildinājumiem un 0 dzēšanām
  1. 9
    0
      bpy_misc/refresh_scripts.py

+ 9
- 0
bpy_misc/refresh_scripts.py Parādīt failu

@@ -0,0 +1,9 @@
1
+reload_on = False #reload from external file or save all from internal
2
+import bpy
3
+area = bpy.context.area
4
+for text in bpy.data.texts:
5
+    area.spaces[0].text = text
6
+    if text.filepath != '' and reload_on == True:
7
+        bpy.ops.text.reload()
8
+    if text.filepath != '' and text.is_dirty:
9
+        bpy.ops.text.save()

Notiek ielāde…
Atcelt
Saglabāt