Fix T82336: Cycles standard attributes missing in displacement shaders
Standard attributes are not added to the attributes requests when shaders only have displacement. This is because nodes are only considering the case when the surface socket is connected. To support this, added `Shader.has_surface_link()` which checks for both cases (`has_surface` and `has_displacement`) and replaces all checks on `Shader.has_surface`. Reviewed By: brecht Differential Revision: https://developer.blender.org/D12240
This commit is contained in:
@@ -158,13 +158,13 @@ void ShaderNode::attributes(Shader *shader, AttributeRequestSet *attributes)
|
||||
foreach (ShaderInput *input, inputs) {
|
||||
if (!input->link) {
|
||||
if (input->flags() & SocketType::LINK_TEXTURE_GENERATED) {
|
||||
if (shader->has_surface)
|
||||
if (shader->has_surface_link())
|
||||
attributes->add(ATTR_STD_GENERATED);
|
||||
if (shader->has_volume)
|
||||
attributes->add(ATTR_STD_GENERATED_TRANSFORM);
|
||||
}
|
||||
else if (input->flags() & SocketType::LINK_TEXTURE_UV) {
|
||||
if (shader->has_surface)
|
||||
if (shader->has_surface_link())
|
||||
attributes->add(ATTR_STD_UV);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user