Bring in your VDB however you need to.
Plug it into a VolumeVOP and create an addpoint node. Plug P into the ptvalue input.
Next create a setattrib node and plug your addpoint's ptnum output into the setattrib's i1. Plug your density into the value node and name the parameter "density". Jump back out of the VOP.
This will have made a volume grid of points that represent your VDB, each containing the corresponding density value. The number of points created is dependent on the resolution of your VDB, although I guess you could duplicate points and hope that they interpolate nicely?
Next, add a Timeshift node after the VOP and freeze your volume at the point you think it occupies the most space. Eg. if it's a trail of cigarette smoke, it's last frame. Create a Bound node for this.
This is now the lattice you can transform and deform.
Then make a Lattice node and plug your Volume VOP into the first input, the output of the Bound into the 2nd and then finally whatever your transform/deforms are into the 3rd.
So far, we've transformed a bunch of points, that hold our density values.. Now we have to recreate our volume..
Connect a Bound node to your deformed points. We're making an empty volume that encompasses the limits of your deformed sequence. Add an Iso Offset to this, set the Output Type to Fog Volume, Mode to Ray Intersect and name it Density. You control the effective resolution with the sampling. Next let's copy the density back into your empty volume.
Make a volume VOP, plug the Iso Offset into the first input & the lattice into the second. Jump in and make a Point Cloud Open node. Connect the P to the P and the OpInput2 into the File input.
Create a Point Cloud Filter and set it's signature to Float Channel and label the Channel "density". Plug the Point Cloud Open's handle into the Point Cloud Filter's handle input. Finally plug the value into the volumevopoutput's Density..
Your blank volume now has a deformed version of the original's density!
Sit back, relax and pretend you're resimming now.
Showing posts with label FFD. Show all posts
Showing posts with label FFD. Show all posts
Friday, 23 June 2017
Monday, 7 November 2016
Maya style FFD lattice
Hook up a Bound node to the geo you want to lattice. To this, add an Edit node - this will be the node you pull points about with. Create a Lattice node and plug the geo into the First tab, the bound into the 2nd and the Edit into the 3rd.
Might be an idea to copy the divisions of the bound into the Lattice's divisions.
*further note*
since the lattice is linked to the bounds of your object, it isn't ideal for dynamically changing objects - eg a fluid sim. In the case of this, you're better off creating a static lattice object that will deal with the shape of your object throughout it's simulation. I think.
Might be an idea to copy the divisions of the bound into the Lattice's divisions.
*further note*
since the lattice is linked to the bounds of your object, it isn't ideal for dynamically changing objects - eg a fluid sim. In the case of this, you're better off creating a static lattice object that will deal with the shape of your object throughout it's simulation. I think.
Subscribe to:
Posts (Atom)