feat: automatically loading models used in skeleton

This commit is contained in:
MihailRis
2024-07-17 12:12:40 +03:00
parent 051dc6e05f
commit 739ef49d8f
11 changed files with 43 additions and 32 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ static int l_get_model(lua::State* L) {
if (!modelOverride.model) {
return lua::pushstring(L, modelOverride.name);
}
return lua::pushstring(L, rigConfig->getNodes()[index]->model.name);
return lua::pushstring(L, rigConfig->getBones()[index]->model.name);
}
return 0;
}
+1 -1
View File
@@ -48,7 +48,7 @@ static int l_get_skeleton(lua::State* L) {
static int l_set_skeleton(lua::State* L) {
if (auto entity = get_entity(L, 1)) {
std::string skeletonName = lua::require_string(L, 2);
auto rigConfig = content->getRig(skeletonName);
auto rigConfig = content->getSkeleton(skeletonName);
if (rigConfig == nullptr) {
throw std::runtime_error("skeleton not found '"+skeletonName+"'");
}