Fix cycles backwards compatibility for specular_toon shader this actually needs
to be done in cycles itself to keep compatibility for bytecode too. Also fix broken button to compile OSL from the text editors, this got broken after recent change to disable editing of library linked nodes.
This commit is contained in:
@@ -198,6 +198,8 @@ void OSLShader::register_closures(OSLShadingSystem *ss_)
|
||||
bsdf_diffuse_toon_params(), bsdf_diffuse_toon_prepare);
|
||||
register_closure(ss, "glossy_toon", id++,
|
||||
bsdf_glossy_toon_params(), bsdf_glossy_toon_prepare);
|
||||
register_closure(ss, "specular_toon", id++,
|
||||
bsdf_glossy_toon_params(), bsdf_glossy_toon_prepare);
|
||||
register_closure(ss, "westin_backscatter", id++,
|
||||
bsdf_westin_backscatter_params(), bsdf_westin_backscatter_prepare);
|
||||
register_closure(ss, "westin_sheen", id++,
|
||||
|
||||
@@ -467,10 +467,7 @@ closure color bssrdf_cubic(normal N, vector radius) BUILTIN;
|
||||
|
||||
// Backwards compatibility
|
||||
|
||||
closure color specular_toon(normal N, float size, float smooth)
|
||||
{
|
||||
return glossy_toon(N, size, smooth);
|
||||
}
|
||||
closure color specular_toon(normal N, float size, float smooth) BUILTIN;
|
||||
|
||||
// Renderer state
|
||||
int raytype (string typename) BUILTIN;
|
||||
|
||||
@@ -2315,9 +2315,6 @@ static int node_shader_script_update_poll(bContext *C)
|
||||
bNode *node;
|
||||
Text *text;
|
||||
|
||||
if (!ED_operator_node_editable(C))
|
||||
return 0;
|
||||
|
||||
/* test if we have a render engine that supports shaders scripts */
|
||||
if (!(type && type->update_script_node))
|
||||
return 0;
|
||||
@@ -2325,14 +2322,14 @@ static int node_shader_script_update_poll(bContext *C)
|
||||
/* see if we have a shader script node in context */
|
||||
node = CTX_data_pointer_get_type(C, "node", &RNA_ShaderNodeScript).data;
|
||||
|
||||
if (!node)
|
||||
if (!node && snode && snode->edittree)
|
||||
node = nodeGetActive(snode->edittree);
|
||||
|
||||
if (node && node->type == SH_NODE_SCRIPT) {
|
||||
NodeShaderScript *nss = node->storage;
|
||||
|
||||
if (node->id || nss->filepath[0]) {
|
||||
return 1;
|
||||
return ED_operator_node_editable(C);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user