Is it possible to set the new shape defaults to w/o outline?
Moderators: Víctor Paredes, Belgarath, slowtiger
Is it possible to set the new shape defaults to w/o outline?
Sorry about the weird English, but the character limit wouldn't let me put in any more characters. Usually when setting the defaults for new shapes, you can't set the outline to <i>not</i> be enabled. Is there a reason for this? If not, is there a way to set the default drawing style to not have an outline? I'm just asking because the character I'm drawing has these swirling stripe patterns and it would be more convenient not to have to un-check the box for each shape I draw, especially if I have to animate a head turn or something...
- synthsin75
- Posts: 9973
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
This is the easiest solution I've seen in the forum. It's the one I use, anyway. I just make a new style that has the fill color I want. I copy that color's number (ctrl-c) from the color picker, and paste it (ctrl-v) into the line's color picker. I set the line width as low as I can (entering zero will do this). You want to have everything enabled for this style. Now if you select <none> as your style and this new one as an 'applied style', every shape you make will have matching fill and outline.
Hope that helps.
Hope that helps.
I'm afraid you will need to modify your create shape tool. Luckily, for you, I already have done this and put the files on my .Mac homepage.
Download this zip archive. If you unzip it, it creates a tool folder. The two included files in this folder should be copied into the tool folder of the scripts folder of your Anime Studio Pro folder (see screenshot).
The two files are called "lm_create_shape_noline.lua" and "lm_create_shape_noline.png" (without the quotes).
Mind you, this doesn't work in Moho (predecessor of Anime Studio Pro). It is written for Anime Studio Pro.
The new tool will appear in the others category of the Toolbar (window with the title Tools).
Download this zip archive. If you unzip it, it creates a tool folder. The two included files in this folder should be copied into the tool folder of the scripts folder of your Anime Studio Pro folder (see screenshot).
The two files are called "lm_create_shape_noline.lua" and "lm_create_shape_noline.png" (without the quotes).
Mind you, this doesn't work in Moho (predecessor of Anime Studio Pro). It is written for Anime Studio Pro.
The new tool will appear in the others category of the Toolbar (window with the title Tools).
- synthsin75
- Posts: 9973
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
- Víctor Paredes
- Site Admin
- Posts: 5662
- Joined: Wed Jan 26, 2005 12:18 am
- Location: Barcelona/Chile
- Contact:
I already did publish this tool some time ago, but, nevertheless, I'm glad I could help you.
Except for the name of the tool (create_shape_noline), I have just added 4 lines of code in the HandleMessage function:
if msg == self.CREATE then means: "If there a request to create a shape, then do the following."
local shapeID = moho:CreateShape(true) means: "Create a variable called shapeID that stores the result of the CreateShape function." If the CreateShape function is called with a true value, it returns the number of the filled shape (0, 1, 2, 3, etc.) that has been created. If no fill could be created, the function returns a -1 value. The return value is stored in ShapeID.
This means that if ShapeID is larger than or equal to zero, there was a filled shape created, and the only thing left is to clean up. Before it does that, I added some code that tests if the shape has an outline, which is removed.
So, it is only a small hack. However, it has a big consequence for users. I'm sure that more experienced Lua coders could easily rewrite the create_shape tool to include a check box to fill without an outline.
Except for the name of the tool (create_shape_noline), I have just added 4 lines of code in the HandleMessage function:
Code: Select all
function LM_CreateShape_noline:HandleMessage(moho, view, msg)
local mesh = moho:Mesh()
if (mesh == nil) then
return
end
if (msg == self.CREATE) then
if (moho:CountSelectedEdges() > 0) then
moho.document:PrepUndo(moho.layer)
moho.document:SetDirty()
local shapeID = moho:CreateShape(true) -- filled shape
if (shapeID < 0) then
shapeID = moho:CreateShape(false) -- just an outline
if (shapeID >= 0) then
mesh:SelectNone()
mesh:Shape(shapeID).fFillAllowed = false
end
end
if (shapeID >= 0) then
local shape = mesh:Shape(shapeID) -- added Rasheed
if (shape.fHasFill) then -- added Rasheed
mesh:Shape(shapeID).fHasOutline = false -- added Rasheed
end -- added Rasheed
mesh:SelectNone()
mesh:Shape(shapeID).fSelected = true
moho:NewKeyframe(CHANNEL_FILL)
moho:NewKeyframe(CHANNEL_LINE)
moho:UpdateSelectedChannels()
end
view:DrawMe()
end
elseif (msg == self.LASSO) then
LM_SelectPoints.lassoMode = self.lassoCheck:Value()
elseif (msg >= self.SELECTITEM) then
mesh:SelectNone()
local i = msg - self.SELECTITEM
local name = mesh:Group(i):Name()
mesh:SelectGroup(name)
moho:UpdateUI()
end
end
local shapeID = moho:CreateShape(true) means: "Create a variable called shapeID that stores the result of the CreateShape function." If the CreateShape function is called with a true value, it returns the number of the filled shape (0, 1, 2, 3, etc.) that has been created. If no fill could be created, the function returns a -1 value. The return value is stored in ShapeID.
This means that if ShapeID is larger than or equal to zero, there was a filled shape created, and the only thing left is to clean up. Before it does that, I added some code that tests if the shape has an outline, which is removed.
So, it is only a small hack. However, it has a big consequence for users. I'm sure that more experienced Lua coders could easily rewrite the create_shape tool to include a check box to fill without an outline.
The old file has December 16, 2006 as a time stamp, so the thread must be from around that date.
Ah, using the search function I found the thread. You were in it as well, Vern. I guess you didn't follow up after you'd replied.
viewtopic.php?t=7159
Ah, using the search function I found the thread. You were in it as well, Vern. I guess you didn't follow up after you'd replied.
viewtopic.php?t=7159
Good question.takumi wrote:That was exactly what I was looking for; thank you! So, does "mesh" in a .lua/.anme file refer to the outline of a shape?
It is like this. In a vector layer, points are described with two coordinates, x and y. Points can be connected to each other, to form a segment. Each segment can have a subsegment (a branch), that consists of yet other points. This is your mesh. Segments can be closed or open. Open segments consist of at least two points, while closed segments need at least three points.
You can use this mesh to create shapes. Shapes can have fills and outlines. For fills, a selected segment must be closed and without branches. Outlines can be assigned to any segment.
BTW Although, there are no tools for this in the standard toolbox, it is possible to have non-connected points (single points). These are also part of the mesh, although you cannot use them to create shapes.
To answer your question, it is possible to have a mesh of segments without outlines, but if there is no mesh, you cannot create outlines.
I hope this is clear enough.