Can you use cloth modifier to create .anm file?

Discussion in 'Track Modding' started by Nibiru, Jun 21, 2016.

  1. Nibiru

    Nibiru Registered

    Joined:
    Dec 24, 2011
    Messages:
    1,200
    Likes Received:
    1,295
    I have been playing around with making flags and tents using the cloth modifier in 3dsmax. I have tried to make the .anm file but not luck.

    Is it possible to use the cloth keyframes and make a .anm file?

    Any help is appreciated

    Cheers
    Nib
     
  2. Woodee

    Woodee Registered

    Joined:
    Oct 4, 2010
    Messages:
    4,004
    Likes Received:
    1,058
    It may need to have bones to make a flag.
     
  3. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
     
  4. Nibiru

    Nibiru Registered

    Joined:
    Dec 24, 2011
    Messages:
    1,200
    Likes Received:
    1,295
    Thanks Gijs thats what I have in 3dsmax. I want to use the keyframes to make the .anm file so it can be loaded in game.
     
  5. Coutie

    Coutie Moderator Staff Member

    Joined:
    Oct 5, 2010
    Messages:
    3,779
    Likes Received:
    2,241
    You'll need bones or something else, like dummys. I don't think it'll work right off the bat in rf2.
     
  6. Nibiru

    Nibiru Registered

    Joined:
    Dec 24, 2011
    Messages:
    1,200
    Likes Received:
    1,295
    Thats what I'm thinking Coutie, but it's so much faster to make a nice looking animation with the cloth modifier.
     
  7. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    Bake the dynamic animation to vertex/key frames. (= Morph Target Animation)

    Or

    Create bone joints per vertex and bake the animation to the joints. (= Biped Animation) steps ==> https://www.youtube.com/watch?v=fUpTu-uMFRo

    First you need to create a Cache from the dynamic animation.
    Then manipulate the cache to have a nice loop. (there are some tutorial on youtube how to do this)

    Then you can bake the cache animation on the Flags vertex or the bone joints attached to flag.


    I've done the vertex/key frame bake with the rF2 flag. After the animation bake i could remove the nCloth and the constrains to the pole.
    Each vertex movement is baked on the timeline.
     
  8. Woodee

    Woodee Registered

    Joined:
    Oct 4, 2010
    Messages:
    4,004
    Likes Received:
    1,058
    You could also do a DDS texture animation of flags waving. I have seen this on a few tracks. I can't remember if they were official though.
     
  9. Coutie

    Coutie Moderator Staff Member

    Joined:
    Oct 5, 2010
    Messages:
    3,779
    Likes Received:
    2,241
    You'll use the cloth modifier with the bones, like Gijs is saying. Or you can try morph target, I've never tried it, I didn't think it worked.

    Try this: Make your flag, copy it, do your cloth modifier, get it looping nicely. Do the bake. Create one bone per vertex, don't link them. Turn autokey on and just move them every key frame that the cloth modifier flag has. Then move the flag you copied with no cloth modifier over to the bones, and do your skinning. I might have some steps mixed up, and there may be an easier way, but that should do it.
     
  10. Nibiru

    Nibiru Registered

    Joined:
    Dec 24, 2011
    Messages:
    1,200
    Likes Received:
    1,295
    Thanks Gijs and Coutie, Thats what I started doing so at least I'm on the right page.
     
  11. Nibiru

    Nibiru Registered

    Joined:
    Dec 24, 2011
    Messages:
    1,200
    Likes Received:
    1,295
    NOTE TO SELF: Don't make to many frames if you can.

    This is a very time consuming way. There has to be a faster way to get the task done.

    I have a few different objects I want to play around with. Just this flag alone has 45 verts with 100 frames. Thats 4500 vert moves alone not to mention the panning and zooming that needs to be done manually. It's taken many many hours to get 20 frames done. I'll finish this flag but I'm not sure I'll spend the time on another object unless there is a faster way.

    EDIT: On a side note can you link a sound file to an animation?
     
    Last edited by a moderator: Jun 23, 2016
  12. Coutie

    Coutie Moderator Staff Member

    Joined:
    Oct 5, 2010
    Messages:
    3,779
    Likes Received:
    2,241
    Turn vert snap on and you shouldn't have to zoom or anything.
     
  13. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    Create a cloth flag with wind etc... You already know how to.

    - Pick a point in time were the flag is bend nicely as a starting point and "set starting point from current". So it doesn't start as straight object.
    - Create Cache from the animation.
    - Bake the animation to the vertex (controle points)
    - Remove the Cloth things...




    Note:
    - Playback wasn't set to real time in Maya. Playback was way faster then real time because it was just a low poly flag. A more dense poly flag will look nicer ofcourse.
    - I ended up with a face i couldn't remove at that moment. So i dragged it down. but i could remove it by seperating it into an object and remove the object.
    - Once you have the cache you can mix it so the end state is the same as the start, so that it is loopable.
    - I didn't invent this myself... There are tutorials on youtube... :cool: => https://www.youtube.com/watch?v=0LFWv7rNufI
     
  14. Nibiru

    Nibiru Registered

    Joined:
    Dec 24, 2011
    Messages:
    1,200
    Likes Received:
    1,295
    Thanks for the replies
    @Coutie I am using snaps. I made my bones to small so thats why I needed to pan and zoom at times. (learning from my mistakes) :)

    @Gijs Thanks for the videos. How do you export the anm file from maya? Do you export your scene to fbx then import into gjed?
     
  15. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    I can export an animated fbx. But gJED can't read the animation part. I'll have to wait until gJED does... if ever? :(
     
  16. Nibiru

    Nibiru Registered

    Joined:
    Dec 24, 2011
    Messages:
    1,200
    Likes Received:
    1,295
    Hmmm.........This is my problem. I can also export the gmt BUT without correct .anm file gmt doesn't work.

    So I go back to the heading of the post "Can you use cloth modifier to create .anm file?"

    at this stage it is possible but very time consuming depending on the size of animation and object.

    There should be an easier and faster way to get the job done.

    Maybe a script Mario could work on :)

    or maybe Luc or tuttle can shed some light.


    EDIT so maybe this statement from the Gjed documents is stretching the truth :)
     
    Last edited by a moderator: Jun 24, 2016
  17. Mario Morais

    Mario Morais Registered

    Joined:
    Oct 26, 2010
    Messages:
    1,465
    Likes Received:
    169
    almost everything is possible with MAXScript. :)
     
  18. Coutie

    Coutie Moderator Staff Member

    Joined:
    Oct 5, 2010
    Messages:
    3,779
    Likes Received:
    2,241
    There is a way. Someone here made one, but doesn't have the script anymore. Search for flag or something and you'll see.

    Sent from my HTC One using Tapatalk
     
  19. Bink

    Bink Registered

    Joined:
    Nov 20, 2011
    Messages:
    523
    Likes Received:
    2
    If I remember correctly... started out trying to use cloth mod, but found it too buggy.

    It's been a while (couple of programs, and a few years ago), but I can look into it if you want to know about the process.

    Eventually re-wrote the script to make flags / trackside banners with bones (but kept the script's name myClothThing).

    Never finished or released the script, as I found working on another script (aiw~thing) to be more challenging.

    You can find an example animation (max file, checkered image, readme... etc..) and directions how to load and export it on this thread:
    http://isiforums.net/f/showthread.php/2276-How-to-open-ANM-files-in-3ds-Max?p=415815&viewfull=1#post415815
     
  20. Nibiru

    Nibiru Registered

    Joined:
    Dec 24, 2011
    Messages:
    1,200
    Likes Received:
    1,295

    I like the sound of that
     

Share This Page