[Bf-blender-cvs] [82e63de2842] soc-2018-hair-shader: Merge branch 'master' into soc-2018-hair-shader

L. E. Segovia noreply at git.blender.org
Tue May 29 15:36:46 CEST 2018


Commit: 82e63de2842c2af8be5ec19a00752b110dbd0c57
Author: L. E. Segovia
Date:   Mon May 28 19:01:19 2018 +0000
Branches: soc-2018-hair-shader
https://developer.blender.org/rB82e63de2842c2af8be5ec19a00752b110dbd0c57

Merge branch 'master' into soc-2018-hair-shader

First conflict: IES vs our shader

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



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

diff --cc source/blender/editors/space_node/drawnode.c
index 906a10eb03f,ea8d4b36d3b..ab97a7d9b41
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@@ -75,7 -75,7 +75,7 @@@
  /* ****************** SOCKET BUTTON DRAW FUNCTIONS ***************** */
  
  static void node_socket_button_label(bContext *UNUSED(C), uiLayout *layout, PointerRNA *UNUSED(ptr), PointerRNA *UNUSED(node_ptr),
--                                     const char *text)
++									 const char *text)
  {
  	uiItemL(layout, text, 0);
  }
@@@ -274,11 -274,11 +274,11 @@@ static void node_buts_texture(uiLayout 
  	bNode *node = ptr->data;
  
  	short multi = (
--	    node->id &&
--	    ((Tex *)node->id)->use_nodes &&
--	    (node->type != CMP_NODE_TEXTURE) &&
--	    (node->type != TEX_NODE_TEXTURE)
--	    );
++		node->id &&
++		((Tex *)node->id)->use_nodes &&
++		(node->type != CMP_NODE_TEXTURE) &&
++		(node->type != TEX_NODE_TEXTURE)
++		);
  	
  	uiItemR(layout, ptr, "texture", 0, "", ICON_NONE);
  	
@@@ -430,12 -430,12 +430,12 @@@ static void node_draw_frame_label(bNode
  
  		BLF_enable(fontid, BLF_CLIPPING | BLF_WORD_WRAP);
  		BLF_clipping(
--		        fontid,
--		        rct->xmin,
--		        /* round to avoid clipping half-way through a line */
--		        y - (floorf(((y - rct->ymin) - (margin * 2)) / line_spacing) * line_spacing),
--		        rct->xmin + line_width,
--		        rct->ymax);
++				fontid,
++				rct->xmin,
++				/* round to avoid clipping half-way through a line */
++				y - (floorf(((y - rct->ymin) - (margin * 2)) / line_spacing) * line_spacing),
++				rct->xmin + line_width,
++				rct->ymax);
  
  		BLF_wordwrap(fontid, line_width);
  
@@@ -461,7 -461,7 +461,7 @@@
  }
  
  static void node_draw_frame(const bContext *C, ARegion *ar, SpaceNode *snode,
--                            bNodeTree *ntree, bNode *node, bNodeInstanceKey UNUSED(key))
++							bNodeTree *ntree, bNode *node, bNodeInstanceKey UNUSED(key))
  {
  	rctf *rct = &node->totr;
  	int color_id = node_get_colorid(node);
@@@ -502,8 -502,8 +502,8 @@@
  			UI_ThemeColorShadeAlpha(TH_SELECT, 0, -40);
  		UI_draw_roundbox_corner_set(UI_CNR_ALL);
  		UI_draw_roundbox_gl_mode(GL_LINE_LOOP,
--		          rct->xmin, rct->ymin,
--		          rct->xmax, rct->ymax, BASIS_RAD);
++				  rct->xmin, rct->ymin,
++				  rct->xmax, rct->ymax, BASIS_RAD);
  		
  		glDisable(GL_LINE_SMOOTH);
  		glDisable(GL_BLEND);
@@@ -578,7 -578,7 +578,7 @@@ static void node_draw_reroute_prepare(c
  }
  
  static void node_draw_reroute(const bContext *C, ARegion *ar, SpaceNode *UNUSED(snode),
--                              bNodeTree *ntree, bNode *node, bNodeInstanceKey UNUSED(key))
++							  bNodeTree *ntree, bNode *node, bNodeInstanceKey UNUSED(key))
  {
  	bNodeSocket *sock;
  	char showname[128]; /* 128 used below */
@@@ -591,7 -591,7 +591,7 @@@
  
  	/* skip if out of view */
  	if (node->totr.xmax < ar->v2d.cur.xmin || node->totr.xmin > ar->v2d.cur.xmax ||
--	    node->totr.ymax < ar->v2d.cur.ymin || node->totr.ymin > ar->v2d.cur.ymax)
++		node->totr.ymax < ar->v2d.cur.ymin || node->totr.ymin > ar->v2d.cur.ymax)
  	{
  		UI_block_end(C, node->block);
  		node->block = NULL;
@@@ -629,9 -629,9 +629,9 @@@
  		/* draw title (node label) */
  		BLI_strncpy(showname, node->label, sizeof(showname));
  		uiDefBut(node->block, UI_BTYPE_LABEL, 0, showname,
--		         (int)(rct->xmin - NODE_DYS), (int)(rct->ymax),
--		         (short)512, (short)NODE_DY,
--		         NULL, 0, 0, 0, 0, NULL);
++				 (int)(rct->xmin - NODE_DYS), (int)(rct->ymax),
++				 (short)512, (short)NODE_DY,
++				 NULL, 0, 0, 0, 0, NULL);
  	}
  
  	/* only draw input socket. as they all are placed on the same position.
@@@ -683,8 -683,8 +683,8 @@@ static void node_common_set_butfunc(bNo
  /* ****************** BUTTON CALLBACKS FOR SHADER NODES ***************** */
  
  static void node_buts_image_user(uiLayout *layout, bContext *C, PointerRNA *ptr,
--                                 PointerRNA *imaptr, PointerRNA *iuserptr,
--                                 bool compositor)
++								 PointerRNA *imaptr, PointerRNA *iuserptr,
++								 bool compositor)
  {
  	uiLayout *col;
  	int source;
@@@ -720,8 -720,8 +720,8 @@@
  	}
  
  	if (compositor &&
--	    RNA_enum_get(imaptr, "type") == IMA_TYPE_MULTILAYER &&
--	    RNA_boolean_get(ptr, "has_layers"))
++		RNA_enum_get(imaptr, "type") == IMA_TYPE_MULTILAYER &&
++		RNA_boolean_get(ptr, "has_layers"))
  	{
  		col = uiLayoutColumn(layout, false);
  		uiItemR(col, ptr, "layer", 0, NULL, ICON_NONE);
@@@ -860,8 -860,8 +860,8 @@@ static void node_shader_buts_tex_enviro
  
  	uiLayoutSetContextPointer(layout, "image_user", &iuserptr);
  	uiTemplateID(
--	        layout, C, ptr, "image",
--	        NULL, "IMAGE_OT_open", NULL, UI_TEMPLATE_ID_FILTER_ALL);
++			layout, C, ptr, "image",
++			NULL, "IMAGE_OT_open", NULL, UI_TEMPLATE_ID_FILTER_ALL);
  
  	node_buts_image_user(layout, C, &iuserptr, &imaptr, &iuserptr, false);
  
@@@ -878,8 -878,8 +878,8 @@@ static void node_shader_buts_tex_enviro
  
  	uiLayoutSetContextPointer(layout, "image_user", &iuserptr);
  	uiTemplateID(
--	        layout, C, ptr, "image",
--	        ima ? NULL : "IMAGE_OT_new", "IMAGE_OT_open", NULL, UI_TEMPLATE_ID_FILTER_ALL);
++			layout, C, ptr, "image",
++			ima ? NULL : "IMAGE_OT_new", "IMAGE_OT_open", NULL, UI_TEMPLATE_ID_FILTER_ALL);
  
  	if (!ima)
  		return;
@@@ -1109,9 -1109,19 +1109,24 @@@ static void node_shader_buts_hair(uiLay
  	uiItemR(layout, ptr, "component", 0, "", ICON_NONE);
  }
  
 +static void node_shader_buts_principled_hair(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
 +{
-     uiItemR(layout, ptr, "parametrization", 0, "", ICON_NONE);
++	uiItemR(layout, ptr, "parametrization", 0, "", ICON_NONE);
++}
++
+ static void node_shader_buts_ies(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
+ {
+ 	uiLayout *row;
+ 
+ 	row = uiLayoutRow(layout, false);
+ 	uiItemR(row, ptr, "mode", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
+ 
+ 	row = uiLayoutRow(layout, true);
+ 
+ 	if (RNA_enum_get(ptr, "mode") == NODE_IES_INTERNAL)
+ 		uiItemR(row, ptr, "ies", 0, "", ICON_NONE);
+ 	else
+ 		uiItemR(row, ptr, "filepath", 0, "", ICON_NONE);
  }
  
  static void node_shader_buts_script(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
@@@ -1282,9 -1292,6 +1297,9 @@@ static void node_shader_set_butfunc(bNo
  		case SH_NODE_BSDF_HAIR:
  			ntype->draw_buttons = node_shader_buts_hair;
  			break;
-         case SH_NODE_BSDF_HAIR_PRINCIPLED:
-             ntype->draw_buttons = node_shader_buts_principled_hair;
-             break;
++		case SH_NODE_BSDF_HAIR_PRINCIPLED:
++			ntype->draw_buttons = node_shader_buts_principled_hair;
++			break;
  		case SH_NODE_SCRIPT:
  			ntype->draw_buttons = node_shader_buts_script;
  			ntype->draw_buttons_ex = node_shader_buts_script_ex;
@@@ -1307,7 -1317,7 +1325,7 @@@
  /* ****************** BUTTON CALLBACKS FOR COMPOSITE NODES ***************** */
  
  static void node_buts_image_views(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr,
--                                 PointerRNA *imaptr)
++								 PointerRNA *imaptr)
  {
  	uiLayout *col;
  
@@@ -1332,8 -1342,8 +1350,8 @@@ static void node_composit_buts_image(ui
  	RNA_pointer_create((ID *)ptr->id.data, &RNA_ImageUser, node->storage, &iuserptr);
  	uiLayoutSetContextPointer(layout, "image_user", &iuserptr);
  	uiTemplateID(
--	        layout, C, ptr, "image",
--	        NULL, "IMAGE_OT_open", NULL, UI_TEMPLATE_ID_FILTER_ALL);
++			layout, C, ptr, "image",
++			NULL, "IMAGE_OT_open", NULL, UI_TEMPLATE_ID_FILTER_ALL);
  	if (!node->id) return;
  	
  	imaptr = RNA_pointer_get(ptr, "image");
@@@ -1854,15 -1864,15 +1872,15 @@@ static void node_composit_buts_file_out
  	/* using different collection properties if multilayer format is enabled */
  	if (multilayer) {
  		uiTemplateList(col, C, "UI_UL_list", "file_output_node", ptr, "layer_slots", ptr, "active_input_index",
--		               NULL, 0, 0, 0, 0);
++					   NULL, 0, 0, 0, 0);
  		RNA_property_collection_lookup_int(ptr, RNA_struct_find_property(ptr, "layer_slots"),
--		                                   active_index, &active_input_ptr);
++										   active_index, &active_input_ptr);
  	}
  	else {
  		uiTemplateList(col, C, "UI_UL_list", "file_output_node", ptr, "file_slots", ptr, "active_input_index",
--		               NULL, 0, 0, 0, 0);
++					   NULL, 0, 0, 0, 0);
  		RNA_property_collection_lookup_int(ptr, RNA_struct_find_property(ptr, "file_slots"),
--		                                   active_index, &active_input_ptr);
++										   active_index, &active_input_ptr);
  	}
  	/* XXX collection lookup does not return the ID part of the pointer, setting this manually here */
  	active_input_ptr.id.data = ptr->id.data;
@@@ -1882,7 -1892,7 +1900,7 @@@
  			row = uiLayoutRow(col, false);
  			uiItemR(row, &active_input_ptr, "name", 0, "", ICON_NONE);
  			uiItemFullO(row, "NODE_OT_output_file_remove_active_socket", "",
--			            ICON_X, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_R_ICON_ONLY, NULL);
++						ICON_X, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_R_ICON_ONLY, NULL);
  		}
  		else {
  			col = uiLayoutColumn(layout, true);
@@@ -1891,7 -1901,7 +1909,7 @@@
  			row = uiLayoutRow(col, false);
  			uiItemR(row, &active_input_ptr, "path", 0, "", ICON_NONE);
  			uiItemFullO(row, "NODE_OT_output_file_remove_active_socket", "",
--			            ICON_X, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_R_ICON_ONLY, NULL);
++						ICON_X, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_R_ICON_ONLY, NULL);
  			
  			/* format details for individual files */
  			imfptr = RNA_pointer_get(&active_input_ptr, "format");
@@@ -2204,8 -2214,8 +2222,8 @@@ static void node_composit_buts_switch(u
  static void node_composit_buts_switch_view_ex(uiLayout *layout, bContext *UNUSED(C), PointerRNA *UNUSED(ptr))
  {
  	uiItemFullO(
--	        layout, "NODE_OT_switch_view_update",
--	        "Update Views", ICON_FILE_REFRESH, NULL, WM_OP_INVOKE_DEFAULT, 0, NULL);
++			layout, "NODE_OT_switch_view_update",
++			"Update Views", ICON_FILE_REFRESH, NULL, WM_OP_INVOKE_DEFAULT, 0, NULL);
  }
  
  static void node_composit_buts_boxmask(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
@@@

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list