Age | Commit message (Collapse) | Author |
|
Follow our code style guide by using C-comments for text descriptions.
|
|
|
|
This patch "modernizes" `DNA_struct_switch_endian` similar to
how I updated `DNA_struct_reconstruct` recently. Furthermore,
some special case handling have been moved to another place.
Reviewers: campbellbarton
Differential Revision: https://developer.blender.org/D9089
|
|
The overlay options in the image/uv editor is hidden in side panels and menus. Sometimes this panel is even hidden, while still useful.
The goal of this task is to introduce an overlay pop-over just like the overlay-popover of the 3d viewport.
Popover has
* UV Stretching (only available in the UV mode, when active object mode is a mesh and in OB_EDIT mode)
* Display As (only available in the UV mode, when active object mode is a mesh and in OB_EDIT mode)
* Show Modified (only available in the UV mode, when active object mode is a mesh and in OB_EDIT mode)
* Show UV Edges (including opacity slider; available UV, View, Paint, when active object mode is a mesh and in OB_EDIT mode)
* Udim tiles when no image is available.
Like the 3d viewport, there will be a editor toggle to enable/disable the overlays
For compatibility reasons the RNA properties are added to both the `SpaceImage.uv_editor` amd `SpaceImage.overlay`. On DNA level they are still stored in the SpaceImage. only new properties are added to the SpaceImageOverlay struct. During the next major release we could remove these options from `SpaceImage.uv_editor`. This should be noted in the Python section of release notes.
Reviewed By: Julian Eisel, Pablo Vazquez
Differential Revision: https://developer.blender.org/D8890
|
|
In the graph editor there is a panel that says "Active Keyframe" for
numerically editing a keyframe's values, but in the code there is no
concept of the "active keyframe." Since this is a useful concept to
have for some other features anyway, this commit adds an active
keyframe index value to FCurves. It also displays it with a theme
color for the active vertex (which didn't exist before) if the
FCurve is active.
The active keyframe in the graph editor is treated similarly to the
active vertex in the 3D view. It is the keyframe most recently selected
with a single click, and it is always selected.
For now, the only real functional change is that the active keyframe
appears in white and it should be more predictable which keyframe is
being edited in the sidebar panel.
Differential Revision: https://developer.blender.org/D7737
|
|
Initialize CLOG in the blendfile-loading unit test superclass. Since
rB8683d4e88f2e CLOG is used by more areas in Blender, and without
initialisation it crashes.
|
|
This is first step of refactoring task T77580.
Next step will be breaking up files into smaller ones.
Reviewed By: sergey, brecht
Differential Revision: https://developer.blender.org/D8492
|
|
BLO_version_defaults_userpref_blend -> blo_do_versions_userdef
The name was misleading as it was declared along with
BLO_update_defaults_startup_blend making it seem these functions were
related.
In fact preference defaults don't need to be updated as is done for
startup.blend since an in-memory blend file isn't used.
Rename the function to match other versioning functions
called from readfile.c. Also add/update comments on these differences.
|
|
Now versioning UserDef is run in readfile.c,
as is done for other Blender data.
Previously versioning was mixed with other run-time initialization,
so it needed to be called later by the window manager.
|
|
readfile.c's versioning function was only used for 2 variables.
Move versioning into versioning_userdef.c so everything
is done in one function.
Note: DNA_struct_elem_find checks have been replaced with checks for
the next released version.
This is harmless, as only old preferences saved between releases can
have their values overwritten.
Note: userdef versioning should be called from `do_versions_userdef`,
this will be done separately.
|
|
|
|
There was an oversight when adding new experimental user preferences.
I can try to overengineer this later to make it more fail-proof. But for now
it should be clear what to update when adding a new variable.
|
|
All themes older than 2.8x are initialized from the defaults,
there is no need to version them.
|
|
Also correct own correction from 58b8724a4892
thanks @mont29 for raising this.
|
|
Version patching userpref.blend wasn't using the correct version,
causing settings not to be properly updated.
This seems the likely cause of T70196 and similar bugs.
|
|
`workspace_hook` of wmWindows store pointers for runtime data and to
data belonging to other IDs (workspace's layouts). That kind of pointers
should always be cleaned up on read, it allows for cleaner segfault
crash in case of mistakes in code updating/re-setting them, and avoids
potential security issue of accessing random memory address.
No behavioral change expected here.
|
|
.blend file.
Relying on pointer addresses across different data-blocks is extremely
not recommended (and should be strictly forbidden ideally), in
particular in direct_link step of blend file reading.
- It assumes a specific order in reading of data, which is not ensured
in future, and is in any case a very bad, non explicit, hidden
dependency on behaviors of other parts of the codebase.
- It is intrinsically unsafe (as in, it makes writing bad code and making
mistakes easy, see e.g. fix in rB84b3f6e049b35f9).
- It makes advanced handling of data-blocks harder (thinking about
partial undo code e.g., even though in this specific case it was not
an issue as we do not re-read neither windowmanagers nor worspaces
during undo).
New code uses windows' `winid` instead as 'anchor' to find again proper
workspace hook in windows at read time.
As a bonus, it will also cleanup the list of relations from any invalid
ones (afaict it was never done previously).
Differential Revision: https://developer.blender.org/D9073
|
|
The adds a new option to simplify volumes in the viewport.
The setting can be found in the Simplify panel in the render properties.
Volume objects use OpenVDB grids, which are sparse. For rendering,
we have to convert sparse grids to dense grids (for now). Those require
significantly more memory. Therefore, it's often a good idea to reduce
the resolution of volumes in the viewport.
Reviewers: brecht
Differential Revision: https://developer.blender.org/D9040
Ref T73201.
|
|
The warning:
runtime error: addition of unsigned offset to 0x61a0000b22d8
overflowed to 0x61a0000b22b8
Fix T81340 (partially)
Reviewed By: campbellbarton
Maniphest Tasks: T81340
Differential Revision: https://developer.blender.org/D9063
|
|
- Rename `find_elem` to `elem_offset` (matching `elem_exists`).
- Remove unused `SDNA_StructMember` return argument.
- Return an offset instead of a pointer which was being converted
back into an offset by one caller,
in this case there was no way to tell the difference between
and element that doesn't exist and a struct member
at the start of the array.
Resolves UBSan warning raised in T81340.
|
|
It looks like this code was left over from tabbed panels in the
properties editor. It wasn't used anywhere except for in one line of
the horizontally-aligned panel code that was recently removed.
Differential Revision: https://developer.blender.org/D8651
|
|
Cleanup old tracker task format to the new. e.g: [#34039] to T34039
Ref D8718
|
|
|
|
Remove the attempt to update the active layout pointers of each window
from whithin `direct_link_workspace`.
This piece of code was a nonsense for at least to critical reasons:
* Do not, never, ever, access data from another datablock within the
direct_link_... functions. Just don't. Don't try to be smart.
* Since it was trying (and failing) to update the active layout of every
window for every workspace, it was effectively setting those
`act_layout` pointers to NULL (remapping can only ever happen once,
trying to remap and already remapped new pointer is bound to fail in
any case).
Luckily (and funnily), this piece of code was actually harmless, since
setting the active layout would be overridden/redone later, in
`lib_link_windowmanager`, when updating their `workspace_hook` in
`lib_link_workspace_instance_hook`.
Note that the similar horror with `WorkSpaceDataRelation->parent` (which
points at a window) is kept for now, because that one is needed. Hope to
refactor it soon though.
|
|
Add an option to disable Alembic vertex interpolation.
Bump subversion from 5 to 6.
Alembic stores mesh samples at specific time keys; when a frame in
Blender maps to a timecode between two samples, Blender will interpolate
the mesh vertex positions. This interpolation only happens when the mesh
has a constant topology, but sometimes this was not detected properly
when the vertices change order, but the number of mesh elements remains
the same. This would result in a mesh with jumbled up vertices (T71981).
With this patch, users have the ability to disable vertex interpolation.
An alternative would be to have better detection of topology changes,
but that that'll cause a considerable slowdown.
Maniphest Tasks: T71981
Differential Revision: https://developer.blender.org/D9041
|
|
When loading large files that are more than a couple weeks old
(such that DNA has changed in that time), a significant amount of
time is spent in `DNA_struct_reconstruct`. This function takes a struct
in the old layout and creates a struct in the new layout from it.
This was slow because it was computing the diff between the struct
layouts every time a struct is updated. Now the steps for the struct
reconstruction is computed only once per struct. This information is
then used to actually reconstruct all structs that changed.
I measured about 10-20% speedup when loading Spring files.
E.g. `10.6s -> 8.7s` for `06_055_A.anim.blend` in BKE_blendfile_read`.
This percentage varies a lot based on the number of blocks that have
to be reconstructed and how much DNA has changed since they have
been written. In none of my tests was the new code slower than the
old code.
Reviewers: campbellbarton
Differential Revision: https://developer.blender.org/D8959
|
|
The data layout remains exactly the same..
This change just gives all the elements in `SDNA->structs` names,
making it more comfortable to work with the data.
Reviewers: campbellbarton
Differential Revision: https://developer.blender.org/D8926
|
|
Object in the 2.7x file is on no layer at all, while this is not really
expected nor considered valid, better to cope with the case gracefully
than crash.
To be backported to 2.90 and 2.83.
|
|
Allows scripters to store additional information in the marker itself instead
of using work-around approach based on marker names and such.
Differential Revision: https://developer.blender.org/D8944
|
|
Keep braces balanced where possible, even with ifdef's as it avoids
confusions with editors calculating correct indentation level &
finding matching brackets.
|
|
Usual issue of win32 not following POSIX standards.
|
|
This patch tries to sanitize the types of our size parameters across our read
and write code, which is currently fairly inconsistent (using `int`, `uint`,
`size_t`...), by using `size_t` everywhere. Since in Blender file themselves
we can only store chunk of size `MAX_INT`, added some asserts to ensure that
as well.
See {T79561} for details.
Differential Revision: https://developer.blender.org/D8672
|
|
|
|
This adds XYZ symmetry as a property of meshes and updates all modes to
use the mesh symmetry by default to have a consistent tool behavior
between all modes and when switching objects.
Reviewed By: brecht, mano-wii, campbellbarton
Maniphest Tasks: T79785
Differential Revision: https://developer.blender.org/D8587
|
|
This implements a new overlay that blends the bakground color over the
objects that are not in the same mode as the active object, making
them fade with the background.
This is especially needed for sculpt mode as there is no other overlay
or indication in the viewport to display which object is active.
This is intended to be used with D7510 in order to have a faster
workflow when sculpting models with multiple objects.
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D8679
|
|
Structure switch statements so new missing items cause warnings.
|
|
rBf2d26409e83b fixed a serious problem with invalid mesh after an
operation with the extrude manifold.
Since BKE_mesh_validate_arrays is a slow operation, the chosen
interval between versions is relatively small and also only the
mentioned invalid mesh problem is tested.
Differential Revision: https://developer.blender.org/D8898
|
|
Bump Blender subversion from 4 to 5, and re-execute some versioning code.
Because of a mistake in the versioning code (corrected in rB1a4fc6dcd67b),
some of the versioning code didn't run in certain cases. This subversion
bump ensures that this code is still run.
|
|
Prefer this over an unknown identifier as it gives a useful error.
|
|
This adds support for the same custom bevel profile widget used in
the bevel tool and modifier to the geometry generation for curves.
This is expecially useful for text and 2D curves with extrusion, as
it works much better than a weld & bevel modifier combination.
It can also be useful for adding quick detail to pipe-like objects.
The curve holds the CurveProfile struct and a new "Bevel Mode"
property decides which type of bevel to build, round, object, or
custom profile.
Although curves can already use another curve to make the bevel
geometry, this is a quicker way, and it also defines the profile of
just one corner of the bevel, so it isn't redundant. It's also nice
to have the same custom profile functionality wherever there is bevel.
Differential Revision: https://developer.blender.org/D8402
|
|
Fix a segfault caused by assuming all scenes have a master collection
when applying versioning to old files.
|
|
There must not be any return directly in our versioning patches. It
would return from the entire versioning function.
Mistake in da95d1d851b4.
As a result, when opening old files with animation data, the versioning
for the new collection color tagging wouldn't run, and all collections
would get the first color assigned.
|
|
Reviewers: campbellbarton
Differential Revision: https://developer.blender.org/D8903
|
|
|
|
This commit makes grid theming more consistent and capable by adding
some new theme colors related to grid rendering.
- Add grid theme color for node editor. `UI_view2d_multi_grid_draw`
is called with TH_GRID instead of a shaded `TH_BACK`.
Also color-blend `TH_NODE_GROUP`.
- Make the movie clip editor's clip preview grid respect grid theme
color (`ED_region_grid_draw` uses color-blended `TH_GRID`).
- Add versioning code to allow fixing existing themes (the resulting
themes should visually look the same as before)
These changes did cause some inconsistencies in the movie clip editor,
even after adjusting the themes accordingly:
1. The alpha slider of the grid color affects the background and not
the grid lines themselves.
2. The grids used by graph and dopesheet mode could already be themed
in the past. Now that the clip preview's grid can also be themed,
two different modes share the same theme color.
Differential Revision: https://developer.blender.org/D8699
|
|
This adds color tagging to collections. There are 8 color
options which are themable in the user preferences, with an additional
option for no color tag by default.
This adds a new filled collection icon and 8 colored variants of the
icon that can be themed in the user preferences.
In this commit the only interface to setting the color tags is through
Python, and there is nowhere in the interface where the collections are
shown colored. Setting and viewing the color tags from the outliner will
follow.
Manifest Task: https://developer.blender.org/T77777
Differential Revision: https://developer.blender.org/D8622
|
|
This adds a search bar to the properties editor. The full search for
every tab isn't included in this patch, but the interaction with
panels, searching behavior, UI, region level, and DNA changes are
included here.
The block-level search works by iterating over the block's button
groups and checking whether they match the search. If they do, they
are tagged with a flag, and the block's panel is tagged too. For
every update (text edit), the panel's expansion is set to whether
the panel has a result or not. The search also checks for matching
strings inside enums and in panel labels.
One complication to this that isn't immediately apparent is that
closed panel's subpanels have to be searched too. This adds some
complexity to the area-level panel layout code.
Possible Future Improvements:
- Use the new fuzzy search in BLI
- Reset panels to their expansion before the search started if
the user escape out of the text box.
- Open all child panels of a panel with expansion.
Differential Revision: https://developer.blender.org/D8856
|
|
We will use a highlight on panel headers to convey that they have
a search match, so this commit initializes the theme color for the
properties editor.
Differential Revision: https://developer.blender.org/D8854
|
|
This reverts commit f492c8d488b7eb2166ca894e10a8128a1678a885.
|
|
Relax limits of FCurve Bézier handles during evaluation. FCurve handles
can be scaled down to avoid the curve looping backward in time. This
scaling was done correctly but over-carefully, posing unnecessary
limitations on the possible slope of FCurves. This commit changes the
scaling approach such that the FCurve can become near-vertical.
Bump Blender's subversion from 291.0.1 to 291.0.2 to ensure that older
animation files are correctly updated.
Reviewed By: sybren
Differential Revision: https://developer.blender.org/D8752
|