Age | Commit message (Collapse) | Author |
|
We have our own assert implementation, `BLI_assert()` that is prefered over the
C standard library one. Its output is more consistent across compilers and
makes termination on assert failure optional (through `WITH_ASSERT_ABORT`).
In many places we'd include the C library header without ever accessing it.
|
|
The region types checked here were removed from the editors in 9e2abbc9ba5d and
eb7485389b8a. So the if-conditions would never be true.
|
|
Missed moving the defines in CMake for e255040c7797
causing cycles not to be enabled.
|
|
Keep related functionality grouped.
|
|
Use doxy syntax & minor improvements.
|
|
The Vertex Group setter function name was wrong for Tint modifier.
|
|
Minimizes ifdef'd code for WIN32.
|
|
The preferences tempdir being used instead of bpy.app.tempdir.
|
|
Revert 76b1a27f96ffe1ec8c5351f34bcc2b9733b4483e since there is no
reason windows should behave differently to other platforms.
This was added so Windows users wouldn't see "/tmp/" in the UI.
Since then the default temporary directory is a blank string,
leave blank on all systems as Python script authors may accidentally
use this instead of `bpy.app.tempdir`.
|
|
This last worked in v2.27 (2003) where all paths were initialized to "/"
which was still checked to initialize the temp directory.
This hasn't been the case since 932e9e831647604e0b129b55e5ab035
where it changed to "/tmp/", then an empty string (current default).
|
|
An error adding search to an existing button,
caused by my own error in rBa4aa94c41cb79e9.
|
|
This makes it unecessary to create a button group when the block
is created, giving more flexibility when creating the first group-- for
example, creating the first button group with special parameters.
|
|
For a future patch (D9006) we need these groups for longer than just the
the layout process, in order to differentiate buttons in panel headers.
It may also be helpful in the future to have a way to access related
buttons added in the same uiLayout.prop call. With this commit, the
groups are stored in and destructed with the uiBlock.
|
|
v2.4x could cancel loading files that warned of being a newer,
unsupported version.
Remove this logic since it's no longer in use.
|
|
When blend files were loaded with app-templates,
setup_app_data was running before defaults were updated.
This is likely to cause problems with order of initialization
so always update the startup file beforehand.
|
|
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.
|
|
This replaces the blue theme color for subpanel titles with the the same
fade as for parent panels.
The search color doesn't work well for subpanel title colors. And actually,
because there are often buttons with checkboxes in the panel headers, we
don't have to treat this indicator any differently than regular buttons.
Differential Revision: https://developer.blender.org/D8976
|
|
Currently there's no way to know if a button is inactive when it doesn't
match the search results, because they use the same 50% gray level.
This isn't a huge problem, but it could lead to confusion. This commit
uses a subtle solution, a 25% opacity when the button is inactive and
also filtered by search.
This requires flipping the meaning of the UI_SEARCH_FILTER_MATCHES
flag in the code, and also adding a widget_alpha_factor utility in
the widget code.
Differential Revision: https://developer.blender.org/D8975
|
|
3D Viewport -> Sidebar -> View -> Local Camera is disabled. When you
click on it, box select starts. This behavior isn't intended, and fixing
it is quite simple. The only case where this would continuing would
still be desired is if a disabled button overlapped with a non-disabled
button, but this shouldn't be the case anywhere.
Differential Revision: https://developer.blender.org/D8832
|
|
Also reduce the scope of some variable declarations.
This also allows making some variables constant.
|
|
int and eContextResult are different types to MSVC
leading to a function signature mismatch.
|
|
Found as part of D8324, multithreaded Cycles object sync, where it caused
a crash on concurrent access to object holdout state.
|
|
|
|
The current way of setting the compute device makes sense for local
use, but for headless rendering it it a massive pain to get Cycles
to use the correct device, usually involving entire Python scripts.
Therefore, this patch adds a simple command-line option to Blender
for specifying the type of device that should be used. If the option
is present, the settings in the user preferences and the scene are
ignored, and instead all devices matching the specified type are used.
Differential Revision: https://developer.blender.org/D9086
|
|
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.
|
|
The license was renamed GPL-license.txt => license/GPL-2.0txt in 0434efa09ddc451.
Although the renaming made all the license files consistent, we are better off
not updating the copyright file in Blender. Instead we can live with some mild
inconsistency in the license names.
|
|
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
|
|
|