Curves: align surface and curves object in Empty Hair operator
Without this, symmetry does not work by default when the surface object was not at the same location as the 3d cursor.
This commit is contained in:
parent
95fd7c3679
commit
2232855b50
|
@ -2071,16 +2071,16 @@ static int object_curves_empty_hair_add_exec(bContext *C, wmOperator *op)
|
|||
Scene *scene = CTX_data_scene(C);
|
||||
|
||||
ushort local_view_bits;
|
||||
blender::float3 loc, rot;
|
||||
if (!ED_object_add_generic_get_opts(
|
||||
C, op, 'Z', loc, rot, nullptr, nullptr, &local_view_bits, nullptr)) {
|
||||
C, op, 'Z', nullptr, nullptr, nullptr, nullptr, &local_view_bits, nullptr)) {
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
Object *surface_ob = CTX_data_active_object(C);
|
||||
BLI_assert(surface_ob != nullptr);
|
||||
|
||||
Object *curves_ob = ED_object_add_type(C, OB_CURVES, nullptr, loc, rot, false, local_view_bits);
|
||||
Object *curves_ob = ED_object_add_type(C, OB_CURVES, nullptr, nullptr, nullptr, false, local_view_bits);
|
||||
BKE_object_apply_mat4(curves_ob, surface_ob->obmat, false, false);
|
||||
|
||||
/* Set surface object. */
|
||||
Curves *curves_id = static_cast<Curves *>(curves_ob->data);
|
||||
|
|
Loading…
Reference in New Issue