* Added RNA path functionality to fluidsim modifier settings, to allow keying of fluidsim settings properties.

Note: Although the properties can be animated with the RNA system, the values are not exported to the actual fluid sim yet, that can come later.
This commit is contained in:
Matt Ebb 2009-09-15 03:54:13 +00:00
parent 41ed712ea3
commit 223bc8aee1
4 changed files with 24 additions and 0 deletions

@ -80,6 +80,7 @@ void fluidsim_init(FluidsimModifierData *fluidmd)
if(!fss)
return;
fss->fmd = fluidmd;
fss->type = OB_FLUIDSIM_ENABLE;
fss->show_advancedoptions = 0;

@ -9692,10 +9692,23 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
/* put 2.50 compatibility code here until next subversion bump */
{
Scene *sce;
Object *ob;
for(sce = main->scene.first; sce; sce = sce->id.next)
if(sce->unit.scale_length == 0.0f)
sce->unit.scale_length= 1.0f;
for(ob = main->object.first; ob; ob = ob->id.next) {
ModifierData *md;
/* add backwards pointer for fluidsim modifier RNA access */
for (md=ob->modifiers.first; md; md = md->next) {
if (md->type == eModifierType_Fluidsim) {
FluidsimModifierData *fluidmd= (FluidsimModifierData*) md;
fluidmd->fss->fmd = fluidmd;
}
}
}
}
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */

@ -41,6 +41,7 @@ struct Ipo;
struct MVert;
typedef struct FluidsimSettings {
struct FluidsimModifierData *fmd; /* for fast RNA access */
/* domain,fluid or obstacle */
short type;
/* display advanced options in fluid sim tab (on=1,off=0)*/

@ -151,6 +151,14 @@ static int rna_DomainFluidSettings_memory_estimate_length(PointerRNA *ptr)
return 32;
}
static char *rna_FluidSettings_path(PointerRNA *ptr)
{
FluidsimSettings *fss = (FluidsimSettings*)ptr->data;
ModifierData *md= (ModifierData *)fss->fmd;
return BLI_sprintfN("modifiers[%s].settings", md->name);
}
#else
static void rna_def_fluidsim_slip(StructRNA *srna)
@ -509,6 +517,7 @@ void RNA_def_fluidsim(BlenderRNA *brna)
srna= RNA_def_struct(brna, "FluidSettings", NULL);
RNA_def_struct_sdna(srna, "FluidsimSettings");
RNA_def_struct_refine_func(srna, "rna_FluidSettings_refine");
RNA_def_struct_path_func(srna, "rna_FluidSettings_path");
RNA_def_struct_ui_text(srna, "Fluid Simulation Settings", "Fluid simulation settings for an object taking part in the simulation.");
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);