Page MenuHome

Fix T86347: Add Primitive Tool fails for 1x1x1 scale
ClosedPublic

Authored by Philipp Oeser (lichtwerk) on Mar 7 2021, 1:07 PM.

Details

Summary

The Tool stores desired dimensions as scale and thus had to half the
scale again in make_prim_init() because by default all primitives are
created at a size of 2 in blender.

This worked, but:

  • [1] it logged something like size=2, scale=2,2,2 for a 2x2x2 cube [which does not sound right, it should be size=2 scale=1,1,1]
  • [2] it had to make an exception for the case scale is exactly 1x1x1 [this happens when the property is not set specifically, e.g. adding primitives from the menu]
    • this exception led to double sized primitives being created when the tool asked for exact dimensions of 1x1x1

Now - instead of compensating in make_prim_init() - do this earlier in
the tool itself, see view3d_interactive_add_modal, this fixes the bug
and now also correctly logs size=2 scale 0.5,0.5,0.5 for a 1x1x1 cube.

Diff Detail

Repository
rB Blender