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 duplicated View2D pan polling logicJulian Eisel
Same as 21fc4ae20692, but for view panning this time. Also had to set the poll callbacks still in this case.
2020-10-03Revert part of previous commitJulian Eisel
The change to the `poll()` callback was actually incorrect. But also reduandant, since the function is actually already executed in the operator.
2020-10-03Fix compile error when compiling with WITH_INPUT_NDOF after View2D changesJulian Eisel
Actually, fixes compile error and an incorrect poll. Caused by 21fc4ae20692 and 3a1cf838ca09. The poll has to perfrom the `view_zoom_poll()` logic to ensure correct context.
2020-10-03Fix error in previous commit...Julian Eisel
2020-10-03Fix possible un-initialized variable use in UI codeJulian Eisel
Uncovered by a4aa94c41cb7. Before that, it would actually be a possible `NULL` pointer dereference. It would happen if a `UILayout.prop()` was placed with the `full_event` option set to `True` (or the C equivalent) for a non keymap-item property. Now this the `full_event` option is ignored then with a warning print.
2020-10-03Fix issues with calling View2D zoom operators in an `EXEC` contextJulian Eisel
Multiple related issues: * `view_zoomdrag_exec()` required `view_zoomdrag_init()` to be called first to set up data. Can now easily be done in the `_exec()` function as well though. * Because of that the operators could not be called in an `EXEC_` context (e.g. `EXEC_REGION_WIN`). * With "Zoom to Mouse Position" enabled, zooming from a menu or script would zoom to the mouse position. That should only happen if the operators are called directly in the editor.
2020-10-03Cleanup: Remove redundant View2D operator poll checkJulian Eisel
The poll would already be executed as operator callback, this check was redundant. Also see previous commit.
2020-10-03Cleanup: Remove duplicated View2D zoom polling logicJulian Eisel
`view_zoomdrag_init()` would perform a number of sanity checks that `view_zoom_poll()` already executed. The design of operators forsees that (non-expensive) context sanity checks are done by the `poll()` callbacks, and the execution callbacks can then just assume that happened. No reason to be overly pedantic, we don't do that elsewhere either. Note that this code is from the earliest days of an operator design. So it's not surprising that it wasn't using the design "properly".
2020-10-03Property Search: Set panel expansion when tab changesHans Goudey
This commit makes the panel expansion set based on the search results when the active tab in the properties editor changes. The multi-tab search patch (D8859) actually doesn't handle this because it uses a different code path. This feature uncovered a subtle but fairly significant issue with the implementation of property search (More details in T81113). Basically, the search needed multiple redraws to properly display the expansion of panels based on the search results. Because there is no animation of panel expansion when switching tabs, the problem was exposed only now. With this commit, hiding of "search only" buttons and panel size calculation happens in a single final step of the panel layout pass. The "search only" layout root flag is removed. Instead every button inside a panel header is in a single "uiButtonGroup" marked with a specific "in header" flag, an idea which could be generalized in the future. Differential Revision: https://developer.blender.org/D9006
2020-10-03Cleanup: use BLI_path_join in appdir.c to simplify logicCampbell Barton
Change `test_path` function so: - Joining paths calls a function instead of being performed inline. - Optional NULL paths must always be ordered last (easier to follow). Other minor changes: - Remove FIXME comment is it's handled properly by BLI_path_join. - The wrong size was being used copying into `targetpath`.
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 ...