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?
Horizontal lines from grid don't go higher than 20
Moderators: Víctor Paredes, Belgarath, slowtiger
- synthsin75
- Posts: 10253
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: Horizontal lines from grid don't go higher than 20
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:
You'd need to change the "20" in the two LM.Clamp lines to "50", like this:
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
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
- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Re: Horizontal lines from grid don't go higher than 20
Ohh got it! Didn't realise I had to change the limit set. Thank you for the help!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: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, 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
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
- synthsin75
- Posts: 10253
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: Horizontal lines from grid don't go higher than 20
Yeah, no idea why the limit is set so low.
Welcome to scripting.
Welcome to scripting.

- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
- hayasidist
- Posts: 3830
- Joined: Wed Feb 16, 2011 8:12 pm
- Location: Kent, England
Re: Horizontal lines from grid don't go higher than 20
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
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!
Hayasidist, could you point us to your shape tool?
Thanks!
- hayasidist
- Posts: 3830
- Joined: Wed Feb 16, 2011 8:12 pm
- Location: Kent, England
Re: Horizontal lines from grid don't go higher than 20
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
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.