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:
authorKalle-Samuli Riihikoski <haikalle@gmail.com>2020-10-13 17:49:39 +0300
committerKalle-Samuli Riihikoski <haikalle@gmail.com>2020-10-13 17:49:39 +0300
commit2c9bacef5323acac97f1d1ae2003ddfb56e71930 (patch)
treec5fa6e7cb6c54298ac264f31e1767e01a3a7b32a
parent3fe71eb650918b0c5b50fd7900e973c45f5569b8 (diff)
io_coat3D: parent scale included better when exporting
-rw-r--r--io_coat3D/__init__.py26
1 files changed, 25 insertions, 1 deletions
diff --git a/io_coat3D/__init__.py b/io_coat3D/__init__.py
index 1fe5a6f9..5d3e05d3 100644
--- a/io_coat3D/__init__.py
+++ b/io_coat3D/__init__.py
@@ -304,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 = []
@@ -511,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
@@ -742,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'}