Page 1 of 2

*NEW* Stacked shape tools

Posted: Mon Sep 10, 2018 10:46 am
by synthsin75
https://drive.google.com/uc?export=down ... Uudoxbqjad
For Moho v14: https://drive.google.com/uc?export=down ... 1tSn9CoCUs

Create shape tool:
  • This mod allows you to create stacked shapes on the exact same vector points.
    • Warning: Stacking too many shapes can cause aliased edges when rendered.
      The select shape tool will help you avoid that.
  • Update 7/4/19: This now displays selected end points as fat markers.

Select shape tool features:
  • A shape stack indicator: Shape ID: 0 [1] 2
    • When you select a shape, this shows all the IDs for the shapes below the cursor.
    • It indicates which shape in the stack is selected with "[ ]". So you can see either your selection change, using Ctrl+Up/Down, or the shape order change (IDs move), just using Up/Down.
    • Left to right is top to bottom in the stack.
  • No more Ctrl+Up/Down overrun...where you keep hitting the arrow and nothing happens.
  • You can also make contiguous shape selections in the stack using Ctrl+Shift+Up/Down. All selected shapes in the stack are indicated by "[ ]" and can be moved as a group.

:D :!: :!: :!:

Re: *NEW* Stacked shape tools

Posted: Tue Sep 11, 2018 6:13 am
by ulrik
That is indeed a very useful tool, thank you for sharing this! :)

Re: *NEW* Stacked shape tools

Posted: Tue Sep 11, 2018 5:12 pm
by synthsin75
Updated the above link to correct a minor issue.

Re: *NEW* Stacked shape tools

Posted: Thu Sep 13, 2018 9:56 pm
by onurbeiren
it will help a lot!

Re: *NEW* Stacked shape tools

Posted: Thu Oct 11, 2018 4:31 am
by A.Evseeva
Oh, thank You very very much, it is very helpful!
I even wanted to write such a tool, but could not imagine how shoud an interface look like. Your idea is simple and perfect!

Sometimes the tool can not see some shapes.
Image
(two shapes selected but only no 11 shown)
Here is the file.

Also I have a tool mod wich can show an outline of selected shape. Maybe You want to implement it into Your tool?
It looks like this:
Image

Re: *NEW* Stacked shape tools

Posted: Thu Oct 11, 2018 4:55 am
by synthsin75
A.Evseeva wrote:Oh, thank You very very much, it is very helpful!
I even wanted to write such a tool, but could not imagine how shoud an interface look like. Your idea is simple and perfect!
Yeah, I kicked myself for not thinking of it earlier.
Sometimes the tool can not see some shapes.
Image
(two shapes selected but only no 11 shown)
Here is the file.
It doesn't show all selected shape IDs. It only shows all selected and unselected IDs under where you last clicked.
In your picture, the hair line is shape 11 (selected) and the hair fill is shape 9 (unselected). The ear is shape 17, so you probably selected that and then shift-selected the hair line (shape 11).
Also I have a tool mod wich can show an outline of selected shape. Maybe You want to implement it into Your tool?
It looks like this:
Image
Interesting. Since there's already a checkerboard pattern, maybe I could use that to highlight the whole stack.
Is that mod in one of your existing tools?

Re: *NEW* Stacked shape tools

Posted: Thu Oct 11, 2018 7:04 am
by A.Evseeva
Oh, thank You! Now I understand how does it work. I missed that I have to click to see numbers under cursor.

Here is my function for tracing shapes

Code: Select all

function LM_SelectShape:TraceSelected(moho, view)
	local mesh = moho:Mesh()
	if mesh == nil then return end	
	local g = view:Graphics()
	local matrix = LM.Matrix:new_local()
	moho.drawingLayer:GetFullTransform(moho.frame, matrix, moho.document)
	g:Push()
	g:ApplyMatrix(matrix)
	
	for s = 0, mesh:CountShapes()-1 do
		local shape = mesh:Shape(s)
		if shape.fSelected then
			for e = 0, shape:CountEdges()-1 do
				local c,p = shape:GetEdge(e)
				local startPercent, endPercent = mesh:Curve(c):GetSegmentRange(p)
				local step = (endPercent-startPercent)/10
				local p1 = mesh:Curve(c):GetPercentLocation(startPercent)
				for i=1,10 do
					local nextPercent = startPercent + step * i
					if nextPercent > endPercent then nextPercent = endPercent end
					local p2 = mesh:Curve(c):GetPercentLocation(nextPercent)
					g:DrawFatLine(3, p1.x, p1.y, p2.x, p2.y)
					p1:Set(p2)
				end
			end
		end
	end
	
	g:Pop()
	
end

Re: *NEW* Stacked shape tools

Posted: Thu Oct 11, 2018 11:30 pm
by synthsin75
Thanks for the tracing function.

Re: *NEW* Stacked shape tools

Posted: Fri Oct 12, 2018 12:31 am
by Greenlaw
This looks cool, Wes! Will try it out this evening.

Re: *NEW* Stacked shape tools

Posted: Fri Jul 05, 2019 3:23 am
by synthsin75
Per Victor's request here: http://www.lostmarble.com/forum/viewtop ... 20#p188420

Link: http://www.lostmarble.com/forum/viewtop ... 90#p184390

Create shape tool:
  • Update 7/4/19: This now displays selected end points as fat markers.

Re: *NEW* Stacked shape tools

Posted: Fri Jul 05, 2019 5:07 am
by Greenlaw
This is great! Thanks Wes!

Re: *NEW* Stacked shape tools

Posted: Sat Jul 06, 2019 3:11 am
by alanthebox
I installed this script tonight and have been playing around with it, but I'm having trouble understanding the application for it. Would someone fill me as to how you would use this in one of your projects?

Sorry, I'm sure it's super obvious but I feel like I'm missing it!

Re: *NEW* Stacked shape tools

Posted: Sat Jul 06, 2019 3:38 am
by synthsin75
alanthebox wrote: Sat Jul 06, 2019 3:11 am I installed this script tonight and have been playing around with it, but I'm having trouble understanding the application for it. Would someone fill me as to how you would use this in one of your projects?

Sorry, I'm sure it's super obvious but I feel like I'm missing it!
The stacked shapes? Here's an example from Denis: https://www.lostmarble.com/forum/viewto ... 63#p184363

Chucky used to have a very nice example of a desk lamp that really showed off the potential of shape stacking, but I'm not finding it.

Re: *NEW* Stacked shape tools

Posted: Fri Jul 12, 2019 4:49 pm
by chucky
Well this is well over ten years old.
Good memory Wes.

Image

Because the shapes are stacked on the same vectors, it's possible to change the entire shape and all the effects move with it.

Re: *NEW* Stacked shape tools

Posted: Fri Jul 12, 2019 11:09 pm
by synthsin75
That's it, Chucky. It's memorable because it makes an impact.