diff options
author | Ton Roosendaal <ton@blender.org> | 2010-11-20 20:31:59 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2010-11-20 20:31:59 +0300 |
commit | 4f3d80e70608a1d308e96cd278ba619edb569e31 (patch) | |
tree | 0550487af8f0684cae73aea3ce98f3405362595f | |
parent | 03e943be527e7d898b4b85b7709f1b5aa852b8a0 (diff) |
Bugfix #21028
- Image Editor, "New", gave for each tweak in redo menu a new Image
when Object is in Editmode. This is a limitation of our current
undo system. Marked this issue in the wiki todo.
Solved by adding a poll in operator that prevents this to be called.
(a bit annoying, but the error is worse!)
- On assigning a new image texture to faces in Editmode, no redraw
happened in 3D window. Added notifier for it.
-rw-r--r-- | source/blender/editors/space_image/image_ops.c | 15 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 2 |
2 files changed, 15 insertions, 2 deletions
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index ea6579f3429..21db6372028 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -1301,6 +1301,18 @@ static int new_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } +/* XXX is temp, redo is not possible in editmode due to undo conflicts */ +static int space_image_no_editmode_poll(bContext *C) +{ + SpaceImage *sima= CTX_wm_space_image(C); + Object *ob= CTX_data_edit_object(C); + + if(sima && ob) + return 0; + + return 1; +} + void IMAGE_OT_new(wmOperatorType *ot) { PropertyRNA *prop; @@ -1313,7 +1325,8 @@ void IMAGE_OT_new(wmOperatorType *ot) /* api callbacks */ ot->exec= new_exec; ot->invoke= WM_operator_props_popup; - + ot->poll= space_image_no_editmode_poll; + /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 45ad7700229..7da83a41ab8 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -1376,7 +1376,7 @@ static void rna_def_space_image(BlenderRNA *brna) RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceImageEditor_image_set", NULL, NULL); RNA_def_property_ui_text(prop, "Image", "Image displayed and edited in this space"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); + RNA_def_property_update(prop, NC_GEOM|ND_DATA, NULL); // is handled in image editor too prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); |