Skip to content

Commit

Permalink
Mrl fixes (#107)
Browse files Browse the repository at this point in the history
Refactor MRL creation to fix shading issues in exporting of unmodified characters.

Added "Features" sub-panel that lets you select all of the shader commands/parameters instead of trying to guess them based on textures used. This proved to be much more robust. The con is that creating a material from scratch might be more complicated, since basic parameters like setting the usage of normal map to use the first uv layer are not set.
Furthermore, some games don't support all parameters, and export will fail if they are used; right now there is no check nor hiding of parameters not supported for a game. The recommended workflow remains to copy the original existing materials.

Added Parameters for BlendState, Depth Stencil State and Rasterizer State.

Added 9 new texture slots to mtfw_shader: Detail 2 DNM, Albedo Blend BM, Albedo Blend 2 BM, Vertex Displacement, Vertex Displacement Mask, Hair Shift, Height Map, Emission Map.

Added 3 new Constant Buffer sub-panesl: CB Vertex Displacement, CB Vertex Displacement 2, and Color Mask. They are currently always showing, but are not exported if the corresponging texture is not set.
  • Loading branch information
Brachi authored Jun 23, 2024
1 parent 674307a commit 35b6d5b
Show file tree
Hide file tree
Showing 20 changed files with 10,896 additions and 1,324 deletions.
2 changes: 2 additions & 0 deletions albam/blender_ui/custom_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def _create_custom_properties_secondary_subpanel(app_id, label, custom_props_id)
"bl_idname": bl_idname,
"APP_ID": app_id,
"custom_props_to_draw": custom_props_id,
"bl_options": {"DEFAULT_CLOSED"},
}
)
# Since these factories are created at the end, we need to register manually
Expand Down Expand Up @@ -290,6 +291,7 @@ def draw(self, context):
if not custom_props:
return
for k in custom_props.__annotations__:
# TODO: don't draw if marked as "HIDDEN"
layout.prop(custom_props, k)

@classmethod
Expand Down
10 changes: 10 additions & 0 deletions albam/blender_ui/export_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@
from .import_panel import ALBAM_UL_VirtualFileSystemUIBase


@blender_registry.register_blender_prop_albam(name="export_settings")
class AlbamExportSettings(bpy.types.PropertyGroup):
# remove suffix added by blender when there are duplicate material names.
# e.g. rename pl_skin.001 to pl_skin at export time.
# Mostly useful for import-export tests to be able to compare exported vs original,
# since many models can share a name and the blender database
# is not cleaned in each test.
remove_duplicate_materials_suffix : bpy.props.BoolProperty(default=True)


@blender_registry.register_blender_prop
class ExportableItem(bpy.types.PropertyGroup):
# FIXME: hook to remove from list when object is deleted
Expand Down
1,271 changes: 925 additions & 346 deletions albam/engines/mtfw/material.py

Large diffs are not rendered by default.

Loading

0 comments on commit 35b6d5b

Please sign in to comment.