feat: automatically loading models used in skeleton
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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+"'");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user