91 if (gpd_ptr ==
NULL) {
127 ot->
name =
"Annotation Add New";
128 ot->
idname =
"GPENCIL_OT_annotation_add";
145 if ((gpd_ptr !=
NULL) && (*gpd_ptr !=
NULL)) {
152 return (gpd_ptr && *gpd_ptr);
160 if (gpd_ptr ==
NULL) {
179 ot->
name =
"Annotation Unlink";
180 ot->
idname =
"GPENCIL_OT_data_unlink";
197 const bool is_annotation =
STREQ(op->
idname,
"GPENCIL_OT_layer_annotation_add");
207 if (gpd_ptr ==
NULL) {
212 if (*gpd_ptr ==
NULL) {
248 ot->
name =
"Add New Layer";
249 ot->
idname =
"GPENCIL_OT_layer_add";
250 ot->
description =
"Add new layer or note for the active data-block";
267 ot->
name =
"Add New Annotation Layer";
268 ot->
idname =
"GPENCIL_OT_layer_annotation_add";
269 ot->
description =
"Add new Annotation layer or note for the active data-block";
281 const bool is_annotation =
STREQ(op->
idname,
"GPENCIL_OT_layer_annotation_remove");
336 ot->
name =
"Remove Layer";
337 ot->
idname =
"GPENCIL_OT_layer_remove";
352 return (gpl !=
NULL);
358 ot->
name =
"Remove Annotation Layer";
359 ot->
idname =
"GPENCIL_OT_layer_annotation_remove";
377 const bool is_annotation =
STREQ(op->
idname,
"GPENCIL_OT_layer_annotation_move");
411 ot->
name =
"Move Grease Pencil Layer";
412 ot->
idname =
"GPENCIL_OT_layer_move";
413 ot->
description =
"Move the active Grease Pencil layer up/down in the list";
434 ot->
name =
"Move Annotation Layer";
435 ot->
idname =
"GPENCIL_OT_layer_annotation_move";
436 ot->
description =
"Move the active Annotation layer up/down in the list";
481 sizeof(new_layer->
info));
501 ot->
name =
"Duplicate Layer";
502 ot->
idname =
"GPENCIL_OT_layer_duplicate";
503 ot->
description =
"Make a copy of the active Grease Pencil layer";
549 if ((ob == ob_src) || (ob->type !=
OB_GPENCIL)) {
554 if ((only_active) && (gpl_src != gpl_active)) {
564 gpl_dst->
opacity = gpl_src->opacity;
585 if (ma_src !=
NULL) {
620 ot->
name =
"Duplicate Layer to New Object";
621 ot->
idname =
"GPENCIL_OT_layer_duplicate_object";
622 ot->
description =
"Make a copy of the active Grease Pencil layer to selected object";
637 "Copy only active Layer, uncheck to append all layers");
681 {
GP_FRAME_DUP_ALL,
"ALL", 0,
"All",
"Duplicate active frames in all layers"},
686 ot->
name =
"Duplicate Frame";
687 ot->
idname =
"GPENCIL_OT_frame_duplicate";
688 ot->
description =
"Make a copy of the active Grease Pencil Frame";
708 bool changed =
false;
715 init_gpf = gpl->frames.first;
771 ot->
name =
"Clean Fill Boundaries";
772 ot->
idname =
"GPENCIL_OT_frame_clean_fill";
788 bool changed =
false;
794 bGPDframe *init_gpf = (is_multiedit) ? gpl->frames.first : gpl->actframe;
797 if ((gpf == gpl->actframe) || ((gpf->flag &
GP_FRAME_SELECT) && (is_multiedit))) {
810 if (gps->totpoints <= limit) {
847 ot->
name =
"Clean Loose Points";
848 ot->
idname =
"GPENCIL_OT_frame_clean_loose";
864 "Number of points to consider stroke as loose",
872 if ((gpf_a ==
NULL) || (gpf_b ==
NULL)) {
878 if ((totstrokes_a == 0) || (totstrokes_b == 0) || (totstrokes_a != totstrokes_b)) {
884 for (
int i = 0; i < totstrokes_a; i++) {
899 if (gps_a->
caps[0] != gps_b->
caps[0]) {
902 if (gps_a->
caps[1] != gps_b->
caps[1]) {
922 for (
int p = 0; p < gps_a->
totpoints; p++) {
957 bool changed =
false;
971 while (gpf !=
NULL) {
997 {0,
"ALL", 0,
"All Frames",
""},
998 {1,
"SELECTED", 0,
"Selected Frames",
""},
1003 ot->
name =
"Clean Duplicated Frames";
1004 ot->
idname =
"GPENCIL_OT_frame_clean_duplicate";
1057 ot->
name =
"Hide Layer(s)";
1059 ot->
description =
"Hide selected/unselected Grease Pencil layers";
1070 ot->
srna,
"unselected", 0,
"Unselected",
"Hide unselected rather than selected layers");
1092 for (i = 0, pt = gps->
points; i < gps->totpoints; i++, pt++) {
1120 if (gpl->actframe) {
1127 for (gpf = gpl->frames.first; gpf; gpf = gpf->
next) {
1145 ot->
name =
"Show All Layers";
1186 ot->
name =
"Lock All Layers";
1187 ot->
idname =
"GPENCIL_OT_lock_all";
1189 "Lock all Grease Pencil layers to prevent them from being accidentally modified";
1225 ot->
name =
"Unlock All Layers";
1226 ot->
idname =
"GPENCIL_OT_unlock_all";
1227 ot->
description =
"Unlock all Grease Pencil layers so that they can be edited";
1244 bool isolate =
false;
1265 if ((gpl->flag & flags) == 0) {
1285 gpl->flag &= ~flags;
1299 ot->
name =
"Isolate Layer";
1300 ot->
idname =
"GPENCIL_OT_layer_isolate";
1302 "Toggle whether the active layer is the only one that can be edited and/or visible";
1313 "affect_visibility",
1315 "Affect Visibility",
1316 "In addition to toggling the editability, also affect the visibility");
1330 gps->fill_opacity_fac *= gpl->
opacity;
1331 gps->vert_color_fill[3] *= gpl->
opacity;
1332 for (
int p = 0; p < gps->totpoints; p++) {
1362 if (
ELEM(
NULL, gpd, gpl_dst, gpl_active)) {
1384 gpl_dst = gpl_active;
1388 if (gpl == gpl_dst) {
1396 if (gpl == gpl_dst) {
1435 ot->
idname =
"GPENCIL_OT_layer_merge";
1458 uiItemsEnumO(layout,
"GPENCIL_OT_layer_change",
"layer");
1475 if (layer_num == -1) {
1485 op->
reports,
RPT_ERROR,
"Cannot change to non-existent layer (index = %d)", layer_num);
1504 ot->
name =
"Change Layer";
1505 ot->
idname =
"GPENCIL_OT_layer_change";
1532 op->
reports,
RPT_ERROR,
"Cannot change to non-existent layer (index = %d)", layer_num);
1550 ot->
name =
"Active Layer";
1551 ot->
idname =
"GPENCIL_OT_layer_active";
1591 bool changed =
false;
1596 bGPDframe *init_gpf = (is_multiedit) ? gpl->frames.first : gpl->actframe;
1600 if ((gpf == gpl->actframe) || ((gpf->flag &
GP_FRAME_SELECT) && (is_multiedit))) {
1605 for (gps = gpf->strokes.first; gps; gps = gps->next) {
1616 bool gpf_lock =
false;
1619 if (gps == gpf->strokes.last) {
1626 if (gps == gpf->strokes.first) {
1638 const int target_index = (gps_target) ?
BLI_findindex(&gpf->strokes, gps_target) : -1;
1639 int prev_index = target_index;
1641 switch (direction) {
1662 if (gps_index + 1 >= prev_index) {
1663 prev_index = gps_index;
1666 prev_index = gps_index;
1678 if (gps_index - 1 <= prev_index) {
1679 prev_index = gps_index;
1682 prev_index = gps_index;
1710 if (!is_multiedit) {
1736 ot->
name =
"Arrange Stroke";
1737 ot->
idname =
"GPENCIL_OT_stroke_arrange";
1738 ot->
description =
"Arrange selected strokes up/down in the display order of the active layer";
1762 if (name[0] ==
'\0') {
1787 bool changed =
false;
1790 bGPDframe *init_gpf = (is_multiedit) ? gpl->frames.first : gpl->actframe;
1793 if ((gpf == gpl->actframe) || ((gpf->flag &
GP_FRAME_SELECT) && (is_multiedit))) {
1818 if (!is_multiedit) {
1837 ot->
name =
"Change Stroke Color";
1838 ot->
idname =
"GPENCIL_OT_stroke_change_color";
1839 ot->
description =
"Move selected strokes to active material";
1865 for (
short i = 0; i < *totcol; i++) {
1873 bool changed =
false;
1878 for (
bGPDstroke *gps = gpl->actframe->strokes.last; gps; gps = gps->
prev) {
1916 ot->
name =
"Lock Unused Materials";
1917 ot->
idname =
"GPENCIL_OT_material_lock_unused";
1918 ot->
description =
"Lock any material not used in any selected stroke";
1942 brush = paint->
brush;
1950 brush = paint->
brush;
1958 brush = paint->
brush;
1966 brush = paint->
brush;
1985 ot->
name =
"Reset Brush";
1986 ot->
idname =
"GPENCIL_OT_brush_reset";
2003 brush_next = brush->
id.
next;
2005 if (brush->gpencil_settings ==
NULL) {
2036 brush_next = brush->
id.
next;
2042 short preset = (brush->gpencil_settings) ? brush->gpencil_settings->preset_type :
2051 if ((brush_active) && (brush_active->
gpencil_tool != brush->gpencil_tool)) {
2060 if ((brush_active) && (brush_active->
gpencil_sculpt_tool != brush->gpencil_sculpt_tool)) {
2069 if ((brush_active) && (brush_active->
gpencil_weight_tool != brush->gpencil_weight_tool)) {
2078 if ((brush_active) && (brush_active->
gpencil_vertex_tool != brush->gpencil_vertex_tool)) {
2085 if ((brush->gpencil_settings) && (brush->gpencil_settings->material !=
NULL)) {
2086 brush->gpencil_settings->material =
NULL;
2091 if (brush == brush_active) {
2092 brush_active =
NULL;
2195 ot->
name =
"Reset All Brushes";
2196 ot->
idname =
"GPENCIL_OT_brush_reset_all";
2197 ot->
description =
"Delete all mode brushes and recreate a default set";
2267 ot->
name =
"Assign to Vertex Group";
2268 ot->
idname =
"GPENCIL_OT_vertex_group_assign";
2269 ot->
description =
"Assign the selected vertices to the active vertex group";
2302 ot->
name =
"Remove from Vertex Group";
2303 ot->
idname =
"GPENCIL_OT_vertex_group_remove_from";
2304 ot->
description =
"Remove the selected vertices from active or all vertex group(s)";
2336 ot->
name =
"Select Vertex Group";
2337 ot->
idname =
"GPENCIL_OT_vertex_group_select";
2338 ot->
description =
"Select all the vertices assigned to the active vertex group";
2370 ot->
name =
"Deselect Vertex Group";
2371 ot->
idname =
"GPENCIL_OT_vertex_group_deselect";
2372 ot->
description =
"Deselect all selected vertices assigned to the active vertex group";
2398 if (defgroup ==
NULL) {
2408 if ((gps->totpoints == 0) || (gps->dvert ==
NULL)) {
2412 for (
int i = 0; i < gps->totpoints; i++) {
2413 dvert = &gps->dvert[i];
2418 else if (dw->
weight == 1.0f) {
2438 ot->
name =
"Invert Vertex Group";
2439 ot->
idname =
"GPENCIL_OT_vertex_group_invert";
2440 ot->
description =
"Invert weights to the active vertex group";
2467 if (defgroup ==
NULL) {
2480 if ((gps->totpoints == 0) || (gps->dvert ==
NULL)) {
2484 for (
int s = 0; s < repeat; s++) {
2485 for (
int i = 0; i < gps->totpoints; i++) {
2488 pta = &gps->points[i - 1];
2489 dverta = &gps->dvert[i - 1];
2492 pta = &gps->points[i];
2493 dverta = &gps->dvert[i];
2496 ptb = &gps->points[i];
2497 dvertb = &gps->dvert[i];
2499 if (i + 1 < gps->totpoints) {
2500 ptc = &gps->points[i + 1];
2503 ptc = &gps->points[i];
2513 const float optimal =
interpf(wa, wb, opfac);
2535 ot->
name =
"Smooth Vertex Group";
2536 ot->
idname =
"GPENCIL_OT_vertex_group_smooth";
2537 ot->
description =
"Smooth weights to the active vertex group";
2566 if (defgroup ==
NULL) {
2576 if ((gps->totpoints == 0) || (gps->dvert ==
NULL)) {
2581 float maxvalue = 0.0f;
2582 for (
int i = 0; i < gps->totpoints; i++) {
2583 dvert = &gps->dvert[i];
2585 if ((dw !=
NULL) && (dw->
weight > maxvalue)) {
2591 if (maxvalue > 0.0f) {
2592 for (
int i = 0; i < gps->totpoints; i++) {
2593 dvert = &gps->dvert[i];
2613 ot->
name =
"Normalize Vertex Group";
2614 ot->
idname =
"GPENCIL_OT_vertex_group_normalize";
2615 ot->
description =
"Normalize weights to the active vertex group";
2643 if (defbase_tot == 0) {
2649 if ((gps->totpoints == 0) || (gps->dvert ==
NULL)) {
2654 float *tot_values =
MEM_callocN(gps->totpoints *
sizeof(
float), __func__);
2656 for (
int i = 0; i < gps->totpoints; i++) {
2657 dvert = &gps->dvert[i];
2658 for (
int v = 0;
v < defbase_tot;
v++) {
2666 if ((lock_active) && (
v == def_nr)) {
2672 tot_values[i] += dw->
weight;
2678 for (
int i = 0; i < gps->totpoints; i++) {
2679 if (tot_values[i] == 0.0f) {
2683 dvert = &gps->dvert[i];
2684 for (
int v = 0;
v < defbase_tot;
v++) {
2692 if ((lock_active) && (
v == def_nr)) {
2718 ot->
name =
"Normalize All Vertex Group";
2719 ot->
idname =
"GPENCIL_OT_vertex_group_normalize_all";
2721 "Normalize all weights of all vertex groups, "
2722 "so that for each vertex, the sum of all weights is 1.0";
2736 "Keep the values of the active group while normalizing others");
2769 if (!
STREQ(old_name, new_name) && strstr(fcu->
rna_path, old_name)) {
2771 id, fcu->
rna_path,
"layers", old_name, new_name, 0, 0,
false);
2787 if (dtar->id == src_id) {
2794 if (dtar->rna_path && strstr(dtar->rna_path,
"layers[")) {
2800 if (!
STREQ(old_name, new_name)) {
2801 if ((dtar->rna_path) && strstr(dtar->rna_path, old_name)) {
2804 id, dtar->rna_path,
"layers", old_name, new_name, 0, 0,
false);
2838 if ((ob_iter->rot[0] != 0) || (ob_iter->rot[1] != 0) || (ob_iter->rot[2] != 0)) {
2847 if (ob_iter == ob_active) {
2861 Object *ob_dst = ob_active;
2865 if ((ob_iter->type ==
OB_GPENCIL) && (ob_iter != ob_active)) {
2867 if (ob_active->
data != ob_iter->data) {
2868 Object *ob_src = ob_iter;
2869 bGPdata *gpd_src = ob_iter->data;
2892 if (gps->dvert ==
NULL) {
2895 for (i = 0, dvert = gps->dvert; i < gps->totpoints; i++, dvert++) {
2913 for (
short i = 0; i < *totcol; i++) {
2924 float imat[3][3], bmat[3][3];
2925 float offset_global[3];
2926 float offset_local[3];
2939 float diff_mat[4][4];
2940 float inverse_diff_mat[4][4];
2956 for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
2971 sizeof(gpl_new->
info));
3035 return *totcolp > 0;
3060 for (
short i = 0; i < *totcol; i++) {
3075 for (
bGPDstroke *gps = gpl->actframe->strokes.last; gps; gps = gps->
prev) {
3086 if (gp_style !=
NULL) {
3109 ot->
name =
"Disable Unused Layer Colors";
3110 ot->
idname =
"GPENCIL_OT_lock_layer";
3111 ot->
description =
"Lock and hide any color not used in any layer";
3129 bool isolate =
false;
3135 if (
ELEM(
NULL, gpd, active_color)) {
3143 for (
short i = 0; i < *totcol; i++) {
3154 if ((gp_style->
flag & flags) == 0) {
3163 for (
short i = 0; i < *totcol; i++) {
3169 if (gp_style == active_color) {
3172 gp_style->
flag |= flags;
3178 for (
short i = 0; i < *totcol; i++) {
3184 gp_style->
flag &= ~flags;
3203 ot->
name =
"Isolate Material";
3204 ot->
idname =
"GPENCIL_OT_material_isolate";
3206 "Toggle whether the active material is the only one that is editable and/or visible";
3217 "affect_visibility",
3219 "Affect Visibility",
3220 "In addition to toggling "
3221 "the editability, also affect the visibility");
3243 for (
short i = 0; i < *totcol; i++) {
3247 if (active_color !=
color) {
3274 ot->
name =
"Hide Material(s)";
3275 ot->
idname =
"GPENCIL_OT_material_hide";
3276 ot->
description =
"Hide selected/unselected Grease Pencil materials";
3287 ot->
srna,
"unselected", 0,
"Unselected",
"Hide unselected rather than selected colors");
3306 for (
short i = 0; i < *totcol; i++) {
3309 gp_style = ma->gp_style;
3330 ot->
name =
"Show All Materials";
3331 ot->
idname =
"GPENCIL_OT_material_reveal";
3332 ot->
description =
"Unhide all hidden Grease Pencil materials";
3359 for (
short i = 0; i < *totcol; i++) {
3362 gp_style = ma->gp_style;
3383 ot->
name =
"Lock All Materials";
3384 ot->
idname =
"GPENCIL_OT_material_lock_all";
3386 "Lock all Grease Pencil materials to prevent them from being accidentally modified";
3412 for (
short i = 0; i < *totcol; i++) {
3415 gp_style = ma->gp_style;
3436 ot->
name =
"Unlock All Materials";
3437 ot->
idname =
"GPENCIL_OT_material_unlock_all";
3438 ot->
description =
"Unlock all Grease Pencil materials so that they can be edited";
3465 bGPDframe *init_gpf = (is_multiedit) ? gpl->frames.first : gpl->actframe;
3468 if ((gpf == gpl->actframe) || ((gpf->flag &
GP_FRAME_SELECT) && (is_multiedit))) {
3482 if (ob->
actcol == gps->mat_nr + 1) {
3494 for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
3506 if (!is_multiedit) {
3525 ot->
name =
"Select Material";
3526 ot->
idname =
"GPENCIL_OT_material_select";
3527 ot->
description =
"Select/Deselect all Grease Pencil strokes using current material";
3548 if ((slot < 1) || (slot > ob->
totcol)) {
3550 op->
reports,
RPT_ERROR,
"Cannot change to non-existent material (index = %d)", slot);
3567 ot->
name =
"Set Material";
3568 ot->
idname =
"GPENCIL_OT_material_set";
3596 bool changed =
false;
3601 ob->
actcol = gps->mat_nr + 1;
3619 ot->
name =
"Set active material";
3620 ot->
idname =
"GPENCIL_OT_set_active_material";
3621 ot->
description =
"Set the selected stroke material as the active material";
3639 if (*totcolp == 0) {
3654 if ((ob == ob_src) || (ob->type !=
OB_GPENCIL)) {
3658 for (
int i = 0; i < ob_src->
totcol; i++) {
3660 if (only_active && ma_src != ma_active) {
3664 if (ma_src !=
NULL) {
3685 ot->
name =
"Copy Materials to Selected Object";
3686 ot->
idname =
"GPENCIL_OT_materials_copy_to_object";
3687 ot->
description =
"Append Materials of the active Grease Pencil to other object";
3700 "Append only active material, uncheck to append all materials");
3734 if (ob_latt != mmd->
object) {
3737 "The existing Lattice modifier is already using a different Lattice object");
3755 if (gpl_active ==
NULL) {
3767 if (gpl == gpl_active) {
3777 if (gpl_active->act_mask == 256) {
3800 ot->
name =
"Add New Mask Layer";
3801 ot->
idname =
"GPENCIL_OT_layer_mask_add";
3826 if (gpl->act_mask > 0) {
3830 if ((gpl->mask_layers.first !=
NULL) && (gpl->act_mask == 0)) {
3849 ot->
name =
"Remove Mask Layer";
3850 ot->
idname =
"GPENCIL_OT_layer_mask_remove";
3894 ot->
name =
"Move Grease Pencil Layer Mask";
3895 ot->
idname =
"GPENCIL_OT_layer_mask_move";
3896 ot->
description =
"Move the active Grease Pencil mask layer up/down in the list";
typedef float(TangentPoint)[2]
struct AnimData * BKE_animdata_copy(struct Main *bmain, struct AnimData *adt, int flag)
void BKE_animdata_merge_copy(struct Main *bmain, struct ID *dst_id, struct ID *src_id, eAnimData_MergeCopy_Modes action_mode, bool fix_drivers)
void BKE_fcurves_main_cb(struct Main *bmain, ID_FCurve_Edit_Callback func, void *user_data)
char * BKE_animsys_fix_rna_path_rename(struct ID *owner_id, char *old_path, const char *prefix, const char *oldName, const char *newName, int oldSubscript, int newSubscript, bool verify_paths)
bool BKE_brush_delete(struct Main *bmain, struct Brush *brush)
void BKE_brush_gpencil_paint_presets(struct Main *bmain, struct ToolSettings *ts, bool reset)
void BKE_gpencil_brush_preset_set(struct Main *bmain, struct Brush *brush, short type)
void BKE_brush_gpencil_weight_presets(struct Main *bmain, struct ToolSettings *ts, bool reset)
void BKE_brush_gpencil_sculpt_presets(struct Main *bmain, struct ToolSettings *ts, bool reset)
void BKE_brush_gpencil_vertex_presets(struct Main *bmain, struct ToolSettings *ts, bool reset)
struct Scene * CTX_data_scene(const bContext *C)
#define CTX_DATA_BEGIN(C, Type, instance, member)
@ CTX_MODE_WEIGHT_GPENCIL
@ CTX_MODE_VERTEX_GPENCIL
@ CTX_MODE_SCULPT_GPENCIL
struct bGPdata * CTX_data_gpencil_data(const bContext *C)
struct Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
struct Object * CTX_data_active_object(const bContext *C)
struct Main * CTX_data_main(const bContext *C)
struct ToolSettings * CTX_data_tool_settings(const bContext *C)
enum eContextObjectMode CTX_data_mode_enum(const bContext *C)
#define DRIVER_TARGETS_USED_LOOPER_BEGIN(dvar)
#define DRIVER_TARGETS_LOOPER_END
void BKE_gpencil_stroke_select_index_set(struct bGPdata *gpd, struct bGPDstroke *gps)
struct bGPDframe * BKE_gpencil_frame_addnew(struct bGPDlayer *gpl, int cframe)
void BKE_gpencil_layer_active_set(struct bGPdata *gpd, struct bGPDlayer *active)
struct bGPDlayer_Mask * BKE_gpencil_layer_mask_named_get(struct bGPDlayer *gpl, const char *name)
void BKE_gpencil_free_data(struct bGPdata *gpd, bool free_all)
void BKE_gpencil_layer_mask_sort(struct bGPdata *gpd, struct bGPDlayer *gpl)
struct bGPDstroke * BKE_gpencil_stroke_duplicate(struct bGPDstroke *gps_src, bool dup_points, bool dup_curve)
struct bGPDlayer * BKE_gpencil_layer_active_get(struct bGPdata *gpd)
struct bGPDframe * BKE_gpencil_frame_addcopy(struct bGPDlayer *gpl, int cframe)
void BKE_gpencil_free_stroke_weights(struct bGPDstroke *gps)
int BKE_gpencil_object_material_ensure(struct Main *bmain, struct Object *ob, struct Material *material)
void BKE_gpencil_layer_mask_sort_all(struct bGPdata *gpd)
struct bGPDlayer * BKE_gpencil_layer_duplicate(const struct bGPDlayer *gpl_src, bool dup_frames, bool dup_strokes)
void BKE_gpencil_stroke_select_index_reset(struct bGPDstroke *gps)
void BKE_gpencil_layer_mask_remove(struct bGPDlayer *gpl, struct bGPDlayer_Mask *mask)
struct bGPDlayer_Mask * BKE_gpencil_layer_mask_add(struct bGPDlayer *gpl, const char *name)
struct bGPDlayer * BKE_gpencil_layer_addnew(struct bGPdata *gpd, const char *name, bool setactive, bool add_to_header)
bool BKE_gpencil_layer_is_editable(const struct bGPDlayer *gpl)
bool BKE_gpencil_layer_frame_delete(struct bGPDlayer *gpl, struct bGPDframe *gpf)
int BKE_gpencil_object_material_index_get(struct Object *ob, struct Material *ma)
void BKE_gpencil_layer_mask_cleanup(struct bGPdata *gpd, struct bGPDlayer *gpl)
struct bGPDlayer * BKE_gpencil_layer_named_get(struct bGPdata *gpd, const char *name)
struct bGPDframe * BKE_gpencil_layer_frame_get(struct bGPDlayer *gpl, int cframe, eGP_GetFrame_Mode addnew)
struct bGPdata * BKE_gpencil_data_addnew(struct Main *bmain, const char name[])
void BKE_gpencil_layer_transform_matrix_get(const struct Depsgraph *depsgraph, struct Object *obact, struct bGPDlayer *gpl, float diff_mat[4][4])
void BKE_gpencil_layer_delete(struct bGPdata *gpd, struct bGPDlayer *gpl)
struct GpencilModifierData * BKE_gpencil_modifiers_findby_type(struct Object *ob, GpencilModifierType type)
const GpencilModifierTypeInfo * BKE_gpencil_modifier_get_info(GpencilModifierType type)
bool BKE_id_is_editable(const struct Main *bmain, const struct ID *id)
void id_us_min(struct ID *id)
struct ID * BKE_libblock_find_name(struct Main *bmain, short type, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void BKE_id_free_us(struct Main *bmain, void *idv) ATTR_NONNULL()
General operations, lookup, etc. for materials.
struct MaterialGPencilStyle * BKE_gpencil_material_settings(struct Object *ob, short act)
struct Material * BKE_object_material_get(struct Object *ob, short act)
struct Material * BKE_gpencil_material(struct Object *ob, short act)
short * BKE_object_material_len_p(struct Object *ob)
General operations, lookup, etc. for blender objects.
void BKE_paint_brush_set(struct Paint *paint, struct Brush *br)
void BKE_paint_toolslots_brush_validate(struct Main *bmain, struct Paint *paint)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
BLI_INLINE void * BLI_ghashIterator_getKey(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT
BLI_INLINE void * BLI_ghashIterator_getValue(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT
GHash * BLI_ghash_str_new(const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
#define GHASH_ITER(gh_iter_, ghash_)
void BLI_ghash_insert(GHash *gh, void *key, void *val)
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
void BLI_addhead(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
void BLI_freelinkN(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
#define LISTBASE_FOREACH_BACKWARD(type, var, list)
struct LinkData * BLI_genericNodeN(void *data)
void BLI_insertlinkafter(struct ListBase *listbase, void *vprevlink, void *vnewlink) ATTR_NONNULL(1)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
#define LISTBASE_FOREACH_BACKWARD_MUTABLE(type, var, list)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void void void bool BLI_listbase_link_move(ListBase *listbase, void *vlink, int step) ATTR_NONNULL()
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)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE float interpf(float a, float b, float t)
float line_point_factor_v3(const float p[3], const float l1[3], const float l2[3])
void mul_m3_v3(const float M[3][3], float r[3])
void copy_m3_m4(float m1[3][3], const float m2[4][4])
void invert_m4_m4_safe_ortho(float Ainv[4][4], const float A[4][4])
void unit_m4(float m[4][4])
bool invert_m4_m4(float R[4][4], const float A[4][4])
void invert_m3_m3_safe_ortho(float Ainv[3][3], const float A[3][3])
void mul_v3_m4v3(float r[3], const float M[4][4], const float v[3])
void mul_v3_m3v3(float r[3], const float M[3][3], const float a[3])
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE bool equals_v4v4(const float a[4], const float b[4]) ATTR_WARN_UNUSED_RESULT
MINLINE void sub_v3_v3(float r[3], const float a[3])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE bool equals_v2v2(const float v1[2], const float v2[2]) ATTR_WARN_UNUSED_RESULT
MINLINE bool equals_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void copy_v3_fl(float r[3], float f)
MINLINE void zero_v3(float r[3])
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() ATTR_MALLOC
bool BLI_uniquename(struct ListBase *list, void *vlink, const char *defname, char delim, int name_offset, size_t name_len)
#define SET_FLAG_FROM_TEST(value, test, flag)
struct Depsgraph Depsgraph
void DEG_id_tag_update(struct ID *id, int flag)
void DEG_relations_tag_update(struct Main *bmain)
@ ID_RECALC_COPY_ON_WRITE
@ GP_BRUSH_MATERIAL_PINNED
@ GP_BRUSH_PRESET_DRAW_WEIGHT
@ GP_BRUSH_PRESET_VERTEX_DRAW
@ GP_BRUSH_PRESET_VERTEX_REPLACE
@ GP_BRUSH_PRESET_SMOOTH_STROKE
@ GP_BRUSH_PRESET_AIRBRUSH
@ GP_BRUSH_PRESET_CLONE_STROKE
@ GP_BRUSH_PRESET_UNKNOWN
@ eGpencilModifierType_Lattice
#define GPENCIL_MULTIEDIT_SESSIONS_ON(gpd)
@ GP_DATA_STROKE_EDITMODE
#define GPENCIL_ANY_MODE(gpd)
Object is a sort of wrapper for general info.
struct GpencilModifierData * ED_object_gpencil_modifier_add(struct ReportList *reports, struct Main *bmain, struct Scene *scene, struct Object *ob, const char *name, int type)
void ED_object_base_free_and_unlink(struct Main *bmain, struct Scene *scene, struct 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.
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position CLAMP
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a color
struct uiLayout * UI_popup_menu_layout(uiPopupMenu *pup)
void uiItemsEnumO(uiLayout *layout, const char *opname, const char *propname)
void UI_popup_menu_end(struct bContext *C, struct uiPopupMenu *pup)
uiPopupMenu * UI_popup_menu_begin(struct bContext *C, const char *title, int icon) ATTR_NONNULL()
#define ND_SPACE_PROPERTIES
__forceinline const avxb select(const avxb &m, const avxb &t, const avxb &f)
ATTR_WARN_UNUSED_RESULT const BMVert * v
const Depsgraph * depsgraph
int ED_gpencil_join_objects_exec(bContext *C, wmOperator *op)
static void gpencil_joined_fix_animdata_cb(ID *id, FCurve *fcu, void *user_data)
void GPENCIL_OT_layer_change(wmOperatorType *ot)
void GPENCIL_OT_stroke_arrange(wmOperatorType *ot)
static int gpencil_layer_mask_remove_exec(bContext *C, wmOperator *UNUSED(op))
static int gpencil_layer_add_exec(bContext *C, wmOperator *op)
void GPENCIL_OT_vertex_group_smooth(wmOperatorType *ot)
static int gpencil_material_select_exec(bContext *C, wmOperator *op)
static bool gpencil_frame_is_equal(const bGPDframe *gpf_a, const bGPDframe *gpf_b)
static int gpencil_material_set_exec(bContext *C, wmOperator *op)
static bool gpencil_active_layer_annotation_poll(bContext *C)
void GPENCIL_OT_layer_remove(wmOperatorType *ot)
struct tJoinGPencil_AdtFixData tJoinGPencil_AdtFixData
void GPENCIL_OT_vertex_group_invert(wmOperatorType *ot)
static int gpencil_isolate_layer_exec(bContext *C, wmOperator *op)
@ GP_LAYER_COPY_OBJECT_ACT_FRAME
@ GP_LAYER_COPY_OBJECT_ALL_FRAME
void GPENCIL_OT_layer_annotation_move(wmOperatorType *ot)
static int gpencil_frame_clean_loose_exec(bContext *C, wmOperator *op)
static int gpencil_hide_exec(bContext *C, wmOperator *op)
void GPENCIL_OT_material_reveal(wmOperatorType *ot)
void GPENCIL_OT_layer_annotation_remove(wmOperatorType *ot)
void GPENCIL_OT_frame_duplicate(wmOperatorType *ot)
void GPENCIL_OT_layer_isolate(wmOperatorType *ot)
static int gpencil_materials_copy_to_object_exec(bContext *C, wmOperator *op)
void GPENCIL_OT_lock_all(wmOperatorType *ot)
static int gpencil_frame_clean_duplicate_exec(bContext *C, wmOperator *op)
static int gpencil_brush_reset_all_exec(bContext *C, wmOperator *UNUSED(op))
static int gpencil_layer_change_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
static int gpencil_material_hide_exec(bContext *C, wmOperator *op)
void GPENCIL_OT_layer_mask_remove(wmOperatorType *ot)
static bool gpencil_materials_copy_to_object_poll(bContext *C)
void GPENCIL_OT_stroke_change_color(wmOperatorType *ot)
static int gpencil_lock_layer_exec(bContext *C, wmOperator *UNUSED(op))
void GPENCIL_OT_material_set(wmOperatorType *ot)
static bool gpencil_data_unlink_poll(bContext *C)
static int gpencil_stroke_arrange_exec(bContext *C, wmOperator *op)
void GPENCIL_OT_vertex_group_normalize_all(wmOperatorType *ot)
static bool gpencil_data_add_poll(bContext *C)
static int gpencil_unlock_all_exec(bContext *C, wmOperator *UNUSED(op))
static bool gpencil_add_annotation_poll(bContext *C)
void GPENCIL_OT_material_lock_unused(wmOperatorType *ot)
void GPENCIL_OT_material_select(wmOperatorType *ot)
static int gpencil_brush_reset_exec(bContext *C, wmOperator *UNUSED(op))
void GPENCIL_OT_frame_clean_fill(wmOperatorType *ot)
static int gpencil_vertex_group_deselect_exec(bContext *C, wmOperator *UNUSED(op))
static int gpencil_layer_duplicate_object_exec(bContext *C, wmOperator *op)
void GPENCIL_OT_brush_reset_all(wmOperatorType *ot)
void GPENCIL_OT_annotation_add(wmOperatorType *ot)
static int gpencil_material_unlock_all_exec(bContext *C, wmOperator *UNUSED(op))
static bool gpencil_active_material_poll(bContext *C)
static int gpencil_layer_move_exec(bContext *C, wmOperator *op)
static int gpencil_merge_layer_exec(bContext *C, wmOperator *op)
static void gpencil_reveal_select_frame(bContext *C, bGPDframe *frame, bool select)
void GPENCIL_OT_vertex_group_normalize(wmOperatorType *ot)
void GPENCIL_OT_layer_add(wmOperatorType *ot)
void GPENCIL_OT_layer_mask_move(wmOperatorType *ot)
static int gpencil_data_unlink_exec(bContext *C, wmOperator *op)
static int gpencil_material_reveal_exec(bContext *C, wmOperator *UNUSED(op))
void GPENCIL_OT_materials_copy_to_object(wmOperatorType *ot)
static int gpencil_vertex_group_normalize_exec(bContext *C, wmOperator *op)
void GPENCIL_OT_layer_mask_add(wmOperatorType *ot)
void GPENCIL_OT_reveal(wmOperatorType *ot)
void GPENCIL_OT_layer_duplicate(wmOperatorType *ot)
void GPENCIL_OT_vertex_group_assign(wmOperatorType *ot)
static int gpencil_frame_clean_fill_exec(bContext *C, wmOperator *op)
static int gpencil_frame_duplicate_exec(bContext *C, wmOperator *op)
void GPENCIL_OT_layer_merge(wmOperatorType *ot)
static bool gpencil_vertex_group_weight_poll(bContext *C)
static int gpencil_vertex_group_smooth_exec(bContext *C, wmOperator *op)
void GPENCIL_OT_unlock_all(wmOperatorType *ot)
void GPENCIL_OT_material_lock_all(wmOperatorType *ot)
static int gpencil_stroke_change_color_exec(bContext *C, wmOperator *op)
void GPENCIL_OT_data_unlink(wmOperatorType *ot)
static int gpencil_material_lock_all_exec(bContext *C, wmOperator *UNUSED(op))
static int gpencil_layer_copy_exec(bContext *C, wmOperator *op)
void GPENCIL_OT_brush_reset(wmOperatorType *ot)
static int gpencil_layer_remove_exec(bContext *C, wmOperator *op)
void GPENCIL_OT_set_active_material(wmOperatorType *ot)
@ GP_FRAME_CLEAN_FILL_ALL
@ GP_FRAME_CLEAN_FILL_ACTIVE
static int gpencil_layer_active_exec(bContext *C, wmOperator *op)
static int gpencil_set_active_material_exec(bContext *C, wmOperator *op)
static int gpencil_lock_all_exec(bContext *C, wmOperator *UNUSED(op))
static int gpencil_layer_mask_move_exec(bContext *C, wmOperator *op)
static int gpencil_material_lock_unsused_exec(bContext *C, wmOperator *UNUSED(op))
static int gpencil_layer_mask_add_exec(bContext *C, wmOperator *op)
static int gpencil_vertex_group_normalize_all_exec(bContext *C, wmOperator *op)
void GPENCIL_OT_frame_clean_loose(wmOperatorType *ot)
void GPENCIL_OT_hide(wmOperatorType *ot)
void GPENCIL_OT_material_isolate(wmOperatorType *ot)
static int gpencil_vertex_group_remove_from_exec(bContext *C, wmOperator *UNUSED(op))
void GPENCIL_OT_vertex_group_select(wmOperatorType *ot)
static int gpencil_vertex_group_assign_exec(bContext *C, wmOperator *UNUSED(op))
static bool gpencil_layer_duplicate_object_poll(bContext *C)
static int gpencil_data_add_exec(bContext *C, wmOperator *op)
void GPENCIL_OT_vertex_group_deselect(wmOperatorType *ot)
void GPENCIL_OT_material_hide(wmOperatorType *ot)
static int gpencil_vertex_group_select_exec(bContext *C, wmOperator *UNUSED(op))
void GPENCIL_OT_layer_duplicate_object(wmOperatorType *ot)
static Brush * gpencil_brush_get_first_by_mode(Main *bmain, Paint *UNUSED(paint), const enum eContextObjectMode mode, char tool)
void GPENCIL_OT_layer_annotation_add(wmOperatorType *ot)
void GPENCIL_OT_layer_move(wmOperatorType *ot)
static int gpencil_vertex_group_invert_exec(bContext *C, wmOperator *op)
void GPENCIL_OT_material_unlock_all(wmOperatorType *ot)
static int gpencil_layer_change_exec(bContext *C, wmOperator *op)
void GPENCIL_OT_lock_layer(wmOperatorType *ot)
@ GP_LAYER_DUPLICATE_EMPTY
bool ED_gpencil_add_lattice_modifier(const bContext *C, ReportList *reports, Object *ob, Object *ob_latt)
static bool gpencil_reveal_poll(bContext *C)
static void gpencil_brush_delete_mode_brushes(Main *bmain, Paint *paint, const enum eContextObjectMode mode)
static int gpencil_material_isolate_exec(bContext *C, wmOperator *op)
void GPENCIL_OT_vertex_group_remove_from(wmOperatorType *ot)
void GPENCIL_OT_frame_clean_duplicate(wmOperatorType *ot)
static bool gpencil_vertex_group_poll(bContext *C)
static void apply_layer_settings(bGPDlayer *gpl)
void GPENCIL_OT_layer_active(wmOperatorType *ot)
static int gpencil_reveal_exec(bContext *C, wmOperator *op)
const struct EnumPropertyItem * ED_gpencil_material_enum_itemf(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, bool *r_free)
#define GP_EDITABLE_STROKES_BEGIN(gpstroke_iter, C, gpl, gps)
const struct EnumPropertyItem * ED_gpencil_layers_with_new_enum_itemf(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, bool *r_free)
bool gpencil_active_layer_poll(struct bContext *C)
#define GP_EDITABLE_STROKES_END(gpstroke_iter)
bool gpencil_add_poll(struct bContext *C)
void ED_gpencil_vgroup_deselect(bContext *C, Object *ob)
bool ED_gpencil_stroke_material_editable(Object *ob, const bGPDlayer *gpl, const bGPDstroke *gps)
void ED_gpencil_vgroup_select(bContext *C, Object *ob)
void ED_gpencil_vgroup_remove(bContext *C, Object *ob)
bGPdata * ED_annotation_data_get_active(const bContext *C)
void ED_gpencil_layer_merge(bGPdata *gpd, bGPDlayer *gpl_src, bGPDlayer *gpl_dst, const bool reverse)
bool ED_gpencil_stroke_can_use(const bContext *C, const bGPDstroke *gps)
bGPdata * ED_gpencil_data_get_active(const bContext *C)
bGPdata ** ED_annotation_data_get_pointers(const bContext *C, PointerRNA *r_ptr)
void ED_gpencil_vgroup_assign(bContext *C, Object *ob, float weight)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_dupallocN)(const void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
void RNA_string_get(PointerRNA *ptr, const char *name, char *value)
int RNA_int_get(PointerRNA *ptr, const char *name)
float RNA_float_get(PointerRNA *ptr, const char *name)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
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 DummyRNA_DEFAULT_items[]
struct BrushGpencilSettings * gpencil_settings
void(* bakeModifier)(struct Main *bmain, struct Depsgraph *depsgraph, struct GpencilModifierData *md, struct Object *ob)
struct MaterialGPencilStyle * gp_style
ListBase vertex_group_names
int vertex_group_active_index
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
struct wmOperatorType * type
void WM_main_add_notifier(unsigned int type, void *reference)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)