Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJanne Karhu <jhkarh@gmail.com>2010-11-23 14:15:38 +0300
committerJanne Karhu <jhkarh@gmail.com>2010-11-23 14:15:38 +0300
commit855b83caece3bf95443852ce5e73a8e759273a7d (patch)
tree6387d401ed79de871801e397cc5262ed547cbdd0 /source/blender/makesrna/intern/rna_boid.c
parentce2295999e5fc667f3574b9c53cba04155bd1546 (diff)
Particle fluid and boid settings didn't have a valid rna path, so they couldn't be animated.
Diffstat (limited to 'source/blender/makesrna/intern/rna_boid.c')
-rw-r--r--source/blender/makesrna/intern/rna_boid.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_boid.c b/source/blender/makesrna/intern/rna_boid.c
index 8cd6fcbeff9..b77f40a31f3 100644
--- a/source/blender/makesrna/intern/rna_boid.c
+++ b/source/blender/makesrna/intern/rna_boid.c
@@ -175,6 +175,26 @@ static void rna_BoidState_active_boid_rule_index_set(struct PointerRNA *ptr, int
}
}
+static int particle_id_check(PointerRNA *ptr)
+{
+ ID *id= ptr->id.data;
+
+ return (GS(id->name) == ID_PA);
+}
+
+static char *rna_BoidSettings_path(PointerRNA *ptr)
+{
+ BoidSettings *boids = (BoidSettings *)ptr->data;
+
+ if(particle_id_check(ptr)) {
+ ParticleSettings *part = (ParticleSettings*)ptr->id.data;
+
+ if (part->boids == boids)
+ return BLI_sprintfN("boids");
+ }
+ return NULL;
+}
+
static PointerRNA rna_BoidSettings_active_boid_state_get(PointerRNA *ptr)
{
BoidSettings *boids= (BoidSettings*)ptr->data;
@@ -466,6 +486,7 @@ static void rna_def_boid_settings(BlenderRNA *brna)
PropertyRNA *prop;
srna = RNA_def_struct(brna, "BoidSettings", NULL);
+ RNA_def_struct_path_func(srna, "rna_BoidSettings_path");
RNA_def_struct_ui_text(srna, "Boid Settings", "Settings for boid physics");
prop= RNA_def_property(srna, "land_smooth", PROP_FLOAT, PROP_NONE);