FumeFX - black hole/vacuum/suck in smoke


#1

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


#2

Simulate smoke explosion and play it backward, by reversing frames in postproduction perhaps?


#3

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. :slight_smile:


#4

Maybe you can achieve something like this in conjunction with PFlow and the FindTarget Operator !?


#5

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. :slight_smile:

Edit: The maxscript black hole works. Pretty straight forward actually … reduce smoke, change velocity, tweak, done. :slight_smile:


#6

Show something and tell a bit more about the method if you can, im really interested how you solved it!?
greetz


#7

You could do it with strong gravity point.
Share us with effect you achieved if you can, please. :slight_smile:


#8

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. :stuck_out_tongue:

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!).


#9

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


#10

Why don’t you just place a source at the gravity point that sets smoke to 0?


#11

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.


#12

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:

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


#13

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.


#14

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.