forked from bartvdbraak/blender
reduce imports on startup
This commit is contained in:
parent
e60a33ba07
commit
ffaebe2237
@ -369,7 +369,6 @@ def reset_all(reload_scripts=False):
|
|||||||
Sets the addon state based on the user preferences.
|
Sets the addon state based on the user preferences.
|
||||||
"""
|
"""
|
||||||
import sys
|
import sys
|
||||||
import imp
|
|
||||||
|
|
||||||
# RELEASE SCRIPTS: official scripts distributed in Blender releases
|
# RELEASE SCRIPTS: official scripts distributed in Blender releases
|
||||||
paths_list = paths()
|
paths_list = paths()
|
||||||
@ -381,6 +380,7 @@ def reset_all(reload_scripts=False):
|
|||||||
|
|
||||||
# first check if reload is needed before changing state.
|
# first check if reload is needed before changing state.
|
||||||
if reload_scripts:
|
if reload_scripts:
|
||||||
|
import imp
|
||||||
mod = sys.modules.get(mod_name)
|
mod = sys.modules.get(mod_name)
|
||||||
if mod:
|
if mod:
|
||||||
imp.reload(mod)
|
imp.reload(mod)
|
||||||
|
@ -27,8 +27,6 @@ from bpy.props import (StringProperty,
|
|||||||
EnumProperty,
|
EnumProperty,
|
||||||
)
|
)
|
||||||
|
|
||||||
from rna_prop_ui import rna_idprop_ui_prop_get, rna_idprop_ui_prop_clear
|
|
||||||
|
|
||||||
from bpy.app.translations import pgettext_tip as tip_
|
from bpy.app.translations import pgettext_tip as tip_
|
||||||
|
|
||||||
|
|
||||||
@ -1029,6 +1027,8 @@ class WM_OT_properties_edit(Operator):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
|
from rna_prop_ui import rna_idprop_ui_prop_get, rna_idprop_ui_prop_clear
|
||||||
|
|
||||||
data_path = self.data_path
|
data_path = self.data_path
|
||||||
value = self.value
|
value = self.value
|
||||||
prop = self.property
|
prop = self.property
|
||||||
@ -1080,6 +1080,8 @@ class WM_OT_properties_edit(Operator):
|
|||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
def invoke(self, context, event):
|
def invoke(self, context, event):
|
||||||
|
from rna_prop_ui import rna_idprop_ui_prop_get
|
||||||
|
|
||||||
data_path = self.data_path
|
data_path = self.data_path
|
||||||
|
|
||||||
if not data_path:
|
if not data_path:
|
||||||
@ -1109,6 +1111,8 @@ class WM_OT_properties_add(Operator):
|
|||||||
data_path = rna_path
|
data_path = rna_path
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
|
from rna_prop_ui import rna_idprop_ui_prop_get
|
||||||
|
|
||||||
data_path = self.data_path
|
data_path = self.data_path
|
||||||
item = eval("context.%s" % data_path)
|
item = eval("context.%s" % data_path)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user