(2022-12-28, 23:14)N. W. Perry Wrote: Is there a way to loop through all subfiles of a model, so that the script can work recursively?
You can get submodels trough the ref obect's getSubfile function.
But in the current alpha there is no (easy) way to know if it is a part or submodel.
The upcoming 1.7 Beta 1 has a whole bunch of type information functions though.
Quick copy/paste from the current code:
Code:
static int luaCB_isPart(lua_State *luaState) { return singleBoolParamIO(luaState, luaTypeName, 0, true); }
static int luaCB_isRealPart(lua_State *luaState) { return singleBoolParamIO(luaState, luaTypeName, 1, true); }
static int luaCB_isColourPart(lua_State *luaState) { return singleBoolParamIO(luaState, luaTypeName, 2, true); }
static int luaCB_isShortCut(lua_State *luaState) { return singleBoolParamIO(luaState, luaTypeName, 3, true); }
static int luaCB_isModel(lua_State *luaState) { return singleBoolParamIO(luaState, luaTypeName, 4, true); }
static int luaCB_isGenerated(lua_State *luaState) { return singleBoolParamIO(luaState, luaTypeName, 5, true); }
static int luaCB_isOfficialPart(lua_State *luaState) { return singleBoolParamIO(luaState, luaTypeName, 6, true); }
static int luaCB_isMoved(lua_State *luaState) { return singleBoolParamIO(luaState, luaTypeName, 7, true); }
static int luaCB_isAliasPart(lua_State *luaState) { return singleBoolParamIO(luaState, luaTypeName, 8, true); }
static int luaCB_isMissing(lua_State *luaState) { return singleBoolParamIO(luaState, luaTypeName, 9, true); }
static int luaCB_isRedirectedPart(lua_State *luaState) { return singleBoolParamIO(luaState, luaTypeName, 10, true); }