Age | Commit message (Collapse) | Author |
|
Motivation is to disambiguate on the naming level what the matrix
actually means. It is very easy to understand the meaning backwards,
especially since in Python the name goes the opposite way (it is
called `world_matrix` in the Python API).
It is important to disambiguate the naming without making developers
to look into the comment in the header file (which is also not super
clear either). Additionally, more clear naming facilitates the unit
verification (or, in this case, space validation) when reading an
expression.
This patch calls the matrix `object_to_world` which makes it clear
from the local code what is it exactly going on. This is only done
on DNA level, and a lot of local variables still follow the old
naming.
A DNA rename is setup in a way that there is no change on the file
level, so there should be no regressions at all.
The possibility is to add `_matrix` or `_mat` suffix to the name
to make it explicit that it is a matrix. Although, not sure if it
really helps the readability, or is it something redundant.
Differential Revision: https://developer.blender.org/D16328
|
|
|
|
When a change happens which invalidates view layers the syncing will be postponed until the first usage.
This will improve importing or adding many objects in a single operation/script.
`BKE_view_layer_need_resync_tag` is used to tag the view layer to be out of sync. Before accessing
`BKE_view_layer_active_base_get`, `BKE_view_layer_active_object_get`, `BKE_view_layer_active_collection`
or `BKE_view_layer_object_bases` the caller should call `BKE_view_layer_synced_ensure`.
Having two functions ensures that partial syncing could be added as smaller patches in the future. Tagging a
view layer out of sync could be replaced with a partial sync. Eventually the number of full resyncs could be
reduced. After all tagging has been replaced with partial syncs the ensure_sync could be phased out.
This patch has been added to discuss the details and consequences of the current approach. For clarity
the call to BKE_view_layer_ensure_sync is placed close to the getters.
In the future this could be placed in more strategical places to reduce the number of calls or improve
performance. Finding those strategical places isn't that clear. When multiple operations are grouped
in a single script you might want to always check for resync.
Some areas found that can be improved. This list isn't complete.
These areas aren't addressed by this patch as these changes would be hard to detect to the reviewer.
The idea is to add changes to these areas as a separate patch. It might be that the initial commit would reduce
performance compared to master, but will be fixed by the additional patches.
**Object duplication**
During object duplication the syncing is temporarily disabled. With this patch this isn't useful as when disabled
the view_layer is accessed to locate bases. This can be improved by first locating the source bases, then duplicate
and sync and locate the new bases. Will be solved in a separate patch for clarity reasons ({D15886}).
**Object add**
`BKE_object_add` not only adds a new object, but also selects and activates the new base. This requires the
view_layer to be resynced. Some callers reverse the selection and activation (See `get_new_constraint_target`).
We should make the selection and activation optional. This would make it possible to add multiple objects
without having to resync per object.
**Postpone Activate Base**
Setting the basact is done in many locations. They follow a rule as after an action find the base and set
the basact. Finding the base could require a resync. The idea is to store in the view_layer the object which
base will be set in the basact during the next sync, reducing the times resyncing needs to happen.
Reviewed By: mont29
Maniphest Tasks: T73411
Differential Revision: https://developer.blender.org/D15885
|
|
Related to {D15885} that requires scene parameter
to be added in many places. To speed up the review process
the adding of the scene parameter was added in a separate
patch.
Reviewed By: mont29
Maniphest Tasks: T73411
Differential Revision: https://developer.blender.org/D15930
|
|
These macros don't compile in C++ because of taking an address of a
temporary and use of designated initializers. Besides that, using
functions can improve debugging and type safety.
Differentil Revision: https://developer.blender.org/D15693
|
|
|
|
Currently this isn't used in the key-map, it will eventually
allow the 3D viewports tweak tool to match the behavior of other
editors that support tweaking a selection without first de-selecting
all other elements.
|
|
- Add SelectPick_Params struct to make picking logic more
straightforward and easier to extend.
- Use `eSelectOp` instead of booleans (extend, deselect, toggle)
which were used to represent 4 states (which wasn't obvious).
- Handle deselect_all when pocking instead of view3d_select_exec,
de-duplicate de-selection which was already needed in when replacing
the selection in picking functions.
- Handle outliner update & notifiers in the picking functions
instead of view3d_select_exec.
- Fix particle select deselect_all option which did nothing.
|
|
Use a shorter/simpler license convention, stops the header taking so
much space.
Follow the SPDX license specification: https://spdx.org/licenses
- C/C++/objc/objc++
- Python
- Shell Scripts
- CMake, GNUmakefile
While most of the source tree has been included
- `./extern/` was left out.
- `./intern/cycles` & `./intern/atomic` are also excluded because they
use different header conventions.
doc/license/SPDX-license-identifiers.txt has been added to list SPDX all
used identifiers.
See P2788 for the script that automated these edits.
Reviewed By: brecht, mont29, sergey
Ref D14069
|
|
Continuation of 19100aa57d847699d17527b76c2fab1f4ab88885.
|
|
GPU_select originally used GL_SELECT which defined the format for
storing the selection result.
Now this is no longer the case, define our own struct - making the code
easier to follow:
- Avoid having to deal with arrays in both `uint*` and `uint(*)[4]`
multiplying offsets by 4 in some cases & not others.
- No magic numbers for the offsets of depth & selection-ID.
- No need to allocate unused members to match GL_SELECT
(halving the buffer size).
|
|
Some doc-strings were skipped because of blank-lines between
the doc-string and the symbol and needed to be moved manually.
- Added space below non doc-string comments to make it clear
these aren't comments for the symbols directly below them.
- Use doxy sections for some headers.
Ref T92709
|
|
Replace local static mouse coordinate storage with a single function.
also resolve inconsistencies.
- Edit-mesh selection used equality check (ignoring `U.move_threshold`).
- Motion to clear tooltips checked the value without scaling by the DPI.
Also prevent the unlikely case of the previous motion check matching
a different area by resetting the value when the active region changes.
|
|
Also use doxy style function reference `#` prefix chars when
referencing identifiers.
|
|
This commit cleans up the RNA names of select mirror operators so that
they are all "Select mirror".
This makes the select menu in edit/pose mode consistent regardless of
object type.
Differential Revision: https://developer.blender.org/D7356
|
|
This adds the ability to get a selection list for both edit mode bones
and pose mode bones.
To do this the selection menu list logic had to be reworked a bit.
Before it only stored the names of objects. This might work will of
objects, however as stated in the code, it might fail for linked objects
(so multiple object can have the same name in some corner cases).
For bones it is a very common occurance where you can have multiple
armature that has the same bone names. So now it also stores the object
and bone pointers for this case.
Reviewed By: Sybren
Differential Revision: http://developer.blender.org/D10570
Fix T85796
|
|
Used for local structs/variables,
since `ofs` is by far the most widely used abbreviation.
|
|
|
|
Approximately 141 changes of capitalization to conform to MLA title style.
Differential Revision: https://developer.blender.org/D8392
Reviewed by Julian Eisel
|
|
Corrects incorrect usage of contraction for 'it is', when possessive 'its' was required.
Differential Revision: https://developer.blender.org/D9250
Reviewed by Campbell Barton
|
|
Access to this structure will be needed in BKE's armature code.
|
|
Picking is disabled
Affected were (at least)
- Select Linked pick
- Select Shortest Path
Was originally caused by rB8b347fc2cdc6 [which got improved in
rBfc8a7a44b200 - but only partially].
After removal of BONESEL_NOSEL we have to filter out -1 from the hits for
any bone picking it seems (since armature drawing uses this).
In rBfc8a7a44b200, this was done for 'ED_armature_edit_select_pick' (or
'get_nearest_editbonepoint' precisely), now do this for
'ed_armature_pick_bone_impl' as well.
Reviewers: campbellbarton
Maniphest Tasks: T81200
Differential Revision: https://developer.blender.org/D9080
|
|
|
|
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/editors/armature` module.
No functional changes.
|
|
|
|
The was caused by 8b347fc2cdc67 as the old BONESEL_NOSEL flag
handled the -1 case (used for none).
Instead of checking for -1, remove these elements from the array
as selection code makes decisions based on the number of hits detected.
|
|
|
|
|
|
Remove BONESEL_NOSEL which isn't needed.
Addresses issue raised in T77378.
|
|
|
|
Edit-mode bone selection now cycles on successive clicks.
This now cycles through multiple edit-objects & bones.
|
|
Note this only changes cases where the variable was declared inside
the for loop. To handle it outside as well is a different challenge.
Differential Revision: https://developer.blender.org/D7320
|
|
|
|
There was one function to access both pose/edit bones,
which returned a void pointer type.
Split these into 3 functions which return EditBone, bPoseChannel or Bone
types.
Internally the logic is still shared, this just makes it clearer to
callers which type is expected.
Also use more conventional prefix for picking API:
- ED_armature_pick_(ebone/pchan/bone)
- ED_armature_pick_(ebone/pchan/bone)_from_selectbuffer
|
|
Own error with recent improvements to select link.
|
|
|
|
|
|
This matches select linked for other modes (curve, mesh)
|
|
Selecting linked would only select a single arbitrary chain.
Now select linked follows all child-chains of the bone.
Also add support for following all links, similar to how this would work
if it were a mesh with connected edges instead of only child chains.
Leave this off by default to match pose mode.
|
|
|
|
|
|
Select Similar Group and Select Similar Shape had this issue since they
were added. Basically it assumes there is pose data which in some cases
it does not.
|
|
This is the unification of all overlays into one overlay engine as described in T65347.
I went over all the code making it more future proof with less hacks and removing old / not relevent parts.
Goals / Acheivements:
- Remove internal shader usage (only drw shaders)
- Remove viewportSize and viewportSizeInv and put them in gloabl ubo
- Fixed some drawing issues: Missing probe option and Missing Alt+B clipping of some shader
- Remove old (legacy) shaders dependancy (not using view UBO).
- Less shader variation (less compilation time at first load and less patching needed for vulkan)
- removed some geom shaders when I could
- Remove static e_data (except shaders storage where it is OK)
- Clear the way to fix some anoying limitations (dithered transparency, background image compositing etc...)
- Wireframe drawing now uses the same batching capabilities as workbench & eevee (indirect drawing).
- Reduced complexity, removed ~3000 Lines of code in draw (also removed a lot of unused shader in GPU).
- Post AA to avoid complexity and cost of MSAA.
Remaining issues:
- ~~Armature edits, overlay toggles, (... others?) are not refreshing viewport after AA is complete~~
- FXAA is not the best for wires, maybe investigate SMAA
- Maybe do something more temporally stable for AA.
- ~~Paint overlays are not working with AA.~~
- ~~infront objects are difficult to select.~~
- ~~the infront wires sometimes goes through they solid counterpart (missing clear maybe?) (toggle overlays on-off when using infront+wireframe overlay in solid shading)~~
Note: I made some decision to change slightly the appearance of some objects to simplify their drawing. Namely the empty arrows end (which is now hollow/wire) and distance points of the cameras/spots being done by lines.
Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D6296
|
|
Particularly noticeable when vertex painting with a subsurf modifier.
In some cases every sculpt or paint stroke step would evaluate the dependency
graph. This should only happen for redraws. Now more selectively choose if the
dependency graph should be evaluated to initialize the view context. Doing it
in the view context evaluation is somewhat hidden, now it's more explicit.
Differential Revision: https://developer.blender.org/D5844
|
|
Adds a toggle to the filter menu for outliner synced selection. Enabled
by default, this ensures selection is synced between objects, bones, and
sequences. An active outliner element theme color is added to indicate
which element is active.
Synced selection is controlled on the operator level. Each operator
that modifies selection for objects, bones, sequences, or outliner
elements needs to call the respective ED_outliner_select_sync_from..
function to tag outliners to be synced.
Syncing is done lazily on outliner draw.
|
|
When using multiple viewlayers and switching between them the selection
gets buggy. The reason for this is that the select_id is updated based
on the index in the viewlayer. This makes the select_id not unique as
objects might be shared or not shared at all.
This fix will update the select_id on all objects in main. This will be triggered in all the selection operators.
Reviewed By: sergey, brecht
Maniphest Tasks: T55617
Differential Revision: https://developer.blender.org/D4824
|
|
|
|
|
|
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
|
|
frontside object in 3d-window
Now the depth order of objects when trying to select them is only used when not in X-ray mode.
Before, this was only the case in wireframe mode regardless of X-ray settings.
I've also unified the usage of V3D_XRAY and XRAY_FLAG as they were basically copies of each other.
Reviewed By: Clément
Differential Revision: http://developer.blender.org/D4504
|