22# include <fmt/format.h>
75static void rna_annotation_frame_remove(
bGPDlayer *layer,
106static bGPDlayer *rna_annotation_layer_new(
bGPdata *gpd,
const char *name,
bool setactive)
129static std::optional<std::string> rna_annotation_layer_path(
const PointerRNA *
ptr)
132 char name_esc[
sizeof(gpl->
info) * 2];
136 return fmt::format(
"layers[\"{}\"]", name_esc);
139static int rna_annotation_layer_active_frame_editable(
const PointerRNA *
ptr,
153static void rna_annotation_layer_info_set(
PointerRNA *
ptr,
const char *value)
158 char oldname[128] =
"";
173 if (
STREQ(mask->name, oldname)) {
180static int rna_annotation_active_layer_index_get(
PointerRNA *
ptr)
188static void rna_annotation_active_layer_index_set(
PointerRNA *
ptr,
int value)
200static void rna_annotation_active_layer_index_range(
223 if (
ELEM(
nullptr, C, gpd)) {
230 item_tmp.name = gpl->
info;
287 srna,
"Annotation Frame",
"Collection of related sketches on a particular frame");
330 "The frame on which this sketch appears",
335 parm =
RNA_def_pointer(func,
"frame",
"GPencilFrame",
"",
"The newly created frame");
341 parm =
RNA_def_pointer(func,
"frame",
"GPencilFrame",
"Frame",
"The frame to remove");
347 parm =
RNA_def_pointer(func,
"source",
"GPencilFrame",
"Source",
"The source frame");
349 parm =
RNA_def_pointer(func,
"copy",
"GPencilFrame",
"",
"The newly copied frame");
358 static const float default_onion_color_b[] = {0.302f, 0.851f, 0.302f};
359 static const float default_onion_color_a[] = {0.250f, 0.1f, 1.0f};
416 prop,
"Onion Skinning",
"Display annotation onion skins before and after the current frame");
424 prop,
"Frames Before",
"Maximum number of frames to show before current frame");
432 prop,
"Frames After",
"Maximum number of frames to show after current frame");
457 "Custom Onion Skin Colors",
458 "Use custom colors for onion skinning instead of the theme");
472 prop,
"Locked",
"Protect layer from further editing and/or frame changes");
516 func,
"set_active",
true,
"Set Active",
"Set the newly created layer to the active layer");
517 parm =
RNA_def_pointer(func,
"layer",
"GPencilLayer",
"",
"The newly created layer");
523 parm =
RNA_def_pointer(func,
"layer",
"GPencilLayer",
"",
"The layer to remove");
529 "rna_annotation_active_layer_index_get",
530 "rna_annotation_active_layer_index_set",
531 "rna_annotation_active_layer_index_range");
538 "rna_annotation_active_layer_index_get",
539 "rna_annotation_active_layer_index_set",
540 "rna_annotation_active_layer_itemf");
void BKE_animdata_fix_paths_rename_all(struct ID *ref_id, const char *prefix, const char *oldName, const char *newName)
void BKE_gpencil_layer_active_set(struct bGPdata *gpd, struct bGPDlayer *active)
struct bGPDlayer * BKE_gpencil_layer_addnew(struct bGPdata *gpd, const char *name, bool setactive, bool add_to_header)
bool BKE_gpencil_layer_frame_delete(struct bGPDlayer *gpl, struct bGPDframe *gpf)
struct bGPDframe * BKE_gpencil_layer_frame_get(struct bGPDlayer *gpl, int cframe, eGP_GetFrame_Mode addnew)
struct bGPDlayer * BKE_gpencil_layer_active_get(struct bGPdata *gpd)
struct bGPDframe * BKE_gpencil_frame_addnew(struct bGPDlayer *gpl, int cframe)
void BKE_gpencil_layer_delete(struct bGPdata *gpd, struct bGPDlayer *gpl)
struct bGPDframe * BKE_gpencil_frame_duplicate(const struct bGPDframe *gpf_src, bool dup_strokes)
struct bGPDframe * BKE_gpencil_layer_frame_find(struct bGPDlayer *gpl, int cframe)
int BKE_icon_gplayer_color_ensure(struct bGPDlayer *gpl)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
#define LISTBASE_FOREACH(type, var, list)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLI_addtail(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)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE int max_ii(int a, int b)
#define STRNCPY(dst, src)
size_t BLI_str_escape(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
#define STRNCPY_UTF8(dst, src)
void BLI_uniquename(const struct ListBase *list, void *vlink, const char *defname, char delim, int name_offset, size_t name_maxncpy) ATTR_NONNULL(1
void DEG_id_tag_update(ID *id, unsigned int flags)
@ GP_LAYER_ONIONSKIN_CUSTOM_COLOR
#define RNA_POINTER_INVALIDATE(ptr)
#define ND_SPACE_PROPERTIES
void rna_def_animdata_common(StructRNA *srna)
void RNA_def_annotations(BlenderRNA *brna)
static void rna_def_annotation_data(BlenderRNA *brna)
static void rna_def_annotation_frames_api(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_annotation_layer(BlenderRNA *brna)
static void rna_def_annotation_stroke(BlenderRNA *brna)
static void rna_def_annotation_frame(BlenderRNA *brna)
static void rna_def_annotation_stroke_point(BlenderRNA *brna)
static void rna_def_annotation_layers_api(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_struct_name_property(StructRNA *srna, PropertyRNA *prop)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t bit)
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive)
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
void RNA_def_property_array(PropertyRNA *prop, int length)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
void RNA_def_property_editable_func(PropertyRNA *prop, const char *editable)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
void RNA_def_function_flag(FunctionRNA *func, int flag)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
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_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_float_array_default(PropertyRNA *prop, const float *array)
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 RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
bool rna_GPencil_datablocks_annotations_poll(PointerRNA *ptr, const PointerRNA value)
const EnumPropertyItem rna_enum_dummy_NULL_items[]
const EnumPropertyItem rna_enum_dummy_DEFAULT_items[]
void WM_main_add_notifier(uint type, void *reference)