View Full Version : FumeFX - black hole/vacuum/suck in smoke
harefort 05-27-2009, 04:33 PM Hello again!
I'm looking for a way to remove smoke from my simulation, suck it into a point even.
Simply setting up a source with negative smoke amount didn't work and using vortex/gravity space warps will attract the smoke, but after a while it will explode due to heavy compression.
Has anyone created some black hole like effect with fumeFX before or has an idea on how to solve this?
Thanks!
-Sascha
|
|
Shogun-3D
05-28-2009, 05:58 AM
Simulate smoke explosion and play it backward, by reversing frames in postproduction perhaps?
harefort
05-28-2009, 09:31 AM
Hey!
Yes, I though of that too. Problem is, I want the smoke to come from one point, have some fun and then get sucked in by another point, so I need something to attrach and erase it.
Edit: There might be a way to do this with maxscript. I'll report back if it works. :)
Maybe you can achieve something like this in conjunction with PFlow and the FindTarget Operator !?
harefort
05-28-2009, 01:09 PM
Yes I will certainly have a look at PFlow aswell, as it seems even better suited for what I want to do.
But for now I'll use FumeFX with maxscript, since I have more experience with them and a deadline closing in. :)
Edit: The maxscript black hole works. Pretty straight forward actually ... reduce smoke, change velocity, tweak, done. :)
Show something and tell a bit more about the method if you can, im really interested how you solved it!?
greetz
Shogun-3D
05-30-2009, 02:35 PM
You could do it with strong gravity point.
Share us with effect you achieved if you can, please. :)
harefort
06-01-2009, 05:32 PM
The gravity thing doesn't work, because it compresses the fluid so much that at some point it will just explode. Gives you funky wave-like patterns.
Not sure if I'm allowed to post this, so keep your mouth shut. :P
fn PreSim = (
global nBlackHole = getNodeByName "FumeFX Black Hole" --GRAVITY NODE USED FOR BLACK HOLE -- ICONSIZE = RANGE -- STRENGTH = ATTRACT SPEED -- DECAY = SMOKE REDUCTION AMOUNT -- RANGE INDICATORS = KEEP SPEED DIRECTION
if classOf nBlackHole == gravity then
(
ffxPrintToStatus "FOUND BLACK HOLE NODE!!!"
ffxPrintToStatus nBlackHole.name
ffxPrintToStatus "FOUND BLACK HOLE NODE!!!"
)
)
-- after velocity has been pressure corrected. you can make further adjustments to the velocity,
-- and also you can prepare other values - temp, smoke... - which will be moved next
fn PostPressure = (
if classOf nBlackHole == gravity then
(-- BLACK HOLE REQUIRES GRAVITY SPACE WARP
--BOUNDINGBOX OF BLACK HOLE IN FUMEFX VOCEL SPACE
local p3BlackHoleBoundingBoxStart = ffxWorldPtToVoxel (nBlackHole.pos - [nBlackHole.iconSize,nBlackHole.iconSize,nBlackHole.iconSize])
local p3BlackHoleBoundingBoxEnd = ffxWorldPtToVoxel (nBlackHole.pos + [nBlackHole.iconSize,nBlackHole.iconSize,nBlackHole.iconSize])
for i in 1 to 3 do
(--CLAMP BLACK HOLE BOUNDING BOX TO SIMULATION BOUNDING BOX
local iCurrentMax = case i of
(
1: (nx-1)
2: (ny-1)
3: (nz-1)
)
p3BlackHoleBoundingBoxStart[i] = aMax #(p3BlackHoleBoundingBoxStart[i],0)
p3BlackHoleBoundingBoxEnd[i] = aMin #(p3BlackHoleBoundingBoxEnd[i],iCurrentMax)
)
--REDUCE SMOKE AS IT GETS CLOSER TO THE BLACK HOLE - ATTRACT VELOCITY TO CENTER OF BLACK HOLE
for i in p3BlackHoleBoundingBoxStart.x to p3BlackHoleBoundingBoxEnd.x do
(
for j in p3BlackHoleBoundingBoxStart.y to p3BlackHoleBoundingBoxEnd.y do
(
for k in p3BlackHoleBoundingBoxStart.z to p3BlackHoleBoundingBoxEnd.z do
(
if (GetSmoke i j k) > .001 then
(--THRESHOLD TO AVOID COMPUTATION FOR EMPTY VOXELS
local p3VoxelInWorld = ffxVoxelPtToWorld [i,j,k] --WORLD POSITION OF CURRENT VOXEL
local fFalloff = aMin #(((distance p3VoxelInWorld nBlackHole.pos)/nBlackHole.iconSize), 1.0) --FALLOFF AT CURRENT VOXEL -- 0 AT CENTER, 1 AT RANGE END
local fFalloffWithDecay = pow fFalloff nBlackHole.decay --FALLOFF AT CURRENT VOXEL -- 1 AT CENTER, 0 AT RANGE END -- WITH DECAY
local p3AttractVelocity = (normalize (nBlackHole.pos - p3VoxelInWorld)) * nBlackHole.strength --VELOCITY VECTOR TO BLEND WITH VOXEL'S VELOCITY
if nBlackHole.hoopson then
(--KEEP SPEED DIRECTION WHEN RANGE INDICATORS TAGGED
p3AttractVelocity = p3AttractVelocity*(1-fFalloff) + (GetVel i j k)*fFalloff
)
SetSmoke i j k ((GetSmoke i j k) * fFalloffWithDecay) --REDUCE SMOKE ACCORDING TO DISTANCE TO BLACK HOLE
SetVel i j k ((GetVel i j k)*(1-fFalloff) + p3AttractVelocity*fFalloff) --SET VELOCITY ACCORDING TO DISTANCE TO BLACK HOLE
)
)
)
)
)
)
Basically it attracts the smoke and slowly dissipates it at the same time - so no compression and no explosion.
Just a quick hack - not user-friendly or anything.
Requires a gravity node called "FumeFX Black Hole" (just palce it in the scene - do not add to fumeFX sim!).
icekiller
06-06-2009, 05:21 PM
a bit late,
maybe try to animate it back wards (start @ end frame) and then go back for the same effect not sure if it will work
Glacierise
06-06-2009, 10:08 PM
Why don't you just place a source at the gravity point that sets smoke to 0?
andybyrne462
06-15-2009, 09:36 PM
if you have thinking particles you can try setting up an orbit system and have the particles simply delete once they reach the point or "black hole" I actually believe there's a scene file that comes with TP about this. I'm sure the same effect can be recreated with pflow, but I simiply haven't used pflow in a bit.
I would maybe emit from a circle while using a combination of max's vortex and pflows find target possibly. Give that a shot. Depending on the look you want , maybe add fumefx follow in the mix to get some more detail.
DreamWriter
05-05-2010, 08:32 AM
Hi Harefort:
I am working on a animation which need fire-vortex kind of effect. I try to run your script but shows this error:
http://img243.imageshack.us/img243/1143/27556505.png
PreSim()
-- Error occurred in PreSim()
-- Frame:
-- Runtime error: You must register FumeFX with ffxRegister ($name) or use simulation-callback functions.
I can't find any info about the ffxRegister over the internet, could you give me some help?
Hammer Chen
floopyb
05-10-2010, 03:49 AM
Go to the bottom of the general page of your fumeFX container and you will see a max script rollout, press edit and paste it in there, then save it, make sure "Use" is checked and simulate.
CGTalk Moderation
05-10-2010, 03:49 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.