2008-12-29 17:36:06 +00:00
/**
* $ Id $
*
* * * * * * BEGIN GPL LICENSE BLOCK * * * * *
*
* This program is free software ; you can redistribute it and / or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation ; either version 2
* of the License , or ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program ; if not , write to the Free Software Foundation ,
* Inc . , 59 Temple Place - Suite 330 , Boston , MA 02111 - 1307 , USA .
*
* Contributor ( s ) : Blender Foundation ( 2008 ) .
*
* * * * * * END GPL LICENSE BLOCK * * * * *
*/
# include <stdlib.h>
# include "RNA_define.h"
# include "RNA_types.h"
# include "rna_internal.h"
# include "DNA_object_fluidsim.h"
2009-07-02 19:41:31 +00:00
# include "WM_api.h"
# include "WM_types.h"
2008-12-29 17:36:06 +00:00
# ifdef RNA_RUNTIME
2009-07-02 19:41:31 +00:00
# include "MEM_guardedalloc.h"
# include "DNA_scene_types.h"
# include "DNA_particle_types.h"
# include "BKE_depsgraph.h"
# include "BKE_fluidsim.h"
# include "BKE_main.h"
# include "BKE_modifier.h"
# include "BKE_particle.h"
# include "BKE_pointcache.h"
2008-12-29 17:36:06 +00:00
static StructRNA * rna_FluidSettings_refine ( struct PointerRNA * ptr )
{
FluidsimSettings * fss = ( FluidsimSettings * ) ptr - > data ;
switch ( fss - > type ) {
case OB_FLUIDSIM_DOMAIN :
return & RNA_DomainFluidSettings ;
case OB_FLUIDSIM_FLUID :
return & RNA_FluidFluidSettings ;
case OB_FLUIDSIM_OBSTACLE :
return & RNA_ObstacleFluidSettings ;
case OB_FLUIDSIM_INFLOW :
return & RNA_InflowFluidSettings ;
case OB_FLUIDSIM_OUTFLOW :
return & RNA_OutflowFluidSettings ;
case OB_FLUIDSIM_PARTICLE :
return & RNA_ParticleFluidSettings ;
case OB_FLUIDSIM_CONTROL :
return & RNA_ControlFluidSettings ;
default :
return & RNA_FluidSettings ;
}
}
2009-12-08 17:23:48 +00:00
static void rna_fluid_update ( Main * bmain , Scene * scene , PointerRNA * ptr )
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
{
Object * ob = ptr - > id . data ;
DAG_id_flush_update ( & ob - > id , OB_RECALC_DATA ) ;
2009-12-08 17:23:48 +00:00
WM_main_add_notifier ( NC_OBJECT | ND_MODIFIER , ob ) ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
}
2009-12-08 17:23:48 +00:00
static void rna_FluidSettings_update_type ( Main * bmain , Scene * scene , PointerRNA * ptr )
2009-07-02 19:41:31 +00:00
{
Object * ob = ( Object * ) ptr - > id . data ;
FluidsimModifierData * fluidmd ;
ParticleSystemModifierData * psmd ;
ParticleSystem * psys ;
ParticleSettings * part ;
fluidmd = ( FluidsimModifierData * ) modifiers_findByType ( ob , eModifierType_Fluidsim ) ;
fluidmd - > fss - > flag & = ~ OB_FLUIDSIM_REVERSE ; // clear flag
/* remove fluidsim particle system */
if ( fluidmd - > fss - > type & OB_FLUIDSIM_PARTICLE ) {
for ( psys = ob - > particlesystem . first ; psys ; psys = psys - > next )
if ( psys - > part - > type = = PART_FLUID )
break ;
if ( ob - > type = = OB_MESH & & ! psys ) {
/* add particle system */
2009-07-20 23:52:53 +00:00
part = psys_new_settings ( " ParticleSettings " , bmain ) ;
2009-07-02 19:41:31 +00:00
psys = MEM_callocN ( sizeof ( ParticleSystem ) , " particle_system " ) ;
part - > type = PART_FLUID ;
psys - > part = part ;
New point cache file format:
- HEADER (beginning of each file)
* general header:
+ 8 char: "BPHYSICS"
+ 1 int: simulation type (same as PTCacheID->type)
* custom header (same for sb, particles and cloth, but can be different for new dynamics)
+ 1 int: totpoint (number of points)
+ 1 int: data_types (bit flags for what the stored data is)
- DATA (directly after header)
*totpoint times the data as specified in data_types flags
- simulation type
soft body = 0, particles = 1, cloth = 2
- data types (more can be added easily when needed)
data flag contains
----------------------------------------
index (1<<0) 1 int (index of current point)
location (1<<1) 3 float
velocity (1<<2) 3 float
rotation (1<<3) 4 float (quaternion)
avelocity (1<<4) 3 float (used for particles)
xconst (1<<4) 3 float (used for cloth)
size (1<<5) 1 float
times (1<<6) 3 float (birth, die & lifetime of particle)
boids (1<<7) 1 BoidData
Notes:
- Every frame is not nescessary since data is interpolated for the inbetween frames.
- For now every point is needed for every cached frame, the "index" data type is reserved for future usage.
- For loading external particle caches only "location" data is necessary, other needed values are determined from the given data.
- Non-dynamic data should be written into an info file if external usage is desired.
* Info file is named as normal cache files, but with frame number 0;
* "Non-dynamic" means data such as particle times.
* Written automatically when baking to disk so basically a library of particle simulations should be possible.
- Old disk cache format is supported for reading, so pre 2.5 files shouldn't break. However old style memory cache (added during 2.5 development) is not supported. To keep memory cached simulations convert the cache to disk cache before svn update and save the blend.
- External sb and cloth caches should be perfectly possible, but due to lack of testing these are not yet enabled in ui.
Other changes:
- Multiple point caches per dynamics system.
* In the future these will hopefully be nla editable etc, but for now things are simple and the current (selected) point cache is used.
* Changing the amount of cached points (for example particle count) is allowed, but might not give correct results if multiple caches are present.
- Generalization of point cache baking etc operator & rna code.
- Comb brushing particle hair didn't work smoothly.
2009-08-12 09:54:29 +00:00
psys - > pointcache = BKE_ptcache_add ( & psys - > ptcaches ) ;
2009-07-02 19:41:31 +00:00
psys - > flag | = PSYS_ENABLED ;
BLI_addtail ( & ob - > particlesystem , psys ) ;
/* add modifier */
psmd = ( ParticleSystemModifierData * ) modifier_new ( eModifierType_ParticleSystem ) ;
sprintf ( psmd - > modifier . name , " FluidParticleSystem " ) ;
psmd - > psys = psys ;
BLI_addtail ( & ob - > modifiers , psmd ) ;
2009-10-09 22:09:48 +00:00
modifier_unique_name ( & ob - > modifiers , ( ModifierData * ) psmd ) ;
2009-07-02 19:41:31 +00:00
}
}
else {
for ( psys = ob - > particlesystem . first ; psys ; psys = psys - > next ) {
if ( psys - > part - > type = = PART_FLUID ) {
/* clear modifier */
psmd = psys_get_modifier ( ob , psys ) ;
BLI_remlink ( & ob - > modifiers , psmd ) ;
modifier_free ( ( ModifierData * ) psmd ) ;
/* clear particle system */
BLI_remlink ( & ob - > particlesystem , psys ) ;
psys_free ( ob , psys ) ;
}
}
}
2009-12-08 17:23:48 +00:00
rna_fluid_update ( bmain , scene , ptr ) ;
2009-07-02 19:41:31 +00:00
}
static void rna_DomainFluidSettings_memory_estimate_get ( PointerRNA * ptr , char * value )
{
2009-07-02 22:22:35 +00:00
# ifdef DISABLE_ELBEEM
value [ 0 ] = ' \0 ' ;
# else
2009-07-02 19:41:31 +00:00
Object * ob = ( Object * ) ptr - > id . data ;
FluidsimSettings * fss = ( FluidsimSettings * ) ptr - > data ;
fluid_estimate_memory ( ob , fss , value ) ;
2009-07-02 22:22:35 +00:00
# endif
2009-07-02 19:41:31 +00:00
}
static int rna_DomainFluidSettings_memory_estimate_length ( PointerRNA * ptr )
{
return 32 ;
}
2009-09-15 03:54:13 +00:00
static char * rna_FluidSettings_path ( PointerRNA * ptr )
{
FluidsimSettings * fss = ( FluidsimSettings * ) ptr - > data ;
ModifierData * md = ( ModifierData * ) fss - > fmd ;
2009-11-03 22:07:15 +00:00
return BLI_sprintfN ( " modifiers[ \" %s \" ].settings " , md - > name ) ;
2009-09-15 03:54:13 +00:00
}
2008-12-29 17:36:06 +00:00
# else
static void rna_def_fluidsim_slip ( StructRNA * srna )
{
PropertyRNA * prop ;
static EnumPropertyItem slip_items [ ] = {
2010-02-11 01:11:52 +00:00
{ OB_FSBND_NOSLIP , " NOSLIP " , 0 , " No Slip " , " Obstacle causes zero normal and tangential velocity (=sticky). Default for all. Only option for moving objects " } ,
2009-06-16 00:52:21 +00:00
{ OB_FSBND_PARTSLIP , " PARTIALSLIP " , 0 , " Partial Slip " , " Mix between no-slip and free-slip. Non moving objects only! " } ,
{ OB_FSBND_FREESLIP , " FREESLIP " , 0 , " Free Slip " , " Obstacle only causes zero normal velocity (=not sticky). Non moving objects only! " } ,
{ 0 , NULL , 0 , NULL , NULL } } ;
2008-12-29 17:36:06 +00:00
prop = RNA_def_property ( srna , " slip_type " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_enum_bitflag_sdna ( prop , NULL , " typeFlags " ) ;
RNA_def_property_enum_items ( prop , slip_items ) ;
RNA_def_property_ui_text ( prop , " Slip Type " , " " ) ;
2009-08-31 16:36:02 +00:00
prop = RNA_def_property ( srna , " partial_slip_factor " , PROP_FLOAT , PROP_NONE ) ;
2008-12-29 17:36:06 +00:00
RNA_def_property_float_sdna ( prop , NULL , " partSlipValue " ) ;
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Partial Slip Amount " , " Amount of mixing between no- and free-slip, 0 is no slip and 1 is free slip " ) ;
2008-12-29 17:36:06 +00:00
}
2009-01-10 22:57:33 +00:00
static void rna_def_fluidsim_domain ( BlenderRNA * brna )
2008-12-29 17:36:06 +00:00
{
StructRNA * srna ;
PropertyRNA * prop ;
static EnumPropertyItem quality_items [ ] = {
2010-02-11 01:11:52 +00:00
{ OB_FSDOM_GEOM , " GEOMETRY " , 0 , " Geometry " , " Display geometry " } ,
{ OB_FSDOM_PREVIEW , " PREVIEW " , 0 , " Preview " , " Display preview quality results " } ,
{ OB_FSDOM_FINAL , " FINAL " , 0 , " Final " , " Display final quality results " } ,
2009-06-16 00:52:21 +00:00
{ 0 , NULL , 0 , NULL , NULL } } ;
2008-12-29 17:36:06 +00:00
static EnumPropertyItem viscosity_items [ ] = {
2010-02-11 01:11:52 +00:00
{ 1 , " MANUAL " , 0 , " Manual " , " Manual viscosity settings " } ,
{ 2 , " WATER " , 0 , " Water " , " Viscosity of 1.0 * 10^-6 " } ,
{ 3 , " OIL " , 0 , " Oil " , " Viscosity of 5.0 * 10^-5 " } ,
{ 4 , " HONEY " , 0 , " Honey " , " Viscosity of 2.0 * 10^-3 " } ,
2009-06-16 00:52:21 +00:00
{ 0 , NULL , 0 , NULL , NULL } } ;
2008-12-29 17:36:06 +00:00
2009-01-10 22:57:33 +00:00
srna = RNA_def_struct ( brna , " DomainFluidSettings " , " FluidSettings " ) ;
2008-12-29 17:36:06 +00:00
RNA_def_struct_sdna ( srna , " FluidsimSettings " ) ;
2010-02-10 21:15:44 +00:00
RNA_def_struct_ui_text ( srna , " Domain Fluid Simulation Settings " , " Fluid simulation settings for the domain of a fluid simulation " ) ;
2008-12-29 17:36:06 +00:00
/* standard settings */
prop = RNA_def_property ( srna , " resolution " , PROP_INT , PROP_NONE ) ;
RNA_def_property_int_sdna ( prop , NULL , " resolutionxyz " ) ;
RNA_def_property_range ( prop , 1 , 1024 ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Resolution " , " Domain resolution in X,Y and Z direction " ) ;
2008-12-29 17:36:06 +00:00
prop = RNA_def_property ( srna , " preview_resolution " , PROP_INT , PROP_NONE ) ;
RNA_def_property_int_sdna ( prop , NULL , " previewresxyz " ) ;
RNA_def_property_range ( prop , 1 , 100 ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Preview Resolution " , " Preview resolution in X,Y and Z direction " ) ;
2008-12-29 17:36:06 +00:00
RNA: subtypes and units
* Reviewed subtypes, making them more specific and adding new ones.
* Subtypes now have an associated type of units (length, area, volume,
mass, rotation, time, velocity, acceleration). These are not used
yet anywhere.
* Centralized code that decides the name of array items based on
subtype (XYZ, RGB), was copied in 3 places.
* RNA_def_float etc functions still need to be update, will do this
later together with another change.
2009-08-10 21:31:05 +00:00
prop = RNA_def_property ( srna , " start_time " , PROP_FLOAT , PROP_TIME ) ;
2008-12-29 17:36:06 +00:00
RNA_def_property_float_sdna ( prop , NULL , " animStart " ) ;
RNA_def_property_range ( prop , 0 , 100 ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Start Time " , " Simulation time of the first blender frame " ) ;
2008-12-29 17:36:06 +00:00
RNA: subtypes and units
* Reviewed subtypes, making them more specific and adding new ones.
* Subtypes now have an associated type of units (length, area, volume,
mass, rotation, time, velocity, acceleration). These are not used
yet anywhere.
* Centralized code that decides the name of array items based on
subtype (XYZ, RGB), was copied in 3 places.
* RNA_def_float etc functions still need to be update, will do this
later together with another change.
2009-08-10 21:31:05 +00:00
prop = RNA_def_property ( srna , " end_time " , PROP_FLOAT , PROP_TIME ) ;
2008-12-29 17:36:06 +00:00
RNA_def_property_float_sdna ( prop , NULL , " animEnd " ) ;
RNA_def_property_range ( prop , 0 , 100 ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " End Time " , " Simulation time of the last blender frame " ) ;
2008-12-29 17:36:06 +00:00
prop = RNA_def_property ( srna , " viewport_display_mode " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_enum_sdna ( prop , NULL , " guiDisplayMode " ) ;
RNA_def_property_enum_items ( prop , quality_items ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Viewport Display Mode " , " How to display the mesh in the viewport " ) ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
RNA_def_property_update ( prop , 0 , " rna_fluid_update " ) ;
2008-12-29 17:36:06 +00:00
prop = RNA_def_property ( srna , " render_display_mode " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_enum_sdna ( prop , NULL , " renderDisplayMode " ) ;
RNA_def_property_enum_items ( prop , quality_items ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Render Display Mode " , " How to display the mesh for rendering " ) ;
2008-12-29 17:36:06 +00:00
prop = RNA_def_property ( srna , " reverse_frames " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " flag " , OB_FLUIDSIM_REVERSE ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Reverse Frames " , " Reverse fluid frames " ) ;
2008-12-29 17:36:06 +00:00
prop = RNA_def_property ( srna , " path " , PROP_STRING , PROP_DIRPATH ) ;
RNA_def_property_string_maxlength ( prop , 240 ) ;
RNA_def_property_string_sdna ( prop , NULL , " surfdataPath " ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Path " , " Directory (and/or filename prefix) to store baked fluid simulation files in " ) ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
RNA_def_property_update ( prop , 0 , " rna_fluid_update " ) ;
2009-07-02 19:41:31 +00:00
prop = RNA_def_property ( srna , " memory_estimate " , PROP_STRING , PROP_NONE ) ;
RNA_def_property_clear_flag ( prop , PROP_EDITABLE ) ;
RNA_def_property_string_funcs ( prop , " rna_DomainFluidSettings_memory_estimate_get " , " rna_DomainFluidSettings_memory_estimate_length " , NULL ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Memory Estimate " , " Estimated amount of memory needed for baking the domain " ) ;
2008-12-29 17:36:06 +00:00
/* advanced settings */
RNA: subtypes and units
* Reviewed subtypes, making them more specific and adding new ones.
* Subtypes now have an associated type of units (length, area, volume,
mass, rotation, time, velocity, acceleration). These are not used
yet anywhere.
* Centralized code that decides the name of array items based on
subtype (XYZ, RGB), was copied in 3 places.
* RNA_def_float etc functions still need to be update, will do this
later together with another change.
2009-08-10 21:31:05 +00:00
prop = RNA_def_property ( srna , " gravity " , PROP_FLOAT , PROP_ACCELERATION ) ;
2008-12-29 17:36:06 +00:00
RNA_def_property_float_sdna ( prop , NULL , " gravx " ) ;
RNA_def_property_array ( prop , 3 ) ;
2009-04-15 21:03:23 +00:00
RNA_def_property_range ( prop , - 1000.1 , 1000.1 ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Gravity " , " Gravity in X, Y and Z direction " ) ;
2008-12-29 17:36:06 +00:00
prop = RNA_def_property ( srna , " viscosity_preset " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_enum_sdna ( prop , NULL , " viscosityMode " ) ;
RNA_def_property_enum_items ( prop , viscosity_items ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Viscosity Preset " , " Set viscosity of the fluid to a preset value, or use manual input " ) ;
2008-12-29 17:36:06 +00:00
prop = RNA_def_property ( srna , " viscosity_base " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " viscosityValue " ) ;
RNA_def_property_range ( prop , 0 , 10 ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Viscosity Base " , " Viscosity setting: value that is multiplied by 10 to the power of (exponent*-1) " ) ;
2008-12-29 17:36:06 +00:00
prop = RNA_def_property ( srna , " viscosity_exponent " , PROP_INT , PROP_NONE ) ;
RNA_def_property_int_sdna ( prop , NULL , " viscosityExponent " ) ;
RNA_def_property_range ( prop , 0 , 10 ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Viscosity Exponent " , " Negative exponent for the viscosity value (to simplify entering small values e.g. 5*10^-6.) " ) ;
2008-12-29 17:36:06 +00:00
prop = RNA_def_property ( srna , " real_world_size " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " realsize " ) ;
RNA_def_property_range ( prop , 0.001 , 10 ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Real World Size " , " Size of the simulation domain in metres " ) ;
2008-12-29 17:36:06 +00:00
prop = RNA_def_property ( srna , " grid_levels " , PROP_INT , PROP_NONE ) ;
RNA_def_property_int_sdna ( prop , NULL , " maxRefine " ) ;
RNA_def_property_range ( prop , - 1 , 4 ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Grid Levels " , " Number of coarsened grids to use (-1 for automatic) " ) ;
2008-12-29 17:36:06 +00:00
prop = RNA_def_property ( srna , " compressibility " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " gstar " ) ;
RNA_def_property_range ( prop , 0.001 , 0.1 ) ;
2009-07-20 17:15:41 +00:00
RNA_def_property_ui_text ( prop , " Compressibility " , " Allowed compressibility due to gravitational force for standing fluid. (directly affects simulation step size) " ) ;
2008-12-29 17:36:06 +00:00
/* domain boundary settings */
rna_def_fluidsim_slip ( srna ) ;
prop = RNA_def_property ( srna , " surface_smoothing " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " surfaceSmoothing " ) ;
RNA_def_property_range ( prop , 0.0 , 5.0 ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Surface Smoothing " , " Amount of surface smoothing. A value of 0 is off, 1 is normal smoothing and more than 1 is extra smoothing " ) ;
2008-12-29 17:36:06 +00:00
prop = RNA_def_property ( srna , " surface_subdivisions " , PROP_INT , PROP_NONE ) ;
RNA_def_property_int_sdna ( prop , NULL , " surfaceSubdivs " ) ;
RNA_def_property_range ( prop , 0 , 5 ) ;
RNA_def_property_ui_text ( prop , " Surface Subdivisions " , " Number of isosurface subdivisions. This is necessary for the inclusion of particles into the surface generation. Warning - can lead to longer computation times! " ) ;
prop = RNA_def_property ( srna , " generate_speed_vectors " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_negative_sdna ( prop , NULL , " domainNovecgen " , 0 ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Generate Speed Vectors " , " Generate speed vectors for vector blur " ) ;
2008-12-29 17:36:06 +00:00
/* particles */
prop = RNA_def_property ( srna , " tracer_particles " , PROP_INT , PROP_NONE ) ;
RNA_def_property_int_sdna ( prop , NULL , " generateTracers " ) ;
RNA_def_property_range ( prop , 0 , 10000 ) ;
RNA_def_property_ui_text ( prop , " Tracer Particles " , " Number of tracer particles to generate " ) ;
prop = RNA_def_property ( srna , " generate_particles " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " generateParticles " ) ;
RNA_def_property_range ( prop , 0.0 , 10.0 ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Generate Particles " , " Amount of particles to generate (0=off, 1=normal, >1=more) " ) ;
2008-12-29 17:36:06 +00:00
}
static void rna_def_fluidsim_volume ( StructRNA * srna )
{
PropertyRNA * prop ;
static EnumPropertyItem volume_type_items [ ] = {
2010-02-11 01:11:52 +00:00
{ 1 , " VOLUME " , 0 , " Volume " , " Use only the inner volume of the mesh " } ,
{ 2 , " SHELL " , 0 , " Shell " , " Use only the outer shell of the mesh " } ,
{ 3 , " BOTH " , 0 , " Both " , " Use both the inner volume and the outer shell of the mesh " } ,
2009-06-16 00:52:21 +00:00
{ 0 , NULL , 0 , NULL , NULL } } ;
2008-12-29 17:36:06 +00:00
prop = RNA_def_property ( srna , " volume_initialization " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_enum_bitflag_sdna ( prop , NULL , " volumeInitType " ) ;
RNA_def_property_enum_items ( prop , volume_type_items ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Volume Initialization " , " Volume initialization type " ) ;
2008-12-29 17:36:06 +00:00
prop = RNA_def_property ( srna , " export_animated_mesh " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " domainNovecgen " , 0 ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Export Animated Mesh " , " Export this mesh as an animated one. Slower, only use if really necessary (e.g. armatures or parented objects), animated pos/rot/scale IPOs do not require it " ) ;
2008-12-29 17:36:06 +00:00
}
2009-01-10 22:57:33 +00:00
static void rna_def_fluidsim_fluid ( BlenderRNA * brna )
2008-12-29 17:36:06 +00:00
{
StructRNA * srna ;
PropertyRNA * prop ;
2009-01-10 22:57:33 +00:00
srna = RNA_def_struct ( brna , " FluidFluidSettings " , " FluidSettings " ) ;
2008-12-29 17:36:06 +00:00
RNA_def_struct_sdna ( srna , " FluidsimSettings " ) ;
2010-02-10 21:15:44 +00:00
RNA_def_struct_ui_text ( srna , " Fluid Fluid Simulation Settings " , " Fluid simulation settings for the fluid in the simulation " ) ;
2008-12-29 17:36:06 +00:00
rna_def_fluidsim_volume ( srna ) ;
RNA: subtypes and units
* Reviewed subtypes, making them more specific and adding new ones.
* Subtypes now have an associated type of units (length, area, volume,
mass, rotation, time, velocity, acceleration). These are not used
yet anywhere.
* Centralized code that decides the name of array items based on
subtype (XYZ, RGB), was copied in 3 places.
* RNA_def_float etc functions still need to be update, will do this
later together with another change.
2009-08-10 21:31:05 +00:00
prop = RNA_def_property ( srna , " initial_velocity " , PROP_FLOAT , PROP_VELOCITY ) ;
2008-12-29 17:36:06 +00:00
RNA_def_property_float_sdna ( prop , NULL , " iniVelx " ) ;
RNA_def_property_array ( prop , 3 ) ;
2009-04-15 21:03:23 +00:00
RNA_def_property_range ( prop , - 1000.1 , 1000.1 ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Initial Velocity " , " Initial velocity of fluid " ) ;
2008-12-29 17:36:06 +00:00
}
2009-01-10 22:57:33 +00:00
static void rna_def_fluidsim_obstacle ( BlenderRNA * brna )
2008-12-29 17:36:06 +00:00
{
StructRNA * srna ;
PropertyRNA * prop ;
2009-01-10 22:57:33 +00:00
srna = RNA_def_struct ( brna , " ObstacleFluidSettings " , " FluidSettings " ) ;
2008-12-29 17:36:06 +00:00
RNA_def_struct_sdna ( srna , " FluidsimSettings " ) ;
2010-02-10 21:15:44 +00:00
RNA_def_struct_ui_text ( srna , " Obstacle Fluid Simulation Settings " , " Fluid simulation settings for obstacles in the simulation " ) ;
2008-12-29 17:36:06 +00:00
rna_def_fluidsim_volume ( srna ) ;
rna_def_fluidsim_slip ( srna ) ;
prop = RNA_def_property ( srna , " impact_factor " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " surfaceSmoothing " ) ;
RNA_def_property_range ( prop , - 2.0 , 10.0 ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Impact Factor " , " This is an unphysical value for moving objects - it controls the impact an obstacle has on the fluid, =0 behaves a bit like outflow (deleting fluid), =1 is default, while >1 results in high forces. Can be used to tweak total mass " ) ;
2008-12-29 17:36:06 +00:00
}
2009-01-10 22:57:33 +00:00
static void rna_def_fluidsim_inflow ( BlenderRNA * brna )
2008-12-29 17:36:06 +00:00
{
StructRNA * srna ;
PropertyRNA * prop ;
2009-01-10 22:57:33 +00:00
srna = RNA_def_struct ( brna , " InflowFluidSettings " , " FluidSettings " ) ;
2008-12-29 17:36:06 +00:00
RNA_def_struct_sdna ( srna , " FluidsimSettings " ) ;
2010-02-10 21:15:44 +00:00
RNA_def_struct_ui_text ( srna , " Inflow Fluid Simulation Settings " , " Fluid simulation settings for objects adding fluids in the simulation " ) ;
2008-12-29 17:36:06 +00:00
rna_def_fluidsim_volume ( srna ) ;
RNA: subtypes and units
* Reviewed subtypes, making them more specific and adding new ones.
* Subtypes now have an associated type of units (length, area, volume,
mass, rotation, time, velocity, acceleration). These are not used
yet anywhere.
* Centralized code that decides the name of array items based on
subtype (XYZ, RGB), was copied in 3 places.
* RNA_def_float etc functions still need to be update, will do this
later together with another change.
2009-08-10 21:31:05 +00:00
prop = RNA_def_property ( srna , " inflow_velocity " , PROP_FLOAT , PROP_VELOCITY ) ;
2008-12-29 17:36:06 +00:00
RNA_def_property_float_sdna ( prop , NULL , " iniVelx " ) ;
RNA_def_property_array ( prop , 3 ) ;
2009-04-15 21:03:23 +00:00
RNA_def_property_range ( prop , - 1000.1 , 1000.1 ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Inflow Velocity " , " Initial velocity of fluid " ) ;
2008-12-29 17:36:06 +00:00
prop = RNA_def_property ( srna , " local_coordinates " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " typeFlags " , OB_FSINFLOW_LOCALCOORD ) ;
2009-07-20 17:15:41 +00:00
RNA_def_property_ui_text ( prop , " Local Coordinates " , " Use local coordinates for inflow. (e.g. for rotating objects) " ) ;
2008-12-29 17:36:06 +00:00
}
2009-01-10 22:57:33 +00:00
static void rna_def_fluidsim_outflow ( BlenderRNA * brna )
2008-12-29 17:36:06 +00:00
{
StructRNA * srna ;
2009-01-10 22:57:33 +00:00
srna = RNA_def_struct ( brna , " OutflowFluidSettings " , " FluidSettings " ) ;
2008-12-29 17:36:06 +00:00
RNA_def_struct_sdna ( srna , " FluidsimSettings " ) ;
2010-02-10 21:15:44 +00:00
RNA_def_struct_ui_text ( srna , " Outflow Fluid Simulation Settings " , " Fluid simulation settings for objects removing fluids from the simulation " ) ;
2008-12-29 17:36:06 +00:00
rna_def_fluidsim_volume ( srna ) ;
}
2009-01-10 22:57:33 +00:00
static void rna_def_fluidsim_particle ( BlenderRNA * brna )
2008-12-29 17:36:06 +00:00
{
StructRNA * srna ;
PropertyRNA * prop ;
2009-01-10 22:57:33 +00:00
srna = RNA_def_struct ( brna , " ParticleFluidSettings " , " FluidSettings " ) ;
2008-12-29 17:36:06 +00:00
RNA_def_struct_sdna ( srna , " FluidsimSettings " ) ;
2010-02-10 21:15:44 +00:00
RNA_def_struct_ui_text ( srna , " Particle Fluid Simulation Settings " , " Fluid simulation settings for objects storing fluid particles generated by the simulation " ) ;
2008-12-29 17:36:06 +00:00
prop = RNA_def_property ( srna , " drops " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " typeFlags " , OB_FSPART_DROP ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Drops " , " Show drop particles " ) ;
2008-12-29 17:36:06 +00:00
prop = RNA_def_property ( srna , " floats " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " typeFlags " , OB_FSPART_FLOAT ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Floats " , " Show floating foam particles " ) ;
2008-12-29 17:36:06 +00:00
prop = RNA_def_property ( srna , " tracer " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " typeFlags " , OB_FSPART_TRACER ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Tracer " , " Show tracer particles " ) ;
2008-12-29 17:36:06 +00:00
prop = RNA_def_property ( srna , " particle_influence " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " particleInfSize " ) ;
RNA_def_property_range ( prop , 0.0 , 2.0 ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Particle Influence " , " Amount of particle size scaling: 0=off (all same size), 1=full (range 0.2-2.0), >1=stronger " ) ;
2008-12-29 17:36:06 +00:00
prop = RNA_def_property ( srna , " alpha_influence " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " particleInfAlpha " ) ;
RNA_def_property_range ( prop , 0.0 , 2.0 ) ;
2009-07-20 17:15:41 +00:00
RNA_def_property_ui_text ( prop , " Alpha Influence " , " Amount of particle alpha change, inverse of size influence: 0=off (all same alpha), 1=full. (large particles get lower alphas, smaller ones higher values) " ) ;
2008-12-29 17:36:06 +00:00
prop = RNA_def_property ( srna , " path " , PROP_STRING , PROP_DIRPATH ) ;
RNA_def_property_string_maxlength ( prop , 240 ) ;
RNA_def_property_string_sdna ( prop , NULL , " surfdataPath " ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Path " , " Directory (and/or filename prefix) to store and load particles from " ) ;
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
RNA_def_property_update ( prop , 0 , " rna_fluid_update " ) ;
2008-12-29 17:36:06 +00:00
}
2009-01-10 22:57:33 +00:00
static void rna_def_fluidsim_control ( BlenderRNA * brna )
2008-12-29 17:36:06 +00:00
{
StructRNA * srna ;
PropertyRNA * prop ;
2009-01-10 22:57:33 +00:00
srna = RNA_def_struct ( brna , " ControlFluidSettings " , " FluidSettings " ) ;
2008-12-29 17:36:06 +00:00
RNA_def_struct_sdna ( srna , " FluidsimSettings " ) ;
2010-02-10 21:15:44 +00:00
RNA_def_struct_ui_text ( srna , " Control Fluid Simulation Settings " , " Fluid simulation settings for objects controlling the motion of fluid in the simulation " ) ;
2008-12-29 17:36:06 +00:00
RNA: subtypes and units
* Reviewed subtypes, making them more specific and adding new ones.
* Subtypes now have an associated type of units (length, area, volume,
mass, rotation, time, velocity, acceleration). These are not used
yet anywhere.
* Centralized code that decides the name of array items based on
subtype (XYZ, RGB), was copied in 3 places.
* RNA_def_float etc functions still need to be update, will do this
later together with another change.
2009-08-10 21:31:05 +00:00
prop = RNA_def_property ( srna , " start_time " , PROP_FLOAT , PROP_TIME ) ;
2008-12-29 17:36:06 +00:00
RNA_def_property_float_sdna ( prop , NULL , " cpsTimeStart " ) ;
RNA_def_property_range ( prop , 0.0 , 100.0 ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Start Time " , " Specifies time when the control particles are activated " ) ;
2008-12-29 17:36:06 +00:00
RNA: subtypes and units
* Reviewed subtypes, making them more specific and adding new ones.
* Subtypes now have an associated type of units (length, area, volume,
mass, rotation, time, velocity, acceleration). These are not used
yet anywhere.
* Centralized code that decides the name of array items based on
subtype (XYZ, RGB), was copied in 3 places.
* RNA_def_float etc functions still need to be update, will do this
later together with another change.
2009-08-10 21:31:05 +00:00
prop = RNA_def_property ( srna , " end_time " , PROP_FLOAT , PROP_TIME ) ;
2008-12-29 17:36:06 +00:00
RNA_def_property_float_sdna ( prop , NULL , " cpsTimeEnd " ) ;
RNA_def_property_range ( prop , 0.0 , 100.0 ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " End Time " , " Specifies time when the control particles are deactivated " ) ;
2008-12-29 17:36:06 +00:00
prop = RNA_def_property ( srna , " attraction_strength " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " attractforceStrength " ) ;
2009-04-15 21:03:23 +00:00
RNA_def_property_range ( prop , - 10.0 , 10.0 ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Attraction Strength " , " Force strength for directional attraction towards the control object " ) ;
2008-12-29 17:36:06 +00:00
prop = RNA_def_property ( srna , " attraction_radius " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " attractforceRadius " ) ;
2009-04-15 21:03:23 +00:00
RNA_def_property_range ( prop , 0.0 , 10.0 ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Attraction Radius " , " Specifies the force field radius around the control object " ) ;
2008-12-29 17:36:06 +00:00
prop = RNA_def_property ( srna , " velocity_strength " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " velocityforceStrength " ) ;
2009-04-15 21:03:23 +00:00
RNA_def_property_range ( prop , 0.0 , 10.0 ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Velocity Strength " , " Force strength of how much of the control object's velocity is influencing the fluid velocity " ) ;
2008-12-29 17:36:06 +00:00
prop = RNA_def_property ( srna , " velocity_radius " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " velocityforceRadius " ) ;
2009-04-15 21:03:23 +00:00
RNA_def_property_range ( prop , 0.0 , 10.0 ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Velocity Radius " , " Specifies the force field radius around the control object " ) ;
2008-12-29 17:36:06 +00:00
prop = RNA_def_property ( srna , " quality " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " cpsQuality " ) ;
RNA_def_property_range ( prop , 5.0 , 100.0 ) ;
2009-07-20 17:15:41 +00:00
RNA_def_property_ui_text ( prop , " Quality " , " Specifies the quality which is used for object sampling. (higher = better but slower) " ) ;
2008-12-29 17:36:06 +00:00
prop = RNA_def_property ( srna , " reverse_frames " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " flag " , OB_FLUIDSIM_REVERSE ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Reverse Frames " , " Reverse control object movement " ) ;
2008-12-29 17:36:06 +00:00
}
void RNA_def_fluidsim ( BlenderRNA * brna )
{
StructRNA * srna ;
PropertyRNA * prop ;
static EnumPropertyItem prop_fluid_type_items [ ] = {
2009-07-02 19:41:31 +00:00
{ OB_FLUIDSIM_ENABLE , " NONE " , 0 , " None " , " " } ,
2010-02-11 01:11:52 +00:00
{ OB_FLUIDSIM_DOMAIN , " DOMAIN " , 0 , " Domain " , " Bounding box of this object represents the computational domain of the fluid simulation " } ,
{ OB_FLUIDSIM_FLUID , " FLUID " , 0 , " Fluid " , " Object represents a volume of fluid in the simulation " } ,
{ OB_FLUIDSIM_OBSTACLE , " OBSTACLE " , 0 , " Obstacle " , " Object is a fixed obstacle " } ,
{ OB_FLUIDSIM_INFLOW , " INFLOW " , 0 , " Inflow " , " Object adds fluid to the simulation " } ,
{ OB_FLUIDSIM_OUTFLOW , " OUTFLOW " , 0 , " Outflow " , " Object removes fluid from the simulation " } ,
{ OB_FLUIDSIM_PARTICLE , " PARTICLE " , 0 , " Particle " , " Object is made a particle system to display particles generated by a fluidsim domain object " } ,
{ OB_FLUIDSIM_CONTROL , " CONTROL " , 0 , " Control " , " Object is made a fluid control mesh, which influences the fluid " } ,
2009-06-16 00:52:21 +00:00
{ 0 , NULL , 0 , NULL , NULL } } ;
2008-12-29 17:36:06 +00:00
srna = RNA_def_struct ( brna , " FluidSettings " , NULL ) ;
RNA_def_struct_sdna ( srna , " FluidsimSettings " ) ;
2009-01-01 15:52:51 +00:00
RNA_def_struct_refine_func ( srna , " rna_FluidSettings_refine " ) ;
2009-09-15 03:54:13 +00:00
RNA_def_struct_path_func ( srna , " rna_FluidSettings_path " ) ;
2010-02-10 21:15:44 +00:00
RNA_def_struct_ui_text ( srna , " Fluid Simulation Settings " , " Fluid simulation settings for an object taking part in the simulation " ) ;
2008-12-29 17:36:06 +00:00
prop = RNA_def_property ( srna , " type " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_enum_bitflag_sdna ( prop , NULL , " type " ) ;
RNA_def_property_enum_items ( prop , prop_fluid_type_items ) ;
2010-02-10 21:15:44 +00:00
RNA_def_property_ui_text ( prop , " Type " , " Type of participation in the fluid simulation " ) ;
2009-07-02 19:41:31 +00:00
RNA_def_property_update ( prop , 0 , " rna_FluidSettings_update_type " ) ;
2008-12-29 17:36:06 +00:00
2009-02-02 11:51:10 +00:00
//prop= RNA_def_property(srna, "ipo", PROP_POINTER, PROP_NONE);
2010-02-10 21:15:44 +00:00
//RNA_def_property_ui_text(prop, "Ipo Curves", "Ipo curves used by fluid simulation settings");
2008-12-29 17:36:06 +00:00
/* types */
2009-01-10 22:57:33 +00:00
rna_def_fluidsim_domain ( brna ) ;
rna_def_fluidsim_fluid ( brna ) ;
rna_def_fluidsim_obstacle ( brna ) ;
rna_def_fluidsim_inflow ( brna ) ;
rna_def_fluidsim_outflow ( brna ) ;
rna_def_fluidsim_particle ( brna ) ;
rna_def_fluidsim_control ( brna ) ;
2008-12-29 17:36:06 +00:00
}
# endif