UPDATE
I Replaced the custom execution system !
if #EXECUTE_CUSTOM
is in the firsl line instead of simply #EXECUTE
it will only execute lines between EXECUTE_START
and EXECUTE_STOP
here’s some examples:
Example Script 1=
#EXECUTE
print(1)
print(2)
print(3)
Output:
1
2
3
Example Script 2=
#EXECUTE_CUSTOM
print(1)
#EXECUTE_START
print(2)
#EXECUTE_STOP
print(3)
print(4)
#EXECUTE_START
print(5)
Output:
2
5
#EXECUTE_START
can also crop indentation for you
Example Script 3=
#EXECUTE_CUSTOM
def my_super_complex_def():
if blabla == True:
if 'hello' not in manywow:
#EXECUTE_START
print('very')
print('wow')
print('such')
print('handy')
#EXECUTE_STOP
Cutted script file will be this:
print('very')
print('wow')
print('such')
print('handy')
Output:
very
wow
such
handy
Keep in mind that all the modules, def, and defined objects will not magically be working if not within the boundaries of the custom execution.
#EXECUTE_CUSTOM
import bpy
C = bpy.context
name = "Monkey"
print(4)
print(5)
#EXECUTE_START
C.object.name = name
#EXECUTE_STOP
print(3)
print(4)
print(5)
Output = Error