[Bf-blender-cvs] [2232855b50e] master: Curves: align surface and curves object in Empty Hair operator

Jacques Lucke noreply at git.blender.org
Tue Jul 19 15:50:59 CEST 2022


Commit: 2232855b50e90ef49d07df8ee4e3e0d0efb2cc4c
Author: Jacques Lucke
Date:   Tue Jul 19 15:49:29 2022 +0200
Branches: master
https://developer.blender.org/rB2232855b50e90ef49d07df8ee4e3e0d0efb2cc4c

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.

===================================================================

M	source/blender/editors/object/object_add.cc

===================================================================

diff --git a/source/blender/editors/object/object_add.cc b/source/blender/editors/object/object_add.cc
index 35d23edfbf0..a8e11afba65 100644
--- a/source/blender/editors/object/object_add.cc
+++ b/source/blender/editors/object/object_add.cc
@@ -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);



More information about the Bf-blender-cvs mailing list