Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntony Riakiotakis <kalast@gmail.com>2014-08-27 20:52:17 +0400
committerAntony Riakiotakis <kalast@gmail.com>2014-08-27 20:52:17 +0400
commitbe585a25942738ff8da5382a46cb8823d565069a (patch)
tree32124a83531ae0758295c468f652d9b096a5b7e9 /source/blender
parenta77b46fbe6c04dc9369a83dda465da4d511cd10d (diff)
More fixes for renderer material detection
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/intern/scene.c2
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c8
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_proj.c8
3 files changed, 12 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index a41b7f644f3..eb98e381222 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -1902,7 +1902,7 @@ bool BKE_scene_use_new_shading_nodes(Scene *scene)
bool BKE_scene_uses_blender_internal(struct Scene *scene)
{
- return strcmp("BLENDER_INTERNAL", scene->r.engine);
+ return strcmp("BLENDER_RENDER", scene->r.engine) == 0;
}
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index ded8a83a66c..ea6d56155cc 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -1363,6 +1363,7 @@ void paint_proj_mesh_data_ensure(bContext *C, Object *ob, wmOperator *op)
Mesh *me;
int layernum;
ImagePaintSettings *imapaint = &(CTX_data_tool_settings(C)->imapaint);
+ Scene *scene = CTX_data_scene(C);
Brush *br = BKE_paint_brush(&imapaint->paint);
/* no material, add one */
@@ -1380,7 +1381,12 @@ void paint_proj_mesh_data_ensure(bContext *C, Object *ob, wmOperator *op)
Material *ma = give_current_material(ob, i);
if (ma) {
if (!ma->texpaintslot) {
- proj_paint_add_slot(C, ma, NULL);
+ /* refresh here just in case */
+ BKE_texpaint_slot_refresh_cache(scene, ma);
+
+ /* if still no slots, we have to add */
+ if (!ma->texpaintslot)
+ proj_paint_add_slot(C, ma, NULL);
}
}
else {
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index 11501d1cf72..f24c6888201 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -4826,7 +4826,7 @@ bool proj_paint_add_slot(bContext *C, Material *ma, wmOperator *op)
{
Object *ob = CTX_data_active_object(C);
Scene *scene = CTX_data_scene(C);
- bool is_blender_internal = BKE_scene_uses_blender_internal(scene);
+ bool is_bi = BKE_scene_uses_blender_internal(scene);
if (!ob)
return false;
@@ -4836,7 +4836,7 @@ bool proj_paint_add_slot(bContext *C, Material *ma, wmOperator *op)
if (ma) {
- if (!is_blender_internal || ma->use_nodes) {
+ if (!is_bi || ma->use_nodes) {
/* not supported for now */
}
else {
@@ -4970,12 +4970,12 @@ static int texture_paint_delete_texture_paint_slot_exec(bContext *C, wmOperator
Object *ob = CTX_data_active_object(C);
Scene *scene = CTX_data_scene(C);
Material *ma;
- bool is_blender_internal = BKE_scene_uses_blender_internal(scene);
+ bool is_bi = BKE_scene_uses_blender_internal(scene);
TexPaintSlot *slot;
int i;
/* not supported for node-based engines */
- if (!ob || !is_blender_internal)
+ if (!ob || !is_bi)
return OPERATOR_CANCELLED;
ma = give_current_material(ob, ob->actcol);