M2.5: wire libgr2 dump_materials (opt-in), keep filename heuristic default
- Metin2Model stores gr2::dump_materials() and can resolve surface textures via tri_groups[0].material_index -> material.diffuse_texture basename, gated behind use_gr2_materials (default off): the mapping is unverified and currently regresses warrior (body surfaces pick the face texture), so the filename-convention + dir-scan path stays the default. - Property + setter for use_gr2_materials so it can be A/B'd once a Granny oracle exists. Logged: "gr2 materials: N (M with diffuse name)". warrior/assassin/shaman render unchanged from the heuristic path. docs/GODOT-POC-PLAN.md §M2.5 T2.5.6 gap list already covers the open item. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WaHYEY9rwLWt21PULiYjeJ
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
namespace godot {
|
||||
class Skeleton3D;
|
||||
@@ -54,6 +55,9 @@ public:
|
||||
void set_material_mode(const godot::String &m);
|
||||
godot::String get_material_mode() const { return material_mode; }
|
||||
|
||||
void set_use_gr2_materials(bool v);
|
||||
bool get_use_gr2_materials() const { return use_gr2_materials; }
|
||||
|
||||
// Explicit per-surface texture path override (index -> absolute .dds path).
|
||||
void set_surface_texture(int surface, const godot::String &path);
|
||||
|
||||
@@ -81,9 +85,11 @@ private:
|
||||
bool flip_winding = false;
|
||||
|
||||
godot::String material_mode = "metin2"; // "metin2" (ShaderMaterial) | "standard"
|
||||
bool use_gr2_materials = false; // drive textures from gr2 material names (unverified)
|
||||
godot::PackedStringArray surface_tex_override;
|
||||
|
||||
std::shared_ptr<std::optional<gr2::File>> file; // shared_ptr so accessor stays valid
|
||||
std::vector<gr2::MaterialInfo> materials;
|
||||
godot::Skeleton3D *skel = nullptr;
|
||||
godot::MeshInstance3D *mi = nullptr;
|
||||
godot::String last_info;
|
||||
|
||||
Reference in New Issue
Block a user