Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVilem Duha <vilem.duha@gmail.com>2019-05-29 16:01:01 +0300
committerVilem Duha <vilem.duha@gmail.com>2019-06-01 19:49:18 +0300
commit85fd48c32cbdb42f81b26bfb81d411d83e0898b0 (patch)
treebef0f8366dbe1aca4953cad20e87051468c36651 /blenderkit/bg_blender.py
parent88d0e75f1f35af1ea208565a6eb187162ed8451b (diff)
BlenderKit: convert all imports to importlib
+ new Oauth script version (finished in next commit) +split login/signup buttons
Diffstat (limited to 'blenderkit/bg_blender.py')
-rw-r--r--blenderkit/bg_blender.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/blenderkit/bg_blender.py b/blenderkit/bg_blender.py
index f1681831..4a7afd92 100644
--- a/blenderkit/bg_blender.py
+++ b/blenderkit/bg_blender.py
@@ -16,6 +16,12 @@
#
# ##### END GPL LICENSE BLOCK #####
+if "bpy" in locals():
+ from importlib import reload
+
+ utils = reload(utils)
+else:
+ from blenderkit import utils
import bpy
import sys, threading, os
@@ -25,8 +31,6 @@ from bpy.props import (
EnumProperty,
)
-from blenderkit import utils
-
bg_processes = []
@@ -112,19 +116,19 @@ def bg_update():
# readthread.
if tcom.error:
estring = tcom.eval_path_computing + ' = False'
- exec (estring)
+ exec(estring)
tcom.lasttext = tcom.outtext
if tcom.outtext != '':
tcom.outtext = ''
estring = tcom.eval_path_state + ' = tcom.lasttext'
- exec (estring)
+ exec(estring)
# print(tcom.lasttext)
if 'finished successfully' in tcom.lasttext:
bg_processes.remove(p)
estring = tcom.eval_path_computing + ' = False'
- exec (estring)
+ exec(estring)
else:
readthread = threading.Thread(target=threadread, args=([tcom]), daemon=True)
readthread.start()
@@ -205,7 +209,7 @@ class KillBgProcess(bpy.types.Operator):
kill = True
if kill:
estring = tcom.eval_path_computing + ' = False'
- exec (estring)
+ exec(estring)
processes.remove(p)
tcom.proc.kill()