diff --git a/Sources/armory/logicnode/GetObjectNode.hx b/Sources/armory/logicnode/GetObjectNode.hx index d0bdb60e..08c30c4c 100644 --- a/Sources/armory/logicnode/GetObjectNode.hx +++ b/Sources/armory/logicnode/GetObjectNode.hx @@ -14,36 +14,7 @@ class GetObjectNode extends LogicNode { override function get(from: Int): Dynamic { var objectName: String = inputs[0].get(); - - if (property0 == null || property0 == iron.Scene.active.raw.name) { - return iron.Scene.active.getChild(objectName); - } - - #if arm_json - property0 += ".json"; - #elseif arm_compress - property0 += ".lz4"; - #end - - var outObj: Null = null; - - // Create the object in the active scene if it is from an inactive scene - iron.data.Data.getSceneRaw(property0, (rawScene: TSceneFormat) -> { - var objData: Null = null; - - for (o in rawScene.objects) { - if (o.name == objectName) { - objData = o; - break; - } - } - if (objData == null) return; - - iron.Scene.active.createObject(objData, rawScene, null, null, (newObj: Object) -> { - outObj = newObj; - }); - }); - - return outObj; + + return iron.Scene.active.getChild(objectName); } } diff --git a/blender/arm/logicnode/object/LN_get_object_by_name.py b/blender/arm/logicnode/object/LN_get_object_by_name.py index fd8c893c..4330371e 100644 --- a/blender/arm/logicnode/object/LN_get_object_by_name.py +++ b/blender/arm/logicnode/object/LN_get_object_by_name.py @@ -4,7 +4,7 @@ from arm.logicnode.arm_nodes import * class GetObjectNode(ArmLogicTreeNode): - """Searches for a object that uses the given name and returns it.""" + """Searches for a object that uses the given name in the current active scene and returns it.""" bl_idname = 'LNGetObjectNode' bl_label = 'Get Object by Name' arm_version = 1