In some cases we need to use this array afterwards,
so this gives control over which objects are used for picking.
Also use an index argument as return argument
so callers that need to know the index in the array
don't need to calculate it afterwards.
- Poly build now uses a new gizmo for pre-selection
which has the same behavior as loop-cut.
This replaces hack where mouse-move set the active element
which was no longer working properly because of missing
depsgraph updates.
- Multi-object support for poly-build.
- Support for deformed cage.
- Fix error where changing active object wasn't properly
refreshing the preselect gizmo (for loopcut too).
Currently holding Alt to select non-boundary element's isn't working.
I (Dalai) did a few changes before committing:
* Code style (mostly tabs instead of space).
* Skip loop when no vert selected.
* Keeping comment on why always return FINISHED.
Maniphest Tasks: T54643
https://developer.blender.org/D3338
Changes from reviewer (Dalai Felinto):
* Code style (replace tabs with spaces).
* Return OPERATOR_CANCELLED if no a single object get through.
Maniphest Tasks: T54643
https://developer.blender.org/D3392
"Blend from Shape" lists keys from active object and applies to all selected
objects that have keys with a matching name.
Changes from reviewer (Dalai Felinto):
* Code Style.
* Move Object **objects after sanity check to prevent leak when
returning OPERATOR_CANCELLED.
* Skip objects that have no selected vertex.
* Fixed existent comments code-style: Since we are changing the indentation of
these lines, may as well correct this as well.
Differential Revision: https://developer.blender.org/D3656
Since D3284 was inactive for a long time, I figured I could finish this.
This revision also gives warning when there are no selected faces or when
selected faces are invalid.
Changes from reviewer (Dalai Felinto) :
* Code style
* Fix checking for ngons (BM_ITER_MESH is a for loop, you need to break from it
before continuing the object iteration loop).
Differential Revision: https://developer.blender.org/D3659
- Add orientation option (defaults to local, as 2.7x does)
can optionally use global, cursor, view... etc.
- Fix typo which caused select flush to fail.
- Fix for instanced objects (was only checking one instance).
- Only tag for changes if a change is made.
- Skip meshes with all vertices selected.
Now that this operator is working properly (in world space axis), it can
be ported for multi object support.
The issue of only running on redo is still present though, to be investigated
later.
Not, I tried using `dist_signed_squared_to_plane_v3` but profiling showed that
it is 50% slower than using regular `mul_v3_m4v3` for the verts.
I managed to get this number closer when manually inlining all the functions
called by `dist_signed_squared_to_plane_v3`. But still `mul_v3_m4v3` was better
and it makes the code simpler to understand.
Also I'm changing the default mode to positive, no idea why it was negative as
default in the first place.
Last but not least, the operator only works well on redo. This was a problem
before, not introduced by this patch.
This fully works as "expected", however it seems strange when
there is no selected vertex in the non-active object.
In 2.7x if you join two monkeys, select a vertex in one of them and
try to use this operator in the other it will select the lonely newly
selected vertex.
If you split both monkeys and do this in 2.8 while multi-editing them
you won't get nothing when trying to ctrl+RMB any vertex in the monkey
object that has nothing selected yet.
I propose to have this addressed in an upcoming patch where we always
select a vertex if no vertex was previously selected.