Jump to content

Sign in to follow this  
Chillkroete

Trigger abc animation with xpresso

Recommended Posts

Hi,

 

I want to control my alembic animation (palnt growth) with a null object. I thought that xpresso is a good way to go.
But I have no clue how to build a xpresso rig for this purpose.

 

The idea is that when the null object passes the object in z space, the plant growth animation will start.

 

Somebody any idea?

Kind regards martin

abcgrowthanimation.png

Share this post


Link to post
Share on other sites

Sounds like a job for set driver command 🙂

 

Right click on your Z position of null object and go set driver, then right click on alembic parameter you want to affect and go set driven. This should create simple Xpresso where you can tune the details in range mapper


Free C4D trainings from MAXON professional on our youtube channel

 

https://www.youtube.com/c4dcafe

Share this post


Link to post
Share on other sites
  • Topic Author
  • Thank you hrvoje.

    I tried to build a setup with compare and condition node.
    The problem is that the alembic animation starts right at the begining and not when the null object passes.

    So when the null object passes, the plant just appears and does not grow.

     

    abctriggeranimation.png

    Share this post


    Link to post
    Share on other sites

    Please attach as scene file and alembic asset. If it is under NDA you can send me a pm...


    Free C4D trainings from MAXON professional on our youtube channel

     

    https://www.youtube.com/c4dcafe

    Share this post


    Link to post
    Share on other sites

    Xpresso would work but the more elegant and flexible way is probably to use Fields for that. I've attached an example (you'll have to relink the abc generators to the abc location on your machine). I've created two versions of the abc generator, turned of animation and set one of them to frame 0, the other one to frame 23 (last frame of animation). The cloner is set to blend (which will blend parameters of children, in our case the frame parameter) and the plain effector has everything disabled but "modify clone". The spherical fields replaces the null object in your setup and will control which frame of the abc the clone will be showing.

    This is a very versatile way of doing this as you can a) use any of the available fields to control the animation and it will b) scale easily if you want more than one flower as it will automatically work with all clones. 

     

    Note that this only works when the cloner is outputting "real" objects. If you want to use instancing you'll have to create a copy for each frame of the animation and subordinate it under the cloner. 

    abctriggertest_fields.c4d

    Share this post


    Link to post
    Share on other sites
  • Topic Author
  • Thats a great approach havealot, thanks a lot for your help.
    In fact of performance (i have to scatter a lot of palnts), which way is the best to go?

    Share this post


    Link to post
    Share on other sites

    Make an editable copy of the alembic generator for each frame of the animation (in this case 0 to 23) and make them a child of the cloner. Than switch the cloner to multi instance mode. I just tried for 10000 plant and it is working as expected. Not real time of course but if you need better feedback for setting up your scene you can use switch the cloner to matrix using the "Swap Cloner/Matrix" command and change your effector to also change scale or color to visualise the animation. When you are happy with the your clone distribution and animation you can swap it back before rendering (don't forget to revert the changes you did to the effector). 

    Happy instancing 🙂

    Share this post


    Link to post
    Share on other sites
  • Topic Author
  • Thanks havealot thats a good way to scatter a lot of plants 🙂

    One more problem i see is that the animation speed of the growth effect is dependend on how fast the cloners get activated by the field object.

    For example my growth effect is 40 frames long, but because of the fast movement of the field object, the growth effect just happens in 10 frames.

     

    Share this post


    Link to post
    Share on other sites
  • Topic Author
  • it really depends on the field settings.
    thanks a lot 🙂

    Share this post


    Link to post
    Share on other sites
    On 11/5/2019 at 11:40 AM, Chillkroete said:

    Thanks havealot thats a good way to scatter a lot of plants 🙂

    One more problem i see is that the animation speed of the growth effect is dependend on how fast the cloners get activated by the field object.

    For example my growth effect is 40 frames long, but because of the fast movement of the field object, the growth effect just happens in 10 frames.

     

     

    If fear that is going to be a limitation of this setup. It controls the frames directly instead of triggering animation per clone.  You can probably build a more sophisticated field setup to achieve this but I haven't tried it yet. 

    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.

    ×
    ×
    • Create New...