[Bf-blender-cvs] [bb4a489] soc-2013-paint: Use BKE_libblock_find_name
Campbell Barton
noreply at git.blender.org
Tue Jul 15 01:19:46 CEST 2014
Commit: bb4a489d54570eb95940a39c4098fa1a0332530d
Author: Campbell Barton
Date: Tue Jul 15 09:19:24 2014 +1000
https://developer.blender.org/rBbb4a489d54570eb95940a39c4098fa1a0332530d
Use BKE_libblock_find_name
===================================================================
M source/blender/editors/interface/resources.c
===================================================================
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index dbb10ab..2ea3e19 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -53,6 +53,7 @@
#include "BKE_global.h"
#include "BKE_main.h"
#include "BKE_texture.h"
+#include "BKE_library.h"
#include "BIF_gl.h"
@@ -2480,12 +2481,10 @@ void init_userdef_factory(void)
br->imagepaint_tool = PAINT_TOOL_FILL;
br->ob_mode = OB_MODE_TEXTURE_PAINT;
- for (br = G.main->brush.first; br; br = br->id.next) {
- if (strcmp(br->id.name, "BRMask") == 0) {
- br->imagepaint_tool = PAINT_TOOL_MASK;
- br->ob_mode |= OB_MODE_TEXTURE_PAINT;
- break;
- }
+ br = (Brush *)BKE_libblock_find_name(ID_BR, "Mask");
+ if (br) {
+ br->imagepaint_tool = PAINT_TOOL_MASK;
+ br->ob_mode |= OB_MODE_TEXTURE_PAINT;
}
}
More information about the Bf-blender-cvs
mailing list