diff --git a/Sources/armory/trait/internal/Bridge.hx b/Sources/armory/trait/internal/Bridge.hx index 1ce35562..632fad8f 100644 --- a/Sources/armory/trait/internal/Bridge.hx +++ b/Sources/armory/trait/internal/Bridge.hx @@ -11,6 +11,7 @@ class Bridge { public static var Input = iron.system.Input; public static var Object = iron.object.Object; public static var Data = iron.data.Data; + public static var Vec4 = iron.math.Vec4; public static function log(s: String) { trace(s); }; } diff --git a/blender/arm/live_patch.py b/blender/arm/live_patch.py index 9079cfde..99314c54 100644 --- a/blender/arm/live_patch.py +++ b/blender/arm/live_patch.py @@ -206,9 +206,9 @@ def send_event(event_id: str, opt_data: Any = None): inp_type = socket.arm_socket_type if inp_type in ('VECTOR', 'RGB'): - value = '{' + f'"x": {value[0]}, "y": {value[1]}, "z": {value[2]}' + '}' + value = f'new iron.Vec4({arm.node_utils.haxe_format_socket_val(value, array_outer_brackets=False)}, 1.0)' elif inp_type == 'RGBA': - value = '{' + f'"x": {value[0]}, "y": {value[1]}, "z": {value[2]}, "w": {value[3]}' + '}' + value = f'new iron.Vec4({arm.node_utils.haxe_format_socket_val(value, array_outer_brackets=False)})' elif inp_type == 'OBJECT': value = f'iron.Scene.active.getChild("{value}")' if value != '' else 'null' else: