Announcement

Collapse
No announcement yet.

Reactor Chain Tutorial

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Reactor Chain Tutorial

    Ever tried to create realistic chain simulations using reactor? It can be frustrating to say the least. The chains break from each other unless you use insane amounts of substeps. Also it can take ages to compute if it doesn't crash your computer. Well here's a tutorial that gets around all of that and looks great.

    There are a couple of ways to go about it. One, that we wont document here uses a reactor rope object attached to your chain links. While it works in a pinch, you have to use path deform and that will deform your mesh (links) and doesn't look real great in alot of situations.

    This approach does require a free plugin. Its called Attach_Selection_to_Surface_by_Local_Z.ms and can be found here:http://www.time-in-motion.com/ Anyways, go get it and have it handy.

    Step one:
    Create a torus in the top view and give it segments and sides like you see in the image.


    Step two:
    Convert it to poly and move the bottom vertices until you get a link like so, or however you want the link to look.


    Step three:
    Clone/copy the link, rotate 90degrees and move it down so that the edges of both are just touching. Dont worry about needing a distance between the two of them.



    Step four:
    okay, next select the two links, hold shift and move them down so that they once again touch. In the dialogue box set the # of copies... This will make sure they are the same distance. I chose 10.


    Step Five:
    Now, still in top view, select all the links, go to the hierarchy tab, choose Pivot, and select "center to object." Followed by pressing the "align to world" button. Make sure each links pivot is indeed centered on itself and aligned to world.


    Step Six:
    Next pat yourself on the back, cause your through alot of it already! Now create a plane, the WIDTH of the links, and the LENGTH of the entire set of links. Make sure its segments is 1 wide and enough segments in length to have one full poly per link. You will probably have to collapse to poly and manually adjust the vertices of the plane until ease vertex line exactly touches where each link touches the next? Understood? if not look at the image:


    Step Seven: Okay now time for the script. Make sure your plane is aligned with the links along the Z axis. Select ALL the links and then run the script. Your going to see a rubberband, now select the plane. Youll see a quick progress bar and then its done. Now if you get an error message talking about something not aligned to the Z of something, dont fret, make sure once again all your links are aligned to the world along the z axis. Make sure your in top view. When properly completed youll have all these little null objects for each links like so:



    Step eight: Alright that was the hardest part and it wasn't too bad at all. Now lets setup reactor. Select the plane, give it a reactor cloth modifier and then make it part of a cloth collection. Make sure the cloth is set to concave in reactor object properties. IMPORTANT!! Make sure the plane has a positive mass, and even more important, go to the cloth modifier rollout and set the stiffness to 1.0 If not, the links will break as the cloth stretches.



    Create an object the links can react with, a plane, box or something. I chose a prism object. Make it part of a rigid body collection, make sure it has a mass of 0.0 and set it to inactive.

    Step nine: hey thats pretty much it! Run your simulation and see how fast it simulates and how great it looks!

    Now there are some downsides to this approach. Since the links follow the cloth, the natural rotation of the link caused by the links it touches might not look perfect. After all its all driven by the cloth. Also if the cloth rotates, so do the links, and that might not look great if the cloth rotates too much. But you can go into the subobject mode of the cloth, attach it to other rigid bodies and so on for nice animations. Ive never tried making the links part of a rigid body collection so they properly bounce off of other objects as you can see the links penetrate the prism, though you could set the collision tolerance in reactor to account for the necessary distance.

    Hope that explains it. Thanks for checking it out, and thanks to Morbid Angel for giving me the idea to post the tutorial here. Also thanks to Phormis on the cgtalk forum for the help.

    Check out my final results:http://myweb.cableone.net/amylenhart...rplayblast.avi
    ____________________________________

    "Sometimes life leaves a hundred dollar bill on your dresser, and you don't realize until later that it's because it fu**ed you."


  • #2
    nice tutorial, but it is really easy to set up with simcloth. Took me only a few minutes. Here is the file, it could use some fine tuning but it is a pretty good start.
    Eric Boer
    Dev

    Comment


    • #3
      I couldn't open it...only have max 6
      ____________________________________

      "Sometimes life leaves a hundred dollar bill on your dresser, and you don't realize until later that it's because it fu**ed you."

      Comment


      • #4
        Starting clean with your chain and deflector I would:

        1. Apply Simcloth modifiier to all the objects

        2. Select the deflector object, uninstance the simcloth modifier and verify that it is set to "deflector". That's it the deflector is set.

        3. Select one of the chainlinks (also make sure none of the links are intersecting leaving a small gap between each one.) In the modifier panel set the object type to "rigid body". Increase the mass to around 30. In the global roolout decrease the Substeps to 3 or 4, Check the "check for intersections" box and set the collission tolerance to around 1.75. In the integrity rollout set the Stretch forces-springs-stiffness and the Bend forces-Face angle-Stiffness both to 1000.

        4. That's it, press "START CALCULATION" and away you go.
        Eric Boer
        Dev

        Comment


        • #5
          dont mistake my tutorial as a statement that I dont know how to setup chains in reactor or simcloth, as Ive done considerable testing in both. This is more of an alternative that is incredibly fast to simulate, requires much less cpu overheard and still looks good. Its not hard for any computer to simulate correctly the above setup, but multiply that by 100 or more and see how long it takes.
          ____________________________________

          "Sometimes life leaves a hundred dollar bill on your dresser, and you don't realize until later that it's because it fu**ed you."

          Comment


          • #6
            cool, you started off by saying that it was a pain to set up in reactor and that the solution was slow, so I wanted to show how easy it is is do set up with simcloth and the solution time is under 3 mins. Just for fun I created 100 copies of the scene and am letting solve, looks like it is going to take about 3-4 hours to calc. How long would it take with 100 copies of your setup?
            Eric Boer
            Dev

            Comment


            • #7
              good question. it took about 30 secs to solve the simple one, let me give it a try.
              ____________________________________

              "Sometimes life leaves a hundred dollar bill on your dresser, and you don't realize until later that it's because it fu**ed you."

              Comment


              • #8
                100 copies took 30 minutes to solve.

                http://myweb.cableone.net/amylenhart...playblast2.avi
                ____________________________________

                "Sometimes life leaves a hundred dollar bill on your dresser, and you don't realize until later that it's because it fu**ed you."

                Comment


                • #9
                  simcloth quit at about 60 frames after 2 hours, though with some tweeking it may go but with even longer times :P
                  Eric Boer
                  Dev

                  Comment


                  • #10
                    hehe...mine was 300 frames....im not boasting or anything...
                    ____________________________________

                    "Sometimes life leaves a hundred dollar bill on your dresser, and you don't realize until later that it's because it fu**ed you."

                    Comment


                    • #11
                      this also took about 30 min to simulate. I turned off self intersection as it wasn't necessary.

                      http://myweb.cableone.net/amylenhart/reactorchain1.avi
                      ____________________________________

                      "Sometimes life leaves a hundred dollar bill on your dresser, and you don't realize until later that it's because it fu**ed you."

                      Comment


                      • #12
                        dude that's crazy,nice!
                        Eric Boer
                        Dev

                        Comment


                        • #13
                          hahhahaha percy.........................................Its funny I was about to write a chain tutorial too....but funny thing is that I made my chain differently from yours but also non the less good. Its simple :
                          make your chain, then create a bone structure one bone for one chain ring with splike ik in it. Onto spline ik apply reactorRope modifier, and link every chain ring to a corresponding bone and your done...
                          See the simulation here:

                          http://www3.telus.net/public/vinnik8.../realChain.avi
                          http://www3.telus.net/public/vinnik8...rSim_Chain.avi
                          Dmitry Vinnik
                          Silhouette Images Inc.
                          ShowReel:
                          https://www.youtube.com/watch?v=qxSJlvSwAhA
                          https://www.linkedin.com/in/dmitry-v...-identity-name

                          Comment


                          • #14
                            Percy to compliment your 100 chains simulation here is my try:
                            100 non instanced chains all self colliding. With my setup took 2 minutes to calculate 300 frames on my single amd 2.0 cpu (homebox)
                            enjoy dudes
                            http://www3.telus.net/public/vinnik8...100_chains.avi
                            here is the scene
                            http://www3.telus.net/public/vinnik8...chain_sim2.rar
                            Dmitry Vinnik
                            Silhouette Images Inc.
                            ShowReel:
                            https://www.youtube.com/watch?v=qxSJlvSwAhA
                            https://www.linkedin.com/in/dmitry-v...-identity-name

                            Comment


                            • #15
                              wow very nice dude! Im not an animator, so bones are like a dirty word to me. But with that setup, its looks fantastic! Can you get the bones to rotate realistically so the chains follow suit? With the cloth, you can get a little x rotation, but not much. I would think the bones wouldnt rotate at all.
                              ____________________________________

                              "Sometimes life leaves a hundred dollar bill on your dresser, and you don't realize until later that it's because it fu**ed you."

                              Comment

                              Working...
                              X