[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [33361] trunk/blender/source/blender/ editors/space_image/image_ops.c: fix for fix [#24955] Generating UV-Images within blender (Alt-N) not possible

Campbell Barton ideasman42 at gmail.com
Sun Nov 28 13:38:29 CET 2010


Revision: 33361
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=33361
Author:   campbellbarton
Date:     2010-11-28 13:38:29 +0100 (Sun, 28 Nov 2010)

Log Message:
-----------
fix for fix [#24955] Generating UV-Images within blender (Alt-N) not possible
We had 3 reports of not being able to add images in editmode which was a workaround for redo in editmode bug.
Rather then having it use operator redo, just give an OK button.

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

Modified: trunk/blender/source/blender/editors/space_image/image_ops.c
===================================================================
--- trunk/blender/source/blender/editors/space_image/image_ops.c	2010-11-28 09:44:52 UTC (rev 33360)
+++ trunk/blender/source/blender/editors/space_image/image_ops.c	2010-11-28 12:38:29 UTC (rev 33361)
@@ -1244,7 +1244,7 @@
 
 /********************** new image operator *********************/
 
-static int new_exec(bContext *C, wmOperator *op)
+static int image_new_exec(bContext *C, wmOperator *op)
 {
 	SpaceImage *sima;
 	Scene *scene;
@@ -1301,16 +1301,11 @@
 	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)
+/* XXX, Ton is not a fan of OK buttons but using this function to avoid undo/redo bug while in mesh-editmode, - campbell */
+static int image_new_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
 {
-	SpaceImage *sima= CTX_wm_space_image(C);
-	Object *ob= CTX_data_edit_object(C);
+	return WM_operator_props_dialog_popup(C, op, 300, 100);
 
-	if(sima && ob)
-		return 0; 
-	
-	return 1;
 }
 
 void IMAGE_OT_new(wmOperatorType *ot)
@@ -1323,9 +1318,8 @@
 	ot->idname= "IMAGE_OT_new";
 	
 	/* api callbacks */
-	ot->exec= new_exec;
-	ot->invoke= WM_operator_props_popup;
-	ot->poll= space_image_no_editmode_poll;
+	ot->exec= image_new_exec;
+	ot->invoke= image_new_invoke;
 	
 	/* flags */
 	ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;





More information about the Bf-blender-cvs mailing list