Jump to content

Sign in to follow this  
daddycoull

Changing spline path

Recommended Posts

Hi there,

 

I'm re-using expresso a member @jed helped me with earlier this year, where an object following a spline path switches to another.  In the example they helped me with it was a truck turning a corner then reversing.

 

I now have a new situation where I'm looking into using it for a forklift.  The scenario is the forklift moves to a position picks something up, reverses then moves back in the direction it came from.  The first two movements I've managed using the previous expresso mentioned above.  The problem is that there is a 3rd movement added into the equation.  I tried cracking it myself and failed haha.  I've attached the xpresso, the top section was my failed attempt at trying to crack it!

 

Thanks!

 

194335421_c4dxpresso.thumb.jpg.a4c7e58d7d13d9ee7fed5bb494258d3f.jpg

 

Share this post


Link to post
Share on other sites

You can just chain the condition nodes

selector.thumb.png.94612372d850b8b9ce50b624e69a7657.png

 

although this is a bit more elegant (and customizable)

def main():
    global select

    if frame < 700:
        select = 0

    elif frame >= 700 and frame < 800:
        select = 1

    else:
        select = 2

selector2.thumb.PNG.7a78e3ba8e36811d6fe1dca43d46d6d9.PNG

Share this post


Link to post
Share on other sites
  • Topic Author
  • 31 minutes ago, jed said:

    You can just chain the condition nodes

    selector.thumb.png.94612372d850b8b9ce50b624e69a7657.png

     

    although this is a bit more elegant

    
    def main():
        global select
    
        if frame < 700:
            select = 0
    
        elif frame >= 700 and frame < 800:
            select = 1
    
        else:
            select = 2

    selector2.thumb.PNG.7a78e3ba8e36811d6fe1dca43d46d6d9.PNG

    Ah didn't realise you could chain conditions, the less elegant one work!  Thanks again @jed

    Share this post


    Link to post
    Share on other sites
  • Topic Author
  • @jed On closer inspection I'm getting a weird jump between frame 699 and 700 (when it changes from Path 1 to Path 2), but there isn't the same from when it changes from path 2 to path 3.

     

    Are the splines I'm using not aligned or correct enough?  I've uploaded the file 🙂

     

    Thanks

    c4d_help.c4d.zip

    Share this post


    Link to post
    Share on other sites

    Changing the align keyframe to 0 at F700 seems to make it smoother

     

    help2.zip

    Share this post


    Link to post
    Share on other sites
  • Topic Author
  • 1 hour ago, jed said:

    Changing the align keyframe to 0 at F700 seems to make it smoother

     

    help2.zip 1.12 MB · 1 download

    Ah yeah I see what you mean, @ frame 700 I had it at 0.5% instead of 0, which fixes it.  Great thanks for the help again!

    Share this post


    Link to post
    Share on other sites

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Reply to this topic...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    Sign in to follow this  

    • Recently Browsing   0 members

      No registered users viewing this page.

    Latest Topics

    Latest Comments

    ×
    ×
    • Create New...