[Bf-blender-cvs] [847e90c] cycles-ptex-49: Allow ptex node to be a texpaint slot

Nicholas Bishop noreply at git.blender.org
Fri Feb 6 17:35:17 CET 2015


Commit: 847e90c531e7011d7f675397e6de46161494bbf7
Author: Nicholas Bishop
Date:   Thu Jan 22 22:34:46 2015 +0100
Branches: cycles-ptex-49
https://developer.blender.org/rB847e90c531e7011d7f675397e6de46161494bbf7

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 9b682f1..f56bea2 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -1371,8 +1371,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) {
@@ -1410,6 +1416,22 @@ void BKE_texpaint_slot_refresh_cache(Scene *scene, Material *ma)
 				}
 				index++;
 			}
+			//  TODO
+			if (node->typeinfo->nclass == NODE_CLASS_TEXTURE &&
+				node->typeinfo->type == SH_NODE_TEX_PTEX)
+			{
+				NodeTexPtex *storage = node->storage;
+
+				if (active_node == node)
+					ma->paint_active_slot = index;
+
+				// TODO
+				ma->texpaintslot[index].index = 0;
+				ma->texpaintslot[index].uvname = storage->layer_name;
+				ma->texpaintslot[index].ima = NULL;
+
+				index++;
+			}
 		}
 	}
 	else if (is_bi) {




More information about the Bf-blender-cvs mailing list