Updated to use Blender 4.3.2
This commit is contained in:
parent
0cc8beb830
commit
3e066bbe64
@ -2,7 +2,7 @@ bl_info = {
|
|||||||
'name': 'SWBF .msh Import-Export',
|
'name': 'SWBF .msh Import-Export',
|
||||||
'author': 'Will Snyder, PrismaticFlower',
|
'author': 'Will Snyder, PrismaticFlower',
|
||||||
"version": (1, 3, 3),
|
"version": (1, 3, 3),
|
||||||
'blender': (3, 0, 0),
|
'blender': (4, 3, 2),
|
||||||
'location': 'File > Import-Export',
|
'location': 'File > Import-Export',
|
||||||
'description': 'Export as SWBF .msh file',
|
'description': 'Export as SWBF .msh file',
|
||||||
'warning': '',
|
'warning': '',
|
||||||
|
@ -107,4 +107,4 @@ def extract_and_apply_anim(filename : str, scene : Scene):
|
|||||||
|
|
||||||
arma.animation_data.action = action
|
arma.animation_data.action = action
|
||||||
track = arma.animation_data.nla_tracks.new()
|
track = arma.animation_data.nla_tracks.new()
|
||||||
track.strips.new(action.name, action.frame_range[0], action)
|
track.strips.new(action.name, int(action.frame_range[0]), action)
|
@ -128,7 +128,6 @@ def model_to_mesh_object(model: Model, scene : Scene, materials_map : Dict[str,
|
|||||||
blender_mesh.loops.foreach_set("vertex_index", flat_indices)
|
blender_mesh.loops.foreach_set("vertex_index", flat_indices)
|
||||||
|
|
||||||
# Normals
|
# Normals
|
||||||
blender_mesh.create_normals_split()
|
|
||||||
blender_mesh.loops.foreach_set("normal", [component for i in flat_indices for component in vertex_normals[i]])
|
blender_mesh.loops.foreach_set("normal", [component for i in flat_indices for component in vertex_normals[i]])
|
||||||
|
|
||||||
# UVs
|
# UVs
|
||||||
@ -175,7 +174,6 @@ def model_to_mesh_object(model: Model, scene : Scene, materials_map : Dict[str,
|
|||||||
reset_normals = [0.0] * (len(blender_mesh.loops) * 3)
|
reset_normals = [0.0] * (len(blender_mesh.loops) * 3)
|
||||||
blender_mesh.loops.foreach_get("normal", reset_normals)
|
blender_mesh.loops.foreach_get("normal", reset_normals)
|
||||||
blender_mesh.normals_split_custom_set(tuple(zip(*(iter(reset_normals),) * 3)))
|
blender_mesh.normals_split_custom_set(tuple(zip(*(iter(reset_normals),) * 3)))
|
||||||
blender_mesh.use_auto_smooth = True
|
|
||||||
|
|
||||||
|
|
||||||
blender_mesh_object = bpy.data.objects.new(model.name, blender_mesh)
|
blender_mesh_object = bpy.data.objects.new(model.name, blender_mesh)
|
||||||
@ -198,4 +196,3 @@ def model_to_mesh_object(model: Model, scene : Scene, materials_map : Dict[str,
|
|||||||
|
|
||||||
|
|
||||||
return blender_mesh_object
|
return blender_mesh_object
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user