Compare commits
2 Commits
temp-inter
...
nodes-upda
Author | SHA1 | Date | |
---|---|---|---|
9f31b33f8e | |||
0895eef4fb |
@@ -4500,6 +4500,7 @@ void nodeUpdate(bNodeTree *ntree, bNode *node)
|
||||
}
|
||||
ntree->is_updating = true;
|
||||
|
||||
node->flag |= NODE_DEPSGRAPH_UPDATED;
|
||||
if (node->typeinfo->updatefunc) {
|
||||
node->typeinfo->updatefunc(ntree, node);
|
||||
}
|
||||
|
@@ -1711,6 +1711,14 @@ void DepsgraphNodeBuilder::build_nodetree(bNodeTree *ntree)
|
||||
/* General parameters. */
|
||||
build_parameters(&ntree->id);
|
||||
build_idproperties(ntree->id.properties);
|
||||
add_operation_node(&ntree->id,
|
||||
NodeType::PARAMETERS,
|
||||
OperationCode::NODETREE_UPDATE,
|
||||
[ntree](::Depsgraph *depsgraph) {
|
||||
LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
|
||||
node->flag &= ~NODE_DEPSGRAPH_UPDATED;
|
||||
}
|
||||
});
|
||||
/* Animation, */
|
||||
build_animdata(&ntree->id);
|
||||
/* Shading update. */
|
||||
|
@@ -204,6 +204,9 @@ const char *operationCodeAsString(OperationCode opcode)
|
||||
return "DUPLI";
|
||||
case OperationCode::SIMULATION_EVAL:
|
||||
return "SIMULATION_EVAL";
|
||||
/* Node tree*/
|
||||
case OperationCode::NODETREE_UPDATE:
|
||||
return "NODETREE_UPDATE";
|
||||
}
|
||||
BLI_assert_msg(0, "Unhandled operation code, should never happen.");
|
||||
return "UNKNOWN";
|
||||
|
@@ -206,6 +206,9 @@ enum class OperationCode {
|
||||
|
||||
/* Simulation. ---------------------------------------------------------- */
|
||||
SIMULATION_EVAL,
|
||||
|
||||
/* Nodes. --------------------------------------------------------------- */
|
||||
NODETREE_UPDATE,
|
||||
};
|
||||
const char *operationCodeAsString(OperationCode opcode);
|
||||
|
||||
|
@@ -177,6 +177,8 @@ void ED_node_tag_update_nodetree(Main *bmain, bNodeTree *ntree, bNode *node)
|
||||
if (!node_connected_to_output(bmain, ntree, node)) {
|
||||
do_tag_update = false;
|
||||
}
|
||||
|
||||
node->flag |= NODE_DEPSGRAPH_UPDATED;
|
||||
}
|
||||
|
||||
/* Look through all datablocks to support groups. */
|
||||
|
@@ -361,6 +361,9 @@ typedef struct bNode {
|
||||
/* A preview for the data in this node can be displayed in the spreadsheet editor. */
|
||||
#define __NODE_ACTIVE_PREVIEW (1 << 18) /* deprecated */
|
||||
|
||||
/* Read-only flag to indicate that changes to the node have triggered a depsgraph update. */
|
||||
#define NODE_DEPSGRAPH_UPDATED (1 << 19)
|
||||
|
||||
/* node->update */
|
||||
/* XXX NODE_UPDATE is a generic update flag. More fine-grained updates
|
||||
* might be used in the future, but currently all work the same way.
|
||||
|
@@ -11483,6 +11483,12 @@ static void rna_def_node(BlenderRNA *brna)
|
||||
RNA_def_property_ui_text(prop, "Show Texture", "Display node in viewport textured shading mode");
|
||||
RNA_def_property_update(prop, 0, "rna_Node_update");
|
||||
|
||||
prop = RNA_def_property(srna, "depsgraph_updated", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "flag", NODE_DEPSGRAPH_UPDATED);
|
||||
RNA_def_property_clear_flag(prop, PROP_EDITABLE | PROP_ANIMATABLE);
|
||||
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
|
||||
RNA_def_property_ui_text(prop, "Depsgraph Updated", "Changes to the node have triggered a depsgraph update");
|
||||
|
||||
/* generic property update function */
|
||||
func = RNA_def_function(srna, "socket_value_update", "rna_Node_socket_value_update");
|
||||
RNA_def_function_ui_description(func, "Update after property changes");
|
||||
|
Reference in New Issue
Block a user