Commit: 63678cd8f19feb2dc5545afc46649a7991fd869b
Author: Nicholas Bishop
Date:   Thu Jan 22 22:34:46 2015 +0100
Branches: cycles-ptex-19
https://developer.blender.org/rB63678cd8f19feb2dc5545afc46649a7991fd869b

Allow ptex node to be a texpaint slot

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

M       source/blender/blenkernel/intern/material.c

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

diff --git a/source/blender/blenkernel/intern/material.c 
b/source/blender/blenkernel/intern/material.c
index f8f69b8..800fbd7 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -1351,8 +1351,14 @@ void BKE_texpaint_slot_refresh_cache(Scene *scene, 
Material *ma)
                }
 
                for (node = ma->nodetree->nodes.first; node; node = node->next) 
{
-                       if (node->typeinfo->nclass == NODE_CLASS_TEXTURE && 
node->typeinfo->type == SH_NODE_TEX_IMAGE && node->id)
-                               count++;
+                       if (node->typeinfo->nclass == NODE_CLASS_TEXTURE) {
+                               if (node->typeinfo->type == SH_NODE_TEX_IMAGE 
&& node->id) {
+                                       count++;
+                               }
+                               else if (node->typeinfo->type == 
SH_NODE_TEX_PTEX) {
+                                       count++;
+                               }
+                       }
                }
 
                if (count == 0) {
@@ -1365,10 +1371,17 @@ void BKE_texpaint_slot_refresh_cache(Scene *scene, 
Material *ma)
                active_node = nodeGetActiveTexture(ma->nodetree);
 
                for (node = ma->nodetree->nodes.first; node; node = node->next) 
{
-                       if (node->typeinfo->nclass == NODE_CLASS_TEXTURE && 
node->typeinfo->type == SH_NODE_TEX_IMAGE && node->id) {
-                               if (active_node == node)
-                                       ma->paint_active_slot = index;
-                               ma->texpaintslot[index++].ima = (Image 
*)node->id;
+                       if (node->typeinfo->nclass == NODE_CLASS_TEXTURE) {
+                               if (node->typeinfo->type == SH_NODE_TEX_IMAGE 
&& node->id) {
+                                       if (active_node == node)
+                                               ma->paint_active_slot = index;
+                                       ma->texpaintslot[index++].ima = (Image 
*)node->id;
+                               }
+                               else if (node->typeinfo->type == 
SH_NODE_TEX_PTEX) {
+                                       if (active_node == node)
+                                               ma->paint_active_slot = index;
+                                       //ma->texpaintslot[index++].ima =;
+                               }
                        }
                }
        }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to