JoomlaWatch Stats 1.2.7 by Matej Koval

Countries

8.9%UNITED STATES UNITED STATES
7.6%GERMANY GERMANY
6.1%AUSTRALIA AUSTRALIA
5.9%UNITED KINGDOM UNITED KINGDOM
4.6%FRANCE FRANCE
4.4%RUSSIAN FEDERATION RUSSIAN FEDERATION
4.4%SPAIN SPAIN
3.8%INDIA INDIA
3.7%JAPAN JAPAN
3.6%CHINA CHINA

Visitors

Total:  77444


Home Thinking Particles Thinking Particles Ground Cracking TD
Thinking Particles Ground Cracking TD PDF Print E-mail
Written by Panait Mihai   
Sunday, 21 February 2010 09:23

Thinking Particles Ground Cracking TD Tool.

 

In this tutorial we’ll make a Ground Breaking TD Tool. We want to build a fully customizable Thinking Particles System that will use a prebroken object and a helper object. The helper object will be animated and will influence the cracking of the prebroken object. We expose to the animator only the parameters he needs to customize the animation of the particles. He doesn’t need to know the internal connections between nodes or thinking particles at all. Click read more and go to the bottom of this page to download the package containing the video and the scene files. You need 3DSMax 2010 to open the scene files.

Tutorial Length 46:01 min.

Thinking Particles Operators Used in this tutorial: (O)Object To Particle, (O) PPass, (O) Group, (O) Particle Data, (O) Alignment, (O) Friction, (H) Node, (H) Float, (H) Frame, (H) Timer, (H) Expression, (H) Add&Multiply, (H) Integer, (H) Value to Time, (H) Point3, (H) Invert, (C) Distance, (C) Particle Age .

 

 

 

Groups

TP_GC_01

 

Dynamic Sets

TP_GC_02

 

Operators

TP_GC_03

 TP_GC_04

TP_GC_05

TP_GC_06

TP_GC_07

 TP_GC_08

TP_GC_09

 

Transcript:

 

Presentation

In this tutorial we’ll make a Ground Breaking TD Tool. What is a TD-Tool? A tool meant for Technical Directors that can easily set up highly complex particle systems and only exposes the parameters needed for the animators who do the main animation work. In this case we want to build a fully customizable Thinking Particles System that will use a pre broken object and a helper object. The helper object will be animated and will influence the cracking of the pre broken object. We expose to the animator only the parameters he needs to customize the animation of the particles. He doesn’t need to know the internal connections between nodes or thinking particles at all. When you select the TP system in the scene all the customizable parameters appear in the modify panel. We have the activate rollout were you can select the Helper. The Radius parameter sets the distance around the helper to influence the particles. In the scale rollout we influence the scaling of the particles. A value above 100 means that the particles will grow in size while a value less than 100 means that the particles will shrink in a certain amount of time. This time is set by the In Frames parameter. Velocity Up and Down sets the movement of the particles on the Z axis. We have two controls: near amplitude and far amplitude. A positive near amplitude will force the particles to move upwards while their position is inside the near radius and a negative far amplitude will force the particles to move downwards as soon as they exit the near radius. In the alignment rollout we set the alignment of the particles towards the helper. Affected radius sets the maximum distance around the helper in witch the particles will be affected. Angle limit sets the maximum angle a particle can rotate. A value of 90 means that the particles will rotate all the way from -90 to 90 degrees. Laziness sets the speed of the alignment. In the friction rollout we have the multiplier parameter. This parameter sets the friction for the particles, depending on the distance from the pointer on XY plane. The further away the more friction is applied. A value of zero means no friction will be applied. Of course all the parameters can be animated.

 Let’s see how the thinking particles system looks like. The first dynamic set is named Create Fragments. Here we have an Object to particle operator that transfers the fragmented geometry into the fragments particles group. The dynamics set has five sub sets that are interconnected and are responsible for the particles behavior. The Activate Particles group Tests the distance between the helper and the particles and if the condition is true the particles are passed to the activation group. The next four dynamic sets are working with the particles from the activation group. The first handles the scaling of the particles, the second uses two particle data operators to set the movement of the particles on the Z axis,  depending on the distance from the helper. The next dynamic set uses an alignment operator to set the rotation of the particles towards the helper. The last dynamic set tests the distance on XY plane between the particles and the helper, then multiplies this distance with a float value then assigns it to the friction operator. All dynamic sets have custom rollouts with parameters exposed to the user. Now let’s do it from scratch.

Workflow

Let’s first create some helpers. Go to create panel, helpers, and create a point helper in the scene. Increase the size to make it more visible. You can also enable the box checkbox. Enable auto key and drag the time slider to frame 70. Move the point helper on the y axis to create a keyframe. Create another helper. This time we’ll animate it on a path. Go to splines and create a line in the top viewport. After you finish to draw the curve, select the point helper. From the top menu select animation, constraints, Path constraint, then select the line in the scene. This creates two keys for the point helper. One at frame 0 at the beginning of the path and one at frame 100 at the end of the path. We have the helpers, now let’s create the particle system. Create a thinking particles system in the scene. Move it up a bit to make it more accessible. Open thinking Particles user interface. Select master dynamic. Disable Edit on the fly. Enable show. Create a new particle group and name it Fragments. Create a new dynamic set and name it create fragments. From the create operators drop down list choose object to particle. Click the pick object button. Use shift to select all the fragment objects from the list. Click Pick. Now select them again and from the group dropdown list choose fragments to add the objects to this group. Enable instance and click hide. This will hide the geometry and will leave visible in the scene just the particles. In the next part we’ll test the distance between the particles and the helper to send the particles within a certain radius to an new group.

Select Master dynamics. Create a new dynamic set and name it dynamics. In this set we will have a series of subsets each handling a part of the dynamics, like activation, scaling, movement. We will start with the activation. Create a new set and name it Activate particles. From the Operators, initiator add a PPass operator to the set. From the group dropdown list choose fragments. Create a new particles group and name it activated. Change the color for the group to red. Select the fragments group and enable the position output. From the helpers drag a node helper to the set. From the conditions add a distance condition to the set. Link the fragments position to the position one input. Link the node position to the position two input. From the standard operators drag a group operator to the set. Enable the on input and link it to the distance condition output. Link the fragments particle output to the group particle input. Select the node helper and push the pick node button. Select a point helper from the scene. If the distance condition is true, then the fragment particles will be sent to another group. Select the group operator and choose the activated particles group. Select the distance condition and test some values to see how the particles are affected in the scene. We have to expose some of the parameters to the user. Add a float helper to the set. Enable the Radius 2 input for the distance condition and link it to the float helper. The radius 2 parameter will be controlled through the float helper. If you increase the value of the float you will see the changes in the scene. Set the value to zero. Expose the on input of the distance condition. Drag it to the dynamic set inputs. Do the same with the value input of the float helper and with the node. Select the activate particles dynamic set. In the rollups list we can add a new rollout and expose the parameters to the user. Click add rollout. Rename it activation. Drag the parameters over the new rollout. Drag to change the order if you want. Select the on parameter and change the type to check button. You can see the changes on the modify panel in the scene. Leave the node as is. Change the control type for the value to slider. Click twice on the node name to edit it. Rename it to point helper. Rename the value to radius. Now when you select the TP System you will see the parameters in the modify panel under the thinking rollout. You can simply choose another point helper and change the radius value. Click on to enable the system and you can see the changes immediately in the scene. You don’t need to know the internals of the system. Is very simple and yet flexible.

Next step is to change the scale of the affected particles.

Open the Thinking Particles user interface. Select the dynamics set and create a new set. Name it Scale. From Initiators drag a PPass Operator to the set. Set the group to Activated. From now on we are interested only in the activated group. From the standard operators drag a particle data operator to the set. Link it to the activated particles group. Enable the scale input. From helpers drag a point 3 helper and link the vector output to the scale input of the particle data operator. Select the point 3 helper. Right now all the values are set to 0. This means that the particles will scale to 0 as soon as they enter the group. A scale below one means that the particles will shrink while a scale above one means that the particles will grow. For example a scale of two means twice the size. We also want the particles to shrink or grow over time, not instantly. We will handle this in a moment. From the helpers tab add a timer helper and a frame helper. Enable the frames input for the timer helper. Link the frame helper to the frames input of the timer helper. From conditions add a particle age test. Link the output to the start input of the timer helper. When the condition is true the timer starts. Link the particle input to the activated group. Because we want the scale of the particles to be influenced by the age we have to relink the particle data operator. Link the timer to the particles group and the particle data to the particle output of the timer. We need to normalize the age of the particles. This means to give them a value of 0 at birth and a maximum value of one after a certain amount of time. If we want the scale effect to take place in an interval of 30 frames we have to divide the time passed in frames from the birth of the particle to 30. We’ll get the time passed in frames from the timer helper. This will be set to count from 0 to 30 for every particle since it enters the group. So we’ll have 0 divided by 30 at birth which is 0 and 30 divided by 30 which is 1 at frame 30. This number from 0 to 1 will be used as a multiplier for the scale value on each frame. If it’s not so clear it will soon be. From the helpers drag an add and multiply helper. The frames value of the timer helper is set to 30 frames but it doesn’t matter what value is here as long as have a frames input linked in. This will take the value from the frame helper. Select the frame helper. Set the frame value to 20. Let’s normalize the age of the particles now. Link the frame output to value B. Link the time output to value A. Select the add and multiply helper and set it to divide. To check the output values right click the value output and select write to debug log. The value will color in blue. Also go to master dynamic and enable debug. A debug log window will appear. Here we’ll see the values per frame per particle So keep the particles count low while testing. The value should appear in white. The green text appears by default. To make a value to appear in the debug log you have to do one more step. You have to link it to a valid node. Set the particle age test to enters group. When the particle enters the activated group the timer will start. Link the value to the point 3 helper. It doesn’t matter where for now. We’ll disconnect it anyway later. Now as you can see the value is displayed in the debug log. Click reset to clear the log. As you can see the values start from zero and grow. When a new particle enters the group the value for it is also displayed, so on every frame will be more and more values displayed. After a certain amount of time, the particles reach the maximum value then the value is reset to 0. What happens is that when the timer ends it doesn’t return the last frame which in our case is 20. It returns 0. So the output value will be again 0 instead 1. We’ll have to fix this later. We’ll also have to invert this value. We want the value at start to be 1 and 0 at the end. From the helpers menu drag an expression helper. If you get an error it doesn’t matter. Click ok. The error will disappear when we enter a valid expression. For now let’s close and disable the debug window. Select the expression helper. Click the in out button to create an input for the helper. Add a scalar input and rename it A. You will see it appearing on the node. In the expression textbox write one minus A. This will invert our value. Click in out button. Select Add output, scalar. Rename it Value. Link the add and multiply output value to the expression A input. From helpers add an integer node. Also add a value to time helper and enable time one input.  We’ll use this node to remap the normalized value. For value two enter 1.0. Link the expression output to the value input of the value to time helper. Let me explain this node a bit. The value to time helper converts a float or integer value into time. If we have like in our case an input value animated from one to zero, and value one 0.0, value two 1.0, time one 1, time two 30, the time output will change like this: when input value is 1.0 the output of this node will be 30. When input value is 0.5 the output value will be 15. And finally when input value is 0.0 the output will be integer 0. And all the values in beetween. Unfortunately the output value can only be integer because the purpose of this helper is to be used with time and a frame number can only be integer, but we can overcome this by mapping to a 10 times bigger number than we need for example and divide it afterwards by 10. It will be clear when we’ll actually do it. Set the time two value to 100. We want to map the maximum value to 100. Link the integer value to the time one input. The integer one will be exposed to the user as the scale factor. Right now the remapped value is between zero and 100 but if we want to use it as a scale value we have to divide it to 100. To do this add a float helper. Link the time output to the input value. Set the mode to multiply and the value to 0.01. This is the same as dividing by 100. Link the output value to the point 3 helper X, Y, Z. Drag the time slider to see the changes. The scaling works fine but we still have to solve one problem. After the maximum number of frames the scale of the particles jumps back to one because when the timer ends it returns zero. Unlink the time and the value A. Shift click to unlink a node. Add another expression helper. We’ll use it as an if statement. Add a scalar input and name it on. Add another scalar input and name it Value 1. Add yet another scalar input and name it Value 2. In the expression textbox write if open parenthesis on=1 comma Value1 comma Value2 close parenthesis. This means if the on value is equal to one then the output value will be value one else value two. Also add a scalar output and name it output. Let’s link it now. Link the out timer to on expression. Link time to value one. Link frame to value two. Link output to value A. Drag the time slider to test. All Works fine now. Ok. So what happens? When the timer starts it sends the out as true which means one, so the expression is true and the output value from the expression is value one witch is current particle time. When the timer ends the out value is false which means zero so the expression is false and the output value is value 2 which is frame so the timer doesn’t go back to zero. Now we have to expose some parameter to the user. Select the frame helper and enable frame input. Drag the value input from the integer helper to the dynamic set inputs. Also drag the frame input. Select the scale Dynamic set. Add a new rollout and rename it scale. Drag the two exported values in it. Rename the integer value to Scale Factor. Rename the frame input to in frames. Set the control type for the scale factor to slider. Also set the in frames type to slider. Set the To value to 100. Now you can control the inputs from the modify panel. The scale factor is like a percentage. 100 means no scale, 50 means 50 percent scale and so on. We also need to be able to scale more than 100. Select the scale factor slider and set the To value to 110. You can set it to more than 110 if you want. This was the scale dynamic set. One last thing we have to do before that. Because the frame helper is set to added we have to set the internal frame value to zero. If it was 20 the input frame value would be added to this. Make sure you understand this dynamic set before going further. Ok let’s move further. Next we’ll handle the movement of the fragments.

Select the dynamics set and create a new set. Name it velocity. From the initiators drag a PPass operator. Set the group to activated. From the helpers add a node helper. From conditions add a distance test. We’ll test the position between the activated particles and the point helper. Link the position from the activated group to position one and node position to position two. Expose the radius two input of the distance test. From helpers add a float helper. Link it to radius two. Drag the node input to the dynamic set inputs to expose it outside the set. Also drag the float value. From standard operators add a particle data operator to the set. Enable the on input. Also enable the velocity input. Link the distance output to the on input of the particle data operator. Link the operator to the activated particles group. The velocity input is a vector. Add a point 3 helper and link it to the particle data velocity. Set a random value to test the setup. It seems nothing happens. Select the float helper. As you can see the value is set to zero. This means that the radius two is also zero and no particle passes the test. Select the velocity dynamic set and go to rollups. Add a new rollout and name it velocity up and down. Drag into it the float value. Rename it to near radius. Set the near radius type to slider. Select the node helper. As you can see there is no object selected. We need the same node that drives the activation of the particles. Because we exposed it to the set inputs we can access it from a parent set. Select the dynamics set and drag the child dynamic sets around. Select the activate particles set. Drag the node output so we can use it externally. Link the node output to the velocity set node input.  Now if you drag the time slider you will see that everything works fine. As you can see, a negative value moves the particles down while a positive value moves them up. Also a bigger value moves them faster. Select the standard operators and add another particle data to the set. Enable velocity and on inputs for this operator. Link it to the activated particles group. Link the output of the distance test to the on input. Add another point 3 helper and link it to velocity. Add a invert helper. We have to bypass the test output through the invert helper. This way the near particles will be influenced by the first point 3 helper while the far particles will be influenced by the second point 3 helper. Set the first z value to 5 and the second to minus 5. You see the particles going up and then going down. This effect is what we’re looking for. Of course you can change the near radius. If you set the near radius to 0 only the second z value will influence the particles. We have to expose the z value to the user also. First set the values to zero. Add two float helpers to the set and link each to the corresponding point 3 z value input. Expose the input value of both float helpers. Select the velocity set and drag the value parameters to the velocity up and down rollout. Rename the parameters amplitude near and amplitude far and set the type to slider. Set the from value to minus 50 and the To value to 50. Same with the other one. Test it in the scene to see the results. Next step is to set the alignment towards the point helper.

            Go to Dynamics set and create another set. Name it alignment. Add a PPass operator and set the group to activated. From the helpers add a node helper to the set. Expose the node to the set inputs. Also in this set we will test the distance so we have to enable the position output for the activated group. Add a distance condition and link it to the activated group and node positions. Enable Radius two for the distance test. Add a float helper and link it to the distance condition radius two input. Expose the float value to the set inputs. Select the alignment dynamic set and create a new rollout. Name it alignment and drag the float value in it. Rename it affected radius. Note that you have to use short names for the parameters otherwise part of the name will not be visible in the modify panel. Set the type to slider. From the standard operators add an alignment operator to the set. Link it to the activated particles group. Enable the on input and link it to the output of the distance test. We need to set the alignment towards the point helper. To do this link the position output of the node helper to the to position input of the alignment operator. From the alignment dropdown list choose user defined. Set the user z axis to zero. Now we have to link the node. To do this go to the parent dynamics set. Link the node output from the activated particles to the node input of the alignment set. As you can see the particles are affected now. The effect is to obvious right now so we have to add some control to it to look more natural. To do this we can limit the effect to a certain degree on every axis. Select the alignment operator. Enable x limits, y limits and z limits. You can set different values for the limits to see how it works. Whatever we want to expose this controls to the user. To do this enable the parameters in the inputs but enable only the x and y not the z because we don’t need it in this setup. From the helpers add a float helper and expose the value to the user. Drag it to the rollouts and rename it angle limit. The limits must be from negative something to positive something so we  will use another float to multiply the initial value with minus one. Link the negative value to from and the positive value to To. If you drag the time slider you will see that the particles face backwards. To change this select the alignment operator and enable invert. Now the particles face the right way. There is another parameter we have to expose to influence the strength of the alignment. This is the laziness parameter. Set the laziness to zero. Add a float helper to the set. Enable the laziness input and link it to the float Value. Add the float value to the alignment rollout and rename it laziness. Set it to laziness. Set the To value to 50. Change the values and see how different setting affect the setup. Next step is to add some friction. The friction will also work based on the distance between the particles and the helper. The closer they are the less will be influenced and vice versa.

            Select the dynamics set and create a new set. Name it Friction. Add a PPass operator and set the group to activated. Also add a node helper and link the node input to the set inputs. Go to the parent set and link the node. Enable the position output of the activated particles group. Add a distance condition to the set. Add four point 3 helpers to the set. We need this helpers to calculate the distance only on the XY plane. Link the position to the corresponding point 3 vector input. Between the point 3 helpers link only x and y values. Leave the z value to zero. Link the output vectors from the point 3 helpers to the distance condition. The radius tw2o value doesn’t matter in this case. We only need the distance output of the distance test. From dynamics operators add a friction operator to the set. Link it to the activated particles group. Add a float helper. We will use this helper as a friction multiplyer and we will expose its value to the user. Select the friction set and add a rollout. Name it friction. Add the float value and rename it multiplier. Set the type to slider. From helpers add an add and multiply helper. Link the float helper to the value A input. Link the distance to the value B input. Link the value output to both friction and rotation friction inputs. Set the type to multiplication. A times B. A value of zero for the friction multiplier means there will be no friction, while a value of one means that there will be equivalent to the distance. Greater than one values means that the distance of each particle from the point helper will be multiplied a certain by amount. Set the to value for the multiplier to 20. We don’t need bigger values.

Next step is to save the Dynamic set to use it with different setups in other projects. Select the dynamics set and click the save button. Name it as you wish and click save. A dialog box appears. Click request. This means that when you load the setup in another project will ask you if you want to create the particle groups or use the existing ones if you already built them yourself. That’s all. It was a pretty long tutorial. I hope it was useful. Thanks for watching.

 

 

iii

 

To DOWNLOAD Video Tutorial and Project Files CLICK HERE.

*if you can't download the file, or the archive is corrupt you may need to use a download manager.

 


MediaFire

Alternate download link