Horizontal lines from grid don't go higher than 20

Wondering how to accomplish a certain animation task? Ask here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
denisa
Posts: 38
Joined: Fri Feb 21, 2020 11:55 am
Location: UK
Contact:

Horizontal lines from grid don't go higher than 20

Post 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?
User avatar
synthsin75
Posts: 9973
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Horizontal lines from grid don't go higher than 20

Post 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
denisa
Posts: 38
Joined: Fri Feb 21, 2020 11:55 am
Location: UK
Contact:

Re: Horizontal lines from grid don't go higher than 20

Post 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!
User avatar
synthsin75
Posts: 9973
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Horizontal lines from grid don't go higher than 20

Post by synthsin75 »

Yeah, no idea why the limit is set so low.
Welcome to scripting. :wink:
User avatar
hayasidist
Posts: 3523
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: Horizontal lines from grid don't go higher than 20

Post 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)
User avatar
pihms
Posts: 188
Joined: Sat Apr 18, 2009 9:52 pm

Re: Horizontal lines from grid don't go higher than 20

Post 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!
User avatar
hayasidist
Posts: 3523
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: Horizontal lines from grid don't go higher than 20

Post 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...
User avatar
pihms
Posts: 188
Joined: Sat Apr 18, 2009 9:52 pm

Re: Horizontal lines from grid don't go higher than 20

Post 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.
Post Reply