i feel so soggy!
This commit is contained in:
parent
fc31f49d3f
commit
220e7a04b7
4 changed files with 55 additions and 1 deletions
17
scripts/libs/utils.lua
Normal file
17
scripts/libs/utils.lua
Normal file
|
@ -0,0 +1,17 @@
|
|||
local module = {}
|
||||
|
||||
--- @param model ModelPart
|
||||
--- @param func fun(model: ModelPart)
|
||||
function module.forEachNonGroup(model, func)
|
||||
if model:getType() == "GROUP" then
|
||||
for _, child in pairs(model:getChildren()) do
|
||||
module.forEachNonGroup(child, func)
|
||||
end
|
||||
end
|
||||
|
||||
if model:getType() == "CUBE" or model:getType() == "MESH" then
|
||||
func(model)
|
||||
end
|
||||
end
|
||||
|
||||
return module
|
Loading…
Add table
Add a link
Reference in a new issue