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/editors/space_buttons
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/editors/space_buttons')
-rw-r--r--source/blender/editors/space_buttons/buttons_context.c15
-rw-r--r--source/blender/editors/space_buttons/buttons_ops.c4
2 files changed, 16 insertions, 3 deletions
diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c
index 01794d1bba8..02179f347f5 100644
--- a/source/blender/editors/space_buttons/buttons_context.c
+++ b/source/blender/editors/space_buttons/buttons_context.c
@@ -497,7 +497,7 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r
"world", "object", "meshe", "armature", "lattice", "curve",
"meta_ball", "lamp", "camera", "material", "material_slot",
"texture", "texture_slot", "bone", "edit_bone", "particle_system",
- "cloth", "soft_body", "fluid", NULL};
+ "cloth", "soft_body", "fluid", "collision", NULL};
CTX_data_dir_set(result, dir);
return 1;
@@ -615,7 +615,8 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r
if(ptr && ptr->data) {
Object *ob= ptr->data;
- CTX_data_pointer_set(result, &ob->id, &RNA_SoftBodySettings, ob->soft);
+ ModifierData *md= modifiers_findByType(ob, eModifierType_Softbody);
+ CTX_data_pointer_set(result, &ob->id, &RNA_SoftBodyModifier, md);
return 1;
}
}
@@ -629,6 +630,16 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r
return 1;
}
}
+ else if(CTX_data_equals(member, "collision")) {
+ PointerRNA *ptr= get_pointer_type(path, &RNA_Object);
+
+ if(ptr && ptr->data) {
+ Object *ob= ptr->data;
+ ModifierData *md= modifiers_findByType(ob, eModifierType_Collision);
+ CTX_data_pointer_set(result, &ob->id, &RNA_CollisionModifier, md);
+ return 1;
+ }
+ }
return 0;
}
diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c
index df3e8c62d37..2bc3bdaa613 100644
--- a/source/blender/editors/space_buttons/buttons_ops.c
+++ b/source/blender/editors/space_buttons/buttons_ops.c
@@ -41,6 +41,7 @@
#include "BKE_depsgraph.h"
#include "BKE_font.h"
#include "BKE_library.h"
+#include "BKE_main.h"
#include "BKE_material.h"
#include "BKE_particle.h"
#include "BKE_texture.h"
@@ -471,6 +472,7 @@ void OBJECT_OT_particle_system_remove(wmOperatorType *ot)
static int new_particle_settings_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
+ Main *bmain= CTX_data_main(C);
ParticleSettings *part= CTX_data_pointer_get_type(C, "particle_settings", &RNA_ParticleSettings).data;
Object *ob;
PointerRNA ptr;
@@ -479,7 +481,7 @@ static int new_particle_settings_exec(bContext *C, wmOperator *op)
if(part)
part= psys_copy_settings(part);
else
- part= psys_new_settings("PSys", NULL);
+ part= psys_new_settings("PSys", bmain);
/* attempt to assign to material slot */
ptr= CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem);