mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +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
|
|
@ -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+"'");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue