Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rasterized Path Range issue
#1
Hi, I want to deform a spring mesh along a spline, and animate Rasterized Path's From/To property to create a stretch animation, but the Curvy Generator always throws ArgumentNullException. After some investigation, I found when set To=1, it's actual value becomes 0, and From is also 0,so the CGPath is null. In the BuildRasterizedPath.cs, I see From/To property make some clamp for value:

Code:
public float From
{
    get => m_Range.From;
    set
    {
        float v = DTMath.Repeat(
            value,
            1
        );
        if (m_Range.From != v)
        {
            m_Range.From = v;
            Dirty = true;
        }
    }
}

public float To
{
    get => m_Range.To;
    set
    {
        float v = Mathf.Max(
            From,
            value
        );
        if (ClampPath)
            v = Mathf.Repeat(
                value,
                1
            );
        if (m_Range.To != v)
        {
            m_Range.To = v;
            Dirty = true;
        }
    }
}

From use a specific DTMath.Repeat to clamp the value, which keep 1 for 1, but To still use Mathf.Repeat, which make 1 becomes 0. After replace Mathf.Repeat with  DTMath.Repeat, it can work normally. So should it be DTMath.Repeat too for To property?

In addition, when set From and To with same value, which means Length = 0, the Generator always throws ArgumentNullException, I guess when the Length = 0,  CGPath always is null. Can it generate a empty path/mesh, otherwise I have to keep a small distance between From and To to avoid the ArgumentNullException.

Beside, To use Mathf.Max(From, value) to make sure it >= From, but the From don't have such check. So when set the range, To must set after From. Should From also do the same?

Thanks.
Reply


Messages In This Thread
Rasterized Path Range issue - by proton - 04-12-2024, 04:00 PM
RE: Rasterized Path Range issue - by _Aka_ - 04-15-2024, 01:52 PM
RE: Rasterized Path Range issue - by _Aka_ - 04-15-2024, 03:42 PM
RE: Rasterized Path Range issue - by proton - 04-27-2024, 09:26 AM
RE: Rasterized Path Range issue - by _Aka_ - 04-29-2024, 10:44 AM
RE: Rasterized Path Range issue - by _Aka_ - 04-29-2024, 12:24 PM
RE: Rasterized Path Range issue - by proton - 04-30-2024, 05:13 AM
RE: Rasterized Path Range issue - by _Aka_ - 04-30-2024, 11:17 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Incorrect mesh alignment after extrusion on curved path Thinkurvy 10 21 04-17-2024, 10:57 AM
Last Post: _Aka_
  Curvy discards Input Spline Range VoltDriver 3 5 11-28-2023, 07:14 PM
Last Post: _Aka_
  Disable Generator Rasterized Objects SAMYTHEBIGJUICY 3 5 09-01-2023, 03:38 PM
Last Post: _Aka_
Wink Train carriage with 2 bogies following a path arcadeperfect 9 27 08-25-2023, 02:56 PM
Last Post: arcadeperfect

Forum Jump: