[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43334] trunk/blender/source/blender: Fix ##29803: cycles image texture node refresh issue with image editor.

Brecht Van Lommel brechtvanlommel at pandora.be
Thu Jan 12 22:10:39 CET 2012


Revision: 43334
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43334
Author:   blendix
Date:     2012-01-12 21:10:30 +0000 (Thu, 12 Jan 2012)
Log Message:
-----------
Fix ##29803: cycles image texture node refresh issue with image editor.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_image/space_image.c
    trunk/blender/source/blender/makesrna/intern/rna_nodetree.c

Modified: trunk/blender/source/blender/editors/space_image/space_image.c
===================================================================
--- trunk/blender/source/blender/editors/space_image/space_image.c	2012-01-12 19:47:54 UTC (rev 43333)
+++ trunk/blender/source/blender/editors/space_image/space_image.c	2012-01-12 21:10:30 UTC (rev 43334)
@@ -594,8 +594,13 @@
 			/* new shading system, get image from material */
 			EditFace *efa= EM_get_actFace(em, sloppy);
 
-			if(efa)
-				ED_object_get_active_image(obedit, efa->mat_nr, &sima->image, NULL, NULL);
+			if(efa) {
+				Image *node_ima;
+				ED_object_get_active_image(obedit, efa->mat_nr, &node_ima, NULL, NULL);
+
+				if(node_ima)
+					sima->image= node_ima;
+			}
 		}
 		else {
 			/* old shading system, we set texface */

Modified: trunk/blender/source/blender/makesrna/intern/rna_nodetree.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_nodetree.c	2012-01-12 19:47:54 UTC (rev 43333)
+++ trunk/blender/source/blender/makesrna/intern/rna_nodetree.c	2012-01-12 21:10:30 UTC (rev 43334)
@@ -369,6 +369,15 @@
 	node_update(bmain, scene, ntree, node);
 }
 
+static void rna_Node_image_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+	bNodeTree *ntree= (bNodeTree*)ptr->id.data;
+	bNode *node= (bNode*)ptr->data;
+
+	node_update(bmain, scene, ntree, node);
+	WM_main_add_notifier(NC_IMAGE, NULL);
+}
+
 static void rna_Node_material_update(Main *bmain, Scene *scene, PointerRNA *ptr)
 {
 	bNodeTree *ntree= (bNodeTree*)ptr->id.data;
@@ -1268,7 +1277,7 @@
 	RNA_def_property_struct_type(prop, "Image");
 	RNA_def_property_flag(prop, PROP_EDITABLE);
 	RNA_def_property_ui_text(prop, "Image", "");
-	RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
+	RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_image_update");
 
 	RNA_def_struct_sdna_from(srna, "NodeTexImage", "storage");
 	def_sh_tex(srna);
@@ -1293,7 +1302,7 @@
 	RNA_def_property_struct_type(prop, "Image");
 	RNA_def_property_flag(prop, PROP_EDITABLE);
 	RNA_def_property_ui_text(prop, "Image", "");
-	RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
+	RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_image_update");
 
 	RNA_def_struct_sdna_from(srna, "NodeTexImage", "storage");
 	def_sh_tex(srna);



More information about the Bf-blender-cvs mailing list