Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-10-03Cleanup: Remove/replace C standard library assert() and header usagesJulian Eisel
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.
2020-10-03Cleanup: Remove dead code in panel logicJulian Eisel
The region types checked here were removed from the editors in 9e2abbc9ba5d and eb7485389b8a. So the if-conditions would never be true.
2020-10-03Fix error in recent change "run UserDef versioning from readfile.c"Campbell Barton
Missed moving the defines in CMake for e255040c7797 causing cycles not to be enabled.
2020-10-03Cleanup: use doxy sections for appdir.cCampbell Barton
Keep related functionality grouped.
2020-10-03Cleanup: comments for appdirCampbell Barton
Use doxy syntax & minor improvements.
2020-10-03GPencil: Fix unreported wrong name for RNA setterAntonio Vazquez
The Vertex Group setter function name was wrong for Tint modifier.
2020-10-03Cleanup: move temp directory environment checks into a loopCampbell Barton
Minimizes ifdef'd code for WIN32.
2020-10-03Fix invalid temp-dir for image-project on unsaved filesCampbell Barton
The preferences tempdir being used instead of bpy.app.tempdir.
2020-10-03Preferences: remove temp directory initialization for WIN32Campbell Barton
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`.
2020-10-03Cleanup: remove unused temp directory initializationCampbell Barton
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).
2020-10-03Fix stack use after scope error after recent cleanupHans Goudey
An error adding search to an existing button, caused by my own error in rBa4aa94c41cb79e9.
2020-10-03UI: Create button group if none existsHans Goudey
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.
2020-10-03UI: Move button groups from layout to block levelHans Goudey
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.
2020-10-03Cleanup: remove unused code in blend file loadingCampbell Barton
v2.4x could cancel loading files that warned of being a newer, unsupported version. Remove this logic since it's no longer in use.
2020-10-03readfile: always run setup_app_data after updating defaultsCampbell Barton
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.
2020-10-03Cleanup: rename main preferences versioning functionCampbell Barton
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.
2020-10-03Cleanup: run UserDef versioning from readfile.cCampbell Barton
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.
2020-10-03Cleanup: centralize versioningCampbell Barton
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.
2020-10-02Property Search: Don't use search color for subpanel titlesHans Goudey
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
2020-10-02Property Search: Differentiate search filtered and inactive buttonsHans Goudey
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
2020-10-02Fix T78503: Disabled layout portion passes mouse throughHans Goudey
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
2020-10-02Cleanup: Declare variables where initializedHans Goudey
Also reduce the scope of some variable declarations. This also allows making some variables constant.
2020-10-02Cleanup: Fix build error on windowsRay Molenkamp
int and eContextResult are different types to MSVC leading to a function signature mismatch.
2020-10-02Fix non-thread safe code in view layer object hashBrecht Van Lommel
Found as part of D8324, multithreaded Cycles object sync, where it caused a crash on concurrent access to object holdout state.
2020-10-02Cleanup: clang-formatLukas Stockner
2020-10-02Cycles: Add command line option for overriding the compute deviceLukas Stockner
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
2020-10-02Cleanup: Use enum for return values in context callbacksSybren A. Stüvel
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
2020-10-02Fix T81345: part four, fix handling of IDProperties in edit armature undo.Bastien Montagne
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.
2020-10-02Fix T81345: part three, armature `free_data` was not handling editbones ↵Bastien Montagne
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.
2020-10-02Fix T81345, part two: crash in depsgraph when freeing COW armature.Bastien Montagne
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.
2020-10-02Fix T81345: Part one: Missing handling of ID pointers from EditBone ↵Bastien Montagne
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.
2020-10-02Cleanup: Move `EditBone` structure definition from `ED` to `BKE` area.Bastien Montagne
Access to this structure will be needed in BKE's armature code.
2020-10-02Fix T81200: Crash on certain armature select operators when OpenGL DepthPhilipp Oeser
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
2020-10-02UI: Improve UV sticky select mode descriptionHans Goudey
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
2020-10-02Cleanup: Refactor `ed_screen_context()` to use hash lookupsSybren A. Stüvel
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
2020-10-02Cleanup: split up `ed_screen_context()` into separate functionsSybren A. Stüvel
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
2020-10-02Volumes: make Mesh to Volume modifier independent of object transformsJacques Lucke
2020-10-02Experimental Features: More robust way of sanitizing optionsDalai Felinto
2020-10-02Experimental Features: Sanitize missing (latest) optionsDalai Felinto
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.
2020-10-02Experimental Features: Rename Image editor optionDalai Felinto
This prevents having multiple UI strings starting exactly the same: * Legacy A... * Legacy B ...
2020-10-02CleanUp: Remove header only definitionJeroen Bakker
node_draw_link_straight existed in header files without a body
2020-10-02Cleanup: reduce variable scopesJacques Lucke
2020-10-02Cleanup: remove redundant theme versioningCampbell Barton
All themes older than 2.8x are initialized from the defaults, there is no need to version them.
2020-10-02Cleanup: spellingCampbell Barton
Also correct own correction from 58b8724a4892 thanks @mont29 for raising this.
2020-10-02Fix userpref.blend using version from startup.blendCampbell Barton
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.
2020-10-02License: Rename GPL2 license to match the name specified in copyright.txtDalai Felinto
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.
2020-10-02Fix (unreported) assert in texture code when loading some old 2.74 blend file.Bastien Montagne
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).
2020-10-02Cleanup: readfile for workspaces: NULLify non-owned data pointers.Bastien Montagne
`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.
2020-10-02Fix (unreported) design flow in how workspace's relation data are read from ↵Bastien Montagne
.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
2020-10-02CleanUp: snode_group_offset -> space_node_group_offsetJeroen Bakker