Merge branch 'blender-v2.81-release'
This commit is contained in:
@@ -181,6 +181,7 @@ def submodules_update(args, release_version, branch):
|
||||
skip_msg += submodule_path + " skipped: " + msg + "\n"
|
||||
else:
|
||||
if make_utils.git_branch(args.git_command) != submodule_branch:
|
||||
call([args.git_command, "fetch", "origin"])
|
||||
call([args.git_command, "checkout", submodule_branch])
|
||||
call([args.git_command, "pull", "--rebase", "origin", submodule_branch])
|
||||
finally:
|
||||
|
||||
@@ -2145,6 +2145,7 @@ static int convert_exec(bContext *C, wmOperator *op)
|
||||
const short target = RNA_enum_get(op->ptr, "target");
|
||||
bool keep_original = RNA_boolean_get(op->ptr, "keep_original");
|
||||
int a, mballConverted = 0;
|
||||
bool gpencilConverted = false;
|
||||
|
||||
/* don't forget multiple users! */
|
||||
|
||||
@@ -2385,20 +2386,20 @@ static int convert_exec(bContext *C, wmOperator *op)
|
||||
}
|
||||
else if (target == OB_GPENCIL) {
|
||||
if (ob->type != OB_CURVE) {
|
||||
ob->flag &= ~OB_DONE;
|
||||
BKE_report(
|
||||
op->reports, RPT_ERROR, "Convert Surfaces to Grease Pencil is not supported.");
|
||||
}
|
||||
else {
|
||||
/* Create a new grease pencil object only if it was not created before.
|
||||
* All curves selected are converted as strokes of the same grease pencil object.
|
||||
/* Create a new grease pencil object and copy transformations.
|
||||
* Nurbs Surface are not supported.
|
||||
*/
|
||||
if (gpencil_ob == NULL) {
|
||||
const float *cur = scene->cursor.location;
|
||||
ushort local_view_bits = (v3d && v3d->localvd) ? v3d->local_view_uuid : 0;
|
||||
gpencil_ob = ED_gpencil_add_object(C, scene, cur, local_view_bits);
|
||||
}
|
||||
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);
|
||||
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);
|
||||
gpencilConverted = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2498,6 +2499,17 @@ static int convert_exec(bContext *C, wmOperator *op)
|
||||
}
|
||||
FOREACH_SCENE_OBJECT_END;
|
||||
}
|
||||
/* Remove curves converted to Grease Pencil object. */
|
||||
if (gpencilConverted) {
|
||||
FOREACH_SCENE_OBJECT_BEGIN (scene, ob_curve) {
|
||||
if (ob_curve->type == OB_CURVE) {
|
||||
if (ob_curve->flag & OB_DONE) {
|
||||
ED_object_base_free_and_unlink(bmain, scene, ob_curve);
|
||||
}
|
||||
}
|
||||
}
|
||||
FOREACH_SCENE_OBJECT_END;
|
||||
}
|
||||
}
|
||||
|
||||
// XXX ED_object_editmode_enter(C, 0);
|
||||
|
||||
Reference in New Issue
Block a user