Page 2 of 2

Posted: Sat Dec 10, 2005 12:38 am
by Rasheed
I think the relevant code parts in "lm_line_width.lua" are the following:

Code: Select all

local offset = moho:PixelToDoc((mouseEvent.pt.x - mouseEvent.startPt.x) / 16)
local maxWidth = moho:PixelToDoc(64)

if (self.numSel == 1) then
	local pt = mesh:Point(self.selID)
	pt.fWidth.value = pt.fTempWidth + offset
	pt.fWidth.value = LM.Clamp(pt.fWidth.value, 0, maxWidth)
	pt.fWidth:StoreValue()
	else
	for i, pt in self.selList do
		pt.fWidth.value = pt.fTempWidth + offset
		pt.fWidth.value = LM.Clamp(pt.fWidth.value, 0, maxWidth)
		pt.fWidth:StoreValue()
	end
end
By dragging the mouse to the left the value of offset can become negative. This offset is then added to the width of the selected point or points.

Code: Select all

if (pt.fWidth.value < 0) then
	pt.fWidth:SetValue(moho.frame, 0)
end
In another part of the code there is a check for a negative value of the width of the selected point or points. If it is negative, it is assigned a zero value.

I assume Moho's rendering engine uses the negative value to indicate that no outline is selected. But would it be possible to change this into -64 and make it possible that line widths between -64 (not inclusive) and 0 are not rendered, but still be considered outlines?

It would certainly solve this little artistic problem.

Added: Err, of course, if anyone drags the offset beyond -64, the same problem occurs as when you drag too far to the right with your mouse and make all points 64 pixels wide. So the method is not foolproof, but it would be an improvement.

Posted: Sat Dec 10, 2005 1:01 am
by Rasheed
In fact, I changed (a copy) of "lm_line_width.lua" and commented out the two code lines containing:

Code: Select all

pt.fWidth:SetValue(moho.frame, 0)
by replacing them with:

Code: Select all

--pt.fWidth:SetValue(moho.frame, 0)
And the problems Toontoonz wrote about didn't occur. I could make the selected curves disappear by dragging the mouse to the left and appear with the same line width variation by dragging the mouse to the right.

However, I'm not to sure if this is okay with Moho. Will I run in any trouble if I keep using the modified "lm_line_width.lua" script?

Posted: Sat Dec 10, 2005 2:59 am
by Lost Marble
I don't think that modified script will actually work. Try animating some line widths. Also, you may also get weird results if the line width value for the shape is something other than 1. I wouldn't recommend using that modification.

Posted: Sat Dec 10, 2005 11:00 am
by Rasheed
Okay, then I put the original script back.

Posted: Mon Jan 16, 2006 9:13 pm
by Rai López
Lost Marble wrote:Not really a bug. Think of a photo: First brighten a photo until parts of it turn completely white. Then darken the photo - you won't get the details back in the white areas - they'll all just be a solid shade of gray.
Jaja... HI! :), but LM remember that if we decide working with vector images is for can AVOID this kind of bitmaps limitations ;)