getObjectsByClass
Definition
-- @/lua/ge/ge_utils.lua:656
-- returns all hit with the correct class. Example: getObjectsByClass("CloudLayer")
function getObjectsByClass(className)
local res = {}
local o = scenetree.findClassObjects(className)
if not o or #o == 0 then return nil end
for _, v in pairs(o) do
table.insert(res, scenetree.findObject(v))
end
return res
end
Callers
@/lua/ge/extensions/core/trafficSignals.lua
local statics = getObjectsByClass('TSStatic')
if statics then
@/lua/ge/extensions/core/weather.lua
for objClassStr, attribTable in pairs(p) do
local objs = getObjectsByClass(objClassStr)
for objName, objVal in pairs(formerValues) do
local objects = getObjectsByClass(objName)
values[objName] = {}
local objs = getObjectsByClass(objClassStr)
if objs == nil then
@/lua/ge/extensions/gameplay/speedTraps.lua
local function getSpeedTrapsInCurrentLevel(speedTrapType)
local objs = getObjectsByClass("BeamNGTrigger")
if not objs then return {} end
@/gameplay/missions/automation_test_track/flowgraph/001-Dam/customNodes/getClosestStaticObjectNode.lua
self.pos:setFromTable(self.pinIn.position.value)
for _, obj in ipairs(getObjectsByClass("TSStatic") or {}) do
if not internalName or internalName == tostring(obj:getInternalName()) then
@/lua/ge/ge_utils.lua
-- returns all hit with the correct class. Example: getObjectsByClass("CloudLayer")
function getObjectsByClass(className)
@/lua/ge/extensions/editor/trafficSignalsEditor.lua
local dir1 = selectedObj:getTransform():getForward()
for _, obj in ipairs(getObjectsByClass("TSStatic") or {}) do
if (internalName and obj:getInternalName() == internalName) or obj.shapeName == selectedObj.shapeName then