Merge branch 'master' into xr-actions-D9124
This commit is contained in:
commit
e4a2da3720
|
@ -72,24 +72,29 @@ def every_3_seconds():
|
|||
global liveUpdate
|
||||
global mTime
|
||||
global foundExchangeFolder
|
||||
coat3D = bpy.context.scene.coat3D
|
||||
try:
|
||||
coat3D = bpy.context.scene.coat3D
|
||||
|
||||
|
||||
if(foundExchangeFolder == False):
|
||||
foundExchangeFolder, global_exchange_folder = folders.InitFolders()
|
||||
if(foundExchangeFolder == False):
|
||||
foundExchangeFolder, global_exchange_folder = folders.InitFolders()
|
||||
|
||||
Export_folder = coat3D.exchangeFolder
|
||||
Export_folder += ('%sexport.txt' % (os.sep))
|
||||
Export_folder = coat3D.exchangeFolder
|
||||
Export_folder += ('%sexport.txt' % (os.sep))
|
||||
|
||||
if (os.path.isfile(Export_folder) and mTime != os.path.getmtime(Export_folder)):
|
||||
if (os.path.isfile(Export_folder) and mTime != os.path.getmtime(Export_folder)):
|
||||
|
||||
for objekti in bpy.data.objects:
|
||||
if(objekti.coat3D.applink_mesh):
|
||||
tex.updatetextures(objekti)
|
||||
for objekti in bpy.data.objects:
|
||||
if(objekti.coat3D.applink_mesh):
|
||||
tex.updatetextures(objekti)
|
||||
|
||||
mTime = os.path.getmtime(Export_folder)
|
||||
|
||||
if (os.path.normpath(global_exchange_folder) != os.path.normpath(coat3D.exchangeFolder) and coat3D.exchangeFolder != ''):
|
||||
folders.updateExchangeFile(coat3D.exchangeFolder)
|
||||
mTime = os.path.getmtime(Export_folder)
|
||||
|
||||
if (os.path.normpath(global_exchange_folder) != os.path.normpath(coat3D.exchangeFolder) and coat3D.exchangeFolder != ''):
|
||||
folders.updateExchangeFile(coat3D.exchangeFolder)
|
||||
|
||||
except:
|
||||
pass
|
||||
|
||||
return 3.0
|
||||
|
||||
|
@ -261,12 +266,12 @@ class SCENE_OT_folder(bpy.types.Operator):
|
|||
bl_options = {'UNDO'}
|
||||
|
||||
def invoke(self, context, event):
|
||||
global foundExchangeFolder
|
||||
coat3D = bpy.context.scene.coat3D
|
||||
if(os.path.isdir(coat3D.exchangeFolder)):
|
||||
coat3D.exchange_found = True
|
||||
#bpy.coat3D['status'] = 1
|
||||
foundExchangeFolder= True
|
||||
else:
|
||||
coat3D.exchange_found = False
|
||||
foundExchangeFolder = False
|
||||
|
||||
return {'FINISHED'}
|
||||
|
||||
|
@ -299,6 +304,27 @@ class SCENE_OT_opencoat(bpy.types.Operator):
|
|||
|
||||
return {'FINISHED'}
|
||||
|
||||
def scaleParents():
|
||||
save = []
|
||||
names =[]
|
||||
|
||||
for objekti in bpy.context.selected_objects:
|
||||
temp = objekti
|
||||
while (temp.parent is not None and temp.parent.name not in names):
|
||||
save.append([temp.parent,(temp.parent.scale[0],temp.parent.scale[1],temp.parent.scale[2])])
|
||||
names.append(temp.parent)
|
||||
temp = temp.parent
|
||||
|
||||
for name in names:
|
||||
name.scale = (1,1,1)
|
||||
|
||||
return save
|
||||
|
||||
def scaleBackParents(save):
|
||||
|
||||
for data in save:
|
||||
data[0].scale = data[1]
|
||||
|
||||
def deleteNodes(type):
|
||||
|
||||
deletelist = []
|
||||
|
@ -506,6 +532,8 @@ class SCENE_OT_export(bpy.types.Operator):
|
|||
if (export_ok == False):
|
||||
return {'FINISHED'}
|
||||
|
||||
scaled_objects = scaleParents()
|
||||
|
||||
activeobj = bpy.context.active_object.name
|
||||
checkname = ''
|
||||
coa = bpy.context.active_object.coat3D
|
||||
|
@ -737,7 +765,8 @@ class SCENE_OT_export(bpy.types.Operator):
|
|||
if(mat_list == '__' + objekti.name):
|
||||
for ind, mat in enumerate(mod_mat_list[mat_list]):
|
||||
objekti.material_slots[mod_mat_list[mat_list][ind][0]].material = mod_mat_list[mat_list][ind][1]
|
||||
|
||||
|
||||
scaleBackParents(scaled_objects)
|
||||
bpy.context.scene.render.engine = active_render
|
||||
return {'FINISHED'}
|
||||
|
||||
|
@ -1324,6 +1353,7 @@ class SCENE_PT_Main(bpy.types.Panel):
|
|||
def draw(self, context):
|
||||
layout = self.layout
|
||||
coat3D = bpy.context.scene.coat3D
|
||||
global foundExchangeFolder
|
||||
|
||||
if(foundExchangeFolder == False):
|
||||
row = layout.row()
|
||||
|
@ -1946,6 +1976,8 @@ def register():
|
|||
default=True
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
from bpy.utils import register_class
|
||||
for cls in classes:
|
||||
|
@ -1979,7 +2011,6 @@ def unregister():
|
|||
bpy.types.Material.coat3D_displacement
|
||||
bpy.types.Material.coat3D_emissive
|
||||
bpy.types.Material.coat3D_alpha
|
||||
del bpy.coat3D
|
||||
|
||||
kc = bpy.context.window_manager.keyconfigs.addon
|
||||
if kc:
|
||||
|
|
|
@ -22,7 +22,7 @@ bl_info = {
|
|||
"name": "Collection Manager",
|
||||
"description": "Manage collections and their objects",
|
||||
"author": "Ryan Inch",
|
||||
"version": (2, 15, 2),
|
||||
"version": (2, 15, 3),
|
||||
"blender": (2, 80, 0),
|
||||
"location": "View3D - Object Mode (Shortcut - M)",
|
||||
"warning": '', # used for warning icon and text in addons panel
|
||||
|
|
|
@ -670,6 +670,7 @@ class CMSendReport(Operator):
|
|||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
col = layout.column(align=True)
|
||||
|
||||
first = True
|
||||
string = ""
|
||||
|
@ -677,10 +678,10 @@ class CMSendReport(Operator):
|
|||
for num, char in enumerate(self.message):
|
||||
if char == "\n":
|
||||
if first:
|
||||
layout.row().label(text=string, icon='ERROR')
|
||||
col.row(align=True).label(text=string, icon='ERROR')
|
||||
first = False
|
||||
else:
|
||||
layout.row().label(text=string, icon='BLANK1')
|
||||
col.row(align=True).label(text=string, icon='BLANK1')
|
||||
|
||||
string = ""
|
||||
continue
|
||||
|
@ -688,9 +689,9 @@ class CMSendReport(Operator):
|
|||
string = string + char
|
||||
|
||||
if first:
|
||||
layout.row().label(text=string, icon='ERROR')
|
||||
col.row(align=True).label(text=string, icon='ERROR')
|
||||
else:
|
||||
layout.row().label(text=string, icon='BLANK1')
|
||||
col.row(align=True).label(text=string, icon='BLANK1')
|
||||
|
||||
def invoke(self, context, event):
|
||||
wm = context.window_manager
|
||||
|
|
Loading…
Reference in New Issue