107 if (gpd_ptr ==
NULL) {
143 ot->
name =
"Annotation Add New";
144 ot->
idname =
"GPENCIL_OT_annotation_add";
161 if ((gpd_ptr !=
NULL) && (*gpd_ptr !=
NULL)) {
168 return (gpd_ptr && *gpd_ptr);
176 if (gpd_ptr ==
NULL) {
195 ot->
name =
"Annotation Unlink";
196 ot->
idname =
"GPENCIL_OT_data_unlink";
213 const bool is_annotation =
STREQ(op->
idname,
"GPENCIL_OT_layer_annotation_add");
223 if (gpd_ptr ==
NULL) {
228 if (*gpd_ptr ==
NULL) {
263 ot->
name =
"Add New Layer";
264 ot->
idname =
"GPENCIL_OT_layer_add";
265 ot->
description =
"Add new layer or note for the active data-block";
282 ot->
name =
"Add New Annotation Layer";
283 ot->
idname =
"GPENCIL_OT_layer_annotation_add";
284 ot->
description =
"Add new Annotation layer or note for the active data-block";
296 const bool is_annotation =
STREQ(op->
idname,
"GPENCIL_OT_layer_annotation_remove");
340 ot->
name =
"Remove Layer";
341 ot->
idname =
"GPENCIL_OT_layer_remove";
356 return (gpl !=
NULL);
362 ot->
name =
"Remove Annotation Layer";
363 ot->
idname =
"GPENCIL_OT_layer_annotation_remove";
381 const bool is_annotation =
STREQ(op->
idname,
"GPENCIL_OT_layer_annotation_move");
415 ot->
name =
"Move Grease Pencil Layer";
416 ot->
idname =
"GPENCIL_OT_layer_move";
417 ot->
description =
"Move the active Grease Pencil layer up/down in the list";
438 ot->
name =
"Move Annotation Layer";
439 ot->
idname =
"GPENCIL_OT_layer_annotation_move";
440 ot->
description =
"Move the active Annotation layer up/down in the list";
485 sizeof(new_layer->
info));
505 ot->
name =
"Duplicate Layer";
506 ot->
idname =
"GPENCIL_OT_layer_duplicate";
507 ot->
description =
"Make a copy of the active Grease Pencil layer";
542 if ((base->object != ob) && (base->object->type ==
OB_GPENCIL)) {
557 if (name[0] ==
'\0') {
570 if (
ELEM(
NULL, gpd_src, gpl_src, ob_dst)) {
584 gpl_dst->thickness = gpl_src->thickness;
585 gpl_dst->line_change = gpl_src->line_change;
586 copy_v4_v4(gpl_dst->tintcolor, gpl_src->tintcolor);
587 gpl_dst->opacity = gpl_src->opacity;
608 if (ma_src !=
NULL) {
638 ot->
name =
"Duplicate Layer to New Object";
639 ot->
idname =
"GPENCIL_OT_layer_duplicate_object";
640 ot->
description =
"Make a copy of the active Grease Pencil layer to new object";
696 {
GP_FRAME_DUP_ALL,
"ALL", 0,
"All",
"Duplicate active frames in all layers"},
701 ot->
name =
"Duplicate Frame";
702 ot->
idname =
"GPENCIL_OT_frame_duplicate";
703 ot->
description =
"Make a copy of the active Grease Pencil Frame";
723 bool changed =
false;
730 init_gpf = gpl->frames.first;
786 ot->
name =
"Clean Fill Boundaries";
787 ot->
idname =
"GPENCIL_OT_frame_clean_fill";
803 bool changed =
false;
809 bGPDframe *init_gpf = (is_multiedit) ? gpl->frames.first : gpl->actframe;
812 if ((gpf == gpl->actframe) || ((gpf->flag &
GP_FRAME_SELECT) && (is_multiedit))) {
825 if (gps->totpoints <= limit) {
862 ot->
name =
"Clean Loose Points";
863 ot->
idname =
"GPENCIL_OT_frame_clean_loose";
879 "Number of points to consider stroke as loose",
887 if ((gpf_a ==
NULL) || (gpf_b ==
NULL)) {
893 if ((totstrokes_a == 0) || (totstrokes_b == 0) || (totstrokes_a != totstrokes_b)) {
899 for (
int i = 0; i < totstrokes_a; i++) {
914 if (gps_a->
caps[0] != gps_b->
caps[0]) {
917 if (gps_a->
caps[1] != gps_b->
caps[1]) {
937 for (
int p = 0; p < gps_a->
totpoints; p++) {
972 bool changed =
false;
986 while (gpf !=
NULL) {
1012 {0,
"ALL", 0,
"All Frames",
""},
1013 {1,
"SELECTED", 0,
"Selected Frames",
""},
1018 ot->
name =
"Clean Duplicated Frames";
1019 ot->
idname =
"GPENCIL_OT_frame_clean_duplicate";
1072 ot->
name =
"Hide Layer(s)";
1074 ot->
description =
"Hide selected/unselected Grease Pencil layers";
1085 ot->
srna,
"unselected", 0,
"Unselected",
"Hide unselected rather than selected layers");
1107 for (i = 0, pt = gps->
points; i < gps->totpoints; i++, pt++) {
1135 if (gpl->actframe) {
1142 for (gpf = gpl->frames.first; gpf; gpf = gpf->
next) {
1160 ot->
name =
"Show All Layers";
1201 ot->
name =
"Lock All Layers";
1202 ot->
idname =
"GPENCIL_OT_lock_all";
1204 "Lock all Grease Pencil layers to prevent them from being accidentally modified";
1240 ot->
name =
"Unlock All Layers";
1241 ot->
idname =
"GPENCIL_OT_unlock_all";
1242 ot->
description =
"Unlock all Grease Pencil layers so that they can be edited";
1259 bool isolate =
false;
1280 if ((gpl->flag & flags) == 0) {
1300 gpl->flag &= ~flags;
1314 ot->
name =
"Isolate Layer";
1315 ot->
idname =
"GPENCIL_OT_layer_isolate";
1317 "Toggle whether the active layer is the only one that can be edited and/or visible";
1328 "affect_visibility",
1330 "Affect Visibility",
1331 "In addition to toggling the editability, also affect the visibility");
1342 if (
ELEM(
NULL, gpd, gpl_dst, gpl_src)) {
1410 ot->
idname =
"GPENCIL_OT_layer_merge";
1411 ot->
description =
"Merge the current layer with the layer below";
1431 uiItemsEnumO(layout,
"GPENCIL_OT_layer_change",
"layer");
1444 if (layer_num == -1) {
1454 op->
reports,
RPT_ERROR,
"Cannot change to non-existent layer (index = %d)", layer_num);
1473 ot->
name =
"Change Layer";
1474 ot->
idname =
"GPENCIL_OT_layer_change";
1501 op->
reports,
RPT_ERROR,
"Cannot change to non-existent layer (index = %d)", layer_num);
1519 ot->
name =
"Active Layer";
1520 ot->
idname =
"GPENCIL_OT_layer_active";
1560 bool changed =
false;
1565 bGPDframe *init_gpf = (is_multiedit) ? gpl->frames.first : gpl->actframe;
1569 if ((gpf == gpl->actframe) || ((gpf->flag &
GP_FRAME_SELECT) && (is_multiedit))) {
1574 for (gps = gpf->strokes.first; gps; gps = gps->next) {
1585 bool gpf_lock =
false;
1588 if (gps == gpf->strokes.last) {
1595 if (gps == gpf->strokes.first) {
1607 const int target_index = (gps_target) ?
BLI_findindex(&gpf->strokes, gps_target) : -1;
1608 int prev_index = target_index;
1610 switch (direction) {
1631 if (gps_index + 1 >= prev_index) {
1632 prev_index = gps_index;
1635 prev_index = gps_index;
1647 if (gps_index - 1 <= prev_index) {
1648 prev_index = gps_index;
1651 prev_index = gps_index;
1679 if (!is_multiedit) {
1705 ot->
name =
"Arrange Stroke";
1706 ot->
idname =
"GPENCIL_OT_stroke_arrange";
1707 ot->
description =
"Arrange selected strokes up/down in the display order of the active layer";
1731 if (name[0] ==
'\0') {
1756 bool changed =
false;
1759 bGPDframe *init_gpf = (is_multiedit) ? gpl->frames.first : gpl->actframe;
1762 if ((gpf == gpl->actframe) || ((gpf->flag &
GP_FRAME_SELECT) && (is_multiedit))) {
1787 if (!is_multiedit) {
1806 ot->
name =
"Change Stroke Color";
1807 ot->
idname =
"GPENCIL_OT_stroke_change_color";
1808 ot->
description =
"Move selected strokes to active material";
1834 for (
short i = 0; i < *totcol; i++) {
1842 bool changed =
false;
1847 for (
bGPDstroke *gps = gpl->actframe->strokes.last; gps; gps = gps->
prev) {
1885 ot->
name =
"Lock Unused Materials";
1886 ot->
idname =
"GPENCIL_OT_material_lock_unused";
1887 ot->
description =
"Lock any material not used in any selected stroke";
1911 brush = paint->
brush;
1919 brush = paint->
brush;
1927 brush = paint->
brush;
1935 brush = paint->
brush;
1954 ot->
name =
"Reset Brush";
1955 ot->
idname =
"GPENCIL_OT_brush_reset";
1972 brush_next = brush->
id.
next;
1974 if (brush->gpencil_settings ==
NULL) {
2005 brush_next = brush->
id.
next;
2011 short preset = (brush->gpencil_settings) ? brush->gpencil_settings->preset_type :
2020 if ((brush_active) && (brush_active->
gpencil_tool != brush->gpencil_tool)) {
2029 if ((brush_active) && (brush_active->
gpencil_sculpt_tool != brush->gpencil_sculpt_tool)) {
2038 if ((brush_active) && (brush_active->
gpencil_weight_tool != brush->gpencil_weight_tool)) {
2047 if ((brush_active) && (brush_active->
gpencil_vertex_tool != brush->gpencil_vertex_tool)) {
2054 if ((brush->gpencil_settings) && (brush->gpencil_settings->material !=
NULL)) {
2055 brush->gpencil_settings->material =
NULL;
2161 ot->
name =
"Reset All Brushes";
2162 ot->
idname =
"GPENCIL_OT_brush_reset_all";
2163 ot->
description =
"Delete all mode brushes and recreate a default set";
2227 ot->
name =
"Assign to Vertex Group";
2228 ot->
idname =
"GPENCIL_OT_vertex_group_assign";
2229 ot->
description =
"Assign the selected vertices to the active vertex group";
2262 ot->
name =
"Remove from Vertex Group";
2263 ot->
idname =
"GPENCIL_OT_vertex_group_remove_from";
2264 ot->
description =
"Remove the selected vertices from active or all vertex group(s)";
2296 ot->
name =
"Select Vertex Group";
2297 ot->
idname =
"GPENCIL_OT_vertex_group_select";
2298 ot->
description =
"Select all the vertices assigned to the active vertex group";
2330 ot->
name =
"Deselect Vertex Group";
2331 ot->
idname =
"GPENCIL_OT_vertex_group_deselect";
2332 ot->
description =
"Deselect all selected vertices assigned to the active vertex group";
2354 const int def_nr = ob->
actdef - 1;
2356 if (defgroup ==
NULL) {
2366 if ((gps->totpoints == 0) || (gps->dvert ==
NULL)) {
2370 for (
int i = 0; i < gps->totpoints; i++) {
2371 dvert = &gps->dvert[i];
2376 else if (dw->
weight == 1.0f) {
2397 ot->
name =
"Invert Vertex Group";
2398 ot->
idname =
"GPENCIL_OT_vertex_group_invert";
2399 ot->
description =
"Invert weights to the active vertex group";
2423 const int def_nr = ob->
actdef - 1;
2425 if (defgroup ==
NULL) {
2438 if ((gps->totpoints == 0) || (gps->dvert ==
NULL)) {
2442 for (
int s = 0; s < repeat; s++) {
2443 for (
int i = 0; i < gps->totpoints; i++) {
2446 pta = &gps->points[i - 1];
2447 dverta = &gps->dvert[i - 1];
2450 pta = &gps->points[i];
2451 dverta = &gps->dvert[i];
2454 ptb = &gps->points[i];
2455 dvertb = &gps->dvert[i];
2457 if (i + 1 < gps->totpoints) {
2458 ptc = &gps->points[i + 1];
2461 ptc = &gps->points[i];
2471 const float optimal =
interpf(wa, wb, opfac);
2494 ot->
name =
"Smooth Vertex Group";
2495 ot->
idname =
"GPENCIL_OT_vertex_group_smooth";
2496 ot->
description =
"Smooth weights to the active vertex group";
2522 const int def_nr = ob->
actdef - 1;
2524 if (defgroup ==
NULL) {
2534 if ((gps->totpoints == 0) || (gps->dvert ==
NULL)) {
2539 float maxvalue = 0.0f;
2540 for (
int i = 0; i < gps->totpoints; i++) {
2541 dvert = &gps->dvert[i];
2543 if ((dw !=
NULL) && (dw->
weight > maxvalue)) {
2549 if (maxvalue > 0.0f) {
2550 for (
int i = 0; i < gps->totpoints; i++) {
2551 dvert = &gps->dvert[i];
2572 ot->
name =
"Normalize Vertex Group";
2573 ot->
idname =
"GPENCIL_OT_vertex_group_normalize";
2574 ot->
description =
"Normalize weights to the active vertex group";
2599 const int def_nr = ob->
actdef - 1;
2601 if (defbase_tot == 0) {
2607 if ((gps->totpoints == 0) || (gps->dvert ==
NULL)) {
2612 float *tot_values =
MEM_callocN(gps->totpoints *
sizeof(
float), __func__);
2614 for (
int i = 0; i < gps->totpoints; i++) {
2615 dvert = &gps->dvert[i];
2616 for (
int v = 0;
v < defbase_tot;
v++) {
2624 if ((lock_active) && (
v == def_nr)) {
2630 tot_values[i] += dw->
weight;
2636 for (
int i = 0; i < gps->totpoints; i++) {
2637 if (tot_values[i] == 0.0f) {
2641 dvert = &gps->dvert[i];
2642 for (
int v = 0;
v < defbase_tot;
v++) {
2650 if ((lock_active) && (
v == def_nr)) {
2677 ot->
name =
"Normalize All Vertex Group";
2678 ot->
idname =
"GPENCIL_OT_vertex_group_normalize_all";
2680 "Normalize all weights of all vertex groups, "
2681 "so that for each vertex, the sum of all weights is 1.0";
2695 "Keep the values of the active group while normalizing others");
2728 if (!
STREQ(old_name, new_name) && strstr(fcu->
rna_path, old_name)) {
2730 id, fcu->
rna_path,
"layers", old_name, new_name, 0, 0,
false);
2747 if (dtar->id == src_id) {
2754 if (dtar->rna_path && strstr(dtar->rna_path,
"layers[")) {
2760 if (!
STREQ(old_name, new_name)) {
2761 if ((dtar->rna_path) && strstr(dtar->rna_path, old_name)) {
2764 id, dtar->rna_path,
"layers", old_name, new_name, 0, 0,
false);
2800 if ((ob_iter->rot[0] != 0) || (ob_iter->rot[1] != 0) || (ob_iter->rot[2] != 0)) {
2809 if (ob_iter == ob_active) {
2822 gpd_dst = ob_active->
data;
2823 Object *ob_dst = ob_active;
2827 if ((ob_iter->type ==
OB_GPENCIL) && (ob_iter != ob_active)) {
2829 if (ob_active->
data != ob_iter->data) {
2830 Object *ob_src = ob_iter;
2831 bGPdata *gpd_src = ob_iter->data;
2854 if (gps->dvert ==
NULL) {
2857 for (i = 0, dvert = gps->dvert; i < gps->totpoints; i++, dvert++) {
2874 for (
short i = 0; i < *totcol; i++) {
2885 float imat[3][3], bmat[3][3];
2886 float offset_global[3];
2887 float offset_local[3];
2900 float diff_mat[4][4];
2901 float inverse_diff_mat[4][4];
2917 for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
2932 sizeof(gpl_new->
info));
2996 return *totcolp > 0;
3021 for (
short i = 0; i < *totcol; i++) {
3036 for (
bGPDstroke *gps = gpl->actframe->strokes.last; gps; gps = gps->
prev) {
3047 if (gp_style !=
NULL) {
3070 ot->
name =
"Disable Unused Layer Colors";
3071 ot->
idname =
"GPENCIL_OT_lock_layer";
3072 ot->
description =
"Lock and hide any color not used in any layer";
3090 bool isolate =
false;
3096 if (
ELEM(
NULL, gpd, active_color)) {
3104 for (
short i = 0; i < *totcol; i++) {
3115 if ((gp_style->
flag & flags) == 0) {
3124 for (
short i = 0; i < *totcol; i++) {
3130 if (gp_style == active_color) {
3133 gp_style->
flag |= flags;
3139 for (
short i = 0; i < *totcol; i++) {
3145 gp_style->
flag &= ~flags;
3164 ot->
name =
"Isolate Material";
3165 ot->
idname =
"GPENCIL_OT_material_isolate";
3167 "Toggle whether the active material is the only one that is editable and/or visible";
3178 "affect_visibility",
3180 "Affect Visibility",
3181 "In addition to toggling "
3182 "the editability, also affect the visibility");
3204 for (
short i = 0; i < *totcol; i++) {
3208 if (active_color != color) {
3235 ot->
name =
"Hide Material(s)";
3236 ot->
idname =
"GPENCIL_OT_material_hide";
3237 ot->
description =
"Hide selected/unselected Grease Pencil materials";
3248 ot->
srna,
"unselected", 0,
"Unselected",
"Hide unselected rather than selected colors");
3267 for (
short i = 0; i < *totcol; i++) {
3270 gp_style = ma->gp_style;
3291 ot->
name =
"Show All Materials";
3292 ot->
idname =
"GPENCIL_OT_material_reveal";
3293 ot->
description =
"Unhide all hidden Grease Pencil materials";
3320 for (
short i = 0; i < *totcol; i++) {
3323 gp_style = ma->gp_style;
3344 ot->
name =
"Lock All Materials";
3345 ot->
idname =
"GPENCIL_OT_material_lock_all";
3347 "Lock all Grease Pencil materials to prevent them from being accidentally modified";
3373 for (
short i = 0; i < *totcol; i++) {
3376 gp_style = ma->gp_style;
3397 ot->
name =
"Unlock All Materials";
3398 ot->
idname =
"GPENCIL_OT_material_unlock_all";
3399 ot->
description =
"Unlock all Grease Pencil materials so that they can be edited";
3426 bGPDframe *init_gpf = (is_multiedit) ? gpl->frames.first : gpl->actframe;
3429 if ((gpf == gpl->actframe) || ((gpf->flag &
GP_FRAME_SELECT) && (is_multiedit))) {
3443 if (ob->
actcol == gps->mat_nr + 1) {
3455 for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
3467 if (!is_multiedit) {
3486 ot->
name =
"Select Material";
3487 ot->
idname =
"GPENCIL_OT_material_select";
3488 ot->
description =
"Select/Deselect all Grease Pencil strokes using current material";
3509 if ((slot < 1) || (slot > ob->
totcol)) {
3511 op->
reports,
RPT_ERROR,
"Cannot change to non-existent material (index = %d)", slot);
3528 ot->
name =
"Set Material";
3529 ot->
idname =
"GPENCIL_OT_material_set";
3557 bool changed =
false;
3562 ob->
actcol = gps->mat_nr + 1;
3580 ot->
name =
"Set active material";
3581 ot->
idname =
"GPENCIL_OT_set_active_material";
3582 ot->
description =
"Set the selected stroke material as the active material";
3623 if (ob_latt != mmd->
object) {
3626 "The existing Lattice modifier is already using a different Lattice object");
3644 if (gpl_active ==
NULL) {
3656 if (gpl == gpl_active) {
3666 if (gpl_active->act_mask == 256) {
3689 ot->
name =
"Add New Mask Layer";
3690 ot->
idname =
"GPENCIL_OT_layer_mask_add";
3715 if (gpl->act_mask > 0) {
3719 if ((gpl->mask_layers.first !=
NULL) && (gpl->act_mask == 0)) {
3738 ot->
name =
"Remove Mask Layer";
3739 ot->
idname =
"GPENCIL_OT_layer_mask_remove";
void BKE_animdata_merge_copy(struct Main *bmain, struct ID *dst_id, struct ID *src_id, eAnimData_MergeCopy_Modes action_mode, bool fix_drivers)
struct AnimData * BKE_animdata_copy(struct Main *bmain, struct AnimData *adt, const int flag)
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, const bool reset)
void BKE_brush_gpencil_sculpt_presets(struct Main *bmain, struct ToolSettings *ts, const bool reset)
void BKE_brush_gpencil_weight_presets(struct Main *bmain, struct ToolSettings *ts, const bool reset)
void BKE_brush_gpencil_vertex_presets(struct Main *bmain, struct ToolSettings *ts, const bool reset)
void BKE_gpencil_brush_preset_set(struct Main *bmain, struct Brush *brush, const short type)
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 ViewLayer * CTX_data_view_layer(const bContext *C)
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_layer_mask_sort(struct bGPdata *gpd, struct bGPDlayer *gpl)
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, const bool dup_frames, const 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)
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)
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])
struct bGPDstroke * BKE_gpencil_stroke_duplicate(struct bGPDstroke *gps_src, const bool dup_points, const bool dup_curve)
void BKE_gpencil_layer_delete(struct bGPdata *gpd, struct bGPDlayer *gpl)
struct bGPDlayer * BKE_gpencil_layer_addnew(struct bGPdata *gpd, const char *name, bool setactive)
struct GpencilModifierData * BKE_gpencil_modifiers_findby_type(struct Object *ob, GpencilModifierType type)
const GpencilModifierTypeInfo * BKE_gpencil_modifier_get_info(GpencilModifierType type)
void id_us_min(struct ID *id)
struct ID * BKE_libblock_find_name(struct Main *bmain, const short type, const char *name) ATTR_WARN_UNUSED_RESULT 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_report(ReportList *reports, ReportType type, const char *message)
void BKE_reportf(ReportList *reports, ReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
struct Object * BKE_scene_object_find_by_name(const struct Scene *scene, const char *name)
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_)
GHash * BLI_ghash_int_new_ex(const char *info, const unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void BLI_ghash_insert(GHash *gh, void *key, void *val)
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
void * BLI_ghash_lookup(GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
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 void BLI_movelisttolist(struct ListBase *dst, struct ListBase *src) ATTR_NONNULL(1
void void BLI_freelistN(struct ListBase *listbase) 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)
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 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
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 len)
#define POINTER_FROM_INT(i)
#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
#define ID_IS_LINKED(_id)
@ 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 RGB to Bright Vector Camera CLAMP
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
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 bool gpencil_frame_is_equal(bGPDframe *gpf_a, bGPDframe *gpf_b)
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 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)
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)
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)
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)
@ GP_LAYER_COPY_OBJECT_ACT_FRAME
@ GP_LAYER_COPY_OBJECT_ALL_FRAME
@ GP_LAYER_DUPLICATE_EMPTY
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)
static int gpencil_data_unlink_exec(bContext *C, wmOperator *op)
static int gpencil_material_reveal_exec(bContext *C, wmOperator *UNUSED(op))
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)
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_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_FRAME_CLEAN_FILL_ALL
@ GP_FRAME_CLEAN_FILL_ACTIVE
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)
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)
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)
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
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
__forceinline const avxb select(const avxb &m, const avxb &t, const avxb &f)
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
void WM_main_add_notifier(unsigned int type, void *reference)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)