Fix #143323: Material with "frame_current" attribute is not updated on frame change
Add a time dependency for "frame_current" attributes. (4.5 backport candidate) Pull Request: https://projects.blender.org/blender/blender/pulls/143572
This commit is contained in:
@@ -3029,6 +3029,14 @@ void DepsgraphRelationBuilder::build_nodetree(bNodeTree *ntree)
|
||||
build_nodetree_socket(socket);
|
||||
}
|
||||
|
||||
if (ntree->type == NTREE_SHADER && bnode->is_type("ShaderNodeAttribute")) {
|
||||
NodeShaderAttribute *attr = static_cast<NodeShaderAttribute *>(bnode->storage);
|
||||
if (attr->type == SHD_ATTRIBUTE_VIEW_LAYER && STREQ(attr->name, "frame_current")) {
|
||||
TimeSourceKey time_src_key;
|
||||
add_relation(time_src_key, ntree_output_key, "TimeSrc -> Node");
|
||||
}
|
||||
}
|
||||
|
||||
ID *id = bnode->id;
|
||||
if (id == nullptr) {
|
||||
continue;
|
||||
|
||||
@@ -5050,12 +5050,12 @@ static void def_sh_attribute(BlenderRNA * /*brna*/, StructRNA *srna)
|
||||
RNA_def_property_enum_sdna(prop, nullptr, "type");
|
||||
RNA_def_property_enum_items(prop, prop_attribute_type);
|
||||
RNA_def_property_ui_text(prop, "Attribute Type", "General type of the attribute");
|
||||
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
|
||||
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update_relations");
|
||||
|
||||
prop = RNA_def_property(srna, "attribute_name", PROP_STRING, PROP_NONE);
|
||||
RNA_def_property_string_sdna(prop, nullptr, "name");
|
||||
RNA_def_property_ui_text(prop, "Attribute Name", "");
|
||||
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
|
||||
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update_relations");
|
||||
}
|
||||
|
||||
static void def_sh_tex(BlenderRNA * /*brna*/, StructRNA *srna)
|
||||
|
||||
Reference in New Issue
Block a user