mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
feat: automatically loading models used in skeleton
This commit is contained in:
parent
051dc6e05f
commit
739ef49d8f
11 changed files with 43 additions and 32 deletions
|
|
@ -12,6 +12,7 @@
|
|||
#include "../content/Content.hpp"
|
||||
#include "../content/ContentPack.hpp"
|
||||
#include "../voxels/Block.hpp"
|
||||
#include "../objects/rigging.hpp"
|
||||
#include "../graphics/core/Texture.hpp"
|
||||
#include "../logic/scripting/scripting.hpp"
|
||||
|
||||
|
|
@ -205,6 +206,16 @@ void AssetsLoader::addDefaults(AssetsLoader& loader, const Content* content) {
|
|||
fs::path folder = info.folder / fs::path("layouts");
|
||||
addLayouts(pack->getEnvironment(), info.id, folder, loader);
|
||||
}
|
||||
|
||||
for (auto& entry : content->getSkeletons()) {
|
||||
auto& skeleton = *entry.second;
|
||||
for (auto& bone : skeleton.getBones()) {
|
||||
auto& model = bone->model.name;
|
||||
if (!model.empty()) {
|
||||
loader.add(AssetType::MODEL, MODELS_FOLDER+"/"+model, model);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
loader.add(AssetType::ATLAS, TEXTURES_FOLDER+"/blocks", "blocks");
|
||||
loader.add(AssetType::ATLAS, TEXTURES_FOLDER+"/items", "items");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue