Blender V5.0
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.h"
18#include "BLI_string.h"
19#include "BLI_string_utf8.h"
20#include "BLI_utildefines.h"
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.h"
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(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 = static_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 LISTBASE_FOREACH (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 = static_cast<ShaderFxData *>(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 >= BLI_listbase_count(&ob->shader_fx)) {
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
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) ? (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{
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
330 for (a = 0; rna_enum_object_shaderfx_type_items[a].identifier; a++) {
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. */
368 ot->invoke = WM_menu_invoke;
369 ot->exec = shaderfx_add_exec;
370 ot->poll = edit_shaderfx_poll;
371
372 /* flags */
374
375 /* properties */
376 ot->prop = RNA_def_enum(
377 ot->srna, "type", rna_enum_object_shaderfx_type_items, eShaderFxType_Blur, "Type", "");
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.data != nullptr) {
421 ShaderFxData *fx = static_cast<ShaderFxData *>(ctx_ptr.data);
422 RNA_string_set(op->ptr, "shaderfx", fx->name);
423 return true;
424 }
425
426 /* Check the custom data of panels under the mouse for an effect. */
427 if (event != nullptr) {
429
430 if (!(panel_ptr == nullptr || RNA_pointer_is_null(panel_ptr))) {
431 if (RNA_struct_is_a(panel_ptr->type, &RNA_ShaderFx)) {
432 ShaderFxData *fx = static_cast<ShaderFxData *>(panel_ptr->data);
433 RNA_string_set(op->ptr, "shaderfx", fx->name);
434 return true;
435 }
436
437 BLI_assert(r_retval != nullptr); /* We need the return value in this case. */
438 if (r_retval != nullptr) {
440 }
441 return false;
442 }
443 }
444
445 if (r_retval != nullptr) {
446 *r_retval = OPERATOR_CANCELLED;
447 }
448 return false;
449}
450
452{
453 char shaderfx_name[MAX_NAME];
454 ShaderFxData *fx;
455 RNA_string_get(op->ptr, "shaderfx", shaderfx_name);
456
457 fx = BKE_shaderfx_findby_name(ob, shaderfx_name);
458
459 if (fx && type != 0 && fx->type != type) {
460 fx = nullptr;
461 }
462
463 return fx;
464}
465
467
468/* -------------------------------------------------------------------- */
471
473{
474 Main *bmain = CTX_data_main(C);
477 if (!fx) {
478 return OPERATOR_CANCELLED;
479 }
480
481 /* Store name temporarily for report. */
482 char name[MAX_NAME];
483 STRNCPY_UTF8(name, fx->name);
484
485 if (!shaderfx_remove(op->reports, bmain, ob, fx)) {
486 return OPERATOR_CANCELLED;
487 }
488
489 if (RNA_boolean_get(op->ptr, "report")) {
490 BKE_reportf(op->reports, RPT_INFO, "Removed effect: %s", name);
491 }
492
494
495 return OPERATOR_FINISHED;
496}
497
499{
500 wmOperatorStatus retval;
501 if (edit_shaderfx_invoke_properties(C, op, event, &retval)) {
502 return shaderfx_remove_exec(C, op);
503 }
504 return retval;
505}
506
508{
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";
512
513 ot->invoke = shaderfx_remove_invoke;
514 ot->exec = shaderfx_remove_exec;
515 ot->poll = edit_shaderfx_poll;
516
517 /* flags */
521}
522
524
525/* -------------------------------------------------------------------- */
528
530{
533
534 if (!fx || !shaderfx_move_up(op->reports, ob, fx)) {
535 return OPERATOR_CANCELLED;
536 }
537
540
541 return OPERATOR_FINISHED;
542}
543
545{
546 wmOperatorStatus retval;
547 if (edit_shaderfx_invoke_properties(C, op, event, &retval)) {
548 return shaderfx_move_up_exec(C, op);
549 }
550 return retval;
551}
552
554{
555 ot->name = "Move Up Effect";
556 ot->description = "Move effect up in the stack";
557 ot->idname = "OBJECT_OT_shaderfx_move_up";
558
559 ot->invoke = shaderfx_move_up_invoke;
561 ot->poll = edit_shaderfx_poll;
562
563 /* flags */
566}
567
569
570/* -------------------------------------------------------------------- */
573
575{
578
579 if (!fx || !shaderfx_move_down(op->reports, ob, fx)) {
580 return OPERATOR_CANCELLED;
581 }
582
585
586 return OPERATOR_FINISHED;
587}
588
590 wmOperator *op,
591 const wmEvent *event)
592{
593 wmOperatorStatus retval;
594 if (edit_shaderfx_invoke_properties(C, op, event, &retval)) {
595 return shaderfx_move_down_exec(C, op);
596 }
597 return retval;
598}
599
601{
602 ot->name = "Move Down Effect";
603 ot->description = "Move effect down in the stack";
604 ot->idname = "OBJECT_OT_shaderfx_move_down";
605
608 ot->poll = edit_shaderfx_poll;
609
610 /* flags */
613}
614
616
617/* -------------------------------------------------------------------- */
620
622{
625 int index = RNA_int_get(op->ptr, "index");
626
627 if (!fx || !shaderfx_move_to_index(op->reports, ob, fx, index)) {
628 return OPERATOR_CANCELLED;
629 }
630
631 return OPERATOR_FINISHED;
632}
633
635 wmOperator *op,
636 const wmEvent *event)
637{
638 wmOperatorStatus retval;
639 if (edit_shaderfx_invoke_properties(C, op, event, &retval)) {
640 return shaderfx_move_to_index_exec(C, op);
641 }
642 return retval;
643}
644
646{
647 ot->name = "Move Effect to Index";
648 ot->idname = "OBJECT_OT_shaderfx_move_to_index";
649 ot->description =
650 "Change the effect's position in the list so it evaluates after the set number of "
651 "others";
652
655 ot->poll = edit_shaderfx_poll;
656
657 /* flags */
661 ot->srna, "index", 0, 0, INT_MAX, "Index", "The index to move the effect to", 0, INT_MAX);
662}
663
665
666/* -------------------------------------------------------------------- */
669
671{
674 if (!fx) {
675 return OPERATOR_CANCELLED;
676 }
678 if (!nfx) {
679 return OPERATOR_CANCELLED;
680 }
681
682 STRNCPY_UTF8(nfx->name, fx->name);
683 /* Make sure effect data has unique name. */
685
686 BKE_shaderfx_copydata(fx, nfx);
687 BLI_insertlinkafter(&ob->shader_fx, fx, nfx);
688
691
692 return OPERATOR_FINISHED;
693}
694
696{
697 wmOperatorStatus retval;
698 if (edit_shaderfx_invoke_properties(C, op, event, &retval)) {
699 return shaderfx_copy_exec(C, op);
700 }
701 return retval;
702}
703
705{
706 ot->name = "Copy Effect";
707 ot->description = "Duplicate effect at the same position in the stack";
708 ot->idname = "OBJECT_OT_shaderfx_copy";
709
710 ot->invoke = shaderfx_copy_invoke;
711 ot->exec = shaderfx_copy_exec;
712 ot->poll = edit_shaderfx_poll;
713
714 /* flags */
717}
718
720
721} // namespace blender::ed::object
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)
Definition lib_id.cc:2523
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
@ RPT_INFO
Definition BKE_report.hh:35
@ RPT_ERROR
Definition BKE_report.hh:39
@ RPT_WARNING
Definition BKE_report.hh:38
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition report.cc:153
struct ShaderFxData * BKE_shaderfx_findby_type(struct Object *ob, ShaderFxType type)
Definition shader_fx.cc:227
void BKE_shaderfx_copy(struct ListBase *dst, const struct ListBase *src)
struct ShaderFxData * BKE_shaderfx_new(int type)
Definition shader_fx.cc:54
void BKE_shaderfx_free(struct ShaderFxData *fx)
Definition shader_fx.cc:110
void BKE_shaderfx_copydata(struct ShaderFxData *fx, struct ShaderFxData *target)
Definition shader_fx.cc:205
bool BKE_shaderfx_is_nonlocal_in_liboverride(const struct Object *ob, const struct ShaderFxData *shaderfx)
const ShaderFxTypeInfo * BKE_shaderfx_get_info(ShaderFxType type)
Definition shader_fx.cc:131
struct ShaderFxData * BKE_shaderfx_findby_name(struct Object *ob, const char *name)
Definition shader_fx.cc:253
void BKE_shaderfx_unique_name(struct ListBase *shaders, struct ShaderFxData *fx)
Definition shader_fx.cc:115
@ eShaderFxTypeFlag_NoUserAdd
@ eShaderFxTypeFlag_Single
#define BLI_assert(a)
Definition BLI_assert.h:46
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Definition listbase.cc:586
#define LISTBASE_FOREACH(type, var, list)
void void BLI_freelistN(ListBase *listbase) ATTR_NONNULL(1)
Definition listbase.cc:497
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:111
void BLI_insertlinkafter(ListBase *listbase, void *vprevlink, void *vnewlink) ATTR_NONNULL(1)
Definition listbase.cc:332
void BLI_remlink(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:131
int BLI_listbase_count(const ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Definition listbase.cc:524
void BLI_insertlinkbefore(ListBase *listbase, void *vnextlink, void *vnewlink) ATTR_NONNULL(1)
Definition listbase.cc:371
#define STRNCPY_UTF8(dst, src)
#define UNUSED_FUNCTION(x)
#define ELEM(...)
#define BLT_I18NCONTEXT_ID_ID
void DEG_id_tag_update(ID *id, unsigned int flags)
void DEG_relations_tag_update(Main *bmain)
@ ID_RECALC_TRANSFORM
Definition DNA_ID.h:1054
@ ID_RECALC_GEOMETRY
Definition DNA_ID.h:1074
#define ID_IS_OVERRIDE_LIBRARY(_id)
Definition DNA_ID.h:730
#define MAX_NAME
Definition DNA_defs.h:50
Object is a sort of wrapper for general info.
@ OB_GREASE_PENCIL
@ eShaderFxType_Blur
@ OPERATOR_CANCELLED
@ OPERATOR_FINISHED
@ OPERATOR_PASS_THROUGH
bool ED_operator_object_active_editable_ex(bContext *C, const Object *ob)
@ PROP_SKIP_SAVE
Definition RNA_types.hh:344
@ PROP_HIDDEN
Definition RNA_types.hh:338
#define C
Definition RandGen.cpp:29
PointerRNA * UI_region_panel_custom_data_under_cursor(const bContext *C, const wmEvent *event)
@ OPTYPE_INTERNAL
Definition WM_types.hh:202
@ OPTYPE_UNDO
Definition WM_types.hh:182
@ OPTYPE_REGISTER
Definition WM_types.hh:180
#define ND_SHADERFX
Definition WM_types.hh:471
#define NC_OBJECT
Definition WM_types.hh:379
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)
const char * name
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[]
const char * identifier
Definition RNA_types.hh:657
char name[258]
Definition DNA_ID.h:432
void * first
ListBase shader_fx
StructRNA * type
Definition RNA_types.hh:52
void * data
Definition RNA_types.hh:53
struct ShaderFxData * prev
struct ShaderFxData * next
ShaderFxTypeFlag flags
struct ReportList * reports
struct PointerRNA * ptr
void WM_main_add_notifier(uint type, void *reference)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
PointerRNA * ptr
Definition wm_files.cc:4238
wmOperatorType * ot
Definition wm_files.cc:4237
wmOperatorStatus WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *)