void register_node_type_sh_group(void)
{
	static bNodeType ntype;
	
	/* NB: cannot use sh_node_type_base for node group, because it would map the node type
	 * to the shared NODE_GROUP integer type id.
	 */
	node_type_base_custom(&ntype, "ShaderNodeGroup", "Group", NODE_CLASS_GROUP, NODE_CONST_OUTPUT);
	ntype.type = NODE_GROUP;
	ntype.poll = sh_node_poll_default;
	ntype.poll_instance = node_group_poll_instance;
	ntype.update_internal_links = node_update_internal_links_default;
	ntype.ext.srna = RNA_struct_find("ShaderNodeGroup");
	BLI_assert(ntype.ext.srna != NULL);
	RNA_struct_blender_type_set(ntype.ext.srna, &ntype);
	
	node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING);
	node_type_socket_templates(&ntype, NULL, NULL);
	node_type_size(&ntype, 140, 60, 400);
	node_type_label(&ntype, node_group_label);
	node_type_update(&ntype, NULL, node_group_verify);
	node_type_exec(&ntype, group_initexec, group_freeexec, group_execute);
	node_type_gpu(&ntype, gpu_group_execute);
	
	nodeRegisterType(&ntype);
}
Example #2
0
void register_node_type_cmp_image(void)
{
	static bNodeType ntype;

	cmp_node_type_base(&ntype, CMP_NODE_IMAGE, "Image", NODE_CLASS_INPUT, NODE_PREVIEW);
	node_type_init(&ntype, node_composit_init_image);
	node_type_storage(&ntype, "ImageUser", node_composit_free_image, node_composit_copy_image);
	node_type_update(&ntype, cmp_node_image_update, NULL);

	nodeRegisterType(&ntype);
}
void register_node_type_cmp_output_file(void)
{
	static bNodeType ntype;

	cmp_node_type_base(&ntype, CMP_NODE_OUTPUT_FILE, "File Output", NODE_CLASS_OUTPUT, NODE_PREVIEW);
	node_type_socket_templates(&ntype, NULL, NULL);
	ntype.initfunc_api = init_output_file;
	node_type_storage(&ntype, "NodeImageMultiFile", free_output_file, copy_output_file);
	node_type_update(&ntype, update_output_file, NULL);

	nodeRegisterType(&ntype);
}
Example #4
0
void register_node_type_reroute(bNodeTreeType *ttype)
{
	/* frame type is used for all tree types, needs dynamic allocation */
	bNodeType *ntype= MEM_callocN(sizeof(bNodeType), "frame node type");
	
	node_type_base(ttype, ntype, NODE_REROUTE, "Reroute", NODE_CLASS_LAYOUT, 0);
	node_type_socket_templates(ntype, node_reroute_in, node_reroute_out);
	node_type_internal_connect(ntype, node_reroute_internal_connect);
	node_type_update(ntype, node_reroute_update, NULL);
	
	ntype->needs_free = 1;
	nodeRegisterType(ttype, ntype);
}
Example #5
0
void register_node_type_group_output(void)
{
	/* used for all tree types, needs dynamic allocation */
	bNodeType *ntype = MEM_callocN(sizeof(bNodeType), "node type");
	
	node_type_base(ntype, NODE_GROUP_OUTPUT, "Group Output", NODE_CLASS_INTERFACE, 0);
	node_type_size(ntype, 140, 80, 400);
	node_type_init(ntype, node_group_output_init);
	node_type_update(ntype, node_group_output_update, node_group_output_verify);
	node_type_compatibility(ntype, NODE_OLD_SHADING | NODE_NEW_SHADING);
	
	ntype->needs_free = 1;
	nodeRegisterType(ntype);
}
void register_node_type_cmp_output_file(bNodeTreeType *ttype)
{
	static bNodeType ntype;

	node_type_base(ttype, &ntype, CMP_NODE_OUTPUT_FILE, "File Output", NODE_CLASS_OUTPUT, NODE_OPTIONS|NODE_PREVIEW);
	node_type_socket_templates(&ntype, NULL, NULL);
	node_type_size(&ntype, 140, 80, 300);
	node_type_init(&ntype, init_output_file);
	node_type_storage(&ntype, "NodeImageMultiFile", free_output_file, copy_output_file);
	node_type_update(&ntype, update_output_file, NULL);
	node_type_exec(&ntype, exec_output_file);

	nodeRegisterType(ttype, &ntype);
}
/* node type definition */
void register_node_type_sh_bsdf_hair_principled(void)
{
	static bNodeType ntype;

	sh_node_type_base(&ntype, SH_NODE_BSDF_HAIR_PRINCIPLED, "Principled Hair BSDF", NODE_CLASS_SHADER, 0);
	node_type_compatibility(&ntype, NODE_NEW_SHADING);
	node_type_socket_templates(&ntype, sh_node_bsdf_hair_principled_in, sh_node_bsdf_hair_principled_out);
	node_type_size_preset(&ntype, NODE_SIZE_LARGE);
	node_type_init(&ntype, node_shader_init_hair_principled);
	node_type_storage(&ntype, "", NULL, NULL);
	node_type_update(&ntype, node_shader_update_hair_principled, NULL);

	nodeRegisterType(&ntype);
}
/* node type definition */
void register_node_type_sh_subsurface_scattering(void)
{
	static bNodeType ntype;

	sh_node_type_base(&ntype, SH_NODE_SUBSURFACE_SCATTERING, "Subsurface Scattering", NODE_CLASS_SHADER, 0);
	node_type_compatibility(&ntype, NODE_NEW_SHADING);
	node_type_socket_templates(&ntype, sh_node_subsurface_scattering_in, sh_node_subsurface_scattering_out);
	node_type_size_preset(&ntype, NODE_SIZE_MIDDLE);
	node_type_init(&ntype, node_shader_init_subsurface_scattering);
	node_type_storage(&ntype, "", NULL, NULL);
	node_type_gpu(&ntype, node_shader_gpu_subsurface_scattering);
	node_type_update(&ntype, node_shader_update_subsurface_scattering, NULL);

	nodeRegisterType(&ntype);
}
Example #9
0
void register_node_type_cmp_group(ListBase *lb)
{
	static bNodeType ntype;

	node_type_base(&ntype, NODE_GROUP, "Group", NODE_CLASS_GROUP, NODE_OPTIONS|NODE_CONST_OUTPUT);
	node_type_socket_templates(&ntype, NULL, NULL);
	node_type_size(&ntype, 120, 60, 200);
	node_type_label(&ntype, node_group_label);
	node_type_init(&ntype, node_group_init);
	node_type_valid(&ntype, node_group_valid);
	node_type_template(&ntype, node_group_template);
	node_type_update(&ntype, NULL, node_group_verify);
	node_type_group_edit(&ntype, node_group_edit_get, node_group_edit_set, node_group_edit_clear);
	node_type_exec_new(&ntype, group_initexec, group_freeexec, group_execute);
	
	nodeRegisterType(lb, &ntype);
}
Example #10
0
void register_node_type_cmp_whileloop(ListBase *lb)
{
	static bNodeType ntype;

	node_type_base(&ntype, NODE_WHILELOOP, "While", NODE_CLASS_GROUP, NODE_OPTIONS);
	node_type_socket_templates(&ntype, NULL, NULL);
	node_type_size(&ntype, 120, 60, 200);
	node_type_label(&ntype, node_group_label);
	node_type_init(&ntype, node_whileloop_init);
	node_type_valid(&ntype, node_group_valid);
	node_type_template(&ntype, node_whileloop_template);
	node_type_update(&ntype, NULL, node_group_verify);
	node_type_tree(&ntype, node_whileloop_init_tree, node_loop_update_tree);
	node_type_group_edit(&ntype, node_group_edit_get, node_group_edit_set, node_group_edit_clear);
	node_type_exec_new(&ntype, group_initexec, group_freeexec, whileloop_execute);
	
	nodeRegisterType(lb, &ntype);
}
void register_node_type_sh_forloop(bNodeTreeType *ttype)
{
	static bNodeType ntype;

	node_type_base(ttype, &ntype, NODE_FORLOOP, "For", NODE_CLASS_GROUP, NODE_OPTIONS);
	node_type_socket_templates(&ntype, NULL, NULL);
	node_type_size(&ntype, 120, 60, 200);
	node_type_label(&ntype, node_group_label);
	node_type_init(&ntype, node_forloop_init);
	node_type_valid(&ntype, node_group_valid);
	node_type_template(&ntype, node_forloop_template);
	node_type_update(&ntype, NULL, node_group_verify);
	node_type_tree(&ntype, node_forloop_init_tree, node_loop_update_tree);
	node_type_group_edit(&ntype, node_group_edit_get, node_group_edit_set, node_group_edit_clear);
	node_type_exec_new(&ntype, group_initexec, group_freeexec, forloop_execute);
	
	nodeRegisterType(ttype, &ntype);
}
Example #12
0
void register_node_type_cmp_group(void)
{
	static bNodeType ntype;
	
	/* NB: cannot use sh_node_type_base for node group, because it would map the node type
	 * to the shared NODE_GROUP integer type id.
	 */
	node_type_base_custom(&ntype, "CompositorNodeGroup", "Group", NODE_CLASS_GROUP, NODE_OPTIONS | NODE_CONST_OUTPUT);
	ntype.type = NODE_GROUP;
	ntype.poll = cmp_node_poll_default;
	ntype.poll_instance = node_group_poll_instance;
	ntype.update_internal_links = node_update_internal_links_default;
	ntype.ext.srna = RNA_struct_find("CompositorNodeGroup");
	BLI_assert(ntype.ext.srna != NULL);
	RNA_struct_blender_type_set(ntype.ext.srna, &ntype);
	
	node_type_socket_templates(&ntype, NULL, NULL);
	node_type_size(&ntype, 120, 60, 200);
	node_type_label(&ntype, node_group_label);
	node_type_update(&ntype, NULL, node_group_verify);

	nodeRegisterType(&ntype);
}