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
|
|
This patch is a cleanup required before refactoring the view layer syncing
process {T73411}.
* Remove FIRSTBASE.
* Remove LASTBASE.
* Remove BASACT.
* Remove OBEDIT_FROM_WORKSPACE.
* Replace OBACT with BKE_view_layer_active_object.
* Replace OBEDIT_FROM_VIEW_LAYER with BKE_view_layer_edit_object.
Reviewed By: mont29
Maniphest Tasks: T73411
Differential Revision: https://developer.blender.org/D15799
|
|
This commit renames enums related the "Curve" object type and ID type
to add `_LEGACY` to the end. The idea is to make our aspirations clearer
in the code and to avoid ambiguities between `CURVE` and `CURVES`.
Ref T95355
To summarize for the record, the plans are:
- In the short/medium term, replace the `Curve` object data type with
`Curves`
- In the longer term (no immediate plans), use a proper data block for
3D text and surfaces.
Differential Revision: https://developer.blender.org/D14114
|
|
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
|
|
Outliner would frame the armature object instead of the bone if the bone
was on a hidden armature layer.
Similar to issues reported in e.g. T58068 and T80464, this is due to the
fact that `BKE_pose_channel_active` always checks for the armature layer
(and returns NULL if a bone is not on a visible armature layer).
Now propose to make this layer check **optional** (and e.g. from the
Outliner be more permissive). This also introduces
`BKE_pose_channel_active_if_layer_visible` which just wraps
`BKE_pose_channel_active` with the check being ON.
Maniphest Tasks: T92930
Differential Revision: https://developer.blender.org/D13154
|
|
Ref T92709
|
|
Allow access to a single bones gimbal matrix.
|
|
Commit e1665c3d3190 added math to do 2D affine transformations with 3x3
matrices, but these matrices are also used for 3D transformations.
Remove added functions and use 4x4 matrices for 2D transformation.
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D12510
|
|
Make the "xform" tool/gizmo available for strip transformations in the
sequencer preview window.
Because of the amount of hacks needed to make the gizmo work nicely with
multiple strips at the same time, it was decided to only show the
translate gizmo when multiple strips are selected.
This is because the transforms with multiple strips would appear buggy
because of our lack of shearing support in the transform system.
There is also currently no way to properly sync the gizmo drawing with
the transform when using multiple strips.
Reviewed By: Richard Antalik, Campbell Barton
Differential Revision: http://developer.blender.org/D12729
|
|
This makes it possible to calculate orientation from functions
that don't have the context.
|
|
|
|
Also use doxy style function reference `#` prefix chars when
referencing identifiers.
|
|
Some warnings remain that require larger changes.
|
|
When activated in modal, `translate`, `resize`, `rotate`, `shear` and
`edge_rotate_normal` use a different orientation than the set in scene.
This orientation needed to match since some of these modes can be switched
during operation.
The default orientation for these modes was `V3D_ORIENT_VIEW`.
And this changed when finishing the `translate` and `resize` to
`V3D_ORIENT_GLOBAL`.
But this could cause inconsistencies when inputting values from the
keyboard.
The solution now is to change the orientation when you change the mode.
---
Note: Although the user can expect the value entered to reflect the
orientation set in the scene, it would require a lot of changes and would
not be really useful.
|
|
'orient_type'
`orient_index` is a more comprehensive value as it reveals both the type and index.
Differential Revision: https://developer.blender.org/D9595
|
|
The local orientation chosen was that of the active object, but as
confirmed in other parts of the code, the orientation of the selected
Bone has priority.
|
|
chosen one
Some orientations are not possible to be calculated for certain scenes.
In these cases, others are chosen and informed by the operator.
However, the user may prefer that the chosen one be displayed (even if it
is not actually used).
This corresponds to older versions of Blender.
|
|
This reverts commit f9e994d0f463abb87761591e30c47a9613be6cca.
And fixes T85227.
That commit created an inverted orientation matrix but the 'Align to
Transform Orientation' operator doesn't work well with inverted matrices.
|
|
|
|
The transform code did not provide a 2d context to be used in 3d space.
The solution is to set all matrices for the screen space in these cases.
This commit also removes the dial3d drawing in these cases.
It was not correct anyway.
|
|
The change was intentional so that the orientation matrices match
(`rv3d->viewinv` becomes equal to the orientation matrix).
But, although in a projection matrix the Z axis is negative, this
should not be so from the user's point of view.
So the solution here is to negate the Z axis when the View orientation
is chosen.
This affects all modes, but is only evident for rotation.
---
Another change here is to use the final rotation value (`values_final`)
for the gizmo drawing since this value can be changed by the mode.
|
|
The error was introduced in rBf470a02afaea, but the problem is in
`ED_transform_calc_orientation_from_type_ex`
|
|
Corrects incorrect usages of the fragment 'apart of' when 'a part of' was required.
Differential Revision: https://developer.blender.org/D9245
Reviewed by Campbell Barton
|
|
Remove sculpt/paint checks in getTransformOrientation_ex
This code goes back a long time (early 2.5x). I couldn't find any
reason why sculpt/paint checks were being made.
This makes the following changes:
- When in object mode, the object must be selected.
Since this function typically operates on the selected items.
- When in paint/particle modes, the objects matrix is always
used regardless of selection, since object selection can't be
controlled in these modes.
- When there is no active object, the first selected object is no
longer used as it's quite an arbitrary decision & not something
done elsewhere with objects in Blender.
|
|
To fix the problem, it was necessary to create a fallback for the
zero-sized axis in local orientation.
This also affects the gizmos.
|
|
Improves the organization and identification of the API.
|
|
This simplifies obtaining the parameters for internal functions.
(switch was complicating a little)
Also removes ureachable code.
|
|
Access to this structure will be needed in BKE's armature code.
|
|
Cleanup old tracker task format to the new. e.g: [#34039] to T34039
Ref D8718
|
|
This was the behavior in old versions of blender.
During a transformation operation, when pressing a contrain key, the chosen
orientation is that of the scene.
If you press the same key, the orientation changes to Global or Local.
However, if you choose another contrain axis with the orientation changed,
the orientation does not return to the set for the scene.
It remains Global or Local.
Now when changing a contrain axis, no matter what the current orientation is,
it always returns to the scene orientation.
|
|
Regression in f7829787da5c64b3fa715a042c2a45ecd4314676
|
|
Remove the condition preventing orientation from being obtained out of
the 3d View context.
Also pass the `ob` and `obedit` arguments obtained from the caller.
|
|
Make it obvious which values are written to.
|
|
zero objects in scene
The crash is caused by the fact that a NULL Object pointer is passed to
calculate the transform orientation, which has been set to normal.
A check has been include to detect the same.
Differential Revision: https://developer.blender.org/D7951
|
|
|
|
Also remove unnecessary function return value.
|
|
|
|
orientation is set to 'Local'
Scene orientation is used only for 3DView.
|
|
Bug introduced in rBc75a665c442e
|
|
|
|
When editing a complex curve is very annoying to have all handles at a time. Also, this is a requirement for the current GSoC Edit Grease Pencil using curves.
I have seen that this improvement can be used in any other area of blender, so I have decided to publish the option in the overlay panel..
Reviewed By: fclem, #user_interface, billreynish, Severin
Differential Revision: https://developer.blender.org/D7754
|
|
|
|
This was so because of the rotate transformation mode but it can make
other modes confusing and add unnecessary complexity.
|
|
|
|
|
|
Issue introduced in rBc57e4418bb85.
|
|
Issue introduced in rBc57e4418bb85.
|
|
- Use `t->spacemtx` as the orientation matrix instead `t->orient_matrix`.
- Unify constraint behavior between modal and non-modal.
- Simplify code to remove old workarounds and rearrange struct members.
This fix T66142 since the actual `orient_type` (in the case
`V3D_ORIENT_NORMAL`) is used during Redo instead of always using
`V3D_ORIENT_CUSTOM_MATRIX`).
Differential Revision: https://developer.blender.org/D7469
|