diff options
Diffstat (limited to 'source/blender/editors/physics')
-rw-r--r-- | source/blender/editors/physics/CMakeLists.txt | 4 | ||||
-rw-r--r-- | source/blender/editors/physics/Makefile | 2 | ||||
-rw-r--r-- | source/blender/editors/physics/particle_boids.c | 7 | ||||
-rw-r--r-- | source/blender/editors/physics/particle_edit.c | 35 | ||||
-rw-r--r-- | source/blender/editors/physics/particle_object.c | 8 | ||||
-rw-r--r-- | source/blender/editors/physics/physics_fluid.c | 2 | ||||
-rw-r--r-- | source/blender/editors/physics/physics_ops.c | 3 | ||||
-rw-r--r-- | source/blender/editors/physics/physics_pointcache.c | 13 |
8 files changed, 44 insertions, 30 deletions
diff --git a/source/blender/editors/physics/CMakeLists.txt b/source/blender/editors/physics/CMakeLists.txt index ebe3f913508..be826654311 100644 --- a/source/blender/editors/physics/CMakeLists.txt +++ b/source/blender/editors/physics/CMakeLists.txt @@ -32,9 +32,9 @@ SET(INC ../../../../intern/guardedalloc ) -IF(NOT WITH_ELBEEM) +IF(NOT WITH_FLUID) ADD_DEFINITIONS(-DDISABLE_ELBEEM) -ENDIF(NOT WITH_ELBEEM) +ENDIF(NOT WITH_FLUID) IF(WITH_OPENMP) ADD_DEFINITIONS(-DPARALLEL=1) diff --git a/source/blender/editors/physics/Makefile b/source/blender/editors/physics/Makefile index e9260b66087..9ffc3a5b372 100644 --- a/source/blender/editors/physics/Makefile +++ b/source/blender/editors/physics/Makefile @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, -# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2007 Blender Foundation # All rights reserved. diff --git a/source/blender/editors/physics/particle_boids.c b/source/blender/editors/physics/particle_boids.c index 37de0d8f873..a18890881a8 100644 --- a/source/blender/editors/physics/particle_boids.c +++ b/source/blender/editors/physics/particle_boids.c @@ -35,6 +35,7 @@ #include "BKE_boids.h" #include "BKE_context.h" #include "BKE_depsgraph.h" +#include "BKE_main.h" #include "BKE_particle.h" #include "BLI_listbase.h" @@ -99,6 +100,7 @@ void BOID_OT_rule_add(wmOperatorType *ot) } static int rule_del_exec(bContext *C, wmOperator *op) { + Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); ParticleSystem *psys= ptr.data; @@ -125,7 +127,7 @@ static int rule_del_exec(bContext *C, wmOperator *op) if(rule) rule->flag |= BOIDRULE_CURRENT; - DAG_scene_sort(scene); + DAG_scene_sort(bmain, scene); DAG_id_flush_update(&psys->part->id, OB_RECALC_DATA|PSYS_RECALC_RESET); WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); @@ -266,6 +268,7 @@ void BOID_OT_state_add(wmOperatorType *ot) } static int state_del_exec(bContext *C, wmOperator *op) { + Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); ParticleSystem *psys= ptr.data; @@ -297,7 +300,7 @@ static int state_del_exec(bContext *C, wmOperator *op) state->flag |= BOIDSTATE_CURRENT; - DAG_scene_sort(scene); + DAG_scene_sort(bmain, scene); DAG_id_flush_update(&psys->part->id, OB_RECALC_DATA|PSYS_RECALC_RESET); WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index da0034ac2f9..d3f9926cf8c 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -2098,6 +2098,7 @@ static void remove_tagged_keys(Scene *scene, Object *ob, ParticleSystem *psys) ParticleData *pa; HairKey *hkey, *nhkey, *new_hkeys=0; POINT_P; KEY_K; + PTCacheEditKey *nkey, *new_keys; ParticleSystemModifierData *psmd; short new_totkey; @@ -2133,9 +2134,10 @@ static void remove_tagged_keys(Scene *scene, Object *ob, ParticleSystem *psys) } if(new_totkey != pa->totkey) { - hkey= pa->hair; nhkey= new_hkeys= MEM_callocN(new_totkey*sizeof(HairKey), "HairKeys"); + nkey= new_keys= MEM_callocN(new_totkey*sizeof(PTCacheEditKey), "particle edit keys"); + hkey= pa->hair; LOOP_KEYS { while(key->flag & PEK_TAG && hkey < pa->hair + pa->totkey) { key++; @@ -2144,29 +2146,36 @@ static void remove_tagged_keys(Scene *scene, Object *ob, ParticleSystem *psys) if(hkey < pa->hair + pa->totkey) { VECCOPY(nhkey->co, hkey->co); + nhkey->editflag = hkey->editflag; nhkey->time= hkey->time; nhkey->weight= hkey->weight; + + nkey->co= nhkey->co; + nkey->time= &nhkey->time; + /* these can be copied from old edit keys */ + nkey->flag = key->flag; + nkey->ftime = key->ftime; + nkey->length = key->length; + VECCOPY(nkey->world_co, key->world_co); } - hkey++; + nkey++; nhkey++; + hkey++; } + if(pa->hair) MEM_freeN(pa->hair); + + if(point->keys) + MEM_freeN(point->keys); pa->hair= new_hkeys; + point->keys= new_keys; point->totkey= pa->totkey= new_totkey; - if(point->keys) - MEM_freeN(point->keys); - key= point->keys= MEM_callocN(new_totkey*sizeof(PTCacheEditKey), "particle edit keys"); - - hkey = pa->hair; - LOOP_KEYS { - key->co= hkey->co; - key->time= &hkey->time; - hkey++; - } + /* flag for recalculating length */ + point->flag |= PEP_EDIT_RECALC; } } } @@ -3327,7 +3336,7 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr) RNA_float_get_array(itemptr, "mouse", mousef); mouse[0] = mousef[0]; mouse[1] = mousef[1]; - flip= RNA_boolean_get(itemptr, "flip"); + flip= RNA_boolean_get(itemptr, "pen_flip"); if(bedit->first) { bedit->lastmouse[0]= mouse[0]; diff --git a/source/blender/editors/physics/particle_object.c b/source/blender/editors/physics/particle_object.c index bb30d30fd0e..4885a8b04ec 100644 --- a/source/blender/editors/physics/particle_object.c +++ b/source/blender/editors/physics/particle_object.c @@ -166,7 +166,7 @@ static int new_particle_settings_exec(bContext *C, wmOperator *op) psys_check_boid_data(psys); - DAG_scene_sort(scene); + DAG_scene_sort(bmain, scene); DAG_id_flush_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE, ob); @@ -193,6 +193,7 @@ void PARTICLE_OT_new(wmOperatorType *ot) static int new_particle_target_exec(bContext *C, wmOperator *op) { + Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); ParticleSystem *psys= ptr.data; @@ -214,7 +215,7 @@ static int new_particle_target_exec(bContext *C, wmOperator *op) BLI_addtail(&psys->targets, pt); - DAG_scene_sort(scene); + DAG_scene_sort(bmain, scene); DAG_id_flush_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE, ob); @@ -238,6 +239,7 @@ void PARTICLE_OT_new_target(wmOperatorType *ot) static int remove_particle_target_exec(bContext *C, wmOperator *op) { + Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); ParticleSystem *psys= ptr.data; @@ -262,7 +264,7 @@ static int remove_particle_target_exec(bContext *C, wmOperator *op) if(pt) pt->flag |= PTARGET_CURRENT; - DAG_scene_sort(scene); + DAG_scene_sort(bmain, scene); DAG_id_flush_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE, ob); diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c index 23f604d8c12..f411f92d395 100644 --- a/source/blender/editors/physics/physics_fluid.c +++ b/source/blender/editors/physics/physics_fluid.c @@ -77,7 +77,6 @@ #include "LBM_fluidsim.h" -#include "BIF_gl.h" #include "ED_screen.h" @@ -563,7 +562,6 @@ static void export_fluid_objects(ListBase *fobjects, Scene *scene, int length) if(verts) MEM_freeN(verts); if(tris) MEM_freeN(tris); - if(fsmesh.channelVertices) MEM_freeN(fsmesh.channelVertices); } } diff --git a/source/blender/editors/physics/physics_ops.c b/source/blender/editors/physics/physics_ops.c index 28839693e2c..2b7f8e9d5a2 100644 --- a/source/blender/editors/physics/physics_ops.c +++ b/source/blender/editors/physics/physics_ops.c @@ -100,7 +100,6 @@ static void keymap_particle(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "PARTICLE_OT_delete", XKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "PARTICLE_OT_delete", DELKEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "PARTICLE_OT_delete", BACKSPACEKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "PARTICLE_OT_reveal", HKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "PARTICLE_OT_hide", HKEY, KM_PRESS, 0, 0); @@ -115,7 +114,7 @@ static void keymap_particle(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "PARTICLE_OT_weight_set", KKEY, KM_PRESS, KM_SHIFT, 0); - ED_object_generic_keymap(keyconf, keymap, 1); + ED_object_generic_keymap(keyconf, keymap, 2); } /******************************* boids *************************************/ diff --git a/source/blender/editors/physics/physics_pointcache.c b/source/blender/editors/physics/physics_pointcache.c index 8e53e3c6f50..35f86a49aa7 100644 --- a/source/blender/editors/physics/physics_pointcache.c +++ b/source/blender/editors/physics/physics_pointcache.c @@ -33,15 +33,15 @@ #include "DNA_scene_types.h" -#include "BKE_anim.h" #include "BKE_context.h" +#include "BKE_global.h" +#include "BKE_main.h" +#include "BKE_modifier.h" #include "BKE_particle.h" +#include "BKE_pointcache.h" #include "BKE_report.h" #include "BKE_scene.h" #include "BKE_utildefines.h" -#include "BKE_pointcache.h" -#include "BKE_global.h" -#include "BKE_modifier.h" #include "BLI_blenlib.h" @@ -88,11 +88,12 @@ void bake_console_progress_end(void *arg) static int ptcache_bake_all_exec(bContext *C, wmOperator *op) { + Main *bmain = CTX_data_main(C); Scene *scene= CTX_data_scene(C); wmWindow *win = G.background ? NULL : CTX_wm_window(C); PTCacheBaker baker; - + baker.main = bmain; baker.scene = scene; baker.pid = NULL; baker.bake = RNA_boolean_get(op->ptr, "bake"); @@ -173,6 +174,7 @@ void PTCACHE_OT_free_bake_all(wmOperatorType *ot) } static int ptcache_bake_exec(bContext *C, wmOperator *op) { + Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); wmWindow *win = G.background ? NULL : CTX_wm_window(C); PointerRNA ptr= CTX_data_pointer_get_type(C, "point_cache", &RNA_PointCache); @@ -189,6 +191,7 @@ static int ptcache_bake_exec(bContext *C, wmOperator *op) break; } + baker.main = bmain; baker.scene = scene; baker.pid = pid; baker.bake = RNA_boolean_get(op->ptr, "bake"); |