diff options
author | Matt Ebb <matt@mke3.net> | 2009-09-15 07:54:13 +0400 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2009-09-15 07:54:13 +0400 |
commit | 223bc8aee1c6f0c1e6d16d0edd8cf23387c33a3f (patch) | |
tree | 753b36082ec3bddf93d1badfd71cff2557b07bf5 /source/blender | |
parent | 41ed712ea3937d8baf601131df4f2063e8997764 (diff) |
* 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.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/fluidsim.c | 1 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 13 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_object_fluidsim.h | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_fluidsim.c | 9 |
4 files changed, 24 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/fluidsim.c b/source/blender/blenkernel/intern/fluidsim.c index ad9e481ffd2..aa163b821c8 100644 --- a/source/blender/blenkernel/intern/fluidsim.c +++ b/source/blender/blenkernel/intern/fluidsim.c @@ -80,6 +80,7 @@ void fluidsim_init(FluidsimModifierData *fluidmd) if(!fss) return; + fss->fmd = fluidmd; fss->type = OB_FLUIDSIM_ENABLE; fss->show_advancedoptions = 0; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index d0264002214..bb7262c01d4 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -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! */ diff --git a/source/blender/makesdna/DNA_object_fluidsim.h b/source/blender/makesdna/DNA_object_fluidsim.h index 09288b24c20..da55fb1d47c 100644 --- a/source/blender/makesdna/DNA_object_fluidsim.h +++ b/source/blender/makesdna/DNA_object_fluidsim.h @@ -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)*/ diff --git a/source/blender/makesrna/intern/rna_fluidsim.c b/source/blender/makesrna/intern/rna_fluidsim.c index a62002365c9..c415b3d716a 100644 --- a/source/blender/makesrna/intern/rna_fluidsim.c +++ b/source/blender/makesrna/intern/rna_fluidsim.c @@ -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); |