Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/object')
-rw-r--r--source/blender/editors/object/object_add.c4
-rw-r--r--source/blender/editors/object/object_edit.c3
-rw-r--r--source/blender/editors/object/object_gpencil_modifier.c7
-rw-r--r--source/blender/editors/object/object_modes.c5
-rw-r--r--source/blender/editors/object/object_transform.c10
5 files changed, 19 insertions, 10 deletions
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index 06f532f99e3..17b6bfdb956 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -1537,7 +1537,7 @@ static int object_delete_exec(bContext *C, wmOperator *op)
* Will also remove parent from grease pencil from other scenes,
* even when use_global is false... */
for (bGPdata *gpd = bmain->gpencils.first; gpd; gpd = gpd->id.next) {
- for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) {
+ LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
if (gpl->parent != NULL) {
if (gpl->parent == ob) {
gpl->parent = NULL;
@@ -2394,7 +2394,7 @@ static int convert_exec(bContext *C, wmOperator *op)
* Nurbs Surface are not supported.
*/
ushort local_view_bits = (v3d && v3d->localvd) ? v3d->local_view_uuid : 0;
- gpencil_ob = ED_gpencil_add_object(C, scene, ob->loc, local_view_bits);
+ gpencil_ob = ED_gpencil_add_object(C, ob->loc, local_view_bits);
copy_v3_v3(gpencil_ob->rot, ob->rot);
copy_v3_v3(gpencil_ob->scale, ob->scale);
BKE_gpencil_convert_curve(bmain, scene, gpencil_ob, ob, false, false, true);
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index f9ac0474d44..def93db2537 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -1370,7 +1370,8 @@ static const EnumPropertyItem *object_mode_set_itemsf(bContext *C,
OB_MODE_EDIT_GPENCIL,
OB_MODE_PAINT_GPENCIL,
OB_MODE_SCULPT_GPENCIL,
- OB_MODE_WEIGHT_GPENCIL) &&
+ OB_MODE_WEIGHT_GPENCIL,
+ OB_MODE_VERTEX_GPENCIL) &&
(ob->type == OB_GPENCIL)) ||
(input->value == OB_MODE_OBJECT)) {
RNA_enum_item_add(&item, &totitem, input);
diff --git a/source/blender/editors/object/object_gpencil_modifier.c b/source/blender/editors/object/object_gpencil_modifier.c
index 9138e65dd2f..4543f1a19b3 100644
--- a/source/blender/editors/object/object_gpencil_modifier.c
+++ b/source/blender/editors/object/object_gpencil_modifier.c
@@ -91,6 +91,11 @@ GpencilModifierData *ED_object_gpencil_modifier_add(
/* make sure modifier data has unique name */
BKE_gpencil_modifier_unique_name(&ob->greasepencil_modifiers, new_md);
+ /* Enable edit mode visible by default. */
+ if (mti->flags & eGpencilModifierTypeFlag_SupportsEditmode) {
+ new_md->mode |= eGpencilModifierMode_Editmode;
+ }
+
bGPdata *gpd = ob->data;
DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY);
@@ -362,7 +367,7 @@ void OBJECT_OT_gpencil_modifier_add(wmOperatorType *ot)
PropertyRNA *prop;
/* identifiers */
- ot->name = "Add Grease Pencil Modifier";
+ ot->name = "Add Modifier";
ot->description = "Add a procedural operation/effect to the active grease pencil object";
ot->idname = "OBJECT_OT_gpencil_modifier_add";
diff --git a/source/blender/editors/object/object_modes.c b/source/blender/editors/object/object_modes.c
index 80e7e6312aa..edc2f15813c 100644
--- a/source/blender/editors/object/object_modes.c
+++ b/source/blender/editors/object/object_modes.c
@@ -88,6 +88,9 @@ static const char *object_mode_op_string(eObjectMode mode)
if (mode == OB_MODE_WEIGHT_GPENCIL) {
return "GPENCIL_OT_weightmode_toggle";
}
+ if (mode == OB_MODE_VERTEX_GPENCIL) {
+ return "GPENCIL_OT_vertexmode_toggle";
+ }
return NULL;
}
@@ -129,7 +132,7 @@ bool ED_object_mode_compat_test(const Object *ob, eObjectMode mode)
break;
case OB_GPENCIL:
if (mode & (OB_MODE_EDIT | OB_MODE_EDIT_GPENCIL | OB_MODE_PAINT_GPENCIL |
- OB_MODE_SCULPT_GPENCIL | OB_MODE_WEIGHT_GPENCIL)) {
+ OB_MODE_SCULPT_GPENCIL | OB_MODE_WEIGHT_GPENCIL | OB_MODE_VERTEX_GPENCIL)) {
return true;
}
break;
diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c
index 039714ca3ec..3b1fb49c383 100644
--- a/source/blender/editors/object/object_transform.c
+++ b/source/blender/editors/object/object_transform.c
@@ -696,7 +696,7 @@ static int apply_objects_internal(bContext *C,
/* Unsupported configuration */
bool has_unparented_layers = false;
- for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) {
+ LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
/* Parented layers aren't supported as we can't easily re-evaluate
* the scene to sample parent movement */
if (gpl->parent == NULL) {
@@ -1394,13 +1394,13 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
/* recalculate all strokes
* (all layers are considered without evaluating lock attributes) */
- for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) {
+ LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
/* calculate difference matrix */
- ED_gpencil_parent_location(depsgraph, obact, gpd, gpl, diff_mat);
+ BKE_gpencil_parent_matrix_get(depsgraph, obact, gpl, diff_mat);
/* undo matrix */
invert_m4_m4(inverse_diff_mat, diff_mat);
- for (bGPDframe *gpf = gpl->frames.first; gpf; gpf = gpf->next) {
- for (bGPDstroke *gps = gpf->strokes.first; gps; gps = gps->next) {
+ LISTBASE_FOREACH (bGPDframe *, gpf, &gpl->frames) {
+ LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) {
for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
float mpt[3];
mul_v3_m4v3(mpt, inverse_diff_mat, &pt->x);