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
2021-06-15UI: Support right aligned non-shortcut hints in widgetsJulian Eisel
Widget drawing code already supported drawing right-aligned, grayed out shortcut strings. This patch generalizes things a bit so this can also be used to draw other hints in the same way. There have been a few instances in the past where this would've been useful, D11046 being the latest one. Note that besides some manual regression testing, I didn't check if this works yet, as there is no code actually using it (other than the shortcuts). Can be checked as part of further development for D11046. A possible further improvement would be providing a way to define how clipping should be done. E.g. sometimes the right-aligned text should be clipped first (because it's just a hint), in other cases it should be left untouched (like current code explicitly does it for shortcuts). Removes the `UI_BUT_HAS_SHORTCUT` flag, which isn't needed anymore.
2021-04-13PyAPI: support retrieving the exception when running a stringCampbell Barton
- Optionally get the error as a single line. - Support access the error as an allocated string. - PyC_ExceptionBuffer_Simple was always printing to the `stdout` while PyC_ExceptionBuffer didn't, now either print to the output. Without this, callers are unable to do anything with the error string.
2021-04-07UI: Remove confusing "Unset" context menu entryJulian Eisel
This was added in 37b82a2d260e, doesn't have much purpose and doesn't even do anything in the vast majority of cases. It only affects custom properties. So at the very least it shouldn't be shown for regular RNA property buttons. But even for cases where it may do something, we couldn't find a good use-case. If this operator has use-cases with some add-ons, the add-ons can expose it differently, e.g. with a little 'x' icon next to the button, like it's done in the keymap editor. So removing the context menu entry now. Should this turn out to be a problem, it can be brought back but much more selectively (only where it actually does something). Or we could combine it with "Reset to Default". Differential Revision: https://developer.blender.org/D8727 Reviewed by: Brecht Van Lommel, Hans Goudey
2021-03-11UI: Add Copy Full Data Path to RMB menuAaron Carlisle
This commit adds an operator to the RMB-menu "Copy Full Data Path“, to copy the full RNA path to the clipboard. It aims to complement "Copy Data Path“, which only copies the part of the path that is needed for drivers, but for writing addons, etc. it is useful to have an option that gives the full data path. Similar patch have been submitted before, see D763 and D2746 This time I did not split the operator (as D2746) and does not contain the UI reorganization (as D763) Note, the fixes from D2746 were committed in rB09eac0159db8 so that patch can be closed. Reviewed By: campbellbarton Differential Revision: https://developer.blender.org/D10539
2021-03-10Cleanup: spellingCampbell Barton
2021-02-05Cleanup: correct spelling in commentsCampbell Barton
2021-01-13UI: Revert design changes to data-block selector for the 2.92 releaseJulian Eisel
Partially reverts 2250b5cefee7. Removing the user count and fake user count icons was controversial (which was expected) and there are a few further changes needed, that won't make it in time for the release, see D9946. While there is a design to bring back the user count and fake user indicators, a new design idea was proposed that the UI team wants to follow. This came too late for the 2.92 release, the new design is targeted at the 2.93 release now. Meanwhile, UI team decision was to simply revert the design changes. The new design is being worked on in https://developer.blender.org/T84669. Note that this commit does not revert some internal changes done in 2250b5cefee7. Namely the introduction of `ed_util_ops.c` and data-block operators in there. These will still be needed in the new design.
2021-01-13Asset System: Disable Asset Browser as experimental featureJulian Eisel
The Asset Browser will be disabled and not available for the 2.92 release. In alpha/beta builds, there will be an "Asset Browser" option under Preferences > Experimental, if the developer extras are enabled. Note that this also disables related UI elements (e.g. "Mark Asset" buttons, Preferences settings for asset libraries, etc.). The code is still in master of course, development and testing will continue there. But there simply needs to be too much polishing and fixing before the 2.92 release, plus there are some design decisions to be reevaluated. Check the milestone 1 project to follow ongoing work: https://developer.blender.org/project/view/124/
2021-01-04Cleanup: use const variablesCampbell Barton
2020-12-28Cleanup: Typo: `overriden` -> `overridden`.Bastien Montagne
2020-12-18UI: Redesigned data-block selectorsJulian Eisel
The previous design is rather old and has a couple of problems: * Scalability: The current solution of adding little icon buttons next to the data-block name field doesn't scale well. It only works if there's a small number of operations. We need to be able to place more items there for better data-block management. Especially with the introduction of library overrides. * Discoverability: It's not obvious what some of the icons do. They appear and disappear, but it's not obvious why some are available at times and others not. * Unclear Status: Currently their library status (linked, indirectly linked, broken link, library override) isn't really clear. * Unusual behavior: Some of the icon buttons allow Shift or Ctrl clicking to invoke alternative behaviors. This is not a usual pattern in Blender. This patch does the following changes: * Adds a menu to the right of the name button to access all kinds of operations (create, delete, unlink, user management, library overrides, etc). * Make good use of the "disabled hint" for tooltips, to explain why buttons are disabled. The UI team wants to establish this as a good practise. * Use superimposed icons for duplicate and unlink, rather than extra buttons (uses less space, looks less distracting and is a nice + consistent design language). * Remove fake user and user count button, they are available from the menu now. * Support tooltips for superimposed icons (committed mouse hover feedback to master already). * Slightly increase size of the name button - it was already a bit small before, and the move from real buttons to superimposed icons reduces usable space for the name itself. * More clearly differentiate between duplicate and creating a new data-block. The latter is only available in the menu. * Display library status icon on the left (linked, missing library, overridden, asset) * Disables "Make Single User" button - in review we weren't sure if there are good use-cases for it, so better to see if we can remove it. Note that I do expect some aspects of this design to change still. I think some changes are problematic, but others disagreed. I will open a feedback thread on devtalk to see what others think. Differential Revision: https://developer.blender.org/D8554 Reviewed by: Bastien Montagne Design discussed and agreed on with the UI team, also see T79959.
2020-12-15Asset System: "Mark Asset" & "Clear Asset" operators and UI integrationJulian Eisel
This makes it possible to turn data-blocks into assets and back into normal data-blocks. A core design decision made for the asset system is that not every data-block should be an asset, because not every data-block is made for reuse. Users have to explicitly mark data-blocks as assets. Exposes "Mark Asset" and "Clear Asset" in Outliner context menus (currently ID Data submenu) and button context menus. We are still not too happy with the names, they may change. This uses the new context members to pass data-blocks to operators, added in af008f553293 and 0c1d4769235c. Part of the first Asset Browser milestone. Check the #asset_browser_milestone_1 project milestone on developer.blender.org. Differential Revision: https://developer.blender.org/D9717 Reviewed by: Brecht Van Lommel
2020-12-12UI: Allow UI to pass focused data-block to operators via contextJulian Eisel
This is similar to c4a2067130130d, but applies to the general UI and is only about single data-blocks. Here there was a similar problem: How can buttons pass the data they represent to operators? We currently resort to ugly ad-hoc solutions like `UI_context_active_but_get_tab_ID()`. So the operator would need to know that it is executed on a tab button that represents a data-block. A single button can now hand operators a data-block to operate on. The operator can request it via the "id" context member (`CTX_data_pointer_get_type(C, "id", &RNA_ID)` in C, `bpy.context.id` in .py). In this commit, it is already set in the following places: * Generic RNA button code sets it to the pointed to data-block, if the button represents a data-block RNA pointer property. (I.e for general data-block search buttons.) * Data-block selectors (`templateID`) set it to the currently active data-block. * The material slot UI-List sets it for each slot to the material it represents. The button context menu code is modified so its operators use the context set for the layout of its parent button (i.e. `layout.context_pointer_set()`). No user visible changes. This new design isn't actually used yet. It will be soon for asset operators. Reviewed as part of https://developer.blender.org/D9717. Reviewed by: Brecht Van Lommel
2020-12-04Cleanup: Declare variables where initializedHans Goudey
2020-08-28Fix T80195: crash when invoking tooltips on MacOSGermano Cavalcante
Problem introduced in rBadd48c007428. `UI_but_string_info_get` can change the value of the args.
2020-08-26Cleanup: use const variables in interface codeCampbell Barton
2020-08-17Cleanup: move Python script execution into BPY_extern_run.hCampbell Barton
This commit renames 'execute' to 'run' because: - This follows Python's "PyRun" which these functions wrap. - Execution functions can use either exec/eval modes, making naming awkward (for future API refactoring).
2020-08-07UI Code Quality: Use derived structs for search buttons and decoratorsJulian Eisel
The current on-size-fits-all `uiBut` creates quite a mess, where it's hard to reason about which members are free for use, under which conditions they are used and how. `uiBut` also has members that aren't used at times, violating the "don't pay for what you don't use" principle. To address this, we want to move to typed buttons, where `uiBut` is just a base struct and each type extends it as needed. That structures data better and type specific data is only available if it's actually used by a button type. Two trade-offs: * Many casts to the derived type have to be done. * Sometimes we change the button type after it's created. So I had to add logic to reallocate the button for use with the new, possibly derived struct. Ideally that wouldn't be needed, but for now that's what we have. Part of T74432. Differential Revision: https://developer.blender.org/D7610 Reviewed by: Brecht Van Lommel, Campbell Barton
2020-07-27UI: improve errors when evaluating a number button failsCampbell Barton
Showing the Python error without any explanation is often not enough information and doesn't hint that the error was in the user input. The error report from a invalid expression such as '..1' used to be: ('invalid syntax', ('<string>', 1, 1, '..1')) Now reads: Error evaluating number, see Info editor for details: invalid syntax Address issue raised by T78913.
2020-07-16LibOverride: Fix getting proper RNA path and ID from embedded ones.Bastien Montagne
Master collections and root node trees should now be working as expected in that regard.
2020-07-03Cleanup: Interface, Clang-Tidy else-after-return fixesSybren A. Stüvel
This addresses warnings from Clang-Tidy's `readability-else-after-return` rule in the `source/blender/editors/interface` module. No functional changes.
2020-06-30Cleanup: Use unsigned int when for enum values, instead of signed int.Bastien Montagne
2020-05-07Cleanup: split button search callbacks into their own structCampbell Barton
2020-04-04Cleanup: Rename Panel * variables from pa to panelHans Goudey
2020-04-03Cleanup: Rename bScreen variables from sc/scr to screenJulian Eisel
Part of T74432. Mostly a careful batch rename but had to do few smaller fixes. Also ran clang-format on affected files.
2020-03-19Cleanup: `make format` after SortedIncludes changeDalai Felinto
2020-03-18Cleanup: Resolve HKEY conflictRay Molenkamp
Both the MS headers and blender headers define the HKEY which gives all kind of inclusion order issues. This diff renames all *KEY constants to EVT_*KEY to resolve this conflict. Reviewed By: brecht , dfelinto Differential Revision: http://developer.blender.org/D7164
2020-03-15Cleanup: use 'const' style argumentCampbell Barton
2020-03-06Cleanup: Rename ARegion variables from ar to regionJulian Eisel
The old convention was easy to confuse with ScrArea. Part of https://developer.blender.org/T74432. This is mostly a batch rename with some manual fixing. Only single word variable names are changed, no prefixed/suffixed names. Brecht van Lommel and Campbell Barton both gave me a green light for this convention change. Also ran clan clang format on affected files.
2019-10-21Fix invalid property shortcuts being createdCampbell Barton
When there was no way to find the data-path from context the shortcut was still being created. It would evaluate to "context.(null)". Now adding shortcuts will be disabled if the path can't be computed.
2019-09-20UI: Fix CapitalizationYevgeny Makarov
Differential Revision: https://developer.blender.org/D5716
2019-09-02UI: Don't show button context menu for drag-labelsJulian Eisel
While the vast majority of labels would never get a button context menu (as opposed to the regular context menu of this region), draggable labels would still reach code for such context menu creation. From what I can tell only file browser icons/thumbnails and the properties editor data path would be affected. The button context menu doesn't make sense for them, so let the region context menu show up instead. If at some point we want button context menus for specific labels, we can make checks more granular.
2019-08-27Cleanup: clang-formatCampbell Barton
2019-08-27UI: add title to assign shortcut popup, tweak paddingYevgeny Makarov
Differential Revision: https://developer.blender.org/D5576
2019-08-24UI: Various tooltip corrections and fixesWilliam Reynish
Patch by Yevgeny Makarov (jenkm) Differential Revision: D5514
2019-08-23RNA: Cleanup PointerRNA structJacques Lucke
The old layout of `PointerRNA` was confusing for historic reasons: ``` typedef struct PointerRNA { struct { void *data; } id; struct StructRNA *type; void *data; } PointerRNA; ``` This patch updates it to: ``` typedef struct PointerRNA { struct ID *owner_id; struct StructRNA *type; void *data; } PointerRNA; ``` Throughout the code base `id.data` was replaced with `owner_id`. Furthermore, many explicit pointer type casts were added which were implicit before. Some type casts to `ID *` were removed. Reviewers: brecht, campbellbarton Differential Revision: https://developer.blender.org/D5558
2019-08-14UI: suppress Copy/Paste/Edit Driver options on whole array property fields.Alexander Gavrilov
When a button represents the whole array (e.g. color picker buttons), these context menu options were available, but didn't really work correctly. Since it's not clear how they could reasonably work without a valid index, it's better to hide them.
2019-08-04Add a new Copy As Driver context menu option for properties.Alexander Gavrilov
It is a very common need to create drivers that set the value of a property to the value of some other property, but it currently requires multiple actions: Copy Data Path on the input property, adding a driver to the output property, selecting the input ID reference, and pasting the path. This adds a new Copy As Driver context menu option, which creates a complete driver in the clipboard that reads the current property, so all that remains is to paste it to the output property. It is also possible to paste just the new driver variable into an existing driver to combine multiple inputs. Reviewers: brecht, billreynish Differential Revision: https://developer.blender.org/D5382
2019-07-18Fix context menu Remove Shortcut not being available for non-keyboard shortcutsBrecht Van Lommel
2019-06-15Cleanup: Rename: Static Override -> Library Override.Bastien Montagne
Better to make internal code naming match official/UI naming to some extent, this will reduce confusion in the future. This is 'breaking' scripts and files that would use that feature, but since it is not yet officially supported nor exposed in 2.80, as far as that release is concerned, it is effectively a 'no functional changes' commit.
2019-05-29Cleanup: Remove Dead CodeAaron Carlisle
2019-05-27UI: use tool label instead of id-names for quick favoritesCampbell Barton
2019-05-21Fix T64912: Crash right clicking on 'Add New Material'Campbell Barton
D4904 by @Gvgeo
2019-05-16Refactor: Simplify ID Property freeingJacques Lucke
This also makes `IDP_CopyProperty` the "opposite" of `IDP_FreeProperty`, which is what I'd expect. Two refactoring steps: * rename IDP_FreeProperty to IDP_FreePropertyContent * new IDP_FreeProperty function that actually frees the property Reviewers: brecht Differential Revision: https://developer.blender.org/D4872
2019-05-14Interface: Free argument callback for popupsJacques Lucke
Reviewers: brecht Differential Revision: https://developer.blender.org/D4858
2019-05-14Fix T64592: Assign Shortcut does not autosave preferencesBrecht Van Lommel
2019-05-13Preferences: set dirty when editing quick favourites menuCampbell Barton
2019-05-13Fix T64461: Sub-panels allow pinningCampbell Barton
2019-05-10Add ability to create a keyboard shortcut for more mode settings.Sebastian Parborg
This adds the ability to assign shortcuts to boolean settings and enums via the right click menu. Reviewed By: Brecht Differential Revision: http://developer.blender.org/D4808
2019-05-02Cleanup: use WM_keymap_item_* prefixCampbell Barton