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
path: root/source
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-06-18 18:29:24 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-06-18 18:29:24 +0400
commit8130fb29b2a80a795fd891d2c9a74f86993221e2 (patch)
tree8f639d08fbfedad71f91aca5be8f6c2fcd16ed5f /source
parent5ea992df98d152f83072e886a0b1f9464a4883d6 (diff)
RNA:
* Make cloth settings animateable from buttons.
Diffstat (limited to 'source')
-rw-r--r--source/blender/makesrna/intern/rna_cloth.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_cloth.c b/source/blender/makesrna/intern/rna_cloth.c
index 919ae210801..361c1b61303 100644
--- a/source/blender/makesrna/intern/rna_cloth.c
+++ b/source/blender/makesrna/intern/rna_cloth.c
@@ -31,6 +31,8 @@
#include "rna_internal.h"
#include "BKE_cloth.h"
+#include "BKE_modifier.h"
+
#include "DNA_cloth_types.h"
#ifdef RNA_RUNTIME
@@ -129,6 +131,22 @@ static void rna_ClothSettings_gravity_set(PointerRNA *ptr, const float *values)
sim->gravity[2]= values[2];
}
+static char *rna_ClothSettings_path(PointerRNA *ptr)
+{
+ Object *ob= (Object*)ptr->id.data;
+ ModifierData *md= modifiers_findByType(ob, eModifierType_Cloth);
+
+ return BLI_sprintfN("modifiers[%s].settings", md->name);
+}
+
+static char *rna_ClothCollisionSettings_path(PointerRNA *ptr)
+{
+ Object *ob= (Object*)ptr->id.data;
+ ModifierData *md= modifiers_findByType(ob, eModifierType_Cloth);
+
+ return BLI_sprintfN("modifiers[%s].collision_settings", md->name);
+}
+
#else
static void rna_def_cloth_sim_settings(BlenderRNA *brna)
@@ -139,6 +157,7 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna)
srna = RNA_def_struct(brna, "ClothSettings", NULL);
RNA_def_struct_ui_text(srna, "Cloth Settings", "Cloth simulation settings for an object.");
RNA_def_struct_sdna(srna, "ClothSimSettings");
+ RNA_def_struct_path_func(srna, "rna_ClothSettings_path");
/* goal */
@@ -297,6 +316,7 @@ static void rna_def_cloth_collision_settings(BlenderRNA *brna)
srna = RNA_def_struct(brna, "ClothCollisionSettings", NULL);
RNA_def_struct_ui_text(srna, "Cloth Collision Settings", "Cloth simulation settings for self collision and collision with other objects.");
RNA_def_struct_sdna(srna, "ClothCollSettings");
+ RNA_def_struct_path_func(srna, "rna_ClothCollisionSettings_path");
/* general collision */