How to export a particle bin secuence from a grid?

Post Reply
Jorge Medina
Posts: 71
Joined: Wed Jun 09, 2010 6:23 pm

How to export a particle bin secuence from a grid?

Post by Jorge Medina » Sun Aug 28, 2011 1:08 pm

I am trying to export a bin particles sequence from a cached Grid Fluid Domain, but seems to not work.
Is there any way to do this via scripting?

User avatar
Alex
Site Admin
Posts: 143
Joined: Mon Jun 14, 2010 9:35 am

Re: How to export a particle bin secuence from a grid?

Post by Alex » Tue Aug 30, 2011 3:02 pm

Hi Jorge,

in order to export the BIN files the Grid Domain node must be Active. This script should do the trick:

Code: Select all

def exportDomainBinFiles( domain, minframe, maxframe ):
	currentState = domain.getParameter( "Simulation" )
	domain.setParameter( "Simulation", "Active" )
	domain.activeExportResource( EXPORT_GRID_DOMAIN_BIN, True )
	
	domain.activeExportResource( EXPORT_GRID_DOMAIN_GDC, True )
	
	for i in range( minframe, maxframe+1 ):
		domain.activeExportResource( EXPORT_GRID_DOMAIN_GDC, True )
		scene.setCurrentFrame( i )
		domain.activeExportResource( EXPORT_GRID_DOMAIN_GDC, False )
		domain.export()

	domain.setParameter( "Simulation", currentState )
Just call the function with something like:
exportDomainBinFiles( Grid_Fluid_Domain01, 0, 100 )
:)
Alex Ribao
RealFlow Team
Next Limit Technologies

Jorge Medina
Posts: 71
Joined: Wed Jun 09, 2010 6:23 pm

Re: How to export a particle bin secuence from a grid?

Post by Jorge Medina » Wed Aug 31, 2011 12:34 am

Thank you Alex!!
running!!

Post Reply