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>2011-10-15 22:10:40 +0400
committerKalle-Samuli Riihikoski <haikalle@gmail.com>2011-10-15 22:10:40 +0400
commit855de6d13b5345ce39359ef375a1f0fb7e5bcbc4 (patch)
tree71e80d9eec06a7d626d379d3ef7c311da76b765e /io_coat3D
parent5f7ba38178fca02d54b127df944cbd6e27246041 (diff)
Fixed pivot point move when using applink.
Diffstat (limited to 'io_coat3D')
-rw-r--r--io_coat3D/__init__.py2
-rw-r--r--io_coat3D/coat.py25
2 files changed, 21 insertions, 6 deletions
diff --git a/io_coat3D/__init__.py b/io_coat3D/__init__.py
index f051db3c..c5663d29 100644
--- a/io_coat3D/__init__.py
+++ b/io_coat3D/__init__.py
@@ -71,6 +71,8 @@ def register():
name="FilePath",
subtype="DIR_PATH",
)
+ cursor_loc = FloatVectorProperty(name="Cursor_loc",description="location")
+
exchangedir = StringProperty(
name="FilePath",
subtype="DIR_PATH"
diff --git a/io_coat3D/coat.py b/io_coat3D/coat.py
index 5eb05e7b..4a23603d 100644
--- a/io_coat3D/coat.py
+++ b/io_coat3D/coat.py
@@ -201,15 +201,17 @@ class SCENE_OT_export(bpy.types.Operator):
looking = False
coa.applink_name = checkname
- bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY', center='MEDIAN')
+
+ coat3D.cursor_loc = obj.location
+ coat3D.cursor_orginal = bpy.context.scene.cursor_location
+
+
coa.loc = obj.location
coa.rot = obj.rotation_euler
coa.sca = obj.scale
coa.dime = obj.dimensions
-
-
obj.location = (0,0,0)
obj.rotation_euler = (0,0,0)
obj.scale = (1,1,1)
@@ -217,11 +219,21 @@ class SCENE_OT_export(bpy.types.Operator):
bpy.ops.export_scene.obj(filepath=coa.applink_name,use_selection=True,
use_apply_modifiers=False,use_blen_objects=True, group_by_material= True,
use_materials = False,keep_vertex_order = True,axis_forward='X',axis_up='Y')
-
obj.location = coa.loc
obj.rotation_euler = coa.rot
obj.scale = coa.sca
+
+ bpy.context.scene.cursor_location = coat3D.cursor_loc
+
+
+
+
+ bpy.context.scene.cursor_location = coat3D.cursor_orginal
+
+
+
+
file = open(importfile, "w")
file.write("%s"%(checkname))
@@ -246,6 +258,7 @@ class SCENE_OT_import(bpy.types.Operator):
coat = bpy.coat3D
test = bpy.context.selected_objects
act_first = bpy.context.scene.objects.active
+ bpy.context.scene.game_settings.material_mode = 'GLSL'
for act_name in test:
coa = act_name.coat3D
@@ -320,8 +333,7 @@ class SCENE_OT_import(bpy.types.Operator):
mtl = mtl.replace('.obj','.mtl')
if(os.path.isfile(mtl)):
os.remove(mtl)
-
-
+
bpy.ops.import_scene.obj(filepath=path_object,axis_forward='X',axis_up='Y')
obj_proxy = scene.objects[0]
bpy.ops.object.select_all(action='TOGGLE')
@@ -357,6 +369,7 @@ class SCENE_OT_import(bpy.types.Operator):
bpy.ops.object.delete()
objekti.select = True
objekti.scale = coat3D.dime
+
bpy.context.scene.objects.active = objekti
if(os.path.isfile(path3b_n)):