# Align heart pattern on shader with ribbons (my brain hurts)

**URL:** <https://blenderartists.org/t/align-heart-pattern-on-shader-with-ribbons-my-brain-hurts/1447367>\
**Category:** Materials and Textures\
**Tags:** modeling, shading, geometry-nodes, characters, texturing\
**Created:** [January 30, 2023, 2:49pm UTC](https://blenderartists.org/t/align-heart-pattern-on-shader-with-ribbons-my-brain-hurts/1447367 "2023-01-30T14:49:39Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![WolfStudioArt](https://blenderartists.org/user_avatar/blenderartists.org/wolfstudioart/32/1467462_2.png) [@WolfStudioArt](https://blenderartists.org/u/WolfStudioArt)\
**Post date:** [January 30, 2023, 2:49pm UTC](https://blenderartists.org/t/align-heart-pattern-on-shader-with-ribbons-my-brain-hurts/1447367/1 "2023-01-30T14:49:39Z")

</div>

For valentines i made this ribbon node in GNs out of a vertex line so i can apply stuff like wrapping modifiers without much difficulty

 ![imagen](https://blenderartists.org/uploads/default/original/4X/f/8/f/f8fedad883c2982aa3051aa857d74b64d7e0b302.jpeg)

the thing is, it’s material has a heart shape pattern going along the curve, but i have no idea of how to actually do so since the UV doesnt exist and the actual heart pattern just clips through the ribbon path (photo below)

---

<div class="post-metadata">

**Author:** ![WolfStudioArt](https://blenderartists.org/user_avatar/blenderartists.org/wolfstudioart/32/1467462_2.png) [@WolfStudioArt](https://blenderartists.org/u/WolfStudioArt)\
**Post date:** [January 30, 2023, 2:50pm UTC](https://blenderartists.org/t/align-heart-pattern-on-shader-with-ribbons-my-brain-hurts/1447367/2 "2023-01-30T14:50:17Z")

</div>

![imagen](https://blenderartists.org/uploads/default/original/4X/2/9/c/29c46cb0f44a11e319f27c3f1d56ce855e2cd90e.jpeg)

---

<div class="post-metadata">

**Author:** ![higgsas](https://blenderartists.org/user_avatar/blenderartists.org/higgsas/32/782144_2.png) [@higgsas](https://blenderartists.org/u/higgsas)\
**Post date:** [January 30, 2023, 3:21pm UTC](https://blenderartists.org/t/align-heart-pattern-on-shader-with-ribbons-my-brain-hurts/1447367/3 "2023-01-30T15:21:15Z")

</div>

Setup to get uv on curves

 ![image](https://blenderartists.org/uploads/default/original/4X/9/c/4/9c45232d5bd0dc0475eb729ee623c6bc8ec3b4f9.jpeg)

---

<div class="post-metadata">

**Author:** ![stray](https://blenderartists.org/user_avatar/blenderartists.org/stray/32/1433520_2.png) [@stray](https://blenderartists.org/u/stray)\
**Post date:** [January 30, 2023, 3:24pm UTC](https://blenderartists.org/t/align-heart-pattern-on-shader-with-ribbons-my-brain-hurts/1447367/4 "2023-01-30T15:24:18Z")

</div>

But what happens on the last segment of a cyclic profile? At least that’s where I got stuck with this solution…  
 ![image](https://blenderartists.org/uploads/default/original/4X/2/7/2/272b59a25639c6b81b88412eddd7b750883f0a47.png)

---

<div class="post-metadata">

**Author:** ![Charles\_Weaver](https://blenderartists.org/user_avatar/blenderartists.org/charles_weaver/32/1070800_2.png) [@Charles\_Weaver](https://blenderartists.org/u/Charles_Weaver)\
**Post date:** [January 30, 2023, 3:27pm UTC](https://blenderartists.org/t/align-heart-pattern-on-shader-with-ribbons-my-brain-hurts/1447367/5 "2023-01-30T15:27:29Z")

</div>

Usually there isn’t a perfect method to unwrap face ring topology anyways, right? I mean, you can usually line it up nicely but you’ll always have a seam on every cylinder, cone, and torus you unwrap.

EDIT: I saw the screenshot you added. I see what you mean. Is that an issue with the first point having a value of 0 in the spline length?

---

<div class="post-metadata">

**Author:** ![higgsas](https://blenderartists.org/user_avatar/blenderartists.org/higgsas/32/782144_2.png) [@higgsas](https://blenderartists.org/u/higgsas)\
**Post date:** [January 30, 2023, 3:29pm UTC](https://blenderartists.org/t/align-heart-pattern-on-shader-with-ribbons-my-brain-hurts/1447367/6 "2023-01-30T15:29:48Z")

</div>

Here is curve node group with proper uvs

 ![image](https://blenderartists.org/uploads/default/original/4X/b/1/e/b1e282c9def2200b8556a423a6a746b3b52e8443.jpeg)

[uv crv.blend](https://blenderartists.org/uploads/short-url/vQSjPOYbQrhvIpPkZkjSUxKeCCd.blend) (1.5 MB)

---

<div class="post-metadata">

**Author:** ![sozap](https://blenderartists.org/user_avatar/blenderartists.org/sozap/32/443872_2.png) [@sozap](https://blenderartists.org/u/sozap)\
**Post date:** [January 30, 2023, 3:30pm UTC](https://blenderartists.org/t/align-heart-pattern-on-shader-with-ribbons-my-brain-hurts/1447367/7 "2023-01-30T15:30:08Z")

</div>

you can use @zeroskilz nodegroups : [z-Curve-Sweeper for Blender 3.0+ (Curve-to-Mesh with superpowers)](https://blenderartists.org/t/z-curve-sweeper-for-blender-3-0-curve-to-mesh-with-superpowers/1365277)

I’m pretty sure it solves this issue. This is something that is going to be fixed in blender at some point BTW.

To fix it by yourself it’s a little rabbit hole, you need to make the curve non-cyclic , restore the last segment, then curve to mesh, then transfer UV if I recall correctly …

---

<div class="post-metadata">

**Author:** ![stray](https://blenderartists.org/user_avatar/blenderartists.org/stray/32/1433520_2.png) [@stray](https://blenderartists.org/u/stray)\
**Post date:** [January 30, 2023, 3:34pm UTC](https://blenderartists.org/t/align-heart-pattern-on-shader-with-ribbons-my-brain-hurts/1447367/8 "2023-01-30T15:34:36Z")

</div>

> [@Charles\_Weaver](#):
>
> Is that an issue with the first point having a value of 0 in the spline length?

It’s an issue of the first point being also the last point =) Since it happens twice on the map, we need to somehow get two different values. I’m assuming it would require a bit of indexing magic to transfer correctly…

---

<div class="post-metadata">

**Author:** ![WolfStudioArt](https://blenderartists.org/user_avatar/blenderartists.org/wolfstudioart/32/1467462_2.png) [@WolfStudioArt](https://blenderartists.org/u/WolfStudioArt)\
**Post date:** [January 30, 2023, 3:34pm UTC](https://blenderartists.org/t/align-heart-pattern-on-shader-with-ribbons-my-brain-hurts/1447367/9 "2023-01-30T15:34:41Z")

</div>

Ugh, Thank you you guys are life savers

---

<div class="post-metadata">

**Author:** ![Charles\_Weaver](https://blenderartists.org/user_avatar/blenderartists.org/charles_weaver/32/1070800_2.png) [@Charles\_Weaver](https://blenderartists.org/u/Charles_Weaver)\
**Post date:** [January 30, 2023, 3:46pm UTC](https://blenderartists.org/t/align-heart-pattern-on-shader-with-ribbons-my-brain-hurts/1447367/10 "2023-01-30T15:46:16Z")

</div>

Hey, since the post and title are a question about blender, I moved it to a support category and gave @higgsas the solution.

@WolfStudioArt, please feel free to make a new topic in the #artwork:works-in-progress category if you’d like to share your wip! I just moved this topic because it was more of a support question on its own.

---

<div class="post-metadata">

**Author:** ![Debuk](https://blenderartists.org/user_avatar/blenderartists.org/debuk/32/1441624_2.png) [@Debuk](https://blenderartists.org/u/Debuk)\
**Post date:** [January 30, 2023, 6:33pm UTC](https://blenderartists.org/t/align-heart-pattern-on-shader-with-ribbons-my-brain-hurts/1447367/11 "2023-01-30T18:33:27Z")

</div>

> [@stray](#):
>
> It’s an issue of the first point being also the last point =) Since it happens twice on the map, we need to somehow get two different values.

Yes the problem is caused by the large inverted mapping logic along the “seam”. Its indirectly caused by the way strict way values are interpreted on the gpu. This is not blender only, but rather an old generally known problem. You can duplicate the points and and introduce a uv seam there or you can directly alter the shading to support that, but the latter isnt currently possible in blender, blenders shader graph isnt not supporting the needed shader functions.

---

<div class="post-metadata">

**Author:** ![zeroskilz](https://blenderartists.org/user_avatar/blenderartists.org/zeroskilz/32/1089470_2.png) [@zeroskilz](https://blenderartists.org/u/zeroskilz)\
**Post date:** [January 30, 2023, 7:22pm UTC](https://blenderartists.org/t/align-heart-pattern-on-shader-with-ribbons-my-brain-hurts/1447367/12 "2023-01-30T19:22:22Z")

</div>

Yeah, check out my z-curve-sweeper or this:

> [@Curve-To-Mesh with UVs node-group for Blender 3.0/4.0 (Geometry Nodes)](https://blenderartists.org/t/curve-to-mesh-with-uvs-node-group-for-blender-3-0-geometry-nodes/1362714/15):
>
> Hi, I’ve given up… face_exhaling any attempt to get to the edge-face-corners involve an equivalent amount of computation as you would need to just compute the indices in the first place, so it doesn’t seem like I can speed it up any more without making a tangle of non-sensical switches… cold_sweat Here is the final version of what will get integrated into the z-curve-sweeper. [Curve-To-Mesh-UV.0.1.blend](https://blenderartists.org/uploads/short-url/awKKd4muGn4KptU197HYJdu3q6B.blend) (133.6 KB) Works with any amount of curves and profile curves as inputs: Was…

That same technique is used in the z-curve-sweeper if you don’t wanna do gumroad… It’s using face-corner index-magic, as you’ve guessed. The z-curve-sweeper stores the result in uv\_map face-corner named property so it’s easier to work with - it’s easy to port the above file to do something similar (Thanks to user @quellenform for their help).

@Debuk : not quite - that just happened when using points to transfer the UVs instead of Face-Corners… because the U/V value is going from e.g. 0.9 to 0 on the last vertices, instead of from 0.9 to 1 (since the final and fist vertices are the same) - using Face corners fixes the issue and you don’t get that band. Check out Higgsas’ and my node-groups for solutions that fix it.

---

<div class="post-metadata">

**Author:** ![Debuk](https://blenderartists.org/user_avatar/blenderartists.org/debuk/32/1441624_2.png) [@Debuk](https://blenderartists.org/u/Debuk)\
**Post date:** [January 30, 2023, 8:27pm UTC](https://blenderartists.org/t/align-heart-pattern-on-shader-with-ribbons-my-brain-hurts/1447367/13 "2023-01-30T20:27:15Z")

</div>

Hmm, I was referring to default meshstructures without redundancies like facecorners and so indeed hadn’t those in mind while writing that.

Without directly or indirectly duplicating the uvs thats not possible to solve on meshbasis. You can try to export it without a fitting shader and without a uvseam there. Then you see what I mean. So if you have luck then apply on that facercorner workaround leads to a seam there too or it is simply broken.

But yeah facecorners may indeed be a good way to make it work in GN itself, thanks for the tip.
