Age | Commit message (Collapse) | Author |
|
|
|
This change ensures that operators which needs access to evaluated data
first makes sure there is a dependency graph.
Other accesses to the dependency graph made it more explicit about
whether they just need a valid dependency graph pointer or whether they
expect the graph to be already evaluated.
This replaces OPTYPE_USE_EVAL_DATA which is now removed.
Some general rules about usage of accessors:
- Drawing is expected to happen from a fully evaluated dependency graph.
There is now a function to access it, which will in the future control
that dependency graph is actually evaluated.
This check is not yet done because there are some things to be taken
care about first: for example, post-update hooks might leave scene in
a state where something is still tagged for update.
- All operators which needs to access evaluated state must use
CTX_data_ensure_evaluated_depsgraph().
This function replaces OPTYPE_USE_EVAL_DATA.
The call is generally to be done in the very beginning of the
operator, prior other logic (unless this is some comprehensive
operator which might or might not need access to an evaluated state).
This call is never to be used from a loop.
If some utility function requires evaluated state of dependency graph
the graph is to be passed as an explicit argument. This way it is
clear that no evaluation happens in a loop or something like this.
- All cases which needs to know dependency graph pointer, but which
doesn't want to actually evaluate it can use old-style function
CTX_data_depsgraph_pointer(), assuming that underlying code will
ensure dependency graph is evaluated prior to accessing it.
- The new functions are replacing OPTYPE_USE_EVAL_DATA, so now it is
explicit and local about where dependency graph is being ensured.
This commit also contains some fixes of wrong usage of evaluation
functions on original objects. Ideally should be split out, but in
reality with all the APIs being renamed is quite tricky.
Fixes T67454: Blender crash on rapid undo and select
Speculation here is that sometimes undo and selection operators are
sometimes handled in the same event loop iteration, which leaves
non-evaluated dependency graph.
Fixes T67973: Crash on Fix Deforms operator
Fixes T67902: Crash when undo a loop cut
Reviewers: brecht
Reviewed By: brecht
Subscribers: lichtwerk
Maniphest Tasks: T67454
Differential Revision: https://developer.blender.org/D5343
|
|
Differential Revision: https://developer.blender.org/D3744
|
|
The copy operator requried at least a vert AND a face to be selected.
It should only require that a vert OR a face is selected.
|
|
This commit moves the API of selecting faces, vertices and edges to a DRW manager engine.
Reviewers: campbellbarton, fclem
Subscribers: jbakker, brecht
Differential Revision: https://developer.blender.org/D5090
|
|
Removing this since it was added for TexFace support
which has since been removed.
|
|
|
|
When a mesh is pinned in the properties panel, Blender crashes when you
click the "Add Custom Split Normals Data".
The code calls `ob = ED_object_context(C)` which returns NULL when the
mesh is pinned in the properties panel, causing a segfault when trying
to get the mesh via `ob->data`.
A new function `ED_mesh_context(C)` avoids this by first checking
whether a mesh was pinned in the context. If not, it checks the pinned
object's data. If that's not there, or it's not a mesh, it returns the
active object's mesh. Finally it returns NULL if there is no active
object, or if the active object is not a mesh object.
Reviewed By: brecht, mont29
Differential Revision: https://developer.blender.org/D5223
|
|
|
|
This is needed step out of undo steps which accumulate changes,
larger changes could be made to handle this but better not
make them at this point.
|
|
Reviewers: brecht
Maniphest Tasks: T66332
Differential Revision: https://developer.blender.org/D5177
|
|
|
|
Leaving the modal point-at as a TODO for now.
All the rest of the new split normal tools converted to
operate on all selected objects.
|
|
clnor editing code was simply not checking at all whether it has
something to work on... Guess nobody had idea to edit custom normals on
a mesh that has no normals before! :P
This should probably be handled in a poll function too, to completely
disable those tools when there are no faces/loops, but let's keep it to
minimal changes at that point.
|
|
The fix for T60777 caused this operator not to work from Python.
Add a repeat_last flag for operator execution.
|
|
|
|
|
|
Merge code will generate temp normal editing data for affected loops,
but since it will later (by setting some edges/faces to smooth) alter
and extend affected clnor spaces, it will also need temp normal editing
data for some other loops around those vertices...
Using those clnor editing data in that code is a bit of an abuse, but on
the other hand that struct stores exactly what we need.
So simply added an option to generate that editing data for all clnors
of affected vertices.
|
|
This patch does not bring functional changes, but it is a good change if we want to use these utilities in areas other than those using BMesh (eg painting editors).
This is also a step to replace `ED_view3d_select_id_validate`. That function erroneously checks `V3D_INVALID_BACKBUF` which causes it to update unnecessarily.
Reviewers: campbellbarton
Differential Revision: https://developer.blender.org/D5072
|
|
Cheap tip: anything that is not "Camel Case" and/or that is more than
a few words long should use `TIP_` translation, not `IFACE_` one.
Also added several missing strings (including the one reported in D5056
by Jean First (@robbott), thanks).
|
|
The fix itself is by Germano Cavalcante (mano-wii).
But since I was investigating this with him, I'm including here an
assert in EDBM_select_id_bm_elem_get to help catching this sooner
in the future
|
|
|
|
Operator flags to wrap on a single axis.
D4865 by @Gvgeo with updates.
Resolves T64585
|
|
Match edit-mesh drawing.
|
|
Declaration and implementation of EDBM_select_id_context_create got
out of sync leading to warning with msvc.
|
|
|
|
Differential Revision: https://developer.blender.org/D4926
|
|
Rename it to GPU_batch_draw_advanced and use base instance when possible.
Also add GPU_batch_bind to bind the vao independantly of drawing commands.
|
|
|
|
This was a very specific option to display in global tool settings.
Now this is exposed in the operator when edge-select mode is enabled.
|
|
|
|
Now Normal menu operations and rotate normals (r n) do not need
manual enabling of autosmooth first.
See T64324 for discussion of Normal UI changes.
|
|
Useful to have a generic user data with an optional custom free function,
use for wmGesture.
|
|
|
|
|
|
Removes EDBM_backbuf use.
|
|
|
|
The previous fix 8a6414ed46f66, resolved selection picking but didn't
work for box/circle/lasso select.
- Add ED_select_buffer_utils.h for general select-buffer operations
unrelated to edit-mesh.
- Circle select still needs to cache select-id's for each update.
|
|
|
|
Bug introduced in T64759.
|
|
This patch does not bring any functional change, but it does expose
some utilities that can be very useful to correct occlusion and
performance problems of Circle Select and similar.
Creating a selection context still makes it easier to track issues.
|
|
Since 8a6414ed46f66 the old logic no longer applies.
|
|
Regression in recent commit 8a6414ed46f66
|
|
Avoids having to check rotation modes to get the orientation.
|
|
|
|
This isn't used for looping.
|
|
|
|
Broken in rB0ac3d5f7db67 last year...
|
|
|
|
|