Cycles: fix nodes gone missing after new/old shading node compatibility changes.
This commit is contained in:
@@ -1924,6 +1924,9 @@ static void registerShaderNodes(ListBase *ntypelist)
|
||||
register_node_type_sh_tex_marble(ntypelist);
|
||||
register_node_type_sh_tex_clouds(ntypelist);
|
||||
register_node_type_sh_tex_wood(ntypelist);
|
||||
register_node_type_sh_tex_stucci(ntypelist);
|
||||
register_node_type_sh_tex_noise(ntypelist);
|
||||
register_node_type_sh_tex_distnoise(ntypelist);
|
||||
register_node_type_sh_tex_musgrave(ntypelist);
|
||||
}
|
||||
|
||||
|
||||
@@ -344,7 +344,7 @@ static void ui_node_menu_column(Main *bmain, NodeLinkArg *arg, uiLayout *layout,
|
||||
char name[UI_MAX_NAME_STR];
|
||||
int i, j, num = 0;
|
||||
|
||||
if(!(ntype->compatibility & compatibility))
|
||||
if(compatibility && !(ntype->compatibility & compatibility))
|
||||
continue;
|
||||
|
||||
if(ntype->nclass != nclass)
|
||||
@@ -403,12 +403,14 @@ static void ui_template_node_link_menu(bContext *C, uiLayout *layout, void *but_
|
||||
uiLayout *split, *column;
|
||||
NodeLinkArg *arg = (NodeLinkArg*)but->func_argN;
|
||||
bNodeSocket *sock = arg->sock;
|
||||
int compatibility;
|
||||
int compatibility= 0;
|
||||
|
||||
if(scene_use_new_shading_nodes(scene))
|
||||
compatibility= NODE_NEW_SHADING;
|
||||
else
|
||||
compatibility= NODE_OLD_SHADING;
|
||||
if(arg->ntree->type == NTREE_SHADER) {
|
||||
if(scene_use_new_shading_nodes(scene))
|
||||
compatibility= NODE_NEW_SHADING;
|
||||
else
|
||||
compatibility= NODE_OLD_SHADING;
|
||||
}
|
||||
|
||||
uiBlockSetCurLayout(block, layout);
|
||||
split= uiLayoutSplit(layout, 0, 0);
|
||||
|
||||
@@ -175,7 +175,7 @@ static void node_add_menu(bContext *C, uiLayout *layout, void *arg_nodeclass)
|
||||
SpaceNode *snode= CTX_wm_space_node(C);
|
||||
bNodeTree *ntree;
|
||||
int nodeclass= GET_INT_FROM_POINTER(arg_nodeclass);
|
||||
int event, compatibility;
|
||||
int event, compatibility= 0;
|
||||
|
||||
ntree = snode->nodetree;
|
||||
|
||||
@@ -184,10 +184,12 @@ static void node_add_menu(bContext *C, uiLayout *layout, void *arg_nodeclass)
|
||||
return;
|
||||
}
|
||||
|
||||
if(scene_use_new_shading_nodes(scene))
|
||||
compatibility= NODE_NEW_SHADING;
|
||||
else
|
||||
compatibility= NODE_OLD_SHADING;
|
||||
if(ntree->type == NTREE_SHADER) {
|
||||
if(scene_use_new_shading_nodes(scene))
|
||||
compatibility= NODE_NEW_SHADING;
|
||||
else
|
||||
compatibility= NODE_OLD_SHADING;
|
||||
}
|
||||
|
||||
if (nodeclass==NODE_CLASS_GROUP) {
|
||||
bNodeTree *ngroup;
|
||||
@@ -219,8 +221,9 @@ static void node_add_menu(bContext *C, uiLayout *layout, void *arg_nodeclass)
|
||||
uiLayoutSetFunc(layout, do_node_add_static, NULL);
|
||||
|
||||
for (ntype=ntreeGetType(ntree->type)->node_types.first; ntype; ntype=ntype->next) {
|
||||
if(ntype->nclass==nodeclass && ntype->name && (ntype->compatibility&compatibility))
|
||||
uiItemV(layout, ntype->name, 0, ntype->type);
|
||||
if (ntype->nclass==nodeclass && ntype->name)
|
||||
if (!compatibility || (ntype->compatibility & compatibility))
|
||||
uiItemV(layout, ntype->name, 0, ntype->type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ void register_node_type_sh_rgbtobw(ListBase *lb)
|
||||
static bNodeType ntype;
|
||||
|
||||
node_type_base(&ntype, SH_NODE_RGBTOBW, "RGB to BW", NODE_CLASS_CONVERTOR, 0);
|
||||
node_type_compatibility(&ntype, NODE_OLD_SHADING);
|
||||
node_type_compatibility(&ntype, NODE_OLD_SHADING|NODE_NEW_SHADING);
|
||||
node_type_socket_templates(&ntype, sh_node_rgbtobw_in, sh_node_rgbtobw_out);
|
||||
node_type_size(&ntype, 80, 40, 120);
|
||||
node_type_exec(&ntype, node_shader_exec_rgbtobw);
|
||||
|
||||
Reference in New Issue
Block a user