T84815: Missing preview image in compositing file output node
Hello, I saw that this revision was stalled for a few months so I tried to update it. https://developer.blender.org/D10995 I added a function that adds a preview on the first connected input of the file output node. I removed the preview on the single layer format Thanks Reviewed By: #compositing, jbakker Maniphest Tasks: T84815 Differential Revision: https://developer.blender.org/D14219
This commit is contained in:
@@ -35,12 +35,22 @@ void OutputFileNode::map_input_sockets(NodeConverter &converter,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OutputFileNode::add_preview_to_first_linked_input(NodeConverter &converter) const
|
||||||
|
{
|
||||||
|
NodeInput *first_socket = this->get_input_socket(0);
|
||||||
|
if (first_socket->is_linked()) {
|
||||||
|
converter.add_node_input_preview(first_socket);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void OutputFileNode::convert_to_operations(NodeConverter &converter,
|
void OutputFileNode::convert_to_operations(NodeConverter &converter,
|
||||||
const CompositorContext &context) const
|
const CompositorContext &context) const
|
||||||
{
|
{
|
||||||
NodeImageMultiFile *storage = (NodeImageMultiFile *)this->get_bnode()->storage;
|
NodeImageMultiFile *storage = (NodeImageMultiFile *)this->get_bnode()->storage;
|
||||||
const bool is_multiview = (context.get_render_data()->scemode & R_MULTIVIEW) != 0;
|
const bool is_multiview = (context.get_render_data()->scemode & R_MULTIVIEW) != 0;
|
||||||
|
|
||||||
|
add_preview_to_first_linked_input(converter);
|
||||||
|
|
||||||
if (!context.is_rendering()) {
|
if (!context.is_rendering()) {
|
||||||
/* only output files when rendering a sequence -
|
/* only output files when rendering a sequence -
|
||||||
* otherwise, it overwrites the output files just
|
* otherwise, it overwrites the output files just
|
||||||
@@ -81,7 +91,6 @@ void OutputFileNode::convert_to_operations(NodeConverter &converter,
|
|||||||
map_input_sockets(converter, *output_operation);
|
map_input_sockets(converter, *output_operation);
|
||||||
}
|
}
|
||||||
else { /* single layer format */
|
else { /* single layer format */
|
||||||
bool preview_added = false;
|
|
||||||
for (NodeInput *input : inputs_) {
|
for (NodeInput *input : inputs_) {
|
||||||
if (input->is_linked()) {
|
if (input->is_linked()) {
|
||||||
NodeImageMultiFileSocket *sockdata =
|
NodeImageMultiFileSocket *sockdata =
|
||||||
@@ -133,11 +142,6 @@ void OutputFileNode::convert_to_operations(NodeConverter &converter,
|
|||||||
|
|
||||||
converter.add_operation(output_operation);
|
converter.add_operation(output_operation);
|
||||||
converter.map_input_socket(input, output_operation->get_input_socket(0));
|
converter.map_input_socket(input, output_operation->get_input_socket(0));
|
||||||
|
|
||||||
if (!preview_added) {
|
|
||||||
converter.add_node_input_preview(input);
|
|
||||||
preview_added = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ class OutputFileNode : public Node {
|
|||||||
const CompositorContext &context) const override;
|
const CompositorContext &context) const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void add_preview_to_first_linked_input(NodeConverter &converter) const;
|
||||||
void add_input_sockets(OutputOpenExrMultiLayerOperation &operation) const;
|
void add_input_sockets(OutputOpenExrMultiLayerOperation &operation) const;
|
||||||
void map_input_sockets(NodeConverter &converter,
|
void map_input_sockets(NodeConverter &converter,
|
||||||
OutputOpenExrMultiLayerOperation &operation) const;
|
OutputOpenExrMultiLayerOperation &operation) const;
|
||||||
|
|||||||
Reference in New Issue
Block a user