114 bool *
UNUSED(r_sort_depsgraph))
137 bool sort_depsgraph =
false;
156 bool sort_depsgraph =
false;
214 if (md_index < index) {
216 for (; md_index < index; md_index++) {
224 for (; md_index > index; md_index--) {
276 BKE_report(reports,
RPT_ERROR,
"Modifiers cannot be applied in paint, sculpt or edit mode");
280 if (((
ID *)ob->
data)->us > 1) {
285 else if (((
ID *)ob->
data)->us > 1) {
291 BKE_report(reports,
RPT_INFO,
"Applied modifier was not first, result may not be as expected");
377 group_item = md_item;
402 ot->
name =
"Add Modifier";
403 ot->
description =
"Add a procedural operation/effect to the active grease pencil object";
404 ot->
idname =
"OBJECT_OT_gpencil_modifier_add";
430 const bool is_liboverride_allowed)
439 if (obtype_flag && ((1 << ob->
type) & obtype_flag) == 0) {
448 C,
"Cannot edit modifiers coming from linked data in a library override");
477 ot->
srna,
"report",
false,
"Report",
"Create a notification after the operation");
515 if (r_retval !=
NULL) {
522 if (r_retval !=
NULL) {
559 strcpy(name, md->
name);
585 ot->
name =
"Remove Grease Pencil Modifier";
586 ot->
description =
"Remove a modifier from the active grease pencil object";
587 ot->
idname =
"OBJECT_OT_gpencil_modifier_remove";
627 ot->
name =
"Move Up Modifier";
629 ot->
idname =
"OBJECT_OT_gpencil_modifier_move_up";
668 ot->
name =
"Move Down Modifier";
670 ot->
idname =
"OBJECT_OT_gpencil_modifier_move_down";
707 ot->
name =
"Move Active Modifier to Index";
708 ot->
idname =
"OBJECT_OT_gpencil_modifier_move_to_index";
710 "Change the modifier's position in the list so it evaluates after the set number of "
721 ot->
srna,
"index", 0, 0, INT_MAX,
"Index",
"The index to move the modifier to", 0, INT_MAX);
743 strcpy(name, md->
name);
779 "Apply deform-only modifier to a new shape on this object"},
785 ot->
name =
"Apply Modifier";
786 ot->
description =
"Apply modifier and remove from the stack";
787 ot->
idname =
"OBJECT_OT_gpencil_modifier_apply";
801 "How to apply the modifier to the geometry");
834 ot->
name =
"Copy Modifier";
835 ot->
description =
"Duplicate modifier at the same position in the stack";
836 ot->
idname =
"OBJECT_OT_gpencil_modifier_copy";
861 "Source object '%s' is not a grease pencil object",
874 "Destination object '%s' is not a grease pencil object",
908 bool found_supported_objects =
false;
915 found_supported_objects =
true;
921 if (!found_supported_objects) {
930 ot->
name =
"Copy Modifier to Selected";
931 ot->
description =
"Copy the modifier from the active object to all selected objects";
932 ot->
idname =
"OBJECT_OT_gpencil_modifier_copy_to_selected";
struct Scene * CTX_data_scene(const bContext *C)
#define CTX_DATA_BEGIN(C, Type, instance, member)
PointerRNA CTX_data_pointer_get_type(const bContext *C, const char *member, StructRNA *type)
struct Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
void CTX_wm_operator_poll_msg_set(struct bContext *C, const char *msg)
struct Main * CTX_data_main(const bContext *C)
void BKE_gpencil_modifier_free(struct GpencilModifierData *md)
bool BKE_gpencil_modifier_unique_name(struct ListBase *modifiers, struct GpencilModifierData *gmd)
@ eGpencilModifierTypeFlag_Single
@ eGpencilModifierTypeFlag_SupportsEditmode
@ eGpencilModifierTypeFlag_NoUserAdd
struct GpencilModifierData * BKE_gpencil_modifiers_findby_name(struct Object *ob, const char *name)
bool BKE_gpencil_modifier_is_nonlocal_in_liboverride(const struct Object *ob, const struct GpencilModifierData *gmd)
struct GpencilModifierData * BKE_gpencil_modifiers_findby_type(struct Object *ob, GpencilModifierType type)
void BKE_gpencil_modifier_copydata(struct GpencilModifierData *md, struct GpencilModifierData *target)
const GpencilModifierTypeInfo * BKE_gpencil_modifier_get_info(GpencilModifierType type)
struct GpencilModifierData * BKE_gpencil_modifier_new(int type)
General operations, lookup, etc. for blender objects.
void BKE_object_free_derived_caches(struct Object *ob)
bool BKE_object_copy_gpencil_modifier(struct Object *ob_dst, struct GpencilModifierData *md)
void BKE_report(ReportList *reports, ReportType type, const char *message)
void BKE_reportf(ReportList *reports, ReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BLI_insertlinkafter(struct ListBase *listbase, void *vprevlink, void *vnewlink) 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_utf8(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
struct Depsgraph Depsgraph
void DEG_id_tag_update(struct ID *id, int flag)
void DEG_relations_tag_update(struct Main *bmain)
#define ID_IS_LINKED(_id)
@ eGpencilModifierMode_Editmode
@ eGpencilModifierFlag_OverrideLibrary_Local
@ eGpencilModifierType_Thick
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(struct bContext *C)
_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.
StructRNA RNA_GpencilModifier
struct PointerRNA * UI_region_panel_custom_data_under_cursor(const struct bContext *C, const struct wmEvent *event)
const Depsgraph * depsgraph
static const char * modifier_name[LS_MODIFIER_NUM]
void OBJECT_OT_gpencil_modifier_copy(wmOperatorType *ot)
void ED_object_gpencil_modifier_copy_to_object(Object *ob_dst, GpencilModifierData *md)
void OBJECT_OT_gpencil_modifier_add(wmOperatorType *ot)
static int gpencil_modifier_remove_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void OBJECT_OT_gpencil_modifier_move_up(wmOperatorType *ot)
void OBJECT_OT_gpencil_modifier_move_down(wmOperatorType *ot)
static bool gpencil_modifier_apply_obdata(ReportList *reports, Main *bmain, Depsgraph *depsgraph, Object *ob, GpencilModifierData *md)
static int gpencil_modifier_copy_to_selected_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static int gpencil_modifier_move_to_index_exec(bContext *C, wmOperator *op)
GpencilModifierData * ED_object_gpencil_modifier_add(ReportList *reports, Main *bmain, Scene *UNUSED(scene), Object *ob, const char *name, int type)
static const EnumPropertyItem gpencil_modifier_apply_as_items[]
static int gpencil_modifier_move_to_index_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static void gpencil_edit_modifier_report_property(wmOperatorType *ot)
void ED_object_gpencil_modifier_clear(Main *bmain, Object *ob)
static int gpencil_modifier_apply_exec(bContext *C, wmOperator *op)
bool ED_object_gpencil_modifier_remove(ReportList *reports, Main *bmain, Object *ob, GpencilModifierData *md)
bool ED_object_gpencil_modifier_move_to_index(ReportList *reports, Object *ob, GpencilModifierData *md, const int index)
static int gpencil_modifier_add_exec(bContext *C, wmOperator *op)
static int gpencil_modifier_move_down_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void OBJECT_OT_gpencil_modifier_copy_to_selected(wmOperatorType *ot)
static GpencilModifierData * gpencil_edit_modifier_property_get(wmOperator *op, Object *ob, int type)
static void gpencil_edit_modifier_properties(wmOperatorType *ot)
static int gpencil_modifier_move_up_exec(bContext *C, wmOperator *op)
static int gpencil_modifier_copy_exec(bContext *C, wmOperator *op)
static int gpencil_modifier_move_up_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static int gpencil_modifier_apply_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void OBJECT_OT_gpencil_modifier_move_to_index(wmOperatorType *ot)
bool ED_object_gpencil_modifier_move_down(ReportList *UNUSED(reports), Object *ob, GpencilModifierData *md)
static int gpencil_modifier_copy_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static int gpencil_modifier_move_down_exec(bContext *C, wmOperator *op)
static const EnumPropertyItem * gpencil_modifier_add_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free)
static bool gpencil_edit_modifier_poll_generic(bContext *C, StructRNA *rna_type, int obtype_flag, const bool is_liboverride_allowed)
static bool gpencil_edit_modifier_liboverride_allowed_poll(bContext *C)
bool ED_object_gpencil_modifier_copy(ReportList *reports, Object *ob, GpencilModifierData *md)
static bool gpencil_edit_modifier_invoke_properties(bContext *C, wmOperator *op, const wmEvent *event, int *r_retval)
void OBJECT_OT_gpencil_modifier_remove(wmOperatorType *ot)
bool ED_object_gpencil_modifier_apply(Main *bmain, ReportList *reports, Depsgraph *depsgraph, Object *ob, GpencilModifierData *md, int UNUSED(mode))
static bool gpencil_modifier_copy_to_selected_poll(bContext *C)
static bool gpencil_object_modifier_remove(Main *bmain, Object *ob, GpencilModifierData *md, bool *UNUSED(r_sort_depsgraph))
static int gpencil_modifier_copy_to_selected_exec(bContext *C, wmOperator *op)
void OBJECT_OT_gpencil_modifier_apply(wmOperatorType *ot)
static int gpencil_modifier_remove_exec(bContext *C, wmOperator *op)
bool ED_object_gpencil_modifier_move_up(ReportList *UNUSED(reports), Object *ob, GpencilModifierData *md)
static bool gpencil_edit_modifier_poll(bContext *C)
void edit_modifier_properties(struct wmOperatorType *ot)
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_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_greasepencil_modifier_type_items[]
const EnumPropertyItem rna_enum_object_modifier_type_items[]
struct GpencilModifierData * next
struct GpencilModifierData * prev
void(* bakeModifier)(struct Main *bmain, struct Depsgraph *depsgraph, struct GpencilModifierData *md, struct Object *ob)
GpencilModifierTypeFlag flags
bool(* isDisabled)(struct GpencilModifierData *md, int userRenderParams)
ListBase greasepencil_modifiers
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
ccl_device_inline int mod(int x, int m)
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))