In the first part of this tutorial, we completed the particle simulation that we will now use to drive a Pyro DOPs simulation.
For this part, we will take advantage of the quick DOPs setup using the shelf tools, and from there we will begin to customize our sim.
So in order to create smoke, we first need to create a source. Create a sphere in SOPs. Now go to the Pyro tab, and choose the billowy smoke. Select the sphere, and follow the instructions under the viewport.
Your sphere’s network should now look something like this:
Now, let’s return to the OBJ level. You will see that a few extra nodes were created by the shelf tool. You should have a AutoDopNetwork, and an import_pyro node. The AutoDopNet is where you create your simulation, the import network is a SOPs network that imports the DOP fields in to renderable volumes.
So the rest of this tutorial will now take place in the AutoDopNet.
Let’s see what my AutoDopNet looks like. Yours will be a little different at first. I highlighted the important additions to the network to create our swirly smoke sim.
Let me briefly explain what is happening here, and then I will dive in to the colored nodes.
So we start off with the default shelf setup like you probably have right now. From there I imported our particle simulation and embedded it in to a SOP network within my AutoDop. In there I converted the particle’s velocity to a volume, to use as a DOP field. Now to bring that field in to the simulation, I placed a sopVectorField node under my pyro node. I store the field in a temp field called customVel, which will get integrated in to the velocity field next. In the Pyro solver’s velocity update input, I merged 2 nodes. The first is a gasLinearCombination, which “adds” the customVel in to out velocity field. And the second node is a gasFieldVop which adds a bit of noise to to the velocity field as well.
Ok, so lets take a look at that stand alone SOPS_CUSTOM_VEL network, and see how to convert your particle sim to a velocity field.
I imported the particle data and converted it to a vector volume based off of the “v” attribute on the particle data. To do this, I gathered the bounding box of the particles, and created an empty vector volume. The bound becomes the volume’s dimensions. Be sure to give the volume a name and set the uniform sampling to “by size”, because the dimensions change. Next, plug the volume and particles in to a volumeFromAttrib node, and set the attribute to “v” (velocity). There you have it, you created your customVel volume. The rest of the network is for visualization purposes in SOPs.
Now let’s take this from SOPs volumes to DOPs fields. Lets take a look at some of the settings on the sopVectorField node.
This one is a quick step. We want to switch all of the dropdowns circled in red to “set always”, so that it re-evaluates on every time-step. Check on the “use SOP dimensions”, so that the field is always the size of our SOPS volume. Then for the SOP Path, just point to the customVel volume we created in the previous step. The yellow arrow is pointing to that network. Then at the bottom (not in picture), set a name for the field in “data name”. I used customVel. The vectorFieldVisualization node is just to visualize the DOP field data.
Next we will move on to the gasLinearCombination, which is also a quick step. Before we create it though, let’s drop a merge node, to plug the next 2 nodes in to. Connect the merge in to the “Velocity Update” input of the Pyro solver. The gasLinearCombination is similar to a compositing Merge node, where here you merge multiple fields. In this case, I am doing a simple “add” operation, where I am adding customVel to the simulation’s default vel field.
Moving on to the 2nd node in the merge, is a gasFieldVop. This is basically a custom Vop node that lets us modify the DOP field data manually.
In this final step, we pull in the vel field using a parameter node, and just type vel in the “name” field. If the DOP field name exists, it will pull it in. Then create a curl noise, and pipe in the necessary attributes. Here I am using time to drive offset X. Be sure to set the amplitude to something low. Mine is set to 0.25. Then add the noise on to the imported vel field, and write that back out to vel. You do this by dropping another parameter node like the first one, type in vel to its name, and set the export settings highlighted in red.
Now just add your lights and camera.
Shoot me a question though my “Ask Me” link at the top if you have any questions.
Thanks for following along!