Skip to content
Snippets Groups Projects
Commit 8b9e2e0f authored by Kalle-Samuli Riihikoski's avatar Kalle-Samuli Riihikoski
Browse files

-complete applink dynamic menu.

-fixed the bug when two or more objects dosen't have materials.
parent 40786f09
No related branches found
No related tags found
No related merge requests found
...@@ -294,13 +294,14 @@ class SCENE_OT_import(bpy.types.Operator): ...@@ -294,13 +294,14 @@ class SCENE_OT_import(bpy.types.Operator):
act_first = bpy.context.scene.objects.active act_first = bpy.context.scene.objects.active
for act_name in test: for act_name in test:
if act_name.type == 'MESH' and os.path.isfile(act_name.coat3D.objectdir): if act_name.type == 'MESH' and os.path.isfile(act_name.coat3D.objectdir):
print('eihan tanne voi tulla')
activeobj = act_name.name activeobj = act_name.name
mat_list = [] mat_list = []
scene.objects[activeobj].select = True scene.objects[activeobj].select = True
objekti = scene.objects[activeobj] objekti = scene.objects[activeobj]
coat3D.loca = objekti.location coat3D.loca = objekti.location
coat3D.rota = objekti.rotation_euler coat3D.rota = objekti.rotation_euler
coa = bpy.context.scene.objects.active.coat3D coa = act_name.coat3D
exportfile = coat3D.exchangedir exportfile = coat3D.exchangedir
path3b_n = coat3D.exchangedir path3b_n = coat3D.exchangedir
...@@ -550,18 +551,52 @@ class VIEW3D_MT_Coat_Dynamic_Menu(bpy.types.Menu): ...@@ -550,18 +551,52 @@ class VIEW3D_MT_Coat_Dynamic_Menu(bpy.types.Menu):
ob = context ob = context
if ob.mode == 'OBJECT': if ob.mode == 'OBJECT':
layout.operator("import_applink.pilgway_3d_coat", text="Import") layout.operator("import_applink.pilgway_3d_coat", text="Import")
layout.separator() layout.separator()
layout.operator("export_applink.pilgway_3d_coat", text="Export") layout.operator("export_applink.pilgway_3d_coat", text="Export")
layout.separator() 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.operator("import_applink.pilgway_3d_deltex",text="Delete Textures")
layout.separator() 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(): def register():
bpy.utils.register_module(__name__) bpy.utils.register_module(__name__)
......
...@@ -68,7 +68,7 @@ def gettex(mat_list, objekti, scene,export): ...@@ -68,7 +68,7 @@ def gettex(mat_list, objekti, scene,export):
if tex_slot.texture.image is not None: if tex_slot.texture.image is not None:
tex_slot.texture.image.reload() tex_slot.texture.image.reload()
else: else:
coa = bpy.context.scene.objects.active.coat3D coa = objekti.coat3D
nimi = objname(coa.objectdir) nimi = objname(coa.objectdir)
if(coa.texturefolder): if(coa.texturefolder):
osoite = os.path.dirname(coa.texturefolder) + os.sep osoite = os.path.dirname(coa.texturefolder) + os.sep
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment