Compositor: File output node sockets
When using RNA to alter the type of socket only the type was changed. the typeinfo was not updated. Internally the File Output Node used RNA to update the sockettype. making the socket invalid. When users save the file and reopened the typeinfo was used. Also the color of the node was determined via the typeinfo. Another thing that happened was that the socket conversion was ignored when empty node groups were present. The empty node groups were optimized away before the needed data conversion was determined. Reviewed By: brecht Differential Revision: https://developer.blender.org/D4938
This commit is contained in:
@@ -100,10 +100,10 @@ void NodeOperationBuilder::convertToOperations(ExecutionSystem *system)
|
||||
|
||||
add_operation_input_constants();
|
||||
|
||||
resolve_proxies();
|
||||
|
||||
add_datatype_conversions();
|
||||
|
||||
resolve_proxies();
|
||||
|
||||
determineResolutions();
|
||||
|
||||
/* surround complex ops with read/write buffer */
|
||||
|
||||
@@ -2121,6 +2121,15 @@ static PointerRNA rna_NodeSocket_node_get(PointerRNA *ptr)
|
||||
return r_ptr;
|
||||
}
|
||||
|
||||
static void rna_NodeSocket_type_set(PointerRNA *ptr, int value)
|
||||
{
|
||||
bNodeTree *ntree = (bNodeTree *)ptr->id.data;
|
||||
bNodeSocket *sock = (bNodeSocket *)ptr->data;
|
||||
bNode *node;
|
||||
nodeFindNode(ntree, sock, &node, NULL);
|
||||
nodeModifySocketType(ntree, node, sock, value, 0);
|
||||
}
|
||||
|
||||
static void rna_NodeSocket_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
|
||||
{
|
||||
bNodeTree *ntree = (bNodeTree *)ptr->id.data;
|
||||
@@ -7759,6 +7768,7 @@ static void rna_def_node_socket(BlenderRNA *brna)
|
||||
RNA_def_property_enum_sdna(prop, NULL, "type");
|
||||
RNA_def_property_enum_items(prop, node_socket_type_items);
|
||||
RNA_def_property_enum_default(prop, SOCK_FLOAT);
|
||||
RNA_def_property_enum_funcs(prop, NULL, "rna_NodeSocket_type_set", NULL);
|
||||
RNA_def_property_ui_text(prop, "Type", "Data type");
|
||||
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeSocket_update");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user