[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [33198] trunk/blender/source/blender: Bugfix #21028

Ton Roosendaal ton at blender.org
Sat Nov 20 18:31:59 CET 2010


Revision: 33198
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=33198
Author:   ton
Date:     2010-11-20 18:31:59 +0100 (Sat, 20 Nov 2010)

Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_image/image_ops.c
    trunk/blender/source/blender/makesrna/intern/rna_space.c

Modified: trunk/blender/source/blender/editors/space_image/image_ops.c
===================================================================
--- trunk/blender/source/blender/editors/space_image/image_ops.c	2010-11-20 17:28:05 UTC (rev 33197)
+++ trunk/blender/source/blender/editors/space_image/image_ops.c	2010-11-20 17:31:59 UTC (rev 33198)
@@ -1301,6 +1301,18 @@
 	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 @@
 	/* 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;
 

Modified: trunk/blender/source/blender/makesrna/intern/rna_space.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_space.c	2010-11-20 17:28:05 UTC (rev 33197)
+++ trunk/blender/source/blender/makesrna/intern/rna_space.c	2010-11-20 17:31:59 UTC (rev 33198)
@@ -1376,7 +1376,7 @@
 	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);





More information about the Bf-blender-cvs mailing list