22#include "RNA_prototypes.hh"
86 if (panel_ptr ==
nullptr || !*panel_ptr) {
124 ot->
name =
"Add Scene Effect";
125 ot->
idname =
"SCENE_OT_add_compositor_effect";
126 ot->
description =
"Add a compositor effect to the scene";
175 ot->
name =
"Remove Scene Effect";
176 ot->
idname =
"SCENE_OT_remove_compositor_effect";
177 ot->
description =
"Remove a scene effect from the scene";
185 ot->
srna,
"name",
"Name",
MAX_NAME,
"Name",
"Name of the effect to remove");
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";
254 "Name of the effect to duplicate. If empty duplicate the active effect");
298 ot->
name =
"Move Active Scene Effect to Index";
300 "Change the scene effect's index in the stack so it evaluates after the set number of "
302 ot->
idname =
"SCENE_OT_move_compositor_effect_to_index";
313 ot->
srna,
"index", 0, 0,
INT_MAX,
"Index",
"The index to move the effect to", 0,
INT_MAX);
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";
362 ot->
srna,
"name",
nullptr,
MAX_NAME,
"Name",
"Name of the strip effect to edit");
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";
442 if (!original_node_group ||
ID_MISSING(original_node_group)) {
448 bNodeTree *node_tree = id_cast<bNodeTree *>(
466 ot->
name =
"Duplicate Scene Effect Node Group";
467 ot->
idname =
"SCENE_OT_duplicate_compositor_effect_node_group";
469 "Duplicate the scene effect node group and assign the new node group to the effect";
549 *
C, *properties_ptr,
nullptr);
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";
590 auto meta_data_filter = [&](
const AssetMetaData &meta_data) {
596 &meta_data,
"compositor_node_asset_traits_flag");
640 if (!loading_finished) {
641 layout.
label(
IFACE_(
"Loading Asset Libraries"), ICON_INFO);
646 item,
"SCENE_MT_add_compositor_effect_catalog_assets", layout);
651 layout.
menu(
"SCENE_MT_add_compositor_effect_unassigned_assets",
694 const auto ensure_separator = [&]() {
711 item,
"SCENE_MT_add_compositor_effect_catalog_assets", layout);
757 add_separator =
false;
777 "Effect node group assets not assigned to a catalog.\n"
778 "Catalogs can be assigned in the Asset Browser");
Main runtime representation of an asset.
#define IDP_int_get(prop)
#define STRNCPY_UTF8(dst, src)
ID and Library types, which are fundamental for SDNA.
constexpr bool is_empty() const
void foreach_child(ItemIterFn callback) const
bool has_children() const
void foreach_root_item(ItemIterFn callback) const
const AssetCatalogTreeItem * find_item(const AssetCatalogPath &path) const
AssetMetaData & get_metadata() const
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)
bNodeTree * node_tree_add_tree(Main *bmain, StringRef name, StringRef idname)
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)
@ 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)
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)
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)
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)
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()
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)
SceneCompositorEffectFlags
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
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
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)
void DEG_relations_tag_update(Main *bmain)
Scene * CTX_data_scene(const bContext *C)
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)
static ed::asset::AssetItemTree & get_static_item_tree()
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)
struct LibraryWeakReference * library_weak_reference
ListBaseT< bNodeTree > nodetrees
struct bNodeTree * node_group
SceneCompositorEffectFlags flags
ListBaseT< SceneCompositorEffect > compositor_effects
struct CompositorNodeAssetTraits * compositor_node_asset_traits
std::optional< std::string > asset_catalog_path_prefix
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
wmOperatorStatus(*) invoke(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
std::string(*) get_description(bContext *C, wmOperatorType *ot, PointerRNA *ptr)
struct ReportList * reports