Age | Commit message (Collapse) | Author |
|
Define enum `eContextResult` and use its values for returns, instead of
just returning 1, 0, or -1 (and always having some comment that explains
what -1 means).
This also cleans up the mixup between returning `0` and `false`, and `1`
and `true`. An inconsistency was discovered during this cleanup, and
marked with `TODO(sybren)`. It's not fixed here, as it would consititute
a functional change.
The enum isn't used everywhere, as enums in C and C++ can have different
storage sizes. To prevent issues, callback functions are still declared
as returning`int`. To at least make things easier to understand for
humans, I marked those with `int /*eContextResult*/`.
This is a followup of D9090, and is intended to unify how context
callbacks return values. This will make it easier to extend the approach
in D9090 to those functions.
No functional changes.
Differential Revision: https://developer.blender.org/D9095
|
|
Specific armature editing undo code would duplicate and store a list of
editbones. However, those are not linked to main data storage and should
therefore never affect ID usercounting.
|
|
properly.
Armature freeing would not correctly free its editbone IDProperties.
Add a utils to free the whole list of edit bones, and properly handle
their potential IDProperties.
|
|
Freeing of bones' IDproerties from Armature `free_data` callback would always
attempt to do user refcounting, which should never be done from that code.
This would generate crashes in depsgraph/COW context e.g.
|
|
IDProperties.
So far data management code would simply fully ignore potential ID
pointers in custom properties of edit bones (which are a copy of those
from regular `Bone`). This would lead to all kind of issues, among which
refcounting inconsistencies, missing clearing of data uppon deletion,
etc.
|
|
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
|
|
The sticky_select_mode property is an enum where each item has a
different behavior, but currently the description is for a single one
of the items. It should be more general, especially because one of the
items is "Disabled."
A couple more problems:
- "Automatically" is not so helpful. Many things any program does are
"automatic", it doesn't really help to say it.
- "Also" is bad grammar.
- Overly complex wording
This also adjusts the SHARED_VERTEX tooltip, because "irrespective"
should have "of" after, but it's also unecessarily complex.
Differential Revision: https://developer.blender.org/D9049
|
|
Refactor `ed_screen_context()` to use `GHash` lookups instead of a
sequence of string comparisons. This should provide a nice speedup,
given that the hash for `member` only has to be computed once instead of
matching it to each possible string.
Reviwed by: brecht
Differential Revision: https://developer.blender.org/D9090
|
|
Refactor `ed_screen_context()` to call separate functions, instead of
having the entire functionality in one function. Each function now only
retrieves the data it needs from the context. Furthermore, some string
comparisons are removed.
No functional changes.
Reviwed by: brecht
Differential Revision: https://developer.blender.org/D9090
|
|
|
|
|
|
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.
|
|
This prevents having multiple UI strings starting exactly the same:
* Legacy A...
* Legacy B ...
|
|
node_draw_link_straight existed in header files without a body
|
|
|
|
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.
|
|
Trying to open the 2.74 Fishy Cat file would generate endless asserts in
customdata code. This commit refactors and cleans up the code of
`psys_get_dupli_texture` to avoid useless calls and data access, and
validate data before trying to further access it.
No behavioral changes expected here (besides getting rid of the assert).
|
|
`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
|
|
|
|
|
|
Left/right arrow keys can refine the completion,
this wasn't redrawing and there was an off-by-one error checking
the next character.
|
|
- Remove MMB for activating an auto-complete item (use LMB instead).
- Update on cursor motion.
|
|
|
|
|
|
|
|
Use POINTER_AS_INT instead
Reviewed By: HooglyBoogly
Differential Revision: https://developer.blender.org/D9083
|
|
Followup for rB8398050695
This requires moving a few enum definitions to DNA instead of BKE, and
adding default definitions for the two structs the cloth modifier where
the cloth modifier stores its settings. The defaults are also reordered
to be consistent with the order of each item in the struct.
|
|
Fix a redundant return statement at the end of void function and
an inconsistent declaration parameter names.
|
|
When a Shape Key is active, use the PBVH deformed coordinates for the
preview.
Reviewed By: sergey
Maniphest Tasks: T80873
Differential Revision: https://developer.blender.org/D8921
|
|
This was introduced in 6c9ec1c893f9. The overlays can now be drawn when
PBVH drawing is not enabled, but the PBVH should still exist in the
SculptSession in order to draw them. Before, it was avoiding the crash
by checking use_pbvh as BKE_sculptsession_use_pbvh_draw also checks if
the PBVH exists.
Reviewed By: sergey
Maniphest Tasks: T81268
Differential Revision: https://developer.blender.org/D9044
|
|
When using anchored strokes, inbetween events are not needed since there
is no stroke path to be reconstructed. Handling the inbewteen events are
only producing unnecessary updates, creating performance issues.
Reviewed By: sergey, brecht
Differential Revision: https://developer.blender.org/D9053
|
|
This simulation area mode moves the active area with the brush. When
enabled, the cloth brush has no restrictions on stroke length, area or
mesh vertex count.
In order to work, this enables PBVH nodes dynamically for simulation as
the stroke location moves and builds the constraints for new nodes
during the stroke. When a node is not inside the simulated area, all the
constraints that were created for it and vertex collisions are not
computed. The simulation limits falloff areas and constraints tweaking
control how the simulated and no simulated nodes blend.
Reviewed By: sergey, zeddb
Differential Revision: https://developer.blender.org/D8726
|
|
|
|
This removes `foreachObjectLink` from `ModifierTypeInfo`, `GpencilModifierTypeInfo`
and `ShaderFxTypeInfo`. There is no need to have both, `foreachObjectLink` and `foreachIDLink`.
There is not code that actually depends on `foreachObjectLink`.
Reviewers: brecht
Differential Revision: https://developer.blender.org/D9078
|
|
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.
|
|
Remove the workaround for T59395 that increases the minimal refinement to 2
to work around an OpenSubdiv bug. This bug appears to be fixed in the latest
OpenSubdiv version we are using.
Problem found by Piotr Ostrowski.
Ref D9076
|
|
|
|
As noted in T80164, there are quite a few area of Blender where the
"Reset to Default Value" operator in button context menus doesn't work.
Modifiers are one of them, because the DNA defaults system was never
set up for them.
Additionally, this should make modifier versioning easier. Whenever a
new field is added it should be automatically initialized to the
default value.
I had to make some ordering changes in the following modifiers to work
around an error with `-Wsign-conversion` in the macros:
- Solidify Modifier
- Corrective Smooth Modifier
- Screw Modifier
Some modifiers are special cases and are skipped in this commit:
- Data Transfer Modifier
- Cloth Modifier
- Fluid Modifier
- Softbody Modifier
Differential Revision: https://developer.blender.org/D8747
|
|
|
|
Bug and fix has been found by dfelinto, thanks.
|
|
|
|
This was already changed for Material nodetrees on duplication in
rBa75ac18638f4.
Since it is not obvious from the UI how change World actions - and to be
consistent with Material actions, it is best to copy the action as the
default behavior.
So use generic BKE_id_copy functions with LIB_ID_COPY_ACTIONS flag [which
also enables us to get rid of `BKE_world_copy`]
Note: taking the User Preference `USER_DUP_ACT` into account here (for
both material and world actions) could be a followup step.
Maniphest Tasks: T81248
Differential Revision: https://developer.blender.org/D9046
|
|
Those actions are full proper IDs and should therefore not be affected
by flags used to duplicate 'owner' ID own data.
|
|
|
|
Most collection operations should not be allowed when either the scene
or the parent collection are linked or liboverrides.
This commit adds more stricter checks in both polling and execution
aspects of several related operators.
Fix T81282: Crash on instance to scene of a collection of a linked scene.
|
|
The convention is to keep inactive settings editable even if they are grayed
out for having no effect due to other settings.
|