61 b.add_output<
decl::Color>(
"Image"_ustr).structure_type(StructureType::Dynamic);
62 b.add_output<
decl::Float>(
"Alpha"_ustr).structure_type(StructureType::Dynamic);
73 .structure_type(StructureType::Dynamic);
76 .structure_type(StructureType::Dynamic);
95 const char *pass_name,
107 .dimensions(channels_count)
111 b.add_output(socket_type, name).structure_type(StructureType::Dynamic);
116 b.add_output<
decl::Float>(
"Alpha"_ustr).structure_type(StructureType::Dynamic);
128 .structure_type(StructureType::Dynamic);
133 .structure_type(StructureType::Dynamic);
145 added_outputs_identifiers.
add_new(output_declaration->identifier);
147 const bNodeTree *node_tree =
b.tree_or_null();
149 node_tree->ensure_topology_cache();
151 if (added_outputs_identifiers.
contains(
output->identifier_ustr())) {
154 if (!
output->is_directly_linked()) {
169 const bNodeTree *node_tree =
b.tree_or_null();
210 template_id(&layout, context, node_pointer,
"scene",
nullptr,
nullptr,
nullptr);
222 const char *layer_name;
247 row.
text =
RPT_(
"Node Unsupported");
248 row.
tooltip =
TIP_(
"The Render Layers node is only supported for scene compositing");
249 row.
icon = ICON_STATUS_ERROR;
250 parameters.
rows.append(std::move(row));
263 bool is_any_pass_used =
false;
269 if (
output->is_logically_linked()) {
270 is_any_pass_used =
true;
275 if (!is_any_pass_used) {
280 row.
text =
RPT_(
"Passes Not Supported");
281 row.
tooltip =
TIP_(
"Render passes in the Viewport compositor are only supported in EEVEE");
282 row.
icon = ICON_STATUS_ERROR;
283 parameters.
rows.append(std::move(row));
303 if (!
result.should_compute()) {
329 return reinterpret_cast<const Scene *
>(this->
node().
id);
343 ntype.
ui_name =
"Render Layers";
#define CMP_NODE_R_LAYERS
#define BLI_SCOPED_DEFER(function_to_defer)
#define RE_PASSNAME_COMBINED
#define RE_PASSNAME_FREESTYLE
#define RE_PASSNAME_GREASE_PENCIL
#define NOD_REGISTER_NODE(REGISTER_FUNC)
bool contains(const Key &key) const
void add_new(const Key &key)
virtual Result get_pass(const Scene *scene, int view_layer, const char *name)
NodeOperation(Context &context, const bNode &node)
const bNode & node() const
Result & get_result(StringRef identifier)
Context & context() const
static ResultType type(gpu::TextureFormat format)
static ResultPrecision precision(gpu::TextureFormat format)
BaseSocketDeclarationBuilder & available(bool value=true)
StructureType structure_type
NodeOperation(Context &context, const bNode &node)
const Scene * get_scene()
int get_viewer_layer_index()
bool is_viewport_compositor_used(const bContext &context)
void node_register_type(bNodeType &ntype)
void extract_alpha(Context &context, const Result &input, Result &output)
bool is_socket_available(const bNodeSocket *socket)
static void declare_extra_passes(NodeDeclarationBuilder &b, const Scene *scene, const ViewLayer *view_layer)
static void node_extra_info(NodeExtraInfoParams ¶meters)
static NodeOperation * get_compositor_operation(Context &context, const bNode &node)
static void declare_default(NodeDeclarationBuilder &b)
static void declare_old_linked_outputs(NodeDeclarationBuilder &b)
static void node_init(bNodeTree *, bNode *node)
static void node_declare(NodeDeclarationBuilder &b)
static void node_register()
static BaseSocketDeclarationBuilder & declare_existing_output(NodeDeclarationBuilder &b, const bNodeSocket *output)
static void declare_existing(NodeDeclarationBuilder &b)
static void node_init_api(const bContext *C, PointerRNA *node_ptr)
static void node_draw_buttons(ui::Layout &layout, bContext *context, PointerRNA *node_pointer)
static void declare_pass_callback(void *user_data, Scene *, ViewLayer *, const char *pass_name, int channels_count, const char *, eNodeSocketDatatype socket_type)
@ ITEM_R_SPLIT_EMPTY_NAME
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
bool RE_engines_is_registered(const char *idname)
bool RNA_property_enum_identifier(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **r_identifier)
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
int RNA_property_enum_get(PointerRNA *ptr, PropertyRNA *prop)
@ FREESTYLE_AS_RENDER_PASS
void RE_engine_update_render_passes(RenderEngine *engine, Scene *scene, ViewLayer *view_layer, update_render_passes_cb_t callback, void *callback_data)
@ GREASE_PENCIL_AS_SEPARATE_PASS
const char * RE_engine_id_BLENDER_EEVEE
void RE_engine_free(RenderEngine *engine)
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
SpaceNode * CTX_wm_space_node(const bContext *C)
RenderEngineType * RE_engines_find(const char *idname)
PointerRNA RNA_pointer_get(PointerRNA *ptr, const char *name)
RenderEngine * RE_engine_create(RenderEngineType *type)
Scene * CTX_data_scene(const bContext *C)
std::string RNA_string_get(PointerRNA *ptr, const char *name)
void cmp_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
eFreestyleConfig_Flags flags
void(*) update_render_passes(struct RenderEngine *engine, struct Scene *scene, struct ViewLayer *view_layer)
struct FreestyleConfig freestyle_config
eViewLayerGreasePencilFlags grease_pencil_flags
static constexpr int _240
void(*) draw_buttons(ui::Layout &, bContext *C, PointerRNA *ptr)
std::string ui_description
void(*) initfunc_api(const bContext *C, PointerRNA *ptr)
NodeGetCompositorOperationFunction get_compositor_operation
NodeExtraInfoFunction get_extra_info
void(*) initfunc(bNodeTree *ntree, bNode *node)
const char * enum_name_legacy
NodeDeclareFunction declare
PointerRNA op(wmOperatorType *ot, std::optional< StringRef > name, int icon, wm::OpCallContext context, eUI_Item_Flag flag)
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< StringRef > name_opt, int icon, std::optional< StringRef > placeholder=std::nullopt)
Layout & column(bool align)