mirror of
https://github.com/open-goal/jak-project
synced 2026-09-07 19:40:48 -04:00
custom models: option to copy mod/eye draws from original model (#3800)
Two new flags were added to the Blender plugin to allow reusing the mod and/or eye draws of the original model that is being replaced. Works pretty well for eyes, but the blerc draws can cause some Z-fighting with the non-moving parts of the model. Also a small refactor to the merc replacement code to de-duplicate some code by moving stuff to `gltf_util.cpp`.
This commit is contained in:
@@ -113,6 +113,16 @@ void extract_art_groups_from_level(const ObjectFileDB& db,
|
||||
if (db.obj_files_by_dgo.count(dgo_name)) {
|
||||
const auto& files = db.obj_files_by_dgo.at(dgo_name);
|
||||
MercSwapInfo swapped_info;
|
||||
// build list of models to replace
|
||||
auto merc_replacements_path = file_util::get_jak_project_dir() / "custom_assets" /
|
||||
game_version_names[db.version()] / "merc_replacements";
|
||||
if (file_util::file_exists(merc_replacements_path.string())) {
|
||||
auto custom_models =
|
||||
file_util::find_files_in_dir(merc_replacements_path, std::regex(".*\\.glb"));
|
||||
for (auto& mdl : custom_models) {
|
||||
swapped_info.add_to_swap_list(mdl.stem().string());
|
||||
}
|
||||
}
|
||||
for (const auto& file : files) {
|
||||
if (file.name.length() > 3 && !file.name.compare(file.name.length() - 3, 3, "-ag")) {
|
||||
const auto& ag_file = db.lookup_record(file);
|
||||
|
||||
Reference in New Issue
Block a user