40#include "RNA_prototypes.hh"
105 if ((fx != exclude) && (fx->type == type)) {
136 bool sort_depsgraph =
false;
155 bool sort_depsgraph =
false;
206 if (fx_index < index) {
208 for (; fx_index < index; fx_index++) {
216 for (; fx_index > index; fx_index--) {
258 const bool is_liboverride_allowed)
275 if (obtype_flag != 0 && ((1 << ob->
type) & obtype_flag) == 0) {
285 C,
"Cannot edit shaderfxs coming from linked data in a library override");
344 group_item = fx_item;
352 group_item =
nullptr;
368 ot->
description =
"Add a visual effect to the active object";
369 ot->
idname =
"OBJECT_OT_shaderfx_add";
397 ot->
srna,
"shaderfx",
nullptr,
MAX_NAME,
"Shader",
"Name of the shaderfx to edit");
404 ot->
srna,
"report",
false,
"Report",
"Create a notification after the operation");
424 if (ctx_ptr.
data !=
nullptr) {
431 if (event !=
nullptr) {
442 if (r_retval !=
nullptr) {
449 if (r_retval !=
nullptr) {
463 if (fx && type != 0 && fx->
type != type) {
513 ot->
name =
"Remove Grease Pencil Effect";
514 ot->
description =
"Remove a effect from the active grease pencil object";
515 ot->
idname =
"OBJECT_OT_shaderfx_remove";
559 ot->
name =
"Move Up Effect";
561 ot->
idname =
"OBJECT_OT_shaderfx_move_up";
604 ot->
name =
"Move Down Effect";
606 ot->
idname =
"OBJECT_OT_shaderfx_move_down";
647 ot->
name =
"Move Effect to Index";
648 ot->
idname =
"OBJECT_OT_shaderfx_move_to_index";
650 "Change the effect's position in the list so it evaluates after the set number of "
661 ot->
srna,
"index", 0, 0, INT_MAX,
"Index",
"The index to move the effect to", 0, INT_MAX);
707 ot->
description =
"Duplicate effect at the same position in the stack";
708 ot->
idname =
"OBJECT_OT_shaderfx_copy";
PointerRNA CTX_data_pointer_get_type(const bContext *C, const char *member, StructRNA *type)
void CTX_wm_operator_poll_msg_set(bContext *C, const char *msg)
Scene * CTX_data_scene(const bContext *C)
Main * CTX_data_main(const bContext *C)
bool BKE_id_is_editable(const Main *bmain, const ID *id)
General operations, lookup, etc. for blender objects.
void BKE_object_free_derived_caches(Object *ob)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
struct ShaderFxData * BKE_shaderfx_findby_type(struct Object *ob, ShaderFxType type)
void BKE_shaderfx_copy(struct ListBase *dst, const struct ListBase *src)
struct ShaderFxData * BKE_shaderfx_new(int type)
void BKE_shaderfx_free(struct ShaderFxData *fx)
void BKE_shaderfx_copydata(struct ShaderFxData *fx, struct ShaderFxData *target)
bool BKE_shaderfx_is_nonlocal_in_liboverride(const struct Object *ob, const struct ShaderFxData *shaderfx)
const ShaderFxTypeInfo * BKE_shaderfx_get_info(ShaderFxType type)
struct ShaderFxData * BKE_shaderfx_findby_name(struct Object *ob, const char *name)
void BKE_shaderfx_unique_name(struct ListBase *shaders, struct ShaderFxData *fx)
@ eShaderFxTypeFlag_NoUserAdd
@ eShaderFxTypeFlag_Single
#define LISTBASE_FOREACH(type, var, list)
void BLI_insertlinkafter(struct ListBase *listbase, void *vprevlink, void *vnewlink) ATTR_NONNULL(1)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLI_insertlinkbefore(struct ListBase *listbase, void *vnextlink, void *vnewlink) ATTR_NONNULL(1)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define STRNCPY(dst, src)
#define STRNCPY_UTF8(dst, src)
#define UNUSED_FUNCTION(x)
#define BLT_I18NCONTEXT_ID_ID
void DEG_id_tag_update(ID *id, unsigned int flags)
void DEG_relations_tag_update(Main *bmain)
#define ID_IS_OVERRIDE_LIBRARY(_id)
Object is a sort of wrapper for general info.
bool ED_operator_object_active_editable_ex(bContext *C, const Object *ob)
Read Guarded memory(de)allocation.
PointerRNA * UI_region_panel_custom_data_under_cursor(const bContext *C, const wmEvent *event)
static int shaderfx_move_down_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static int shaderfx_copy_exec(bContext *C, wmOperator *op)
static int shaderfx_move_up_exec(bContext *C, wmOperator *op)
static int shaderfx_move_to_index_exec(bContext *C, wmOperator *op)
static int shaderfx_remove_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void shaderfx_clear(Main *bmain, Object *ob)
static int shaderfx_copy_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static bool UNUSED_FUNCTION object_has_shaderfx(const Object *ob, const ShaderFxData *exclude, ShaderFxType type)
static ShaderFxData * edit_shaderfx_property_get(wmOperator *op, Object *ob, int type)
int shaderfx_move_up(ReportList *reports, Object *ob, ShaderFxData *fx)
static int shaderfx_move_down_exec(bContext *C, wmOperator *op)
static bool edit_shaderfx_poll(bContext *C)
static int shaderfx_remove_exec(bContext *C, wmOperator *op)
static bool edit_shaderfx_invoke_properties(bContext *C, wmOperator *op, const wmEvent *event, int *r_retval)
ShaderFxData * shaderfx_add(ReportList *reports, Main *bmain, Scene *scene, Object *ob, const char *name, int type)
void OBJECT_OT_shaderfx_add(wmOperatorType *ot)
static bool object_shaderfx_remove(Main *bmain, Object *ob, ShaderFxData *fx, bool *)
static int shaderfx_move_to_index_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static void edit_shaderfx_report_property(wmOperatorType *ot)
static const EnumPropertyItem * shaderfx_add_itemf(bContext *C, PointerRNA *, PropertyRNA *, bool *r_free)
int shaderfx_move_down(ReportList *reports, Object *ob, ShaderFxData *fx)
static int shaderfx_add_exec(bContext *C, wmOperator *op)
void OBJECT_OT_shaderfx_copy(wmOperatorType *ot)
void shaderfx_copy(Object *dst, ShaderFxData *fx)
Object * context_active_object(const bContext *C)
static bool edit_shaderfx_poll_generic(bContext *C, StructRNA *rna_type, int obtype_flag, const bool is_liboverride_allowed)
void OBJECT_OT_shaderfx_remove(wmOperatorType *ot)
void OBJECT_OT_shaderfx_move_up(wmOperatorType *ot)
static void edit_shaderfx_properties(wmOperatorType *ot)
bool shaderfx_remove(ReportList *reports, Main *bmain, Object *ob, ShaderFxData *fx)
void OBJECT_OT_shaderfx_move_down(wmOperatorType *ot)
bool shaderfx_move_to_index(ReportList *reports, Object *ob, ShaderFxData *fx, int index)
void OBJECT_OT_shaderfx_move_to_index(wmOperatorType *ot)
static int shaderfx_move_up_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void shaderfx_link(Object *dst, Object *src)
bool RNA_struct_is_a(const StructRNA *type, const StructRNA *srna)
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
void RNA_string_get(PointerRNA *ptr, const char *name, char *value)
int RNA_int_get(PointerRNA *ptr, const char *name)
bool RNA_pointer_is_null(const PointerRNA *ptr)
bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_enum_funcs(PropertyRNA *prop, EnumPropertyItemFunc itemfunc)
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)
const EnumPropertyItem rna_enum_object_shaderfx_type_items[]
struct ShaderFxData * prev
struct ShaderFxData * next
bool(* poll)(bContext *C) ATTR_WARN_UNUSED_RESULT
int(* invoke)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
int(* exec)(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
void WM_main_add_notifier(uint type, void *reference)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
int WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *)