diff --git a/io_coat3D/coat.py b/io_coat3D/coat.py index 4744611e1d67114e915f58d46769b9f6f8c9b0ba..0f3706cadb326e51d56bded7a8a4e33873868461 100644 --- a/io_coat3D/coat.py +++ b/io_coat3D/coat.py @@ -294,13 +294,14 @@ class SCENE_OT_import(bpy.types.Operator): act_first = bpy.context.scene.objects.active for act_name in test: if act_name.type == 'MESH' and os.path.isfile(act_name.coat3D.objectdir): + print('eihan tanne voi tulla') activeobj = act_name.name mat_list = [] scene.objects[activeobj].select = True objekti = scene.objects[activeobj] coat3D.loca = objekti.location coat3D.rota = objekti.rotation_euler - coa = bpy.context.scene.objects.active.coat3D + coa = act_name.coat3D exportfile = coat3D.exchangedir path3b_n = coat3D.exchangedir @@ -550,18 +551,52 @@ class VIEW3D_MT_Coat_Dynamic_Menu(bpy.types.Menu): ob = context if ob.mode == 'OBJECT': - - + layout.operator("import_applink.pilgway_3d_coat", text="Import") layout.separator() layout.operator("export_applink.pilgway_3d_coat", text="Export") layout.separator() + layout.menu("VIEW3D_MT_ImportMenu") + layout.separator() + + layout.menu("VIEW3D_MT_ExportMenu") + layout.separator() + layout.operator("import_applink.pilgway_3d_deltex",text="Delete Textures") layout.separator() + + layout.separator() + + +class VIEW3D_MT_ImportMenu(bpy.types.Menu): + bl_label = "Import Settings" + def draw(self, context): + layout = self.layout + coat3D = bpy.context.scene.coat3D + settings = context.tool_settings + layout.operator_context = 'INVOKE_REGION_WIN' + layout.prop(coat3D,"importmesh") + layout.prop(coat3D,"importmod") + layout.prop(coat3D,"smooth_on") + layout.prop(coat3D,"importtextures") + +class VIEW3D_MT_ExportMenu(bpy.types.Menu): + bl_label = "Export Settings" + + def draw(self, context): + layout = self.layout + coat3D = bpy.context.scene.coat3D + settings = context.tool_settings + layout.operator_context = 'INVOKE_REGION_WIN' + layout.prop(coat3D,"exportover") + if(coat3D.exportover): + layout.prop(coat3D,"exportmod") + layout.prop(coat3D,"exportfile") + layout.prop(coat3D,"export_pos") def register(): bpy.utils.register_module(__name__) diff --git a/io_coat3D/tex.py b/io_coat3D/tex.py index 3d2c9d51fd53af2a5a157df26506052e52593675..92e5dc729aa003e7c7a6417852991eba2ca361a1 100644 --- a/io_coat3D/tex.py +++ b/io_coat3D/tex.py @@ -68,7 +68,7 @@ def gettex(mat_list, objekti, scene,export): if tex_slot.texture.image is not None: tex_slot.texture.image.reload() else: - coa = bpy.context.scene.objects.active.coat3D + coa = objekti.coat3D nimi = objname(coa.objectdir) if(coa.texturefolder): osoite = os.path.dirname(coa.texturefolder) + os.sep