Scripting Live-Link 📜

Thanks for your hard work.

Hey thanks !
but you can thank me once we got the #EXECUTE feature working.

Ok i will.:wink:

i cracked the #execute problem with the help of kiao. im using it for my scripts right now. it’s god damn powerful. i hope the blender institute will let me make this addon official. it make a kinda universal link with any other script editor. (there’s just the step of finding script path which is annoying).

4 Likes

Okay. Finished.

UPTDATE

  • #EXECUTE is now working perfectly, with 3 scripts live-linked simultaneously.
    • It can not work with addon if __name__ == "__main__": register() which is really nice for working on an addon.
  • if your addon is too complex to be used with if __name__ == "__main__": register() you may directly register it inside of blender with the addon realod operator.
    • personally i’m not working with .zip format with multiples scripts for one addon. so right now this operator will only work for one file .py addon format. Please let me know if .zip support important for you. i think i can automate a whole folder to .zip + auto addon reg.
  • i dropped the .blend text editor live link. as it is totally useless. i get that it’s cool but i find not utility in this. It’s worth nothing now that #EXECUTE is here. If you don’t agree with that let me know.
  • you have now the possibility of executing only some part of your script. for example:
    • #EXECUTE[5] will only execute line 5
    • #EXECUTE[5:55] will only execute lines 5 to 55
    • #EXECUTE[5:10][15:16][36] will only execute lines 5 to 10 + 15 to 16 +36

This is really useful. i tested it myself, as there’s no need to use a whole new file to do some testing.
it will also generate a ScriptName_script_cut.py file. let me know if i should automatically delete him after execution.

I could do an alternate way of doing this like #EXECUTE BELOW and #STOP directly inside of the script ? what do you think ? is this better ? i think i’ll do that right now. ?

Script-LiveLink_V17.py (21.3 KB)

i had some def attribute problem in the script so there’s some horrible def repetition. it was kind of tricky to get one def working for the three custom slots at the same time. so i had to made one def per slot which is stupid. but well it is working. #don’t judge me please

1 Like

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




Script-LiveLink_V19.py (19.7 KB)

Thanks again! :slightly_smiling_face:

1 Like

@Elreenys let me know for potential feedbacks, do you use Sublime too ? or something else ?

Until now, I’m using VS code, but I was looking for a solution to use sublime.

1 Like

Cool ! let me know how you like it (both)
i will share my library of Snippets once they are in the 50’s

1 Like

It’s definitively my fav addon :heart:
Just one thing, you should add an how to install it in text form, the video is a bit fast.

Sorry.

i will, in the meanwhile it’s really simple:

1)install the addon .py
2)set up a text editor (always open) and go in the T or N panel. find out my addon category.
3)just set your script path. you can set 3 scripts simultaneously.
4) use #EXECUTE in the first line of your script and every time you save the script will be automatically run inside of blender.

2 Likes

I succeed to use it but if others wants to try it, they’ll have instructions.
It’s CTR + T in the scripting tab to open the sidebar.

1 Like

What is the Addon Reloader is for in the menu?

It will’ automatically de-install/re-install and enable an addon you are working on.

1 Like

Thanks I will give it try.

1 Like

I have test a bit and :

  • if I work on panel, there is no update (no new property is draw)
  • I got this error when I try to disable the addon

Exception in module unregister(): ‘/home/elreenys/.config/blender/2.80/scripts/addons/Script-LiveLink_V19.py’
Traceback (most recent call last):
File “/mnt/55197c6b-14c8-49a8-a69e-286fbfc7ebdb/Blender build/blender-2.80-linux-glibc217-x86_64/2.80/scripts/modules/addon_utils.py”, line 437, in disable
mod.unregister()
File “/home/elreenys/.config/blender/2.80/scripts/addons/Script-LiveLink_V19.py”, line 430, in unregister
bpy.app.timers.unregister(poll_text1)
ValueError: Error: function is not registered

Error: Traceback (most recent call last):
File “/mnt/55197c6b-14c8-49a8-a69e-286fbfc7ebdb/Blender build/blender-2.80-linux-glibc217-x86_64/2.80/scripts/modules/addon_utils.py”, line 437, in disable
mod.unregister()
File “/home/elreenys/.config/blender/2.80/scripts/addons/Script-LiveLink_V19.py”, line 430, in unregister
bpy.app.timers.unregister(poll_text1)
ValueError: Error: function is not registered

the error message is not important, it’s just that i’m trying to remove a timer something that doesn’t exist yet. I will correct that for update v20.

can i get the file that you cannot draw ? i’d like to see it for myself please, hard to tell witouth it.

It’s just a test panel. If I add or remove an element, there is no sync.
test_panel.py (2.1 KB)

1 Like

UPDATE

  • Corrected an unreg bug (small error msg) . as @Elreenys reported to me above.
  • an addon debug system is set in place as a checkbox. it is only for controlling if your link is working properly. you’ll see the activity of every timer and handler check.
  • now #STOP in the first line will stop the livelink from your editor.

Script-LiveLink_V21.py (23.3 KB)

1 Like