Home Adobe Substance

Bezier spline in Substance Painter for something like stitches brush?

Offline / Send Message
gnoop interpolator
Does anyone  know a working  solution ?   3d party maybe?     Maybe a spline guide  approach like in Zbrush or  3d coat?.   I mean to paint   a rope for example  ? 

Also can SPainter  use a long pattern image  for  such a brush  rolling out alone a brush stroke  also like Zbrush or 3dcoat or Corel PAinter   or it always should be square?


  • poopipe
    Offline / Send Message
    poopipe veteran polycounter
    there's a number of tools available that use fx-maps if you have a google.
    eg. this (not particularly a recommendation, just the first one i remember seeing)

    not sure if there's a good pixel processor version released but it's not exactly rocket science (a bezier curve is just a stack of lerps) - if you're interested i've got a simple sd-sex implementation you're welcome to have the code for

    painter brushes can be any aspect ratio but at least on the pre-green versions you are limited to stamping your alpha at set distances along the stroke (as per photoshop) and there's no way to access the brushes through the javascript API
    short answer - dont think it's possible
  • gnoop
    Offline / Send Message
    gnoop interpolator
    Thanks poopipe      Please , share a link to your simple implementation.     I never managed to figure out  how  people do it.   Prefer to understand it myself first. 
     As of  rolling  out brush  my hope we can have a uv stripe  follow  a bezier curve through a pixel processor or fx map.    It could be used  to map anything  along  and  scale the tiling.

  • poopipe
    Offline / Send Message
    poopipe veteran polycounter
    that second bit is definitely not straightforward in a pixel processor - if it's actually practical at all 

    however ,

    this sd-sex expression will plot <n> points a bezier defined by 4 control points.

    <p># points
    p0 = float2(0.2, 0.2)
    p1 = float2(0.8, 0.2)
    p2 = float2(0.4, 0.8)
    p3 = float2(0.8, 0.8)
    pos = get_float2('$pos')
    y = sqrt(2.0)
    ::for i in range(5)
        delta = 0.25    
        t = delta * {{i|float}}
        # position on curve
        p = p0 * vector2((oneminus(t)*oneminus(t)) * oneminus(t),(oneminus(t)*oneminus(t)) * oneminus(t)) + p1 * float2(3.0,3.0) * vector2(t * (oneminus(t) * oneminus(t)),t * (oneminus(t) * oneminus(t))) + p2 * float2(3.0,3.0) * vector2((t*t) * oneminus(t),(t*t) * oneminus(t)) + p3 * vector2((t*t) * t,(t*t) * t)
        y = min(y, distance_vec2(pos, p))
    _OUT_ = y <br></p>

    this will plot 5 points, afaik you can't use a variable to define the length of a loop in this

    if you add more points  you get a smoother curve - delta should =  1/(numberofpoints-1)

    there is a simpler to understand method of implementing a bezier by stacking lerps but you can google for that (coding train has a nice video) 

    you need sd-sex installed, which is here....


    it will change your life

  • gnoop
    Offline / Send Message
    gnoop interpolator
Sign In or Register to comment.