35 void RenderLayersNode::testSocketLink(
NodeConverter &converter,
41 bool is_preview)
const
56 void RenderLayersNode::testRenderLink(NodeConverter &converter,
57 const CompositorContext &
context,
64 missingRenderLink(converter);
68 if (view_layer ==
nullptr) {
69 missingRenderLink(converter);
74 missingRenderLink(converter);
82 if (rpass ==
nullptr) {
83 missingSocketLink(converter,
output);
86 RenderLayersProg *operation;
110 BLI_assert(!
"Unexpected number of channels for pass");
115 is_preview =
STREQ(
output->getbNodeSocket()->name,
"Image");
121 void RenderLayersNode::missingSocketLink(NodeConverter &converter, NodeOutput *
output)
const
123 NodeOperation *operation;
124 switch (
output->getDataType()) {
126 const float color[4] = {0.0f, 0.0f, 0.0f, 0.0f};
127 SetColorOperation *color_operation =
new SetColorOperation();
128 color_operation->setChannels(color);
129 operation = color_operation;
133 const float vector[3] = {0.0f, 0.0f, 0.0f};
134 SetVectorOperation *vector_operation =
new SetVectorOperation();
135 vector_operation->setVector(
vector);
136 operation = vector_operation;
140 SetValueOperation *value_operation =
new SetValueOperation();
141 value_operation->setValue(0.0f);
142 operation = value_operation;
151 converter.mapOutputSocket(
output, operation->getOutputSocket());
152 converter.addOperation(operation);
155 void RenderLayersNode::missingRenderLink(NodeConverter &converter)
const
158 missingSocketLink(converter,
output);
169 testRenderLink(converter,
context, re);
173 missingRenderLink(converter);
void * BLI_findstring(const struct ListBase *listbase, const char *id, const int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define RE_PASSNAME_COMBINED
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
Overall context of the compositor.
void addPreview(NodeOperationOutput *output)
void addOperation(NodeOperation *operation)
void mapOutputSocket(NodeOutput *node_socket, NodeOperationOutput *operation_socket)
NodeOperationOutput * getOutputSocket(unsigned int index=0)
NodeOutput are sockets that can send data/input.
Vector< NodeOutput * > outputs
the list of actual output-sockets
bNode * getbNode() const
get the reference to the SDNA bNode struct
const Vector< NodeOutput * > & getOutputSockets() const
get access to the vector of input sockets
RenderLayersNode(bNode *editorNode)
void convertToOperations(NodeConverter &converter, const CompositorContext &context) const override
convert node to operation
void setViewName(const char *viewName)
void setScene(Scene *scene)
void setRenderData(const RenderData *rd)
void setLayerId(short layerId)
@ Vector
Vector data type.
RenderResult * RE_AcquireResultRead(Render *re)
Render * RE_GetSceneRender(const Scene *scene)
RenderLayer * RE_GetRenderLayer(RenderResult *rr, const char *name)
void RE_ReleaseResult(Render *re)