[Bf-blender-cvs] [ed871df] master: Fix odd situation where you could assign a background image without increasing its usercount.

Bastien Montagne noreply at git.blender.org
Mon Jun 30 19:38:09 CEST 2014


Commit: ed871df83686aebd12292828d6f889baf14ece72
Author: Bastien Montagne
Date:   Mon Jun 30 19:34:52 2014 +0200
https://developer.blender.org/rBed871df83686aebd12292828d6f889baf14ece72

Fix odd situation where you could assign a background image without increasing its usercount.

Probably a leftover from old code, I don't think this invoke usage of VIEW3D_OT_background_image_add
was actually reachable anywhere from the UI, but managed to get it working from py, without increasing
user count...

===================================================================

M	source/blender/editors/space_view3d/view3d_edit.c

===================================================================

diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index aedbca4..f49a738 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -4221,8 +4221,7 @@ static int background_image_add_invoke(bContext *C, wmOperator *op, const wmEven
 	if (ima) {
 		bgpic->ima = ima;
 		
-		if (ima->id.us == 0) id_us_plus(&ima->id);
-		else id_lib_extern(&ima->id);
+		id_us_plus(&ima->id);
 		
 		if (!(v3d->flag & V3D_DISPBGPICS))
 			v3d->flag |= V3D_DISPBGPICS;




More information about the Bf-blender-cvs mailing list