Blender V5.3
object_shader_fx.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2018 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include <cstdlib>
10#include <cstring>
11
13#include "DNA_object_types.h"
14#include "DNA_scene_types.h"
15#include "DNA_shader_fx_types.h"
16
17#include "BLI_listbase.hh"
18#include "BLI_string.hh"
19#include "BLI_string_utf8.hh"
20#include "BLI_utildefines.hh"
21
22#include "BLT_translation.hh"
23
24#include "BKE_context.hh"
25#include "BKE_lib_id.hh"
26#include "BKE_object.hh"
27#include "BKE_report.hh"
28#include "BKE_shader_fx.hh"
29
30#include "DEG_depsgraph.hh"
32
33#include "RNA_access.hh"
34#include "RNA_define.hh"
35#include "RNA_enum_types.hh"
36#include "RNA_prototypes.hh"
37
38#include "ED_object.hh"
39#include "ED_screen.hh"
40
41#include "UI_interface.hh"
42
43#include "WM_api.hh"
44#include "WM_types.hh"
45
46#include "object_intern.hh"
47
48namespace blender::ed::object {
49
50/* -------------------------------------------------------------------- */
53
55 ReportList *reports, Main *bmain, Scene * /*scene*/, Object *ob, const char *name, int type)
56{
57 ShaderFxData *new_fx = nullptr;
59
60 if (!ELEM(ob->type, OB_GREASE_PENCIL)) {
61 BKE_reportf(reports, RPT_WARNING, "Effect cannot be added to object '%s'", ob->id.name + 2);
62 return nullptr;
63 }
64
67 BKE_report(reports, RPT_WARNING, "Only one Effect of this type is allowed");
68 return nullptr;
69 }
70 }
71
72 /* get new effect data to add */
73 new_fx = BKE_shaderfx_new(ShaderFxType(type));
74
75 BLI_addtail(&ob->shader_fx, new_fx);
76
77 if (name) {
78 STRNCPY_UTF8(new_fx->name, name);
79 }
80
81 /* make sure effect data has unique name */
83
85 GreasePencil *grease_pencil = id_cast<GreasePencil *>(ob->data);
87
90
91 return new_fx;
92}
93
94/* Return true if the object has a effect of type 'type' other than
95 * the shaderfx pointed to be 'exclude', otherwise returns false. */
97 const ShaderFxData *exclude,
98 ShaderFxType type)
99{
100 for (ShaderFxData &fx : ob->shader_fx) {
101 if ((&fx != exclude) && (fx.type == type)) {
102 return true;
103 }
104 }
105
106 return false;
107}
108
109static bool object_shaderfx_remove(Main *bmain,
110 Object *ob,
111 ShaderFxData *fx,
112 bool * /*r_sort_depsgraph*/)
113{
114 /* It seems on rapid delete it is possible to
115 * get called twice on same effect, so make
116 * sure it is in list. */
117 if (BLI_findindex(&ob->shader_fx, fx) == -1) {
118 return false;
119 }
120
122
123 BLI_remlink(&ob->shader_fx, fx);
126
127 return true;
128}
129
130bool shaderfx_remove(ReportList *reports, Main *bmain, Object *ob, ShaderFxData *fx)
131{
132 bool sort_depsgraph = false;
133 bool ok;
134
135 ok = object_shaderfx_remove(bmain, ob, fx, &sort_depsgraph);
136
137 if (!ok) {
138 BKE_reportf(reports, RPT_ERROR, "Effect '%s' not in object '%s'", fx->name, ob->id.name);
139 return false;
140 }
141
144
145 return true;
146}
147
148void shaderfx_clear(Main *bmain, Object *ob)
149{
150 ShaderFxData *fx = ob->shader_fx.first();
151 bool sort_depsgraph = false;
152
153 if (!fx) {
154 return;
155 }
156
157 while (fx) {
158 ShaderFxData *next_fx;
159
160 next_fx = fx->next;
161
162 object_shaderfx_remove(bmain, ob, fx, &sort_depsgraph);
163
164 fx = next_fx;
165 }
166
169}
170
171int shaderfx_move_up(ReportList * /*reports*/, Object *ob, ShaderFxData *fx)
172{
173 if (fx->prev) {
174 BLI_remlink(&ob->shader_fx, fx);
175 BLI_insertlinkbefore(&ob->shader_fx, fx->prev, fx);
176 }
177
178 return 1;
179}
180
182{
183 if (fx->next) {
184 BLI_remlink(&ob->shader_fx, fx);
185 BLI_insertlinkafter(&ob->shader_fx, fx->next, fx);
186 }
187
188 return 1;
189}
190
191bool shaderfx_move_to_index(ReportList *reports, Object *ob, ShaderFxData *fx, const int index)
192{
193 BLI_assert(fx != nullptr);
194 BLI_assert(index >= 0);
195 if (index >= ob->shader_fx.count()) {
196 BKE_report(reports, RPT_WARNING, "Cannot move effect beyond the end of the stack");
197 return false;
198 }
199
200 int fx_index = BLI_findindex(&ob->shader_fx, fx);
201 BLI_assert(fx_index != -1);
202 if (fx_index < index) {
203 /* Move shaderfx down in list. */
204 for (; fx_index < index; fx_index++) {
205 if (!shaderfx_move_down(reports, ob, fx)) {
206 break;
207 }
208 }
209 }
210 else {
211 /* Move shaderfx up in list. */
212 for (; fx_index > index; fx_index--) {
213 if (!shaderfx_move_up(reports, ob, fx)) {
214 break;
215 }
216 }
217 }
218
221
222 return true;
223}
224
226{
227 dst->shader_fx.free_no_destruct();
229
232}
233
235{
237 STRNCPY_UTF8(nfx->name, fx->name);
238 BKE_shaderfx_copydata(fx, nfx);
239 BLI_addtail(&dst->shader_fx, nfx);
240
243}
244
246
247/* -------------------------------------------------------------------- */
250
252 StructRNA *rna_type,
253 int obtype_flag,
254 const bool is_liboverride_allowed)
255{
256 PointerRNA ptr = CTX_data_pointer_get_type(C, "shaderfx", rna_type);
257 Object *ob = (ptr.owner_id) ? id_cast<Object *>(ptr.owner_id) : context_active_object(C);
258 ShaderFxData *fx = static_cast<ShaderFxData *>(ptr.data); /* May be nullptr. */
259
261 return false;
262 }
263
264 /* NOTE: Temporary 'forbid all' for overrides, until we implement support to add shaderfx to
265 * overrides. */
266 if (ID_IS_OVERRIDE_LIBRARY(ob)) {
267 CTX_wm_operator_poll_msg_set(C, "Cannot edit shaderfxs in a library override");
268 return false;
269 }
270
271 if (obtype_flag != 0 && ((1 << ob->type) & obtype_flag) == 0) {
272 CTX_wm_operator_poll_msg_set(C, "Object type is not supported");
273 return false;
274 }
275 if (ptr.owner_id != nullptr && !BKE_id_is_editable(CTX_data_main(C), ptr.owner_id)) {
276 CTX_wm_operator_poll_msg_set(C, "Cannot edit library or override data");
277 return false;
278 }
279 if (!is_liboverride_allowed && BKE_shaderfx_is_nonlocal_in_liboverride(ob, fx)) {
281 C, "Cannot edit shaderfxs coming from linked data in a library override");
282 return false;
283 }
284
285 return true;
286}
287
289{
290 return edit_shaderfx_poll_generic(C, RNA_ShaderFx, 0, false);
291}
292
294
295/* -------------------------------------------------------------------- */
298
300{
301 Main *bmain = CTX_data_main(C);
302 Scene *scene = CTX_data_scene(C);
304 int type = RNA_enum_get(op->ptr, "type");
305
306 if (!shaderfx_add(op->reports, bmain, scene, ob, nullptr, type)) {
307 return OPERATOR_CANCELLED;
308 }
309
311
312 return OPERATOR_FINISHED;
313}
314
316 PointerRNA * /*ptr*/,
317 PropertyRNA * /*prop*/,
318 bool *r_free)
319{
320 Object *ob = (C) ? context_active_object(C) : nullptr;
321 EnumPropertyItem *item = nullptr;
322 const EnumPropertyItem *fx_item, *group_item = nullptr;
323 const ShaderFxTypeInfo *mti;
324 int totitem = 0, a;
325
326 if (!ob) {
328 }
329
332 if (fx_item->identifier[0]) {
334
336 continue;
337 }
338 }
339 else {
340 group_item = fx_item;
341 fx_item = nullptr;
342
343 continue;
344 }
345
346 if (group_item) {
347 RNA_enum_item_add(&item, &totitem, group_item);
348 group_item = nullptr;
349 }
350
351 RNA_enum_item_add(&item, &totitem, fx_item);
352 }
353
354 RNA_enum_item_end(&item, &totitem);
355 *r_free = true;
356
357 return item;
358}
359
361{
362 /* identifiers */
363 ot->name = "Add Effect";
364 ot->description = "Add a visual effect to the active object";
365 ot->idname = "OBJECT_OT_shaderfx_add";
366
367 /* API callbacks. */
371
372 /* flags */
374
375 /* properties */
376 ot->prop = RNA_def_enum(
379
380 /* Abused, for "Light"... */
382}
383
385
386/* -------------------------------------------------------------------- */
389
391{
393 ot->srna, "shaderfx", nullptr, MAX_NAME, "Shader", "Name of the shaderfx to edit");
395}
396
398{
400 ot->srna, "report", false, "Report", "Create a notification after the operation");
402}
403
411 wmOperator *op,
412 const wmEvent *event,
413 wmOperatorStatus *r_retval)
414{
415 if (RNA_struct_property_is_set(op->ptr, "shaderfx")) {
416 return true;
417 }
418
419 PointerRNA ctx_ptr = CTX_data_pointer_get_type(C, "shaderfx", RNA_ShaderFx);
420 if (ctx_ptr) {
421 ShaderFxData *fx = static_cast<ShaderFxData *>(ctx_ptr.data);
422 RNA_string_set(op->ptr, "shaderfx", fx->name);
423 return true;
424 }
425
426 if (event == nullptr) {
427 if (r_retval != nullptr) {
428 *r_retval = OPERATOR_CANCELLED;
429 }
430 return false;
431 }
432
433 /* Check the custom data of panels under the mouse for an effect. */
435
436 if (panel_ptr == nullptr || !*panel_ptr) {
437 /* The operators using this function can typically be called from UIs that aren't related to
438 * the ShaderFx UI at all. So include #OPERATOR_PASS_THROUGH to not block events from reaching
439 * other operators/handlers. */
441 return false;
442 }
443
444 if (!RNA_struct_is_a(panel_ptr->type, RNA_ShaderFx)) {
445 /* Work around multiple operators using the same shortcut. The operators for the other
446 * stacks in the property editor use the same key, and will not run after these return
447 * OPERATOR_CANCELLED. */
449 return false;
450 }
451
452 ShaderFxData *fx = static_cast<ShaderFxData *>(panel_ptr->data);
453 RNA_string_set(op->ptr, "shaderfx", fx->name);
454 return true;
455}
456
458{
459 char shaderfx_name[MAX_NAME];
460 ShaderFxData *fx;
461 RNA_string_get(op->ptr, "shaderfx", shaderfx_name);
462
463 fx = BKE_shaderfx_findby_name(ob, shaderfx_name);
464
465 if (fx && type != 0 && fx->type != type) {
466 fx = nullptr;
467 }
468
469 return fx;
470}
471
473
474/* -------------------------------------------------------------------- */
477
479{
480 Main *bmain = CTX_data_main(C);
483 if (!fx) {
484 return OPERATOR_CANCELLED;
485 }
486
487 /* Store name temporarily for report. */
488 char name[MAX_NAME];
489 STRNCPY_UTF8(name, fx->name);
490
491 if (!shaderfx_remove(op->reports, bmain, ob, fx)) {
492 return OPERATOR_CANCELLED;
493 }
494
495 if (RNA_boolean_get(op->ptr, "report")) {
496 BKE_reportf(op->reports, RPT_INFO, "Removed effect: %s", name);
497 }
498
500
501 return OPERATOR_FINISHED;
502}
503
505{
506 wmOperatorStatus retval;
507 if (edit_shaderfx_invoke_properties(C, op, event, &retval)) {
508 return shaderfx_remove_exec(C, op);
509 }
510 return retval;
511}
512
514{
515 ot->name = "Remove Grease Pencil Effect";
516 ot->description = "Remove a effect from the active Grease Pencil object";
517 ot->idname = "OBJECT_OT_shaderfx_remove";
518
522
523 /* flags */
527}
528
530
531/* -------------------------------------------------------------------- */
534
536{
539
540 if (!fx || !shaderfx_move_up(op->reports, ob, fx)) {
541 return OPERATOR_CANCELLED;
542 }
543
546
547 return OPERATOR_FINISHED;
548}
549
551{
552 wmOperatorStatus retval;
553 if (edit_shaderfx_invoke_properties(C, op, event, &retval)) {
554 return shaderfx_move_up_exec(C, op);
555 }
556 return retval;
557}
558
560{
561 ot->name = "Move Up Effect";
562 ot->description = "Move effect up in the stack";
563 ot->idname = "OBJECT_OT_shaderfx_move_up";
564
568
569 /* flags */
572}
573
575
576/* -------------------------------------------------------------------- */
579
581{
584
585 if (!fx || !shaderfx_move_down(op->reports, ob, fx)) {
586 return OPERATOR_CANCELLED;
587 }
588
591
592 return OPERATOR_FINISHED;
593}
594
596 wmOperator *op,
597 const wmEvent *event)
598{
599 wmOperatorStatus retval;
600 if (edit_shaderfx_invoke_properties(C, op, event, &retval)) {
601 return shaderfx_move_down_exec(C, op);
602 }
603 return retval;
604}
605
607{
608 ot->name = "Move Down Effect";
609 ot->description = "Move effect down in the stack";
610 ot->idname = "OBJECT_OT_shaderfx_move_down";
611
615
616 /* flags */
619}
620
622
623/* -------------------------------------------------------------------- */
626
628{
631 int index = RNA_int_get(op->ptr, "index");
632
633 if (!fx || !shaderfx_move_to_index(op->reports, ob, fx, index)) {
634 return OPERATOR_CANCELLED;
635 }
636
637 return OPERATOR_FINISHED;
638}
639
641 wmOperator *op,
642 const wmEvent *event)
643{
644 wmOperatorStatus retval;
645 if (edit_shaderfx_invoke_properties(C, op, event, &retval)) {
646 return shaderfx_move_to_index_exec(C, op);
647 }
648 return retval;
649}
650
652{
653 ot->name = "Move Effect to Index";
654 ot->idname = "OBJECT_OT_shaderfx_move_to_index";
655 ot->description =
656 "Change the effect's position in the list so it evaluates after the set number of "
657 "others";
658
662
663 /* flags */
667 ot->srna, "index", 0, 0, INT_MAX, "Index", "The index to move the effect to", 0, INT_MAX);
668}
669
671
672/* -------------------------------------------------------------------- */
675
677{
680 if (!fx) {
681 return OPERATOR_CANCELLED;
682 }
684 if (!nfx) {
685 return OPERATOR_CANCELLED;
686 }
687
688 STRNCPY_UTF8(nfx->name, fx->name);
689 /* Make sure effect data has unique name. */
691
692 BKE_shaderfx_copydata(fx, nfx);
693 BLI_insertlinkafter(&ob->shader_fx, fx, nfx);
694
697
698 return OPERATOR_FINISHED;
699}
700
702{
703 wmOperatorStatus retval;
704 if (edit_shaderfx_invoke_properties(C, op, event, &retval)) {
705 return shaderfx_copy_exec(C, op);
706 }
707 return retval;
708}
709
711{
712 ot->name = "Copy Effect";
713 ot->description = "Duplicate effect at the same position in the stack";
714 ot->idname = "OBJECT_OT_shaderfx_copy";
715
719
720 /* flags */
723}
724
726
727} // namespace blender::ed::object
General operations, lookup, etc. for blender objects.
#define STRNCPY_UTF8(dst, src)
#define BLT_I18NCONTEXT_ID_ID
#define ID_IS_OVERRIDE_LIBRARY(_id)
Definition DNA_ID.h:736
#define MAX_NAME
Definition DNA_defs.h:63
Object is a sort of wrapper for general info.
#define C
Definition RandGen.cpp:29
#define ND_SHADERFX
Definition WM_types.hh:512
#define NC_OBJECT
Definition WM_types.hh:392
#define UNUSED_FUNCTION(x)
#define ELEM(...)
#define INT_MAX
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)
PointerRNA * region_panel_custom_data_under_cursor(const bContext *C, const wmEvent *event)
void WM_main_add_notifier(uint type, void *reference)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
void RNA_def_enum_funcs(PropertyRNA *prop, EnumPropertyItemFunc itemfunc)
wmOperatorStatus WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *)
void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
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)
@ RPT_WARNING
Definition BKE_report.hh:40
bool RNA_struct_is_a(const StructRNA *type, const StructRNA *srna)
ShaderFxData * BKE_shaderfx_new(ShaderFxType type)
Definition shader_fx.cc:56
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
int RNA_int_get(PointerRNA *ptr, const char *name)
ShaderFxData * BKE_shaderfx_findby_type(Object *ob, ShaderFxType type)
Definition shader_fx.cc:226
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Definition listbase.cc:593
void BKE_shaderfx_unique_name(ListBaseT< ShaderFxData > *shaders, ShaderFxData *fx)
Definition shader_fx.cc:118
void CTX_wm_operator_poll_msg_set(bContext *C, const char *msg)
void BKE_object_free_derived_caches(Object *ob)
Definition object.cc:1810
void BLI_remlink(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:138
void DEG_id_tag_update(ID *id, unsigned int flags)
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition report.cc:162
void BLI_insertlinkafter(ListBase *listbase, void *vprevlink, void *vnewlink) ATTR_NONNULL(1)
Definition listbase.cc:339
bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void BLI_insertlinkbefore(ListBase *listbase, void *vnextlink, void *vnewlink) ATTR_NONNULL(1)
Definition listbase.cc:378
ShaderFxData * BKE_shaderfx_findby_name(Object *ob, const char *name)
Definition shader_fx.cc:252
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void BKE_shaderfx_free(ShaderFxData *fx)
Definition shader_fx.cc:113
bool BKE_shaderfx_is_nonlocal_in_liboverride(const Object *ob, const ShaderFxData *shaderfx)
Definition shader_fx.cc:144
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)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
Definition report.cc:191
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:118
Main * CTX_data_main(const bContext *C)
@ eShaderFxTypeFlag_NoUserAdd
@ eShaderFxTypeFlag_Single
void BKE_shaderfx_copydata(ShaderFxData *fx, ShaderFxData *target)
Definition shader_fx.cc:208
@ ID_RECALC_TRANSFORM
Definition DNA_ID.h:1054
@ ID_RECALC_GEOMETRY
Definition DNA_ID.h:1074
@ PROP_SKIP_SAVE
Definition RNA_types.hh:414
@ 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)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
bool BKE_id_is_editable(const Main *bmain, const ID *id)
Definition lib_id.cc:2782
void BKE_shaderfx_copy(ListBaseT< ShaderFxData > *dst, const ListBaseT< ShaderFxData > *src)
Definition shader_fx.cc:213
bool ED_operator_object_active_editable_ex(bContext *C, const Object *ob)
const EnumPropertyItem rna_enum_object_shaderfx_type_items[]
PointerRNA CTX_data_pointer_get_type(const bContext *C, const char *member, StructRNA *type)
const ShaderFxTypeInfo * BKE_shaderfx_get_info(ShaderFxType type)
Definition shader_fx.cc:134
char name[258]
Definition DNA_ID.h:433
ListBaseT< ShaderFxData > shader_fx
StructRNA * type
Definition RNA_types.hh:63
struct ShaderFxData * prev
struct ShaderFxData * next
wmOperatorStatus(*) exec(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1125
const char * description
Definition WM_types.hh:1115
bool(*) poll(bContext *C) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1165
wmOperatorStatus(*) invoke(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1141
struct ReportList * reports