Skip to content

Commit

Permalink
Fixed blur, added unrestricted shapekeys support and skeleton scale i…
Browse files Browse the repository at this point in the history
…nput filed
  • Loading branch information
SpectrumQT committed Jul 13, 2024
1 parent 1fffb41 commit 356678e
Show file tree
Hide file tree
Showing 5 changed files with 275 additions and 172 deletions.
4 changes: 2 additions & 2 deletions wwmi-tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

bl_info = {
"name": "WWMI Tools",
"version": (0, 8, 6),
"wwmi_version": (0, 6, 1),
"version": (0, 9, 0),
"wwmi_version": (0, 7, 0),
"blender": (2, 80, 0),
"author": "SpectrumQT, DarkStarSword",
"location": "View3D > Sidebar > Tool Tab",
Expand Down
7 changes: 4 additions & 3 deletions wwmi-tools/blender_export/blender_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def get_default_data_map():
]},
VertexBuffers={
'Position': [
BufferSemantic(AbstractSemantic(Semantic.Position, 0), DXGIFormat.R32_FLOAT, stride=12)
BufferSemantic(AbstractSemantic(Semantic.Position, 0), DXGIFormat.R32G32B32_FLOAT)
],
'Blend': [
BufferSemantic(AbstractSemantic(Semantic.Blendindices, 0), DXGIFormat.R8_UINT, stride=4),
Expand Down Expand Up @@ -282,7 +282,7 @@ def build_buffers(data_map, vertex_count, faces, vertex_cache, shapekey_offsets,
buffers[name] = vertex_buffer

# Build Shape Key Buffers
if len(data_map.ShapeKeyBuffers) > 0 and shapekey_offsets is not None:
if len(data_map.ShapeKeyBuffers) > 0 and shapekey_offsets is not None and len(shapekey_vertex_ids) > 0:
shapekey_offset_buffer = ByteBuffer(BufferElementLayout(data_map.ShapeKeyBuffers['ShapeKeyOffset']))
shapekey_offset_buffer.extend(128)
shapekey_offset_buffer.set_values(AbstractSemantic(Semantic.RawData), shapekey_offsets)
Expand Down Expand Up @@ -333,7 +333,6 @@ def blender_export(operator, context, cfg, data_map):
mesh = merged_object.mesh

# Collect merged temp object data

faces, loop_data, vertex_data = get_mesh_data(context, mesh, data_map, cfg.component_collection)

shapekey_offsets, shapekey_vertex_ids, shapekey_vertex_offsets = get_shapekey_data(obj, mesh, data_map, loop_data)
Expand Down Expand Up @@ -377,6 +376,8 @@ def blender_export(operator, context, cfg, data_map):
buffers=buffers,
textures=textures,
comment_code=cfg.comment_ini,
skeleton_scale=cfg.skeleton_scale,
unrestricted_custom_shape_keys=cfg.unrestricted_custom_shape_keys,
)

with open(ini_path, "w") as f:
Expand Down
Loading

0 comments on commit 356678e

Please sign in to comment.