Page 1 of 1
Horizontal lines from grid don't go higher than 20
Posted: Wed May 05, 2021 3:42 pm
by denisa
I am trying to make a 50 x 5 grid for a mesh but it doesn't let me go higher than 20. The vertical lines are okay, just the horizontal lines that don't let go higher.
Anybody has had any issues with this?
Re: Horizontal lines from grid don't go higher than 20
Posted: Wed May 05, 2021 3:54 pm
by synthsin75
That's a limit set in the tool.
You can change it by copying lm_shape.lua (and it's png icon) from the installation ...\Resources\Support\Scripts\Tool to your custom content folder Scripts/Tools and opening it in a plain text editor, like Notepad.
At the very bottom you will see:
Code: Select all
elseif (msg == self.CHANGE) then
self.gridCellsX = self.cellsXText:IntValue()
if (self.gridCellsX < 1 or self.gridCellsX > 20) then
self.gridCellsX = LM.Clamp(self.gridCellsX, 1, 20)
self.cellsXText:SetValue(self.gridCellsX)
end
self.gridCellsY = self.cellsYText:IntValue()
if (self.gridCellsY < 1 or self.gridCellsY > 20) then
self.gridCellsY = LM.Clamp(self.gridCellsY, 1, 20)
self.cellsYText:SetValue(self.gridCellsY)
end
end
end
You'd need to change the "20" in the two LM.Clamp lines to "50", like this:
Code: Select all
elseif (msg == self.CHANGE) then
self.gridCellsX = self.cellsXText:IntValue()
if (self.gridCellsX < 1 or self.gridCellsX > 20) then
self.gridCellsX = LM.Clamp(self.gridCellsX, 1, 50)
self.cellsXText:SetValue(self.gridCellsX)
end
self.gridCellsY = self.cellsYText:IntValue()
if (self.gridCellsY < 1 or self.gridCellsY > 20) then
self.gridCellsY = LM.Clamp(self.gridCellsY, 1, 50)
self.cellsYText:SetValue(self.gridCellsY)
end
end
end
Re: Horizontal lines from grid don't go higher than 20
Posted: Sat May 08, 2021 4:16 pm
by denisa
synthsin75 wrote: ↑Wed May 05, 2021 3:54 pm
That's a limit set in the tool.
You can change it by copying lm_shape.lua (and it's png icon) from the installation ...\Resources\Support\Scripts\Tool to your custom content folder Scripts/Tools and opening it in a plain text editor, like Notepad.
At the very bottom you will see:
Code: Select all
elseif (msg == self.CHANGE) then
self.gridCellsX = self.cellsXText:IntValue()
if (self.gridCellsX < 1 or self.gridCellsX > 20) then
self.gridCellsX = LM.Clamp(self.gridCellsX, 1, 20)
self.cellsXText:SetValue(self.gridCellsX)
end
self.gridCellsY = self.cellsYText:IntValue()
if (self.gridCellsY < 1 or self.gridCellsY > 20) then
self.gridCellsY = LM.Clamp(self.gridCellsY, 1, 20)
self.cellsYText:SetValue(self.gridCellsY)
end
end
end
You'd need to change the "20" in the two LM.Clamp lines to "50", like this:
Code: Select all
elseif (msg == self.CHANGE) then
self.gridCellsX = self.cellsXText:IntValue()
if (self.gridCellsX < 1 or self.gridCellsX > 20) then
self.gridCellsX = LM.Clamp(self.gridCellsX, 1, 50)
self.cellsXText:SetValue(self.gridCellsX)
end
self.gridCellsY = self.cellsYText:IntValue()
if (self.gridCellsY < 1 or self.gridCellsY > 20) then
self.gridCellsY = LM.Clamp(self.gridCellsY, 1, 50)
self.cellsYText:SetValue(self.gridCellsY)
end
end
end
Ohh got it! Didn't realise I had to change the limit set. Thank you for the help!
Re: Horizontal lines from grid don't go higher than 20
Posted: Sat May 08, 2021 6:59 pm
by synthsin75
Yeah, no idea why the limit is set so low.
Welcome to scripting.

Re: Horizontal lines from grid don't go higher than 20
Posted: Sun May 09, 2021 10:01 am
by hayasidist
synthsin75 wrote: ↑Sat May 08, 2021 6:59 pm
Yeah, no idea why the limit is set so low.
One explanation is the time it takes to create all the shapes -- the LM tool creates all the shapes (400 in a 20*20 grid) when you start to draw, so the lag between first click and Moho recognising that the cursor has moved gets huge... (my shape tool creates the shapes on mouse up -- the end-to-end time is the same, but there's no discernible lag between first click and the grid moving)
Re: Horizontal lines from grid don't go higher than 20
Posted: Wed Jun 09, 2021 8:48 pm
by pihms
I was wondering as well how to fix that. Synthsin, the coding fix works well, thank you.
Hayasidist, could you point us to your shape tool?
Thanks!
Re: Horizontal lines from grid don't go higher than 20
Posted: Wed Jun 09, 2021 8:58 pm
by hayasidist
pihms wrote: ↑Wed Jun 09, 2021 8:48 pm
Hayasidist, could you point us to your shape tool?
it's here:
http://www.lostmarble.com/forum/viewtop ... 12&t=33900
That has a 24 row/col limit ... if there's a real need for bigger, just let me know...
Re: Horizontal lines from grid don't go higher than 20
Posted: Wed Jun 09, 2021 9:24 pm
by pihms
I just tried out the shape tool, AWESOME! Very well done and will be quite useful. Thanks! I can see this being incorporated into the next version of Moho.