Newer
Older
bpy.ops.object.select_all(action='DESELECT')
obj_proxy.select_set(True)
bpy.ops.object.select_all(action='TOGGLE')
if objekti.coat3D.applink_firsttime == True and objekti.coat3D.type == 'vox':
objekti.select_set(True)
objekti.rotation_euler[0] = 1.5708
objekti.rotation_euler[2] = 1.5708
bpy.ops.object.transforms_to_deltas(mode='ROT')
bpy.ops.object.transforms_to_deltas(mode='SCALE')
objekti.coat3D.applink_firsttime = False
objekti.select_set(False)
elif objekti.coat3D.applink_firsttime == True:
objekti.scale = (objekti.scale[0]/objekti.coat3D.applink_scale[0],objekti.scale[1]/objekti.coat3D.applink_scale[1],objekti.scale[2]/objekti.coat3D.applink_scale[2])
#bpy.ops.object.transforms_to_deltas(mode='SCALE')
if(objekti.coat3D.applink_onlyone == False):
objekti.rotation_euler = (0,0,0)
objekti.coat3D.applink_firsttime = False
if(coat3D.importlevel):
obj_proxy.select = True
obj_proxy.modifiers.new(name='temp',type='MULTIRES')
objekti.select = True
bpy.ops.object.multires_reshape(modifier=multires_name)
bpy.ops.object.select_all(action='TOGGLE')
else:
bpy.context.view_layer.objects.active = obj_proxy
keep_materials_count = len(obj_proxy.material_slots) - len(objekti.material_slots)
#delete_materials_from_end(keep_materials_count, obj_proxy)
updatemesh(objekti,obj_proxy, texturelist)
bpy.context.view_layer.objects.active = objekti
#it is important to get the object translated correctly
Kalle-Samuli Riihikoski
committed
objekti.select_set(True)
Kalle-Samuli Riihikoski
committed
if (use_smooth):
for data_mesh in objekti.data.polygons:
data_mesh.use_smooth = True
else:
for data_mesh in objekti.data.polygons:
data_mesh.use_smooth = False
Kalle-Samuli Riihikoski
committed
bpy.ops.object.select_all(action='DESELECT')
Kalle-Samuli Riihikoski
committed
if(coat3D.importmesh and not(os.path.isfile(objekti.coat3D.applink_address))):
coat3D.importmesh = False
Kalle-Samuli Riihikoski
committed
objekti.select_set(True)
if(coat3D.importtextures):
is_new = False
if(objekti.coat3D.retopo == False):
tex.matlab(objekti,mat_list,texturelist,is_new)
objekti.select_set(False)
else:
mat_list = []
if (objekti.material_slots):
for obj_mat in objekti.material_slots:
mat_list.append(obj_mat.material)
Kalle-Samuli Riihikoski
committed
if (coat3D.importtextures):
is_new = False
if(objekti.coat3D.retopo == False):
tex.matlab(objekti,mat_list,texturelist, is_new)
objekti.select_set(False)
Kalle-Samuli Riihikoski
committed
if(coat3D.remove_path == True):
if(os.path.isfile(path3b_n)):
os.remove(path3b_n)
coat3D.remove_path = False
Kalle-Samuli Riihikoski
committed
bpy.ops.object.select_all(action='DESELECT')
if(import_list):
for del_obj in diff_objects:
Kalle-Samuli Riihikoski
committed
if(bpy.context.collection.all_objects[del_obj].coat3D.type == 'vox' and bpy.context.collection.all_objects[del_obj].coat3D.delete_proxy_mesh == False):
bpy.context.collection.all_objects[del_obj].select_set(True)
objekti = bpy.context.collection.all_objects[del_obj]
#bpy.ops.object.transforms_to_deltas(mode='ROT')
objekti.scale = (1, 1, 1)
bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY')
Kalle-Samuli Riihikoski
committed
objekti.data.coat3D.name = '3DC'
Kalle-Samuli Riihikoski
committed
objekti.coat3D.objecttime = str(os.path.getmtime(objekti.coat3D.applink_address))
objekti.coat3D.applink_name = objekti.name
objekti.coat3D.applink_mesh = True
objekti.coat3D.import_mesh = False
Kalle-Samuli Riihikoski
committed
#bpy.ops.object.transforms_to_deltas(mode='SCALE')
objekti.coat3D.applink_firsttime = False
bpy.context.collection.all_objects[del_obj].select_set(False)
Kalle-Samuli Riihikoski
committed
else:
bpy.context.collection.all_objects[del_obj].select_set(True)
bpy.data.objects.remove(bpy.data.objects[del_obj])
if (coat3D.bring_retopo or coat3D.bring_retopo_path):
if(os.path.isfile(coat3D.bring_retopo_path)):
bpy.ops.import_scene.fbx(filepath=coat3D.bring_retopo_path, global_scale=1, axis_forward='X', use_custom_normals=False)
os.remove(coat3D.bring_retopo_path)
kokeilu = coat3D.exchangeFolder[:-9]
Blender_folder2 = ("%s%sExchange" % (kokeilu, os.sep))
Blender_folder2 += ('%sexport.txt' % (os.sep))
if (os.path.isfile(Blender_folder2)):
os.remove(Blender_folder2)
def blender_3DC(texturelist, new_applink_address):
bpy.ops.object.select_all(action='DESELECT')
for old_obj in bpy.context.collection.objects:
old_obj.coat3D.applink_old = True
coat3D = bpy.context.scene.coat3D
Blender_folder = ("%s%sBlender"%(coat3D.exchangeFolder,os.sep))
Blender_export = Blender_folder
path3b_now = coat3D.exchangeFolder + os.sep
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
path3b_now += ('last_saved_3b_file.txt')
Blender_export += ('%sexport.txt'%(os.sep))
mat_list = []
osoite_3b = ''
if (os.path.isfile(path3b_now)):
path3b_fil = open(path3b_now)
for lin in path3b_fil:
osoite_3b = lin
path3b_fil.close()
head, tail = os.path.split(osoite_3b)
just_3b_name = tail
os.remove(path3b_now)
create_collection = True
for collection in bpy.data.collections:
if collection.name == 'Applink_Objects':
create_collection = False
if create_collection:
bpy.data.collections.new('Applink_Objects')
coll_items = bpy.context.scene.collection.children.items()
add_applink_collection = True
for coll in coll_items:
if coll[0] == 'Applink_Objects':
add_applink_collection = False
if add_applink_collection:
bpy.context.scene.collection.children.link(bpy.data.collections['Applink_Objects'])
bpy.context.view_layer.active_layer_collection = bpy.context.view_layer.layer_collection.children['Applink_Objects']
old_materials = bpy.data.materials.keys()
old_objects = bpy.data.objects.keys()
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
bpy.ops.import_scene.fbx(filepath=new_applink_address, global_scale = 1, axis_forward='-Z', axis_up='Y')
new_materials = bpy.data.materials.keys()
new_objects = bpy.data.objects.keys()
diff_mat = [i for i in new_materials if i not in old_materials]
diff_objects = [i for i in new_objects if i not in old_objects]
for mark_mesh in diff_mat:
bpy.data.materials[mark_mesh].coat3D.name = '3DC'
bpy.data.materials[mark_mesh].use_fake_user = True
laskuri = 0
index = 0
facture_object = False
for c_index in diff_objects:
bpy.data.objects[c_index].data.coat3D.name = '3DC'
laskuri += 1
if(laskuri == 2 and c_index == ('vt_' + diff_objects[0])):
facture_object = True
print('Facture object founded!!')
#bpy.ops.object.transforms_to_deltas(mode='SCALE')
bpy.ops.object.select_all(action='DESELECT')
for new_obj in bpy.context.collection.objects:
if(new_obj.coat3D.applink_old == False):
new_obj.select_set(True)
new_obj.coat3D.applink_firsttime = False
new_obj.select_set(False)
new_obj.coat3D.type = 'ppp'
new_obj.coat3D.applink_address = new_applink_address
new_obj.coat3D.applink_mesh = True
new_obj.coat3D.objecttime = str(os.path.getmtime(new_obj.coat3D.applink_address))
new_obj.coat3D.applink_name = new_obj.name
index = index + 1
bpy.context.view_layer.objects.active = new_obj
new_obj.coat3D.applink_export = True
if (os.path.isfile(osoite_3b)):
mesh_time = os.path.getmtime(new_obj.coat3D.applink_address)
b_time = os.path.getmtime(osoite_3b)
if (abs(mesh_time-b_time) < 240):
new_obj.coat3D.applink_3b_path = osoite_3b
new_obj.coat3D.applink_3b_just_name = just_3b_name
mat_list.append(new_obj.material_slots[0].material)
is_new = True
if(facture_object):
texVR.matlab(new_obj, mat_list, texturelist, is_new)
else:
tex.matlab(new_obj, mat_list, texturelist, is_new)
mat_list.pop()
for new_obj in bpy.context.collection.objects:
if(new_obj.coat3D.applink_old == False):
new_obj.coat3D.applink_old = True
kokeilu = coat3D.exchangeFolder[:-10]
Blender_folder2 = ("%s%sExchange%sBlender" % (kokeilu, os.sep, os.sep))
Blender_folder2 += ('%sexport.txt' % (os.sep))
if (os.path.isfile(Blender_export)):
os.remove(Blender_export)
if (os.path.isfile(Blender_folder2)):
os.remove(Blender_folder2)
for material in bpy.data.materials:
if material.use_nodes == True:
for node in material.node_tree.nodes:
if (node.name).startswith('3DC'):
node.location = node.location
def workflow1(ExportFolder):
coat3D = bpy.context.scene.coat3D
texturelist = make_texture_list(ExportFolder)
for texturepath in texturelist:
for image in bpy.data.images:
if(image.filepath == texturepath[3] and image.users == 0):
bpy.data.images.remove(image)
path3b_now = coat3D.exchangeFolder
path3b_now += ('last_saved_3b_file.txt')
new_applink_address = 'False'
new_object = False
new_ref_object = False
exportfile3 = coat3D.exchangeFolder
exportfile3 += ('%sexport.txt' % (os.sep))
if(os.path.isfile(exportfile3)):
obj_pathh = open(exportfile3)
for line in obj_pathh:
new_applink_address = line
break
obj_pathh.close()
for scene_objects in bpy.context.collection.all_objects:
if(scene_objects.type == 'MESH'):
if(scene_objects.coat3D.applink_address == new_applink_address and scene_objects.coat3D.type == 'ref'):
scene_objects.coat3D.type == ''
new_ref_object = True
nimi = scene_objects.name
exportfile = coat3D.exchangeFolder
exportfile += ('%sBlender' % (os.sep))
exportfile += ('%sexport.txt' % (os.sep))
if (os.path.isfile(exportfile)):
os.remove(exportfile)
if(new_ref_object):
new_ref_function(new_applink_address, nimi)
blender_3DC_blender(texturelist, new_applink_address)
def workflow2(BlenderFolder):
coat3D = bpy.context.scene.coat3D
texturelist = make_texture_list(BlenderFolder)
for texturepath in texturelist:
for image in bpy.data.images:
if(image.filepath == texturepath[3] and image.users == 0):
bpy.data.images.remove(image)
kokeilu = coat3D.exchangeFolder
Blender_export = os.path.join(kokeilu, 'Blender')
path3b_now = coat3D.exchangeFolder
path3b_now += ('last_saved_3b_file.txt')
Blender_export += ('%sexport.txt'%(os.sep))
new_applink_address = 'False'
new_object = False
new_ref_object = False
if(os.path.isfile(Blender_export)):
obj_pathh = open(Blender_export)
new_object = True
for line in obj_pathh:
new_applink_address = line
break
obj_pathh.close()
for scene_objects in bpy.context.collection.all_objects:
if(scene_objects.type == 'MESH'):
if(scene_objects.coat3D.applink_address == new_applink_address):
new_object = False
exportfile = coat3D.exchangeFolder
exportfile += ('%sBlender' % (os.sep))
exportfile += ('%sexport.txt' % (os.sep))
if (os.path.isfile(exportfile)):
os.remove(exportfile)
if(new_ref_object):
new_ref_function(new_applink_address, nimi)
else:
blender_3DC(texturelist, new_applink_address)
from bpy import *
from mathutils import Vector, Matrix
bl_label = "3D-Coat Applink"
bl_region_type = "UI"
@classmethod
def poll(cls, context):
if bpy.context.mode == 'OBJECT':
return True
else:
return False
def draw(self, context):
layout = self.layout
coat3D = bpy.context.scene.coat3D
global foundExchangeFolder
if(foundExchangeFolder == False):
row.label(text="Applink didn't find your 3d-Coat/Exchange folder.")
row.label(text="Please select it before using Applink.")
row.prop(coat3D,"exchangeFolder",text="")
row = layout.row()
row.operator("update_exchange_folder.pilgway_3d_coat", text="Apply folder")
else:
#Here you add your GUI
row = layout.row()
row.prop(coat3D,"type",text = "")
flow = layout.grid_flow(row_major=True, columns=0, even_columns=False, even_rows=False, align=True)
row.operator("export_applink.pilgway_3d_coat", text="Send")
row.operator("getback.pilgway_3d_coat", text="GetBack")
class ObjectButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "object"
class SCENE_PT_Settings(ObjectButtonsPanel,bpy.types.Panel):
bl_label = "3D-Coat Applink Settings"
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "scene"
def draw(self, context):
pass
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
class MaterialButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "material"
class SCENE_PT_Material(MaterialButtonsPanel,bpy.types.Panel):
bl_label = "3D-Coat Applink"
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "material"
def draw(self, context):
pass
class SCENE_PT_Material_Import(MaterialButtonsPanel, bpy.types.Panel):
bl_label = "Import Textures:"
bl_parent_id = "SCENE_PT_Material"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
def draw(self, context):
layout = self.layout
layout.use_property_split = False
coat3D = bpy.context.active_object.active_material
layout.active = True
flow = layout.grid_flow(row_major=True, columns=0, even_columns=False, even_rows=False, align=True)
col = flow.column()
col.prop(coat3D, "coat3D_diffuse", text="Diffuse")
Kalle-Samuli Riihikoski
committed
col.prop(coat3D, "coat3D_metalness", text="Metalness")
col.prop(coat3D, "coat3D_roughness", text="Roughness")
col.prop(coat3D, "coat3D_ao", text="AO")
col = flow.column()
col.prop(coat3D, "coat3D_normal", text="NormalMap")
col.prop(coat3D, "coat3D_displacement", text="Displacement")
col.prop(coat3D, "coat3D_emissive", text="Emissive")
col.prop(coat3D, "coat3D_alpha", text="Alpha")
class SCENE_PT_Settings_Update(ObjectButtonsPanel, bpy.types.Panel):
bl_label = "Update"
bl_parent_id = "SCENE_PT_Settings"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
def draw(self, context):
layout = self.layout
layout.use_property_split = False
coat3D = bpy.context.scene.coat3D
layout.active = True
flow = layout.grid_flow(row_major=True, columns=0, even_columns=False, even_rows=False, align=True)
col = flow.column()
col.prop(coat3D, "importmesh", text="Update Mesh/UV")
col = flow.column()
col.prop(coat3D, "createnodes", text="Create Extra Nodes")
col = flow.column()
col.prop(coat3D, "importtextures", text="Update Textures")
col = flow.column()
col.prop(coat3D, "exportmod", text="Export with modifiers")
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
class SCENE_PT_Bake_Settings(ObjectButtonsPanel, bpy.types.Panel):
bl_label = "Bake"
bl_parent_id = "SCENE_PT_Settings"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
def draw(self, context):
layout = self.layout
layout.use_property_split = False
coat3D = bpy.context.scene.coat3D
layout.active = True
flow = layout.grid_flow(row_major=True, columns=0, even_columns=False, even_rows=False, align=True)
col = flow.column()
col.prop(coat3D, "bake_resolution", text="Resolution")
col = flow.column()
col.prop(coat3D, "bake_diffuse", text="Diffuse")
col = flow.column()
col.prop(coat3D, "bake_ao", text="AO")
col = flow.column()
col.prop(coat3D, "bake_normal", text="Normal")
col = flow.column()
col.prop(coat3D, "bake_roughness", text="Roughness")
class SCENE_PT_Settings_Folders(ObjectButtonsPanel, bpy.types.Panel):
bl_label = "Folders"
bl_parent_id = "SCENE_PT_Settings"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
def draw(self, context):
layout = self.layout
layout.use_property_split = False
coat3D = bpy.context.scene.coat3D
layout.active = True
flow = layout.grid_flow(row_major=True, columns=0, even_columns=False, even_rows=False, align=True)
col = flow.column()
col.prop(coat3D, "exchangeFolder", text="Exchange folder")
col.operator("save_new_export.pilgway_3d_coat", text="Save new Exchange folder")
col = flow.column()
col.prop(coat3D, "defaultfolder", text="Object/Texture folder")
Kalle-Samuli Riihikoski
committed
col = flow.column()
col.prop(coat3D, "folder_size", text="Max count in Applink folder")
Kalle-Samuli Riihikoski
committed
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
class SCENE_PT_Settings_DeleteNodes(ObjectButtonsPanel, bpy.types.Panel):
bl_label = "Delete 3DC nodes from selected..."
bl_parent_id = "SCENE_PT_Settings"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
def draw(self, context):
layout = self.layout
layout.use_property_split = False
coat3D = bpy.context.scene.coat3D
layout.active = True
flow = layout.grid_flow(row_major=True, columns=0, even_columns=False, even_rows=False, align=True)
col = flow.column()
col.operator("delete_material_nodes.pilgway_3d_coat", text="Material")
col.operator("delete_object_nodes.pilgway_3d_coat", text="Object(s)")
col = flow.column()
col.operator("delete_collection_nodes.pilgway_3d_coat", text="Collection")
col.operator("delete_scene_nodes.pilgway_3d_coat", text="Scene")
Kalle-Samuli Riihikoski
committed
Kalle-Samuli Riihikoski
committed
col = flow.column()
col.prop(coat3D, "delete_images", text="Delete nodes images")
Kalle-Samuli Riihikoski
committed
# 3D-Coat Dynamic Menu
class VIEW3D_MT_Coat_Dynamic_Menu(bpy.types.Menu):
bl_label = "3D-Coat Applink Menu"
def draw(self, context):
layout = self.layout
layout.operator_context = 'INVOKE_REGION_WIN'
ob = context
if ob.mode == 'OBJECT':
if(len(context.selected_objects) > 0):
Kalle-Samuli Riihikoski
committed
layout.operator("import_applink.pilgway_3d_coat",
text="Update Scene")
Kalle-Samuli Riihikoski
committed
layout.operator("export_applink.pilgway_3d_coat",
text="Transfer to 3D-Coat")
Kalle-Samuli Riihikoski
committed
if(context.selected_objects[0].coat3D.applink_3b_path != ''):
Kalle-Samuli Riihikoski
committed
layout.operator("open_3dcoat.pilgway_3d_coat",
text="Open " +context.selected_objects[0].coat3D.applink_3b_just_name)
Kalle-Samuli Riihikoski
committed
layout.operator("import_applink.pilgway_3d_coat",
text="Update Scene")
Kalle-Samuli Riihikoski
committed
if (len(context.selected_objects) > 0):
layout.operator("delete_material_nodes.pilgway_3d_coat",
text="Delete 3D-Coat nodes from active material")
layout.operator("delete_object_nodes.pilgway_3d_coat",
text="Delete 3D-Coat nodes from selected objects")
Kalle-Samuli Riihikoski
committed
layout.operator("delete_collection_nodes.pilgway_3d_coat",
Kalle-Samuli Riihikoski
committed
text="Delete 3D-Coat nodes from active collection")
layout.operator("delete_scene_nodes.pilgway_3d_coat",
Kalle-Samuli Riihikoski
committed
text="Delete all 3D-Coat nodes")
layout.separator()
class ObjectCoat3D(PropertyGroup):
obj_mat: StringProperty(
name="Object_Path",
default=''
)
applink_address: StringProperty(
name="Object_Applink_address"
)
Kalle-Samuli Riihikoski
committed
applink_index: StringProperty(
name="Object_Applink_address"
)
applink_3b_path: StringProperty(
name="Object_3B_Path"
)
applink_name: StringProperty(
name="Applink object name"
)
applink_3b_just_name: StringProperty(
name="Applink object name"
)
applink_firsttime: BoolProperty(
name="FirstTime",
description="FirstTime",
default=True
)
Kalle-Samuli Riihikoski
committed
retopo: BoolProperty(
name="Retopo object",
description="Retopo object",
default=False
)
delete_proxy_mesh: BoolProperty(
name="FirstTime",
description="FirstTime",
default=False
)
applink_onlyone: BoolProperty(
name="FirstTime",
description="FirstTime",
default=False
)
type: StringProperty(
name="type",
description="shows type",
default=''
)
import_mesh: BoolProperty(
name="ImportMesh",
description="ImportMesh",
default=False
)
applink_mesh: BoolProperty(
name="ImportMesh",
description="ImportMesh",
default=False
)
applink_old: BoolProperty(
name="OldObject",
description="Old Object",
default=False
)
applink_export: BoolProperty(
name="FirstTime",
description="Object is from 3d-ocat",
default=False
)
objecttime: StringProperty(
name="ObjectTime",
subtype="FILE_PATH"
)
path3b: StringProperty(
name="3B Path",
subtype="FILE_PATH"
dime: FloatVectorProperty(
name="dime",
description="Dimension"
)
applink_scale: FloatVectorProperty(
name="Scale",
description="Scale"
)
class SceneCoat3D(PropertyGroup):
defaultfolder: StringProperty(
name="FilePath",
subtype="DIR_PATH",
)
Kalle-Samuli Riihikoski
committed
deleteMode: StringProperty(
name="FilePath",
subtype="DIR_PATH",
default=''
)
coat3D_exe: StringProperty(
name="FilePath",
exchangeFolder: StringProperty(
name="FilePath",
subtype="DIR_PATH"
)
bring_retopo: BoolProperty(
name="Import window",
description="Allows to skip import dialog",
default=False
)
foundExchangeFolder: BoolProperty(
name="found Exchange Folder",
description="found Exchange folder",
Kalle-Samuli Riihikoski
committed
delete_images: BoolProperty(
name="Import window",
description="Allows to skip import dialog",
default=True
)
bring_retopo_path: StringProperty(
name="FilePath",
subtype="DIR_PATH",
)
remove_path: BoolProperty(
name="Import window",
description="Allows to skip import dialog",
default=False
)
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
exchange_found: BoolProperty(
name="Exchange Found",
description="Alert if Exchange folder is not found",
default=True
)
exportfile: BoolProperty(
name="No Import File",
description="Add Modifiers and export",
default=False
)
importmod: BoolProperty(
name="Remove Modifiers",
description="Import and add modifiers",
default=False
)
exportmod: BoolProperty(
name="Modifiers",
description="Export modifiers",
default=False
)
importtextures: BoolProperty(
name="Bring Textures",
description="Import Textures",
default=True
)
createnodes: BoolProperty(
name="Bring Textures",
description="Import Textures",
default=True
)
importlevel: BoolProperty(
name="Multires. Level",
description="Bring Specific Multires Level",
default=False
)
importmesh: BoolProperty(
name="Mesh",
description="Import Mesh",
default=True
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
)
# copy location
loca: FloatVectorProperty(
name="location",
description="Location",
subtype="XYZ",
default=(0.0, 0.0, 0.0)
)
rota: FloatVectorProperty(
name="location",
description="Location",
subtype="EULER",
default=(0.0, 0.0, 0.0)
)
scal: FloatVectorProperty(
name="location",
description="Location",
subtype="XYZ",
default=(0.0, 0.0, 0.0)
)
dime: FloatVectorProperty(
name="dimension",
description="Dimension",
subtype="XYZ",
default=(0.0, 0.0, 0.0)
)
type: EnumProperty(
name="Export Type",
description="Different Export Types",
items=(("ppp", "Per-Pixel Painting", ""),
("mv", "Microvertex Painting", ""),
("ptex", "Ptex Painting", ""),
("uv", "UV-Mapping", ""),
("ref", "Reference Mesh", ""),
("retopo", "Retopo mesh as new layer", ""),
("vox", "Mesh As Voxel Object", ""),
("alpha", "Mesh As New Pen Alpha", ""),
("prim", "Mesh As Voxel Primitive", ""),
("curv", "Mesh As a Curve Profile", ""),
("autopo", "Mesh For Auto-retopology", ""),
("update", "Update mesh/uvs", ""),
),
default="ppp"
)
bake_resolution: EnumProperty(
name="Bake Resolution",
description="Bake resolution",
items=(("res_64", "64 x 64", ""),
("res_128", "128 x 128", ""),
("res_256", "256 x 256", ""),
("res_512", "512 x 512", ""),
("res_1024", "1024 x 1024", ""),
("res_2048", "2048 x 2048", ""),
("res_4096", "4096 x 4096", ""),
("res_8192", "8192 x 8192", ""),
),
default="res_1024"
)
Kalle-Samuli Riihikoski
committed
folder_size: EnumProperty(
name="Applink folder size",
description="Applink folder size",
Kalle-Samuli Riihikoski
committed
items=(("10", "10", ""),
("100", "100", ""),
("500", "500", ""),
("1000", "1000", ""),
("5000", "5000", ""),
("10000", "10000", ""),
),
default="500"
)
bake_textures: BoolProperty(
name="Bake all textures",
description="Add Modifiers and export",
default=False
)
bake_diffuse: BoolProperty(
name="Bake diffuse texture",
description="Add Modifiers and export",
default=False
)
bake_ao: BoolProperty(
name="Bake AO texture",
description="Add Modifiers and export",
default=False
)
bake_roughness: BoolProperty(
name="Bake roughness texture",
description="Add Modifiers and export",
default=False
)
Kalle-Samuli Riihikoski
committed
bake_metalness: BoolProperty(
name="Bake metalness texture",
description="Add Modifiers and export",
default=False
)
bake_emissive: BoolProperty(
name="Bake emissive texture",
description="Add Modifiers and export",
default=False
)
bake_normal: BoolProperty(
name="Bake normal texture",
description="Add Modifiers and export",
default=False
)
bake_displacement: BoolProperty(
name="Bake displacement",
description="Add Modifiers and export",
default=False
)
class MeshCoat3D(PropertyGroup):
applink_address: StringProperty(
name="ApplinkAddress",
# subtype="APPLINK_ADDRESS",
class MaterialCoat3D(PropertyGroup):
name: StringProperty(
name="ApplinkAddress",
# subtype="APPLINK_ADDRESS",
)
bring_diffuse: BoolProperty(
name="Import diffuse texture",
description="Import diffuse texture",
default=True
)
bring_metalness: BoolProperty(
name="Import diffuse texture",
description="Import diffuse texture",
)
bring_roughness: BoolProperty(
name="Import diffuse texture",
description="Import diffuse texture",
default=True
)
bring_normal: BoolProperty(
name="Import diffuse texture",
description="Import diffuse texture",
default=True
)
bring_displacement: BoolProperty(
name="Import diffuse texture",
description="Import diffuse texture",
default=True
)
bring_emissive: BoolProperty(
name="Import diffuse texture",
description="Import diffuse texture",
default=True
bring_gloss: BoolProperty(
name="Import diffuse texture",
description="Import diffuse texture",
default=True
)
classes = (
SCENE_PT_Main,
SCENE_PT_Material,
SCENE_PT_Settings_Update,
SCENE_PT_Bake_Settings,
Kalle-Samuli Riihikoski
committed
SCENE_PT_Settings_DeleteNodes,
SCENE_PT_Settings_Folders,
SCENE_PT_Material_Import,
SCENE_OT_folder,
Kalle-Samuli Riihikoski
committed
SCENE_OT_delete_material_nodes,
SCENE_OT_delete_object_nodes,
SCENE_OT_delete_collection_nodes,
SCENE_OT_delete_scene_nodes,
ObjectCoat3D,
SceneCoat3D,
MaterialCoat3D,
bpy.types.Material.coat3D_diffuse = BoolProperty(
name="Import diffuse texture",
description="Import diffuse texture",
default=True
)
bpy.types.Material.coat3D_roughness = BoolProperty(
name="Import diffuse texture",
description="Import diffuse texture",
default=True
)
Kalle-Samuli Riihikoski
committed
bpy.types.Material.coat3D_metalness = BoolProperty(
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
name="Import diffuse texture",
description="Import diffuse texture",
default=True
)
bpy.types.Material.coat3D_normal = BoolProperty(
name="Import diffuse texture",
description="Import diffuse texture",
default=True
)
bpy.types.Material.coat3D_displacement = BoolProperty(
name="Import diffuse texture",
description="Import diffuse texture",
default=True
)
bpy.types.Material.coat3D_emissive = BoolProperty(
name="Import diffuse texture",
description="Import diffuse texture",
default=True
)
bpy.types.Material.coat3D_ao = BoolProperty(
name="Import diffuse texture",
description="Import diffuse texture",
default=True
)
bpy.types.Material.coat3D_alpha = BoolProperty(
name="Import alpha texture",
description="Import alpha texture",
default=True
)
bpy.types.Material.coat3D_gloss = BoolProperty(
name="Import alpha texture",
description="Import alpha texture",
default=True
)
from bpy.utils import register_class
for cls in classes:
register_class(cls)