From 0fca2d8da8b06456346ce01eeb1a8a7e80ffe451 Mon Sep 17 00:00:00 2001 From: CoolCat467 <52022020+CoolCat467@users.noreply.github.com> Date: Tue, 9 Mar 2021 13:24:27 -0600 Subject: [PATCH] Attempt to add variable shapeLimit. --- Applications/3D Print.app/Main.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Applications/3D Print.app/Main.lua b/Applications/3D Print.app/Main.lua index a3f4d7c7..9c3b108c 100644 --- a/Applications/3D Print.app/Main.lua +++ b/Applications/3D Print.app/Main.lua @@ -78,7 +78,15 @@ local localization = system.getLocalization(currentScriptDirectory .. "Localizat local currentLayer = 0 local model local savePath -local shapeLimit = 24 + +if component.isAvailable("printer3d") then + local printer3d = component.get("printer3d") + local shapeLimit = printer3d.getMaxShapeCount() + --Might also be getShapeCount(), as it's doc info talks about a config file. +else + local shapeLimit = 24 +end + local viewPixelWidth, viewPixelHeight = 4, 2 local colors, hue, hueStep = {}, 0, 360 / shapeLimit