How do I clip lines in an object?

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

Moderators: Víctor Paredes, Belgarath, slowtiger

User avatar
Gibble
Posts: 131
Joined: Mon Aug 20, 2018 7:01 pm

How do I clip lines in an object?

Post by Gibble »

Hey Gang!
I am making a shirt with a plaid print using vector lines.
I am trying to make the ends of dark red lines appear under the black outline [see below].

Issue: As you can see below, the dark red lines extend above and beyond the black outlines.
This is all on one layer- otherwise I know I could mask them if I made two layers. But can I clip the red lines (masking essentially ) but have all the object on a single layer?
Thx in advance!

Image
User avatar
slowtiger
Posts: 6242
Joined: Thu Feb 16, 2006 6:53 pm
Location: Berlin, Germany
Contact:

Re: How do I clip lines in an object?

Post by slowtiger »

The only way I know:
- create the underlying shape (maybe without outline)
- create the lines or pattern on top of it (you may want to switch off round caps)
- copy the underlying shape, paste on top, and make its fill invisible (just switch off).

This way everything stays on one layer.
AS 9.5 MacPro Quadcore 3GHz 16GB OS 10.6.8 Quicktime 7.6.6
AS 11 MacPro 12core 3GHz 32GB OS 10.11 Quicktime 10.7.3
Moho 13.5 iMac Quadcore 2,9GHz 16GB OS 10.15

Moho 14.1 Mac Mini Plus OS 13.5
User avatar
Gibble
Posts: 131
Joined: Mon Aug 20, 2018 7:01 pm

Re: How do I clip lines in an object?

Post by Gibble »

slowtiger wrote: Sun Dec 29, 2024 10:56 am The only way I know:
- create the underlying shape (maybe without outline)
- create the lines or pattern on top of it (you may want to switch off round caps)
- copy the underlying shape, paste on top, and make its fill invisible (just switch off).

This way everything stays on one layer.
Thank you very much, @SlowTiger. That should work. I'll try that.
User avatar
Greenlaw
Posts: 10396
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: How do I clip lines in an object?

Post by Greenlaw »

If you use Wes' Create Shape mod, you can select the points along the outer edge, and create a Stroke-only version of the shape, which can sit on top of all the shapes, including the pattern lines.

In other words, this Stroke-only shape will share the same curve as the base shape, and the two will sandwich the pattern shapes.

You can get the mod from here:

*NEW* Stacked shape tools

Note: The reason you can't do this with the native Create Shape is that Moho will not allow you to create two shapes using the same closed curves. Wes' mod allows it. Also, the mod installs as an additional tool and doesn't replace the native tool.
Last edited by Greenlaw on Mon Dec 30, 2024 5:54 pm, edited 2 times in total.
User avatar
slowtiger
Posts: 6242
Joined: Thu Feb 16, 2006 6:53 pm
Location: Berlin, Germany
Contact:

Re: How do I clip lines in an object?

Post by slowtiger »

Moho will not allow you to create two shapes using the same closed curves
Ah, is that new behaviour in v14? I tested in v13 where it works.

However, I just tested my recipe in v14 and it works as well. Copying the shape does the trick.
AS 9.5 MacPro Quadcore 3GHz 16GB OS 10.6.8 Quicktime 7.6.6
AS 11 MacPro 12core 3GHz 32GB OS 10.11 Quicktime 10.7.3
Moho 13.5 iMac Quadcore 2,9GHz 16GB OS 10.15

Moho 14.1 Mac Mini Plus OS 13.5
User avatar
synthsin75
Posts: 10263
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: How do I clip lines in an object?

Post by synthsin75 »

slowtiger wrote: Sun Dec 29, 2024 5:37 pm
Moho will not allow you to create two shapes using the same closed curves
Ah, is that new behaviour in v14? I tested in v13 where it works.
Not on the exact same closed curve, like the same four-point circle. Even in v13.
User avatar
Greenlaw
Posts: 10396
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: How do I clip lines in an object?

Post by Greenlaw »

It's been that way for quite a few years now. When you create the new shape using the same points, the native tool will instead replace the existing shape.

Actually, I'm not 100% sure this is true when I'm creating a Stroke-only shape. BRB.
Last edited by Greenlaw on Sun Dec 29, 2024 6:06 pm, edited 1 time in total.
User avatar
Greenlaw
Posts: 10396
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: How do I clip lines in an object?

Post by Greenlaw »

Yeah, that happens even when I use the Stroke Only option: Moho will replace the existing filled shape with a stroke-only shape.

Wes' modified tool produces the desired result, a filled shape and a separate stroke-only shape on top. (Tested in Moho 14.3.)
User avatar
Gibble
Posts: 131
Joined: Mon Aug 20, 2018 7:01 pm

Re: How do I clip lines in an object?

Post by Gibble »

Greenlaw wrote: Sun Dec 29, 2024 5:10 pm If you use Wes' Create Shape mod, you can select the points along the outer edge, and create a Stroke-only version of the shape, which can sit on top of all the shapes, including the pattern lines.

In other words, this Stroke-only shape will share the same curve as the base shape, and the two will sandwich the pattern shapes.

You can get the mod from here:

https://www.lostmarble.com/forum/viewtopic.php?p=184390#p184390

Note: The reason you can't do this with the native Create Shape is that Moho will not allow you to create two shapes using the same closed curves. Wes' mod allows it. Also, the mod installs as an additional tool and doesn't replace the native tool.
Thanks a bunch for this alternative, DR. This definitely looks interesting. I am assuming the main advantage is that this becomes one shape- instead of multiple shapes?
User avatar
Greenlaw
Posts: 10396
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: How do I clip lines in an object?

Post by Greenlaw »

Sort of. They are still two distinct shapes, but they share the same curve. The advantage is that the shapes are perfectly matched and won't drift apart when deformed because they share the same curve.

In your image above, the only thing I see that might not be 'perfect' with this method is that the red lines break the edge stroke. So, when the stroke is laid on top of the pattern, we will see red tips peeking out around the edges.

This might be a valid design choice, but if not, you might look into placing the base shape into its own layer and use it as a mask. This way, you can use Exclude Strokes to automatically overlay the stroke on top of the 'plaid' layer being masked. This is the approach I usually take. I would put everything inside a 'shirt' group to keep the layers structure clean and manageable.

I'm curious to see how you do this. I created a plaid-shirt version of the artist character seen in the tutorial videos because I often wear an open plaid shirt with rolled-up sleeves. Unfortunately, I ran out of time to fix a few technical issues with the design, so I went with the plain shirt. Next year, I hope to upgrade the character's wardrobe to make him more 'authentic.' :D
User avatar
synthsin75
Posts: 10263
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: How do I clip lines in an object?

Post by synthsin75 »

Greenlaw wrote: Mon Dec 30, 2024 5:45 am In your image above, the only thing I see that might not be 'perfect' with this method is that the red lines break the edge stroke. So, when the stroke is laid on top of the pattern, we will see red tips peeking out around the edges.
Disabling round caps on those strokes should fix that.
User avatar
Víctor Paredes
Site Admin
Posts: 5814
Joined: Wed Jan 26, 2005 12:18 am
Location: Barcelona/Chile
Contact:

Re: How do I clip lines in an object?

Post by Víctor Paredes »

You could use Liquid Shapes in two ways:

A- Create the shirt and then create rectangles for the lines (rectangles with both fill and stroke) and clip them inside of the shirt.
The limitation of this is the strokes of the lines will need to be thinner than the lines of the shirt, otherwise they will be visible outside of the shirt.

B- Create the shirt, then create the lines using rectangles (only fill, no stroke) and then clip those into the shirt.
With this you will be able to have lines thicker than the shirt, although they won't be single strokes anymore, but rectangles.

Here is a very rough image explaining the ideas:
Image
1- "A" with with lines thicker than the shirt stroke
2- "A" with line thinner than the shirt stroke
3- "B" with rectangles fills instead of strokes
Image Image Image Image Image Image
Moho co-owner

Previously Rigged animation supervisor: My father's dragon, Wolfwalkers & Star Wars Visions "Screecher's Reach"
My personal Youtube Channel
User avatar
Greenlaw
Posts: 10396
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: How do I clip lines in an object?

Post by Greenlaw »

synthsin75 wrote: Mon Dec 30, 2024 6:22 am Disabling round caps on those strokes should fix that.
Oh! I should check that. For some reason, I thought the round caps option was broken and always stuck on round, but I could be mistaken about that.
User avatar
Greenlaw
Posts: 10396
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: How do I clip lines in an object?

Post by Greenlaw »

Víctor Paredes wrote: Mon Dec 30, 2024 2:28 pm You could use Liquid Shapes in two ways...
Cool! Thanks for creating and posting these examples, Victor. I wondered if Liquid Shapes would be appropriate, and seeing this is helpful.

The one thing that could be problematic is when artwork needs to be deformed. I'm almost certain the lines will need to be subdivided to bend correctly, and even then, it might look weird.

At least, that was my experience with Dark Swatter, a character in Boss Baby: Back In Business, who had a giant fly swatter on his helmet. The swatter was constructed like how you created the plaid pattern, but it did not deform well, and it was too complicated to subdivide. To solve this, I rendered a high-res bitmap image of the pattern and replaced the vector version with the bitmap version. (Paul's Bake-2-PNG tool arrived shortly after I mentioned this in the forums. Thanks, Paul! The tool has since come in handy many times. This tool really should be native.)

However, we were using Moho 12.5 for Boss Baby, which didn't have Liquid Shapes, and nowadays, in Moho 14.3, I'm not sure subdividing or baking is necessary because Liquid Shapes dynamically creates new geometry as needed. In this case, I'm guessing it still needs subdivided lines.

I'll have to check this later, but if anyone already knows, please post here.

Thanks!
Last edited by Greenlaw on Mon Dec 30, 2024 5:52 pm, edited 1 time in total.
User avatar
lucasfranca
Posts: 180
Joined: Sat Oct 07, 2017 11:47 pm

Re: How do I clip lines in an object?

Post by lucasfranca »

Greenlaw wrote: Sun Dec 29, 2024 5:10 pm If you use Wes' Create Shape mod, you can select the points along the outer edge, and create a Stroke-only version of the shape, which can sit on top of all the shapes, including the pattern lines.

In other words, this Stroke-only shape will share the same curve as the base shape, and the two will sandwich the pattern shapes.

You can get the mod from here:

https://www.lostmarble.com/forum/viewtopic.php?p=184390#p184390

Note: The reason you can't do this with the native Create Shape is that Moho will not allow you to create two shapes using the same closed curves. Wes' mod allows it. Also, the mod installs as an additional tool and doesn't replace the native tool.
Is the link broken? I can't access it.
An old guy [since 1983] who was raised in front of the TV.
Passionate about animation, after getting old, he decides to make it his hobby.

I share tutorials, reviews, tips and tricks from this vast world of animation on my channel.

https://youtube.com/animai2D
Post Reply