From 923e4cc1cb0442d673851350d8fd7619961b502e Mon Sep 17 00:00:00 2001 From: Danilo Pimentel Date: Thu, 9 Oct 2025 21:03:49 -0300 Subject: [PATCH] Load first file in the imageFiles array The direct use of the array causes the following error, breaking the Floor plan importer feature. ``` [Importers >> Floor plan importer...@addOnScript:error] 121: in sim.loadImage: argument 2 is not a string/buffer. stack traceback: [C]: in function 'sim-1.loadImage' [string "Importers >> Floor plan importer...@addOnScri..."]:121: in function 'go' [CoppeliaSim:error] External call to simCallScriptFunction failed ('go'): error in script function. ``` Accessing the first position of the array passes the right file path for the sim.loadImage method, and the feature works as normal. --- Floor plan importer.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Floor plan importer.lua b/Floor plan importer.lua index 8c0dfe8..c0e1e18 100644 --- a/Floor plan importer.lua +++ b/Floor plan importer.lua @@ -119,7 +119,7 @@ function sysCall_init() optimizationEnabled = simUI.getCheckboxValue(ui, 901) > 0 invertImageValues = simUI.getCheckboxValue(ui, 902) > 0 respondable = simUI.getCheckboxValue(ui, 911) > 0 - im, res = sim.loadImage(0, imageFiles) + im, res = sim.loadImage(0, imageFiles[1]) c = {res[1] / 2, res[2] / 2} im = sim.transformBuffer(im, sim.buffer_uint8rgb, 1, 0, sim.buffer_uint8) im = sim.unpackUInt8Table(im)