Page 1 of 1

How to export a particle bin secuence from a grid?

Posted: Sun Aug 28, 2011 1:08 pm
by Jorge Medina
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?

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

Posted: Tue Aug 30, 2011 3:02 pm
by Alex
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 )
:)

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

Posted: Wed Aug 31, 2011 12:34 am
by Jorge Medina
Thank you Alex!!
running!!