move view3d keymaps so edit&paint mode keymaps override removed workaround that preve...
authorCampbell Barton <ideasman42@gmail.com>
Thu, 15 Oct 2009 17:59:42 +0000 (17:59 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 15 Oct 2009 17:59:42 +0000 (17:59 +0000)
+ other minor changes

source/blender/blenkernel/BKE_particle.h
source/blender/blenkernel/intern/particle.c
source/blender/editors/object/object_edit.c
source/blender/editors/space_file/file_ops.c
source/blender/editors/space_view3d/space_view3d.c
source/blender/makesrna/intern/rna_particle.c

index e9285782a1e4aab19408d6cabbc54243b6523cfa..2291601bd4761ecadaf42ba42d93dde7c6b8cc92 100644 (file)
@@ -200,6 +200,7 @@ struct Object *psys_get_lattice(struct ParticleSimulationData *sim);
 
 int psys_in_edit_mode(struct Scene *scene, struct ParticleSystem *psys);
 int psys_check_enabled(struct Object *ob, struct ParticleSystem *psys);
+int psys_check_edited(struct ParticleSystem *psys);
 
 void psys_check_group_weights(struct ParticleSettings *part);
 
index 011d5c3f1342c862921fc40c260b6b6913d223dd..ea8562c0ca8b35a66ad4eb2243f8fc9ce9c0189b 100644 (file)
@@ -298,6 +298,14 @@ int psys_check_enabled(Object *ob, ParticleSystem *psys)
        return 1;
 }
 
+int psys_check_edited(ParticleSystem *psys)
+{
+       if(psys->part && psys->part->type==PART_HAIR)
+               return (psys->flag & PSYS_EDITED || (psys->edit && psys->edit->edited));
+       else
+               return (psys->pointcache->edit && psys->pointcache->edit->edited);
+}
+
 void psys_check_group_weights(ParticleSettings *part)
 {
        ParticleDupliWeight *dw, *tdw;
index d302e1eeec8ef80ca26da656629d972aa8e44ee5..bd8b865a6c9963d9751d55b11be5e3c83548156c 100644 (file)
@@ -2002,12 +2002,6 @@ static int object_mode_set_exec(bContext *C, wmOperator *op)
        if(!ob || !object_mode_set_compat(C, op, ob))
                return OPERATOR_PASS_THROUGH;
 
-       /* Irritating workaround! disallow paint modes from editmode since a number of shortcuts conflict
-        * XXX - would be much better to handle this on a keymap level */
-       if((ob->mode & OB_MODE_EDIT) && ELEM6(mode, OB_MODE_SCULPT, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT, OB_MODE_TEXTURE_PAINT, OB_MODE_PARTICLE_EDIT, OB_MODE_POSE)) {
-               return OPERATOR_PASS_THROUGH;
-       }
-
        /* Exit current mode if it's not the mode we're setting */
        if(ob->mode != OB_MODE_OBJECT && ob->mode != mode)
                WM_operator_name_call(C, object_mode_op_string(ob->mode), WM_OP_EXEC_REGION_WIN, NULL);
index a49b0a072af6027e49d0bba7faf976b46e353206..c35ff6ed7b6648d3fae59f1a10bb5dc93119f8f9 100644 (file)
@@ -795,9 +795,6 @@ int file_directory_exec(bContext *C, wmOperator *unused)
        SpaceFile *sfile= CTX_wm_space_file(C);
        
        if(sfile->params) {
-               char prev_dir[sizeof(sfile->params->dir)];
-               BLI_strncpy(prev_dir, filelist_dir(sfile->files), sizeof(prev_dir));
-
                if ( sfile->params->dir[0] == '~' ) {
                        if (sfile->params->dir[1] == '\0') {
                                BLI_strncpy(sfile->params->dir, BLI_gethome(), sizeof(sfile->params->dir) );
index d017e11e783e7ca1997f5f5d59bef9908209821b..2cade9bb6856943f5918fe7f92044eddbb900c7e 100644 (file)
@@ -298,8 +298,6 @@ static void view3d_main_area_init(wmWindowManager *wm, ARegion *ar)
        wmKeyMap *keymap;
 
        /* object ops. */
-       keymap= WM_keymap_find(wm->defaultconf, "Object Non-modal", 0, 0);
-       WM_event_add_keymap_handler(&ar->handlers, keymap);
        
        /* pose is not modal, operator poll checks for this */
        keymap= WM_keymap_find(wm->defaultconf, "Pose", 0, 0);
@@ -349,6 +347,9 @@ static void view3d_main_area_init(wmWindowManager *wm, ARegion *ar)
        keymap= WM_keymap_find(wm->defaultconf, "Font", 0, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 
+       keymap= WM_keymap_find(wm->defaultconf, "Object Non-modal", 0, 0);
+       WM_event_add_keymap_handler(&ar->handlers, keymap);
+
        /* own keymap, last so modes can override it */
        keymap= WM_keymap_find(wm->defaultconf, "View3D Generic", SPACE_VIEW3D, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
index 28d0d2deb343aaa3cee345b3aad5c86fdfbcff5b..d261bda739e695f20c9412e0e6f0096b39f76a5e 100644 (file)
@@ -420,10 +420,7 @@ static int rna_ParticleSystem_editable_get(PointerRNA *ptr)
 {
        ParticleSystem *psys= (ParticleSystem*)ptr->data;
 
-       if(psys->part && psys->part->type==PART_HAIR)
-               return (psys->flag & PSYS_HAIR_DONE);
-       else
-               return (psys->pointcache->flag & PTCACHE_BAKED);
+       return psys_check_edited(psys);
 }
 static int rna_ParticleSystem_edited_get(PointerRNA *ptr)
 {