Blender Git Commit Log

Git Commits -> Revision 9b2b32a

Revision 9b2b32a by Falk David (master)
September 13, 2021, 08:02 (GMT)
Fix T84638: Wrong scale for primitives with radius

Creating some primitives allows for a scale value (via python) that will
scale the object accordingly. For objects with a radius parameter
(like cylinders, spheres, etc.) passing a scale different to (1,1,1)
would result in unexpected behavior.

For example:
`>>> bpy.ops.mesh.primitive_uv_sphere_add(radius=2, scale=(1,1,2))`
We would expect this to create a sphere with a radius of 2
(dimensions 4,4,4) and then be scaled *2 along the z-axis
(dimensions 4,4,8). But this would previously create a scaled sphere
with dimensions (2,2,4).

The scale was simply divided by two. Maybe because the "radius"
parameter for creating the primitives was confusingly named "diameter"
(but used as the radius).

The fix adds a scale parameter to `ED_object_new_primitive_matrix`
and also renames the wrongly named "diameter" parameters to "radius".

Reviewed By: campbellbarton

Maniphest Tasks: T84638

Ref D10093

Commit Details:

Full Hash: 9b2b32a3338d873529a9b2c402feae4e9d25afdf
Parent Commit: 9d33657
Committed By: Campbell Barton
Lines Changed: +57, -56

6 Modified Paths:

/source/blender/bmesh/intern/bmesh_opdefines.c (+4, -4) (Diff)
/source/blender/bmesh/operators/bmo_primitive.c (+21, -22) (Diff)
/source/blender/editors/curve/editcurve_add.c (+4, -4) (Diff)
/source/blender/editors/include/ED_object.h (+1, -0) (Diff)
/source/blender/editors/mesh/editmesh_add.c (+5, -9) (Diff)
/source/blender/editors/object/object_add.c (+22, -17) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021