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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-07-02 23:41:31 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-07-02 23:41:31 +0400
commit093ff8202ced6391a2ef657abe42615672146954 (patch)
tree8b65da58becc4ac56bf81ae7d3adab7c86730d15 /source/blender/makesrna/intern/rna_object.c
parent5a0896e1a3c7f17abd37e3d818585fde8e80ff6d (diff)
2.5: Physics Buttons
All kinds of changes to get it ready for UI layouts. This means RNA and operators should be working correct, but most buttons are still not actually there yet. * Added near empty soft body, fluid, field and collision panels, tweaks to cloth panels. * Fluid bake works, but without escape or showing any progress. * Fluid/Softbody/Cloth/Collision can now be both added as modifiers or in the physics panels. * Missing: fields & soft body for particles. * Missing: proper updating softbodies, guess this code still needs updates after pointcache refactor?
Diffstat (limited to 'source/blender/makesrna/intern/rna_object.c')
-rw-r--r--source/blender/makesrna/intern/rna_object.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index 947846f8d8d..bf2a2c0ba40 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -48,17 +48,18 @@
#include "BKE_context.h"
#include "BKE_curve.h"
#include "BKE_depsgraph.h"
+#include "BKE_effect.h"
#include "BKE_key.h"
#include "BKE_material.h"
#include "BKE_mesh.h"
#include "BKE_particle.h"
-static void rna_Object_update(bContext *C, PointerRNA *ptr)
+void rna_Object_update(bContext *C, PointerRNA *ptr)
{
DAG_object_flush_update(CTX_data_scene(C), ptr->id.data, OB_RECALC_OB);
}
-static void rna_Object_update_data(bContext *C, PointerRNA *ptr)
+void rna_Object_update_data(bContext *C, PointerRNA *ptr)
{
DAG_object_flush_update(CTX_data_scene(C), ptr->id.data, OB_RECALC_DATA);
}
@@ -456,6 +457,28 @@ static void rna_Object_shape_key_lock_set(PointerRNA *ptr, int value)
ob->shapeflag &= ~OB_SHAPE_TEMPLOCK;
}
+static PointerRNA rna_Object_field_get(PointerRNA *ptr)
+{
+ Object *ob= (Object*)ptr->id.data;
+
+ /* weak */
+ if(!ob->pd)
+ ob->pd= object_add_collision_fields();
+
+ return rna_pointer_inherit_refine(ptr, &RNA_FieldSettings, ob->pd);
+}
+
+static PointerRNA rna_Object_collision_get(PointerRNA *ptr)
+{
+ Object *ob= (Object*)ptr->id.data;
+
+ /* weak */
+ if(!ob->pd)
+ ob->pd= object_add_collision_fields();
+
+ return rna_pointer_inherit_refine(ptr, &RNA_CollisionSettings, ob->pd);
+}
+
#else
static void rna_def_vertex_group(BlenderRNA *brna)
@@ -1006,11 +1029,13 @@ static void rna_def_object(BlenderRNA *brna)
prop= RNA_def_property(srna, "field", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "pd");
RNA_def_property_struct_type(prop, "FieldSettings");
+ RNA_def_property_pointer_funcs(prop, "rna_Object_field_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Field Settings", "Settings for using the objects as a field in physics simulation.");
prop= RNA_def_property(srna, "collision", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "pd");
RNA_def_property_struct_type(prop, "CollisionSettings");
+ RNA_def_property_pointer_funcs(prop, "rna_Object_collision_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Collision Settings", "Settings for using the objects as a collider in physics simulation.");
prop= RNA_def_property(srna, "soft_body", PROP_POINTER, PROP_NONE);