36#include "RNA_prototypes.hh"
101 if ((fx != exclude) && (fx->type == type)) {
132 bool sort_depsgraph =
false;
151 bool sort_depsgraph =
false;
202 if (fx_index < index) {
204 for (; fx_index < index; fx_index++) {
212 for (; fx_index > index; fx_index--) {
254 const bool is_liboverride_allowed)
271 if (obtype_flag != 0 && ((1 << ob->
type) & obtype_flag) == 0) {
281 C,
"Cannot edit shaderfxs coming from linked data in a library override");
340 group_item = fx_item;
348 group_item =
nullptr;
363 ot->name =
"Add Effect";
364 ot->description =
"Add a visual effect to the active object";
365 ot->idname =
"OBJECT_OT_shaderfx_add";
393 ot->srna,
"shaderfx",
nullptr,
MAX_NAME,
"Shader",
"Name of the shaderfx to edit");
400 ot->srna,
"report",
false,
"Report",
"Create a notification after the operation");
420 if (ctx_ptr.
data !=
nullptr) {
427 if (event !=
nullptr) {
438 if (r_retval !=
nullptr) {
445 if (r_retval !=
nullptr) {
459 if (fx && type != 0 && fx->
type != type) {
509 ot->name =
"Remove Grease Pencil Effect";
510 ot->description =
"Remove a effect from the active Grease Pencil object";
511 ot->idname =
"OBJECT_OT_shaderfx_remove";
555 ot->name =
"Move Up Effect";
556 ot->description =
"Move effect up in the stack";
557 ot->idname =
"OBJECT_OT_shaderfx_move_up";
602 ot->name =
"Move Down Effect";
603 ot->description =
"Move effect down in the stack";
604 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);
706 ot->name =
"Copy Effect";
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
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
void void BLI_freelistN(ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_insertlinkafter(ListBase *listbase, void *vprevlink, void *vnewlink) ATTR_NONNULL(1)
void BLI_remlink(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_listbase_count(const ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLI_insertlinkbefore(ListBase *listbase, void *vnextlink, void *vnewlink) ATTR_NONNULL(1)
#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)
PointerRNA * UI_region_panel_custom_data_under_cursor(const bContext *C, const wmEvent *event)
static wmOperatorStatus shaderfx_move_to_index_exec(bContext *C, wmOperator *op)
void shaderfx_clear(Main *bmain, Object *ob)
static wmOperatorStatus shaderfx_remove_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 bool edit_shaderfx_poll(bContext *C)
static wmOperatorStatus shaderfx_move_to_index_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus shaderfx_add_exec(bContext *C, wmOperator *op)
static wmOperatorStatus shaderfx_copy_exec(bContext *C, wmOperator *op)
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 wmOperatorStatus shaderfx_move_down_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)
void OBJECT_OT_shaderfx_copy(wmOperatorType *ot)
void shaderfx_copy(Object *dst, ShaderFxData *fx)
static wmOperatorStatus shaderfx_move_up_invoke(bContext *C, wmOperator *op, const wmEvent *event)
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 wmOperatorStatus shaderfx_move_down_exec(bContext *C, wmOperator *op)
static bool edit_shaderfx_invoke_properties(bContext *C, wmOperator *op, const wmEvent *event, wmOperatorStatus *r_retval)
static wmOperatorStatus shaderfx_remove_exec(bContext *C, wmOperator *op)
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)
static wmOperatorStatus shaderfx_copy_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void OBJECT_OT_shaderfx_move_to_index(wmOperatorType *ot)
static wmOperatorStatus shaderfx_move_up_exec(bContext *C, wmOperator *op)
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)
int RNA_int_get(PointerRNA *ptr, const char *name)
std::string RNA_string_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
struct ReportList * reports
void WM_main_add_notifier(uint type, void *reference)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
wmOperatorStatus WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *)