41 #include "RNA_prototypes.h"
104 for (fx = ob->shader_fx.first; fx; fx = fx->
next) {
105 if ((fx != exclude) && (fx->
type ==
type)) {
116 bool *
UNUSED(r_sort_depsgraph))
136 bool sort_depsgraph =
false;
155 bool sort_depsgraph =
false;
209 if (fx_index < index) {
211 for (; fx_index < index; fx_index++) {
219 for (; fx_index > index; fx_index--) {
278 if (obtype_flag != 0 && ((1 << ob->
type) & obtype_flag) == 0) {
288 C,
"Cannot edit shaderfxs coming from linked data in a library override");
347 group_item = fx_item;
371 ot->
description =
"Add a visual effect to the active object";
372 ot->
idname =
"OBJECT_OT_shaderfx_add";
407 ot->
srna,
"report",
false,
"Report",
"Create a notification after the operation");
445 if (r_retval !=
NULL) {
452 if (r_retval !=
NULL) {
490 strcpy(name, fx->
name);
516 ot->
name =
"Remove Grease Pencil Effect";
517 ot->
description =
"Remove a effect from the active grease pencil object";
518 ot->
idname =
"OBJECT_OT_shaderfx_remove";
562 ot->
name =
"Move Up Effect";
564 ot->
idname =
"OBJECT_OT_shaderfx_move_up";
607 ot->
name =
"Move Down Effect";
609 ot->
idname =
"OBJECT_OT_shaderfx_move_down";
650 ot->
name =
"Move Effect to Index";
651 ot->
idname =
"OBJECT_OT_shaderfx_move_to_index";
653 "Change the effect's position in the list so it evaluates after the set number of "
664 ot->
srna,
"index", 0, 0, INT_MAX,
"Index",
"The index to move the effect to", 0, INT_MAX);
710 ot->
description =
"Duplicate effect at the same position in the stack";
711 ot->
idname =
"OBJECT_OT_shaderfx_copy";
struct Scene * CTX_data_scene(const bContext *C)
PointerRNA CTX_data_pointer_get_type(const bContext *C, const char *member, StructRNA *type)
void CTX_wm_operator_poll_msg_set(struct bContext *C, const char *msg)
struct Main * CTX_data_main(const bContext *C)
bool BKE_id_is_editable(const struct Main *bmain, const struct ID *id)
General operations, lookup, etc. for blender objects.
void BKE_object_free_derived_caches(struct 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)
void BKE_shaderfx_copy(struct ListBase *dst, const struct ListBase *src)
struct ShaderFxData * BKE_shaderfx_findby_type(struct Object *ob, ShaderFxType type)
void BKE_shaderfx_free(struct ShaderFxData *fx)
void BKE_shaderfx_copydata(struct ShaderFxData *fx, struct ShaderFxData *target)
const ShaderFxTypeInfo * BKE_shaderfx_get_info(ShaderFxType type)
struct ShaderFxData * BKE_shaderfx_new(int type)
struct ShaderFxData * BKE_shaderfx_findby_name(struct Object *ob, const char *name)
bool BKE_shaderfx_is_nonlocal_in_liboverride(const struct Object *ob, const struct ShaderFxData *shaderfx)
@ eShaderFxTypeFlag_NoUserAdd
@ eShaderFxTypeFlag_Single
bool BKE_shaderfx_unique_name(struct ListBase *shaderfx, struct ShaderFxData *fx)
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)
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
char * BLI_strncpy_utf8(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL(1
#define UNUSED_FUNCTION(x)
#define BLT_I18NCONTEXT_ID_ID
void DEG_id_tag_update(struct ID *id, int flag)
void DEG_relations_tag_update(struct Main *bmain)
#define ID_IS_OVERRIDE_LIBRARY(_id)
Object is a sort of wrapper for general info.
struct Object * ED_object_active_context(const struct bContext *C)
bool ED_operator_object_active_editable_ex(struct bContext *C, const Object *ob)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
Read Guarded memory(de)allocation.
struct PointerRNA * UI_region_panel_custom_data_under_cursor(const struct bContext *C, const struct wmEvent *event)
SyclQueue void void * src
static const EnumPropertyItem * shaderfx_add_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free)
static int shaderfx_move_to_index_exec(bContext *C, wmOperator *op)
static int shaderfx_add_exec(bContext *C, wmOperator *op)
void OBJECT_OT_shaderfx_move_to_index(wmOperatorType *ot)
static int shaderfx_remove_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static int shaderfx_move_up_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static int shaderfx_move_down_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void OBJECT_OT_shaderfx_add(wmOperatorType *ot)
static int shaderfx_move_up_exec(bContext *C, wmOperator *op)
static int shaderfx_copy_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static void edit_shaderfx_properties(wmOperatorType *ot)
void OBJECT_OT_shaderfx_move_up(wmOperatorType *ot)
static int shaderfx_remove_exec(bContext *C, wmOperator *op)
static int shaderfx_copy_exec(bContext *C, wmOperator *op)
int ED_object_shaderfx_move_down(ReportList *UNUSED(reports), Object *ob, ShaderFxData *fx)
void ED_object_shaderfx_copy(Object *dst, ShaderFxData *fx)
static void edit_shaderfx_report_property(wmOperatorType *ot)
static bool edit_shaderfx_invoke_properties(bContext *C, wmOperator *op, const wmEvent *event, int *r_retval)
static bool object_shaderfx_remove(Main *bmain, Object *ob, ShaderFxData *fx, bool *UNUSED(r_sort_depsgraph))
static bool UNUSED_FUNCTION() object_has_shaderfx(const Object *ob, const ShaderFxData *exclude, ShaderFxType type)
void OBJECT_OT_shaderfx_copy(wmOperatorType *ot)
static bool edit_shaderfx_poll(bContext *C)
void OBJECT_OT_shaderfx_remove(wmOperatorType *ot)
int ED_object_shaderfx_move_up(ReportList *UNUSED(reports), Object *ob, ShaderFxData *fx)
bool ED_object_shaderfx_move_to_index(ReportList *reports, Object *ob, ShaderFxData *fx, const int index)
void ED_object_shaderfx_link(Object *dst, Object *src)
void OBJECT_OT_shaderfx_move_down(wmOperatorType *ot)
bool ED_object_shaderfx_remove(ReportList *reports, Main *bmain, Object *ob, ShaderFxData *fx)
static int shaderfx_move_to_index_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static int shaderfx_move_down_exec(bContext *C, wmOperator *op)
void ED_object_shaderfx_clear(Main *bmain, Object *ob)
ShaderFxData * ED_object_shaderfx_add(ReportList *reports, Main *bmain, Scene *UNUSED(scene), Object *ob, const char *name, int type)
static bool edit_shaderfx_poll_generic(bContext *C, StructRNA *rna_type, int obtype_flag, const bool is_liboverride_allowed)
static ShaderFxData * edit_shaderfx_property_get(wmOperator *op, Object *ob, int type)
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_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool 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_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen, 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)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, int default_value, int hardmin, int hardmax, const char *ui_name, const char *ui_description, int softmin, int softmax)
void RNA_def_enum_funcs(PropertyRNA *prop, EnumPropertyItemFunc itemfunc)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
const EnumPropertyItem rna_enum_object_shaderfx_type_items[]
struct ShaderFxData * prev
struct ShaderFxData * next
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
void WM_main_add_notifier(unsigned int 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 *UNUSED(event))