Blender V5.3
scene_compositor.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2026 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include "BLI_listbase.hh"
10#include "BLI_string_utf8.hh"
11
12#include "BLT_translation.hh"
13
14#include "DNA_ID.h"
15#include "DNA_node_types.h"
18
19#include "RNA_access.hh"
20#include "RNA_define.hh"
21#include "RNA_enum_types.hh"
22#include "RNA_prototypes.hh"
23#include "RNA_types.hh"
24
25#include "WM_api.hh"
26#include "WM_types.hh"
27
28#include "BKE_asset.hh"
29#include "BKE_compositor.hh"
30#include "BKE_context.hh"
31#include "BKE_idprop.hh"
32#include "BKE_lib_id.hh"
33#include "BKE_main.hh"
35#include "BKE_node.hh"
36#include "BKE_report.hh"
37#include "BKE_screen.hh"
38
39#include "UI_interface.hh"
41
42#include "AS_asset_catalog.hh"
44#include "AS_asset_library.hh"
46
47#include "DEG_depsgraph.hh"
49
50#include "NOD_composite.hh"
51#include "NOD_defaults.hh"
52
53#include "ED_asset.hh"
54#include "ED_asset_import.hh"
56#include "ED_object.hh"
57#include "ED_scene.hh"
58
59namespace blender {
60
61/* -------------------------------------------------------------------- */
64
65/* If the "name" property is not set, fill the name property with the name of the effect with a UI
66 * panel below the mouse cursor, unless a specific effect is set with a context pointer. Used in
67 * order to apply effect operators on hover over their panels. */
69 wmOperator *op,
70 const wmEvent *event)
71{
72 if (RNA_struct_property_is_set(op->ptr, "name")) {
73 return OPERATOR_FINISHED;
74 }
75
76 /* Note that the context pointer is *not* the active effect, it is set in UI layouts, see the
77 * panel_context_pointer_set calls in effect panel draw functions. */
78 PointerRNA ctx_ptr = CTX_data_pointer_get_type(C, "effect", RNA_SceneCompositorEffect);
79 if (ctx_ptr) {
80 SceneCompositorEffect *effect = static_cast<SceneCompositorEffect *>(ctx_ptr.data);
81 RNA_string_set(op->ptr, "name", effect->name);
82 return OPERATOR_FINISHED;
83 }
84
86 if (panel_ptr == nullptr || !*panel_ptr) {
87 /* The operators using this function can typically be called from UIs that aren't related to
88 * the effects UI at all. So include #OPERATOR_PASS_THROUGH to not block events from reaching
89 * other operators/handlers. */
91 }
92
93 if (!RNA_struct_is_a(panel_ptr->type, RNA_SceneCompositorEffect)) {
94 /* Work around multiple operators using the same shortcut. The operators for the other
95 * stacks in the property editor use the same key, and will not run after these return
96 * OPERATOR_CANCELLED. */
98 }
99
100 const SceneCompositorEffect *effect = static_cast<const SceneCompositorEffect *>(
101 panel_ptr->data);
102 RNA_string_set(op->ptr, "name", effect->name);
103 return OPERATOR_FINISHED;
104}
105
107
108/* -------------------------------------------------------------------- */
111
113{
114 Scene *scene = CTX_data_scene(C);
115 bke::compositor::new_effect(*scene, "Scene Effect");
116
118
119 return OPERATOR_FINISHED;
120}
121
123{
124 ot->name = "Add Scene Effect";
125 ot->idname = "SCENE_OT_add_compositor_effect";
126 ot->description = "Add a compositor effect to the scene";
127
129
131}
132
134
135/* -------------------------------------------------------------------- */
138
140{
141 Scene *scene = CTX_data_scene(C);
142
143 const std::string name = RNA_string_get(op->ptr, "name");
145 if (!effect) {
146 BKE_reportf(op->reports, RPT_ERROR, "No effect '%s' in scene", name.c_str());
147 return OPERATOR_CANCELLED;
148 }
149
150 bke::compositor::remove_effect(*scene, *effect);
151
152 Main *bmain = CTX_data_main(C);
156
157 return OPERATOR_FINISHED;
158}
159
161 wmOperator *op,
162 const wmEvent *event)
163{
165 if (!(status & OPERATOR_CANCELLED)) {
167 }
168 return status;
169}
170
172{
173 PropertyRNA *prop;
174
175 ot->name = "Remove Scene Effect";
176 ot->idname = "SCENE_OT_remove_compositor_effect";
177 ot->description = "Remove a scene effect from the scene";
178
181
183
184 prop = RNA_def_string(
185 ot->srna, "name", "Name", MAX_NAME, "Name", "Name of the effect to remove");
187}
188
190
191/* -------------------------------------------------------------------- */
194
196{
197 Scene *scene = CTX_data_scene(C);
198 if (scene->compositor_effects.is_empty()) {
199 BKE_report(op->reports, RPT_ERROR, "No effect to duplicate");
200 return OPERATOR_CANCELLED;
201 }
202
203 std::string name = RNA_string_get(op->ptr, "name");
204 SceneCompositorEffect *effect = name.empty() ? bke::compositor::get_active_effect(*scene) :
205 bke::compositor::get_effect(*scene, name);
206 if (!effect) {
207 if (name.empty()) {
208 BKE_reportf(op->reports, RPT_ERROR, "No active effect in scene");
209 }
210 else {
211 BKE_reportf(op->reports, RPT_ERROR, "No effect '%s' in scene", name.c_str());
212 }
213 return OPERATOR_CANCELLED;
214 }
215
216 bke::compositor::duplicate_effect(*scene, *effect);
217
218 Main *bmain = CTX_data_main(C);
222
223 return OPERATOR_FINISHED;
224}
225
227 wmOperator *op,
228 const wmEvent *event)
229{
231 if (!(status & OPERATOR_CANCELLED)) {
233 }
234 return status;
235}
236
238{
239 ot->name = "Duplicate Scene Effect";
240 ot->idname = "SCENE_OT_duplicate_compositor_effect";
241 ot->description = "Duplicate the active or the given scene effect";
242
245
247
248 ot->prop = RNA_def_string(
249 ot->srna,
250 "name",
251 nullptr,
252 MAX_NAME,
253 "Name",
254 "Name of the effect to duplicate. If empty duplicate the active effect");
256}
257
259
260/* -------------------------------------------------------------------- */
263
265{
266 Scene *scene = CTX_data_scene(C);
267 const std::string name = RNA_string_get(op->ptr, "name");
269 if (!effect) {
270 BKE_reportf(op->reports, RPT_ERROR, "No effect '%s' in scene", name.c_str());
271 return OPERATOR_CANCELLED;
272 }
273
274 const int current_index = BLI_findindex(&scene->compositor_effects, effect);
275 const int new_index = RNA_int_get(op->ptr, "index");
276 const bool successful = BLI_listbase_move_index(
277 &scene->compositor_effects, current_index, new_index);
278 if (!successful) {
279 BKE_report(op->reports, RPT_ERROR, "Index is out of range");
280 return OPERATOR_CANCELLED;
281 }
282
285
286 return OPERATOR_FINISHED;
287}
288
295
297{
298 ot->name = "Move Active Scene Effect to Index";
299 ot->description =
300 "Change the scene effect's index in the stack so it evaluates after the set number of "
301 "others";
302 ot->idname = "SCENE_OT_move_compositor_effect_to_index";
303
306
308
309 PropertyRNA *prop;
310 prop = RNA_def_string(ot->srna, "name", nullptr, MAX_NAME, "Name", "Name of the effect to edit");
313 ot->srna, "index", 0, 0, INT_MAX, "Index", "The index to move the effect to", 0, INT_MAX);
314}
315
317
318/* -------------------------------------------------------------------- */
321
323{
324 Scene *scene = CTX_data_scene(C);
325 const std::string name = RNA_string_get(op->ptr, "name");
327 if (!effect) {
328 BKE_reportf(op->reports, RPT_ERROR, "No effect '%s' in scene", name.c_str());
329 return OPERATOR_CANCELLED;
330 }
331 bke::compositor::set_active_effect(*scene, *effect);
332
335
336 return OPERATOR_FINISHED;
337}
338
340 wmOperator *op,
341 const wmEvent *event)
342{
344 if (!(status & OPERATOR_CANCELLED)) {
346 }
347 return status;
348}
349
351{
352 ot->name = "Set Active Scene Effect";
353 ot->description = "Set the given scene effect as the active one";
354 ot->idname = "SCENE_OT_set_active_compositor_effect";
355
358
360
361 ot->prop = RNA_def_string(
362 ot->srna, "name", nullptr, MAX_NAME, "Name", "Name of the strip effect to edit");
364}
365
367
368/* -------------------------------------------------------------------- */
371
373{
374 Main *bmain = CTX_data_main(C);
375 bNodeTree *node_group = bke::node_tree_add_tree(bmain, "Scene Compositor", "CompositorNodeTree");
377
378 if (!node_group->compositor_node_asset_traits) {
379 node_group->compositor_node_asset_traits = MEM_new<CompositorNodeAssetTraits>(__func__);
380 }
383
384 Scene *scene = CTX_data_scene(C);
385
386 SceneCompositorEffect *effect = nullptr;
387 if (PointerRNA ctx_ptr = CTX_data_pointer_get_type(C, "effect", RNA_SceneCompositorEffect)) {
388 effect = static_cast<SceneCompositorEffect *>(ctx_ptr.data);
389 }
390 else {
391 effect = bke::compositor::get_active_effect(*scene);
392 }
393 if (!effect) {
394 effect = &bke::compositor::new_effect(*scene, "Scene Effect");
395 }
396
397 if (effect->node_group) {
398 id_us_min(&effect->node_group->id);
399 }
400 effect->node_group = node_group;
401
405
406 return OPERATOR_FINISHED;
407}
408
410{
411 ot->name = "New Scene Effect Node Group";
412 ot->idname = "SCENE_OT_new_compositor_effect_node_group";
413 ot->description = "Create a new compositor node group and assign it to the scene effect";
414
416
418}
419
421
422/* -------------------------------------------------------------------- */
425
427{
428 Scene *scene = CTX_data_scene(C);
429 SceneCompositorEffect *effect = nullptr;
430 if (PointerRNA ctx_ptr = CTX_data_pointer_get_type(C, "effect", RNA_SceneCompositorEffect)) {
431 effect = static_cast<SceneCompositorEffect *>(ctx_ptr.data);
432 }
433 else {
434 effect = bke::compositor::get_active_effect(*scene);
435 }
436 if (!effect) {
437 BKE_report(op->reports, RPT_ERROR, "No active effect to duplicate");
438 return OPERATOR_CANCELLED;
439 }
440
441 bNodeTree *original_node_group = effect->node_group;
442 if (!original_node_group || ID_MISSING(original_node_group)) {
443 BKE_report(op->reports, RPT_ERROR, "No node group to duplicate");
444 return OPERATOR_CANCELLED;
445 }
446
448 bNodeTree *node_tree = id_cast<bNodeTree *>(
449 BKE_id_copy_ex(main, &original_node_group->id, nullptr, LIB_ID_COPY_ACTIONS));
450
452
453 effect->node_group = node_tree;
454 id_us_min(&original_node_group->id);
455
456 Main *bmain = CTX_data_main(C);
460
461 return OPERATOR_FINISHED;
462}
463
465{
466 ot->name = "Duplicate Scene Effect Node Group";
467 ot->idname = "SCENE_OT_duplicate_compositor_effect_node_group";
468 ot->description =
469 "Duplicate the scene effect node group and assign the new node group to the effect";
470
472
474}
475
477
478/* -------------------------------------------------------------------- */
481
483 PointerRNA &ptr,
484 ReportList *reports)
485{
486 Main &bmain = *CTX_data_main(&C);
487 if (bNodeTree *group = reinterpret_cast<bNodeTree *>(
489 {
490 return group;
491 }
492
495 if (!asset) {
496 return nullptr;
497 }
498 return reinterpret_cast<bNodeTree *>(ed::asset::asset_local_id_ensure_imported(bmain, *asset));
499}
500
502 PointerRNA &properties_ptr,
503 ReportList *reports)
504{
505 bNodeTree *node_group = get_asset_or_local_node_group(C, properties_ptr, reports);
506 if (!node_group || ID_MISSING(node_group)) {
507 BKE_report(reports, RPT_ERROR, "Missing node group for asset");
508 return nullptr;
509 }
510 if (node_group->type != NTREE_COMPOSIT) {
511 if (reports) {
512 BKE_report(reports, RPT_ERROR, "Asset is not a compositor node group");
513 }
514 return nullptr;
515 }
516 return node_group;
517}
518
520{
521 Scene *scene = CTX_data_scene(C);
522 bNodeTree *node_group = get_node_group(*C, *op->ptr, op->reports);
523 if (!node_group) {
524 return OPERATOR_CANCELLED;
525 }
526
528 DATA_(node_group->id.name + 2));
529 effect.node_group = node_group;
530 id_us_plus(&node_group->id);
531 effect.flags &= ~SceneCompositorEffectFlags::ShowNodeGroupSelector;
532
535
536 Main *bmain = CTX_data_main(C);
540
541 return OPERATOR_FINISHED;
542}
543
545 bContext *C, wmOperatorType * /*ot*/, PointerRNA *properties_ptr)
546{
549 *C, *properties_ptr, nullptr);
550 if (!asset) {
551 return "";
552 }
553 if (!asset->get_metadata().description) {
554 return "";
555 }
556 return TIP_(asset->get_metadata().description);
557}
558
560{
561 ot->name = "Add Scene Effect Node Group Asset";
562 ot->description = "Add a scene effect with a node group asset";
563 ot->idname = "SCENE_OT_add_compositor_effect_node_group_asset";
564
567
569
572}
573
575
576/* -------------------------------------------------------------------- */
579
581{
582 static ed::asset::AssetItemTree tree;
583 return tree;
584}
585
587{
588 ed::asset::AssetFilterSettings type_filter{};
589 type_filter.id_types = FILTER_ID_NT;
590 auto meta_data_filter = [&](const AssetMetaData &meta_data) {
591 const IDProperty *tree_type = BKE_asset_metadata_idprop_find(&meta_data, "type");
592 if (tree_type == nullptr || IDP_int_get(tree_type) != NTREE_COMPOSIT) {
593 return false;
594 }
595 const IDProperty *traits_flag = BKE_asset_metadata_idprop_find(
596 &meta_data, "compositor_node_asset_traits_flag");
597 if (traits_flag == nullptr || !(IDP_int_get(traits_flag) & COMPOSIT_NODE_ASSET_SCENE_EFFECT)) {
598 return false;
599 }
600 return true;
601 };
605 library, C, type_filter, meta_data_filter, ntreeType_Composite->asset_catalog_path_prefix);
606}
607
608static bool unassigned_local_poll(const Main &bmain)
609{
610 for (const bNodeTree &group : bmain.nodetrees) {
611 /* Assets are displayed in other menus, and non-local data-blocks aren't added to this menu. */
612 if (group.id.library_weak_reference || ID_IS_ASSET(&group.id)) {
613 continue;
614 }
615 if (!group.compositor_node_asset_traits ||
617 {
618 continue;
619 }
620 return true;
621 }
622 return false;
623}
624
625static void root_catalogs_draw(const bContext *C, Menu *menu)
626{
627 ui::Layout &layout = *menu->layout;
628
630 const bool loading_finished = ed::asset::list::is_loaded(&all_library_ref);
631
633 tree = build_catalog_tree(*C);
634 if (tree.catalogs.is_empty() && loading_finished) {
635 return;
636 }
637
638 layout.separator();
639
640 if (!loading_finished) {
641 layout.label(IFACE_("Loading Asset Libraries"), ICON_INFO);
642 }
643
646 item, "SCENE_MT_add_compositor_effect_catalog_assets", layout);
647 });
648
649 if (!tree.unassigned_assets.is_empty() || unassigned_local_poll(*CTX_data_main(C))) {
650 layout.separator();
651 layout.menu("SCENE_MT_add_compositor_effect_unassigned_assets",
652 IFACE_("Unassigned"),
653 ICON_FILE_HIDDEN);
654 }
655}
656
658{
659 MenuType type{};
660 STRNCPY_UTF8(type.idname, "SCENE_MT_add_compositor_effect_root_catalogs");
664 return type;
665}
666
668
669/* -------------------------------------------------------------------- */
672
673static void catalog_assets_draw(const bContext *C, Menu *menu)
674{
676
677 const std::optional<StringRefNull> menu_path = CTX_data_string_get(C, "asset_catalog_path");
678 if (!menu_path) {
679 return;
680 }
682 menu_path->data());
683 const asset_system::AssetCatalogTreeItem *catalog_item = tree.catalogs.find_item(
684 menu_path->data());
685 BLI_assert(catalog_item != nullptr);
686
687 if (assets.is_empty() && !catalog_item->has_children()) {
688 return;
689 }
690
691 ui::Layout &layout = *menu->layout;
692
693 bool first = true;
694 const auto ensure_separator = [&]() {
695 if (first) {
696 layout.separator();
697 first = false;
698 }
699 };
700
701 wmOperatorType *ot = WM_operatortype_find("SCENE_OT_add_compositor_effect_node_group_asset",
702 true);
703 for (const asset_system::AssetRepresentation *asset : assets) {
704 ensure_separator();
706 }
707
708 catalog_item->foreach_child([&](const asset_system::AssetCatalogTreeItem &item) {
709 ensure_separator();
711 item, "SCENE_MT_add_compositor_effect_catalog_assets", layout);
712 });
713}
714
716{
717 MenuType type{};
718 STRNCPY_UTF8(type.idname, "SCENE_MT_add_compositor_effect_catalog_assets");
722 return type;
723}
724
726
727/* -------------------------------------------------------------------- */
730
731static void unassigned_assets_draw(const bContext *C, Menu *menu)
732{
733 Main &bmain = *CTX_data_main(C);
735 ui::Layout &layout = *menu->layout;
736 wmOperatorType *ot = WM_operatortype_find("SCENE_OT_add_compositor_effect_node_group_asset",
737 true);
738 for (const asset_system::AssetRepresentation *asset : tree.unassigned_assets) {
740 }
741
742 bool first = true;
743 bool add_separator = !tree.unassigned_assets.is_empty();
744 for (const bNodeTree &group : bmain.nodetrees) {
745 /* Assets are displayed in other menus, and non-local data-blocks aren't added to this menu. */
746 if (group.id.library_weak_reference || ID_IS_ASSET(&group.id)) {
747 continue;
748 }
749 if (!group.compositor_node_asset_traits ||
751 {
752 continue;
753 }
754
755 if (add_separator) {
756 layout.separator();
757 add_separator = false;
758 }
759 if (first) {
760 layout.label(IFACE_("Non-Assets"), ICON_NONE);
761 first = false;
762 }
763
764 PointerRNA props_ptr = layout.op(
765 ot, group.id.name + 2, ICON_NONE, wm::OpCallContext::InvokeDefault, UI_ITEM_NONE);
767 }
768}
769
771{
772 MenuType type{};
773 STRNCPY_UTF8(type.idname, "SCENE_MT_add_compositor_effect_unassigned_assets");
776 type.description = N_(
777 "Effect node group assets not assigned to a catalog.\n"
778 "Catalogs can be assigned in the Asset Browser");
779 return type;
780}
781
783
784/* -------------------------------------------------------------------- */
787
799
801
802/* -------------------------------------------------------------------- */
805
812
814
815} // namespace blender
Main runtime representation of an asset.
#define IDP_int_get(prop)
#define STRNCPY_UTF8(dst, src)
#define TIP_(msgid)
#define IFACE_(msgid)
#define DATA_(msgid)
ID and Library types, which are fundamental for SDNA.
#define ID_IS_ASSET(_id)
Definition DNA_ID.h:743
#define ID_MISSING(_id)
Definition DNA_ID.h:695
#define FILTER_ID_NT
Definition DNA_ID.h:1215
#define MAX_NAME
Definition DNA_defs.h:63
#define C
Definition RandGen.cpp:29
#define UI_ITEM_NONE
#define ND_COMPO_RESULT
Definition WM_types.hh:466
#define NC_SCENE
Definition WM_types.hh:391
constexpr bool is_empty() const
Definition BLI_span.hh:264
void foreach_child(ItemIterFn callback) const
void foreach_root_item(ItemIterFn callback) const
const AssetCatalogTreeItem * find_item(const AssetCatalogPath &path) const
#define INT_MAX
#define main()
AssetLibraryReference all_library_reference()
void all_library_reload_catalogs_if_dirty()
SceneCompositorEffect * get_active_effect(const Scene &scene)
void remove_effect(Scene &scene, SceneCompositorEffect &effect)
SceneCompositorEffect * get_effect(const Scene &scene, StringRef name)
SceneCompositorEffect & new_effect(Scene &scene, StringRef name)
void set_active_effect(const Scene &scene, SceneCompositorEffect &effect)
SceneCompositorEffect & duplicate_effect(Scene &scene, SceneCompositorEffect &source_effect)
void update_effect_node_group_interface(Main &main, Scene &scene, SceneCompositorEffect &effect)
void node_update_asset_metadata(bNodeTree &node_tree)
Definition node.cc:2462
bNodeTree * node_tree_add_tree(Main *bmain, StringRef name, StringRef idname)
Definition node.cc:4992
bool is_loaded(const AssetLibraryReference *library_reference)
void asset_reading_region_listen_fn(const wmRegionListenerParams *params)
ID * asset_local_id_ensure_imported(Main &bmain, const asset_system::AssetRepresentation &asset, int flags=0, const std::optional< eAssetImportMethod > import_method=std::nullopt, const std::optional< ImportInstantiateContext > instantiate_context=std::nullopt, ReportList *reports=nullptr)
void operator_asset_reference_props_register(StructRNA &srna)
void draw_menu_for_catalog(const asset_system::AssetCatalogTreeItem &item, const StringRefNull menu_name, ui::Layout &layout)
void draw_asset_menu_item(const asset_system::AssetRepresentation *asset, ui::Layout &layout, FunctionRef< void(ui::Layout &, BIFIconID)> draw_item_fn)
AssetItemTree build_filtered_all_catalog_tree(const AssetLibraryReference &library_ref, const bContext &C, const AssetFilterSettings &filter_settings, FunctionRef< bool(const AssetMetaData &)> meta_data_filter={}, const std::optional< StringRef > skip_prefix=std::nullopt)
const asset_system::AssetRepresentation * operator_asset_reference_props_get_asset_from_all_library(const bContext &C, PointerRNA &ptr, ReportList *reports)
void node_tree_composit_default_init(const bContext *C, bNodeTree *ntree)
PointerRNA * region_panel_custom_data_under_cursor(const bContext *C, const wmEvent *event)
BMesh Iterators.
@ COMPOSIT_NODE_ASSET_SCENE_EFFECT
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
void WM_operatortype_append(void(*opfunc)(wmOperatorType *))
static void SCENE_OT_remove_compositor_effect(wmOperatorType *ot)
static void root_catalogs_draw(const bContext *C, Menu *menu)
static void SCENE_OT_move_compositor_effect_to_index(wmOperatorType *ot)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
bool RNA_struct_is_a(const StructRNA *type, const StructRNA *srna)
void WM_operator_properties_id_lookup(wmOperatorType *ot, const bool add_name_prop)
void id_us_plus(ID *id)
Definition lib_id.cc:433
ID * WM_operator_properties_id_lookup_from_name_or_session_uid(Main *bmain, PointerRNA *ptr, const ID_Type type)
static wmOperatorStatus add_compositor_effect_node_group_asset_exec(bContext *C, wmOperator *op)
bke::bNodeTreeType * ntreeType_Composite
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
static bNodeTree * get_asset_or_local_node_group(const bContext &C, PointerRNA &ptr, ReportList *reports)
static wmOperatorStatus compositor_effect_invoke_properties_with_hover(bContext *C, wmOperator *op, const wmEvent *event)
int RNA_int_get(PointerRNA *ptr, const char *name)
static void SCENE_OT_add_compositor_effect(wmOperatorType *ot)
void ED_menutypes_scene_compositor()
static wmOperatorStatus add_compositor_effect_exec(bContext *C, wmOperator *)
static MenuType SCENE_MT_add_compositor_effect_root_catalogs()
std::optional< StringRefNull > CTX_data_string_get(const bContext *C, const char *member)
static void unassigned_assets_draw(const bContext *C, Menu *menu)
@ LIB_ID_COPY_ACTIONS
static wmOperatorStatus remove_compositor_effect_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static void SCENE_OT_duplicate_compositor_effect(wmOperatorType *ot)
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Definition listbase.cc:593
static ed::asset::AssetItemTree build_catalog_tree(const bContext &C)
static void SCENE_OT_add_compositor_effect_node_group_asset(wmOperatorType *ot)
void DEG_id_tag_update(ID *id, unsigned int flags)
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition report.cc:162
static void SCENE_OT_duplicate_compositor_effect_node_group(wmOperatorType *ot)
static MenuType SCENE_MT_add_compositor_effect_unassigned_assets()
static wmOperatorStatus move_compositor_effect_to_index_invoke(bContext *C, wmOperator *op, const wmEvent *)
bool BLI_listbase_move_index(ListBase *listbase, int from, int to) ATTR_NONNULL()
Definition listbase.cc:474
void WM_operator_properties_id_lookup_set_from_id(PointerRNA *ptr, const ID *id)
static std::string add_compositor_effect_node_group_asset_get_description(bContext *C, wmOperatorType *, PointerRNA *properties_ptr)
static wmOperatorStatus set_active_compositor_effect_exec(bContext *C, wmOperator *op)
static void catalog_assets_draw(const bContext *C, Menu *menu)
IDProperty * BKE_asset_metadata_idprop_find(const AssetMetaData *asset_data, const char *name) ATTR_WARN_UNUSED_RESULT
Definition asset.cc:183
bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
static wmOperatorStatus set_active_compositor_effect_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static bNodeTree * get_node_group(const bContext &C, PointerRNA &properties_ptr, ReportList *reports)
static wmOperatorStatus remove_compositor_effect_exec(bContext *C, wmOperator *op)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
static wmOperatorStatus duplicate_compositor_effect_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus move_compositor_effect_to_index_exec(bContext *C, wmOperator *op)
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, const int default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
static bool unassigned_local_poll(const Main &bmain)
static wmOperatorStatus duplicate_compositor_effect_node_group_exec(bContext *C, wmOperator *op)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
Definition report.cc:191
static wmOperatorStatus duplicate_compositor_effect_exec(bContext *C, wmOperator *op)
Main * CTX_data_main(const bContext *C)
bool WM_menutype_add(MenuType *mt)
static MenuType SCENE_MT_add_compositor_effect_catalog_assets()
static void SCENE_OT_new_compositor_effect_node_group(wmOperatorType *ot)
@ ID_RECALC_COMPOSITOR
Definition DNA_ID.h:1161
@ PROP_HIDDEN
Definition RNA_types.hh:408
void DEG_relations_tag_update(Main *bmain)
Scene * CTX_data_scene(const bContext *C)
@ OPTYPE_REGISTER
Definition WM_types.hh:188
@ OPTYPE_UNDO
Definition WM_types.hh:190
@ OPTYPE_INTERNAL
Definition WM_types.hh:210
std::string RNA_string_get(PointerRNA *ptr, const char *name)
ID * BKE_id_copy_ex(Main *bmain, const ID *id, ID **new_id_p, int flag)
Definition lib_id.cc:851
static ed::asset::AssetItemTree & get_static_item_tree()
void id_us_min(ID *id)
Definition lib_id.cc:441
PointerRNA CTX_data_pointer_get_type(const bContext *C, const char *member, StructRNA *type)
void ED_operatortypes_scene_compositor()
static wmOperatorStatus new_compositor_effect_node_group_exec(bContext *C, wmOperator *)
static void SCENE_OT_set_active_compositor_effect(wmOperatorType *ot)
The meta-data of an asset. By creating and giving this for a data-block (ID.asset_data),...
char name[258]
Definition DNA_ID.h:433
struct LibraryWeakReference * library_weak_reference
Definition DNA_ID.h:529
ListBaseT< bNodeTree > nodetrees
Definition BKE_main.hh:409
char idname[BKE_ST_MAXNAME]
MenuTypeFlag flag
void(*) draw(const bContext *C, Menu *menu)
const char * description
void(*) listener(const wmRegionListenerParams *params)
ui::Layout * layout
StructRNA * type
Definition RNA_types.hh:63
SceneCompositorEffectFlags flags
ListBaseT< SceneCompositorEffect > compositor_effects
struct CompositorNodeAssetTraits * compositor_node_asset_traits
eNodeTree_Type type
std::optional< std::string > asset_catalog_path_prefix
Definition BKE_node.hh:546
MultiValueMap< asset_system::AssetCatalogPath, asset_system::AssetRepresentation * > assets_per_path
Vector< asset_system::AssetRepresentation * > unassigned_assets
asset_system::AssetCatalogTree catalogs
void label(StringRef name, int icon)
PointerRNA op(wmOperatorType *ot, std::optional< StringRef > name, int icon, wm::OpCallContext context, eUI_Item_Flag flag)
void menu(MenuType *mt, std::optional< StringRef > name, int icon)
void separator(float factor=1.0f, LayoutSeparatorType type=LayoutSeparatorType::Auto)
wmOperatorStatus(*) exec(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1125
const char * description
Definition WM_types.hh:1115
wmOperatorStatus(*) invoke(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1141
std::string(*) get_description(bContext *C, wmOperatorType *ot, PointerRNA *ptr)
Definition WM_types.hh:1197
struct ReportList * reports
#define N_(msgid)