18 Replies Latest reply on Jun 29, 2016 1:01 PM by Gutter-Fish

    Automate a stars sparkling randomization?

    juliam83978196

      Hi,

       

      I've created an image in photoshop with stars in it (each star is seperated from the others and is a character from a font, so it's text). I have around a thousand stars.

       

      I'd like to animate them in AE to make them sparkle but I'd like to do it like that:

      - at random

      - choose how many stars appear at the same time

      - know when all of them appeared at least one time

      - and do it automatically so I don't have to animate each (of the thousand) one by hand...

       

      Is it possible? Is there a plugin that could do it?

       

      Any help would be INFINITELY appreciated!

      All the best ,

      Julia

        • 1. Re: Automate a stars sparkling randomization?
          A. Cobb Level 3

          If you want the twinkling to look realistic, I'd recommend applying a very subtle Turbulent Displace effect.  If you set the scale small enough and the amplitude pretty low and animate the evolution, this can give you a faithful simulation of the actual atmospheric turbulence that causes stars to twinkle in the night sky.

           

          For something less subtle and more cartoony, multiplying your stars with a layer of Fractal Noise should do the trick.

          • 2. Re: Automate a stars sparkling randomization?
            juliam83978196 Level 1

            Thank you for answering!

             

            I don't know if I asked my question correctly, sorry for my english.

             

            My "star sky" is done in photoshop. I don't want to change or add anything. Each star is a single object in the project.

             

            What I'm looking for is a way of making each individual star appear and disappear automatically and at random, while being able to set the number of stars appearing on the screen at the same time.

             

            I need to add that I'm a complete AE noob, I know how to manually fade in and out something but doing that for a thousand objects isn't so practical...

            • 3. Re: Automate a stars sparkling randomization?
              Szalam Adobe Community Professional & MVP

              If you made it with text, you can could convert it to editable text in AE and use the text animators in AE to make the opacity flash randomly.

               

              If each star is on its own layer, just put a wiggle() expression on the opacity for each layer. It's easy to copy and paste expressions to a bunch of layers.

              • 4. Re: Automate a stars sparkling randomization?
                Szalam Adobe Community Professional & MVP

                To use an expression:

                Alt-click (or Opt-click, if you're on a Mac) on the stopwatch for opacity. This enables an expression for that value.

                Type something like

                wiggle(1,50)

                That will make the opacity value randomly change once every second and the value could change up to 50. You'll need to mess with this to get the values looking how you want them to.

                 

                Here's a tutorial on using Wiggle.

                • 5. Re: Automate a stars sparkling randomization?
                  A. Cobb Level 3

                  Oops!  Sorry, it's my reading comprehension, not your English that is to blame.  A thousand layers is likely not going to work in AE.  You can make layers change size/opacity/whatever in a turbulent manner using wiggle expressions, but that is way too many layers.  A particle system (like Particular) can do this, but you'd give up a lot of control over individual placement of stars.

                  • 6. Re: Automate a stars sparkling randomization?
                    juliam83978196 Level 1

                    Thank you very much for your answers

                     

                    What I understand is that this is going to be tedious anyway right?

                     

                    I think I'm going to build groups of 5 or 6 stars (which will decrease the amount of layers) and "animate" them manually...

                     

                    Let me know if someone designs a plugin in which one can load a thousand layers and the thing just randomize them with different animation options haha!

                    • 7. Re: Automate a stars sparkling randomization?
                      Dave LaRonde Level 6

                      Good luck with that one!

                      • 9. Re: Automate a stars sparkling randomization?
                        A. Cobb Level 3

                        Trapcode Particular can do what you are asking for like a champ, assuming you are okay with the stars being placed procedurally, rather than you choosing where each is placed explicitly.  But if that isn't an option for you, I think you are on the right track with the idea of consolidating the stars into fewer layers.

                         

                        But you don't have to animate them manually!  You have options at your disposal, but they depend a great deal on the nature of your stars.

                         

                        Is it okay for the stars on each layer to fade in/out in unison?  If so wiggle expressions are your answer.

                         

                        If not: Are the stars on solid black?  Are the stars themselves relatively small?  Will each layer's stars be scattered pretty far apart?

                         

                        If you want the stars to fade independently, Fractal Noise might still work for you.  The idea is to create a field of undulating low-frequency noise with very soft gradients between the light and dark regions, and to multiply this by your stars to make them fade in and out.  Fractal Noise can be multiplied by the layer it is on using the Blending Mode property on the effect itself (this is distinct from the layer's blend mode setting).  If the layer does not have any alpha transparency and is on a solid black field, this will work fine out of the box, but if the stars are matted using an alpha channel, then you'll need to do some channel shifting to keep the Fractal Noise from creating fringes around your stars (FN multiplies its effect by the alpha channel, unfortunately, so it will fade wherever the layer is semi-transparent). 

                         

                        To avoid this ugly fringe, apply Shift Channels, with the Alpha set to "Full On" before the FN, then apply "Set Matte" with default settings (it defaults to the current layer).  This should strip out the alpha, apply the Fractal Noise to the RGB only, an reapply the alpha.

                         

                        On your Fractal Noise, you'll probably want to set the Random Seed property (under Evolution Options) to something different for every layer (this creates a different random pattern for each layer).  You can do this automatically by putting an expression on the Random Seed property that simply says "index".

                        • 10. Re: Automate a stars sparkling randomization?
                          A. Cobb Level 3

                          Text animators are a pretty clever answer.  You could do all this with one text layer (or a handful for more control) and wiggly selectors. Use one wiggly selector driving position set to 0 wiggles per second for distributing the stars randomly, maybe another to randomize scale, then another animating opacity with the wiggles per second set to a nonzero value.

                          • 11. Re: Automate a stars sparkling randomization?
                            Szalam Adobe Community Professional & MVP

                            A. Cobb wrote:

                             

                            Text animators are a pretty clever answer.

                            Thanks! Maybe not ideal for a newbie in AE, but I thought it could be a pretty fun thing to try.

                            • 12. Re: Automate a stars sparkling randomization?
                              juliam83978196 Level 1

                              Amazing tips Cobb, thanks a lot!

                               

                              My stars have to be exactly as I placed them because there is something hidden in their distribution if you show them all at the same time. They are quite small, on a black background and it's okay that each group fade in/out together so you couldn't help better than you did.

                               

                              I'm in the midst of grouping them to less layers, I will decide how I animate everything when that's done.

                               

                              Thanks again guys

                              • 13. Re: Automate a stars sparkling randomization?
                                Gutter-Fish Level 4

                                1000 layers or even 500 sounds like a nightmare.  I would just save it out of photohsop as a single jpeg then use some animated noise as a luma matte.  Easy

                                • 14. Re: Automate a stars sparkling randomization?
                                  juliam83978196 Level 1

                                  I'm down to 120 layers after building stars groups, 5 will be playing at the same time throughout the video which seems acceptable I believe.

                                  • 15. Re: Automate a stars sparkling randomization?
                                    bogiesan Level 4

                                    Gutter-Fish wrote:

                                     

                                    1000 layers or even 500 sounds like a nightmare. I would just save it out of photohsop as a single jpeg then use some animated noise as a luma matte. Easy

                                    And you could use several different matte layers to reveal clusters of the stars to reveal whatever your content is. when you have lots more experience with After Effects you start thinking about how you can use simple effects to drive at simple solutions to what you thought were very complex problems. 

                                    • 16. Re: Automate a stars sparkling randomization?
                                      Gutter-Fish Level 4

                                      As my buddy Smiley used to say whenever I was trying to convince him to follow me into doing some unnecessarily "dangerous" thing:

                                      "That ain't me man but, whatever.  It's all learning. "

                                      • 17. Re: Automate a stars sparkling randomization?
                                        Szalam Adobe Community Professional & MVP

                                        There's also this handy tool. You could animate scale, rotation, and opacity all at once with this. It's super-neat.

                                        • 18. Re: Automate a stars sparkling randomization?
                                          Gutter-Fish Level 4

                                          That dude writes some super useful tools.  RIFT has become my second most used third party script after this little gem Keyframe Velocity Changer - aescripts + aeplugins - aescripts.com