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-10-28Merge branch 'blender-v3.0-release'Germano Cavalcante
2021-10-28Cleanup: remove 'ED_view3d_cursor_snap_exit'Germano Cavalcante
The callers of `ED_view3d_cursor_snap_active` that must handle the snapping of the cursor. Forcing release at the end can hide leaks.
2021-10-27UI: Refactor how dragging onto text buttons works, fixing issuesJulian Eisel
There was a bunch of special handling to support dropping data-blocks onto string or search-menu buttons, to change the value of these. This refactor makes that case use the normal drop-box design, where an operator is executed on drop that gets input properties set by the drop-box. This should also make it easier to add support for dragging assets into these buttons. In addition this fixes an issue: Two tooltips were shown when dragging assets over text buttons. None should be shown, because this isn't supported.
2021-10-27UI: Theme refresh for Blender v3.0Pablo Vazquez
{F11548100, size=full} To celebrate the beginning of a new series, it feels like the right time to give the theme a fresh look while improving on what already works. The aim of this refresh is to keep a familiar look but with polishing touches here and there. Like new paint on the walls of your well known house. The theme for Blender 2.8 was well received but presented a few flaws. * Transparency on menus and tooltips reduce readability * Mismatch on certain colors, especially outlines of connected widgets * Active/open menus highlight was not prominent enough * Header background mismatch in some editors At the same time we can make use of new features in 3.0: * Make panels look like panels again (like in v2.3!) * Make use of roundness in more widgets * Since nodes are no longer hard-coded to be transparent, tweak opacity and saturation * Tweak colors for the new dot grid This update does not include: * Meshes in edit mode to match greenish object-data color. This needs tweaks in the code to improve contrast. * A copy of the Blender 2.8x legacy theme. This could be added to the community themes (shouldn't cost much maintenance, I hope) There will be certainly small tweaks to do here and there, I've been working using this theme for months but there can be areas that are missing update. The overall style is presented here. This commit bumps the file subversion. Reviewed By: #user_interface, Severin Differential Revision: https://developer.blender.org/D13008
2021-10-27Asset Browser: Activate catalog after addingJulian Eisel
Adding a catalog should also activate it, like we do it for adding other data in Blender. The tree-view code will make sure the newly added item will not have collapsed parents.
2021-10-27Revert "Asset Browser: Ensure parent catalogs are expanded when adding child"Julian Eisel
This reverts commit 487faed6d0a1170a2f098552f794280fabe82186. I changed my mind on how to implement this feature. Adding a catalog should also activate it, like we do it for adding other data in Blender. The activation will automatically make it visible then. See the following commit.
2021-10-27Asset Browser: Ensure parent catalogs are expanded when adding childJulian Eisel
When pressing the '+' icon to add a new child catalog, or when adding it through the context menu, the new catalog should be visible. So the this change makes sure the parent is uncollapsed if needed.
2021-10-27Cleanup: Add static assert for tree-view getter templateJulian Eisel
These kind of static asserts for the base type of a template parameter are useful, and can avoid wrong API usage.
2021-10-27UI: Support dragging tree-view itemsJulian Eisel
Adds the needed bits to the UI tree-view API to support dragging tree-view items. This isn't used yet, but will be in the following commit for asset catalogs. There will probably be some further tweaks to the design at some point, for now this should work well enough for our use-cases.
2021-10-27UI: Add padding to the left of tree-rows labels without iconJulian Eisel
The label was placed right at the left border of the row highlight, which looked weird. So add some padding to tree-row labels without icon or collapse chevron, which makes it look more polished. As additional benefit, it alignes the labels better with icons of other rows on the same tree level. And the padding makes it more clear that a child is indeed a child, not just a sibling without icon.
2021-10-27Cleanup: Make UI tree-view item constructor explicitJulian Eisel
Constructors that can be called with a single argument should be explicit, unless there's a reason not to, to avoid unintended constructions.
2021-10-27Fix T92427: Adding new nodes does no edge-panningPhilipp Oeser
Unlike translating existing nodes [which disables cursor wrapping and enables edge-panning instead since rBSa1cc7042a74], adding new nodes would still show the old behavior of cursor wrapping. This has been disabled for the case when the node whould be added outside (due to menus overlapping other editors). Now enable edge-panning for adding new nodes as well and make sure this only starts once the mouse has returned into the inside rect once. Maniphest Tasks: T92427 Differential Revision: https://developer.blender.org/D13005
2021-10-26Don't deselect assets in `ED_fileselect_activate_by_id`Sybren A. Stüvel
`ED_fileselect_activate_by_id()` activates an asset (i.e. marks it as the active asset in the asset browser). To avoid an "active but not selected" state, it also selects it. Before this commit, the function would also deselect all other assets, but that's considered doing too much. If deselection is required, the `ED_fileselect_deselect_all()` function can be called. Manifest Task: T92152
2021-10-26Drop object assets and associated objects at the cursor locationCampbell Barton
When dropping asset objects, place them under the mouse-cursor along with any other objects they link in. Ref D12935 Reviewed By: Severin
2021-10-26UI: Support disabled-hint for dropping in the tree-view APIJulian Eisel
A tree-view item's drop controller can now return a message for the user explaining why dropping isn't possible with the dropped data. This is then displayed in red text next to the cursor. This isn't actually used yet, the follow up commit will do that.
2021-10-26UI: Let object drop operator display hint why it's disabledJulian Eisel
When dragging an object in non-object mode into a 3D View, there will now be red text explaining that this is only possible in object mode. The previous commit enabled this.
2021-10-26UI: Improve node editor breadcrumbs displayHans Goudey
This patch upgrades node editor breadcrumbs to have slightly more visual weight, to including the base path of object/modifier/world, etc, have more visually pleasing spacing, and contain icons. In the code, a generic "context path" is added to interface code. The idea is that this could be used to draw other breadcrumbs in areas like the property editor or the spreadsheet, and features could be added to all of those areas at the same time. Ideally we would be able to control the color of the breadcrumbs with a specific theme color, but since they are drawn with the regular layout system, that is not easily possible. Thanks to @fabian_schempp for the original patch. Differential Revision: https://developer.blender.org/D10413
2021-10-26XR Controller Support Step 5: NavigationPeter Kim
Adds navigation transforms (pose, scale) to the XR session state that will be applied to the viewer/controller poses. By manipulating these values, a viewer can move through the VR viewport without the need to physically walk through it. Add-ons can access these transforms via Python (XrSessionState.navigation_location/rotation/scale) to use with custom operators. Also adds 3 new VR navigation operators that will be exposed to users as default actions in the VR Scene Inspection add-on. While all three of these operators have custom properties that can greatly influence their behaviors, for now these properties will not be accessible by users from the UI. However, other add-ons can still set these custom properties if they desire. 1). Raycast-based teleport Moves the user to a location pointed at on a mesh object. The result can optionally be constrained to specific axes, for example to achieve "elevation snapping" behavior by constraining to the Z-axis. In addition, one can specify an interpolation factor and offset. Credit to KISKA for the elevation snapping concept. 2). "Grab" navigation Moves the user through the viewport by pressing inputs on one or two held controllers and applying deltas to the navigation matrix based on the displacement of these controllers. When inputs on both controllers are pressed at the same time (bimanual interaction), the user can scale themselves relative to the scene based on the distance between the controllers. Also supports locks for location, rotation, and scale. 3). Fly navigation Navigates the viewport by pressing a button and moving/turning relative to navigation space or the VR viewer or controller. Via the operator's properties, one can select from a variety of these modes as well as specify the min/max speed and whether to lock elevation. Reviewed By: Severin Differential Revision: https://developer.blender.org/D11501
2021-10-26UI: Change node editor grid into a dot gridHans Goudey
This patch makes the background grid of the node editor a grid of dots instead of lines. This makes the background look a bit more subtle and reduces visual complexity. The dots are meant to provide a reference when panning and zooming. Based on the design of @pablovazquez, and a patch originally authored by @fabian_schempp. The "Grid Levels" controls how many levels of dots are drawn. As the editor zooms in, the higher levels of dots fade in, making them closer together visually. The zoom factor at which each grid starts and ends fading in is controllable in the code, and could be tweaked further in the future. The new default value is 7, out of a range from 0 to 9. Differential Revision: https://developer.blender.org/D10345
2021-10-25Cleanup: Remove unused functions, make functions staticHans Goudey
2021-10-25Assets: Snapping with visual feedback while draggingGermano Cavalcante
The drag and drop feature of objects in 3D View has been modified to include: - Snap the object being dragged. - Visual feedback through a box and the placement tool grid. Maniphest Tasks: T90198 Differential Revision: https://developer.blender.org/D12912
2021-10-25UI Drag Drop: allow customizable drawingGermano Cavalcante
No functional changes. This commit adds 3 callbacks for `wmDropBox` which allow custom drawing without affecting the internal dropbox API. Differential Revision: https://developer.blender.org/D12948
2021-10-25Fix T92361: Zooming nodes clips text labelsCampbell Barton
While c7d94a7827a5be9343eea22a9638bb059f185206 exposed this bug, this was caused by text widths being calculated without taking the zoom level into account since drawing at a smaller size is often wider than the width of the larger text scaled by the zoom.
2021-10-25UI: Refactor dropping support for the tree-view APIJulian Eisel
Introduces a dropping-controller API for the tree-view items, `AbstractTreeViewItemDropController`. This reduces responsibilities of the main tree-view item classes, which are already getting quite big. As I expect even more functionality to be needed for it (e.g. drag support), it's better to start introducing such controller types already.
2021-10-24Cleanup: cross-reference right pointing arrow literalCampbell Barton
This value is defined in the UI module, but happens to be used in string_search.cc too. Note that these references need to be kept in sync. Use escaped utf-8 sequence since the literal can be avoided. Also replace BLI_str_utf8_as_unicode calls with constant assignments as these values are known there is no need to decode a utf-8 sequence.
2021-10-22Fix panel pinning showing for instanced panels (e.g. FCurve modifiers)Philipp Oeser
This was reported for FCurve modifiers, but was also true (in theory) for other instanced panels (regular modifiers, spreadsheet filters, ...), these would not show pinning for other reasons (no caterories). So in the case of the Graph Editor the follwing happens: `graph_buttons_register` only registers `GRAPH_PT_modifiers`, the panel itself has no header (PANEL_TYPE_NO_HEADER), further panels for individual modifiers are added dynamically in `graph_panel_modifiers`. So when pinning a particular modifier, we would pin e.g. `GRAPH_PT_noise` (not `GRAPH_PT_modifiers`). ED_region_panels_layout_ex would only collect panels known to `graph_buttons_register` (so is not aware of the specific panels of modifiers). So while I think it should be possible to pin `GRAPH_PT_modifiers` on top of an individual modifier's panel this would result in all modifiers being shown in other categories [which would also be weird]. Panel header layout was also not correct (drawing the pin icon over the modifier delete icon). So to resolve this, just dont use pinning for these type of panels. part of T92293. Maniphest Tasks: T92293 Differential Revision: https://developer.blender.org/D12965
2021-10-22Fix T92357: assert changing scenes while in edit modeCampbell Barton
ScrArea.runtime.tool needs to be updated after switching scenes.
2021-10-21Assets: Allow specific data-block types to be enabled by defaultJulian Eisel
Updates UI code so that we can enable the asset UI for specific data-block types by default, i.e. irrespective of the "Extended Asset Browser" experimental feature. "Mark as Asset" and "Clear Asset" are always visible in the Outliner context menu now, but are grayed out if not applicable and show a disabled hint in the tooltip. A known side-effect of this: The "Mark as Asset" and "Clear Asset" operators are enabled for action data-blocks now, even though only pose actions created through the Pose Libraries add-on are supported. If this is something worth addressing is being discussed still. Differential Revision: https://developer.blender.org/D12955 Reviewed by: Sybren Stüvel
2021-10-21Cleanup: unused codePablo Vazquez
Also fixes incompatible types.
2021-10-21Node Editor: Introduce color overlay and dashed wires theme settingPablo Vazquez
This patch includes code from D9891 and D12754, so credit goes to Juanfran and Dalai. I updated the patches to work with `master` and with the new overlay toggle. The reason to include both changes as part of one patch is that the dimmed dashed lines work much better together with colored wires. Theme setting for dash opacity: {F11370574, size=full} {F11286177, size=full, autoplay, loop} {F11149912, size=full} For adding the overlay I used `SpaceImageOverlay` as reference, although I'm not familiar with this code so there might be mistakes. Reviewed By: #user_interface, HooglyBoogly Differential Revision: https://developer.blender.org/D12886
2021-10-21Geometry Nodes: Attribute search in the modifierHans Goudey
This adds attribute search to the geometry nodes modifier for the input and output attributes. The "New" search item is only shown for the output attributes. Some of the attribute search code is extracted to a new file in the interface code, to avoid some code duplication. The UI code required two fixes so that the search would work for dynamic length strings (IDProperties do not have a fixed size). Since this does changes to the UI layout of the modifier, I also addressed T91485 here. Differential Revisiion: https://developer.blender.org/D12788
2021-10-21Cleanup: Use common define for menu separator arrowHans Goudey
2021-10-21Cleanup: Use array as a parameter for event x/y functionsAaron Carlisle
This change simplifies the parameter list for these functions and reduces the chance of typos mixing up array indices. Reviewed By: campbellbarton Ref D12950
2021-10-20View3D: Cursor Snap RefactorGermano Cavalcante
Make the snap system consistent with the placement tool and leak-safe. **Changes:** - Store `SnapCursorDataIntern` in a `static` variable; - Initialize (lazily) `SnapCursorDataIntern` only once (for the keymap). - Move setup members of `V3DSnapCursorData` to a new struct `V3DSnapCursorState` - Merge `ED_view3d_cursor_snap_activate_point` and `ED_view3d_cursor_snap_activate_plane` into `state = ED_view3d_cursor_snap_active()` - Merge `ED_view3d_cursor_snap_deactivate_point` and `ED_view3d_cursor_snap_deactivate_plane` into `ED_view3d_cursor_snap_deactive(state)` - Be sure to free the snap context when closing via `ED_view3d_cursor_snap_exit` - Use RNA properties callbacks to update the properties of the `"Add Primitive Object"` operator
2021-10-20UI: Activate parent when active child is collapsedJulian Eisel
Previously, when an item was active and its parent (or grand parent, etc.) was collapsed, the active item would simply not be visible anymore. It seemed like there was no active item. So instead, change the just collapsed parent to be the active item then, so the active item stays visible.
2021-10-20View3D: expose snap selection as a utility funcitonCampbell Barton
This makes it convenient to position appended objects, see: T92111.
2021-10-19Asset Browser: Improved workflow for asset catalog savingSybren A. Stüvel
No longer save asset catalogs on blendfile save. Instead: - extend the confirmation prompt for unsaved changes to show unsaved catalogs. - In the confirmation prompt, make catalog saving explicit & optional, just like we do it for external images. {F10881736} - In the Asset Browser catalog tree, show an operator icon to save the catalogs to disk. It's grayed out if there are no changes to save, or if the .blend wasn't saved yet (required to know where to save the catalog definitions to). {F10881743} Much of the work was done by @Severin and reviewed by me, then we swapped roles. Reviewed By: Severin Differential Revision: https://developer.blender.org/D12796
2021-10-19Fix image cache margin calculationCampbell Barton
This margin was inconsistently calculated: only taking the visible region and interface scale into account in some cases.
2021-10-19Cleanup: remove unused member and rearrange functionGermano Cavalcante
2021-10-18UI: Reduce vertical margin between panelsPablo Vazquez
In an attempt to reduce scrolling. This can be re-visited if a kind of switch between "compact" and "comfortable" UI size is implemented in the future.
2021-10-18Animation: Motion Paths Refresh AllJan-Willem van Dronkelaar
Adds a button, Update All Paths, to the Motion Paths property tabs and will always show. The operator goes through all visible objects and updates their motion paths. The current implementation has a subtle functional change. Calculating or updating motion paths for armature objects (through the Object tab, not Armature tab) now also updates the paths for its bones. We could preserve the old behavior but it doesn't seem necessary. It seems more likely that the animator wants to update both anyways. Reviewed by: sybren Maniphest Tasks: T83068 Differential Revision: https://developer.blender.org/D11667
2021-10-18Snap and Placement Gizmo RefactorGermano Cavalcante
Move most of the gizmo snap and placement code to `view_cursor_snap.c`. Simplify and extend the snap API. Differential Revision: https://developer.blender.org/D12868
2021-10-17UI: Adjust header color when active instead of inactivePablo Vazquez
Currently, the background color of headers gets darkened when the editor is not active, this makes it hard to theme, and adds contrast/noise when it's not needed. This patch makes headers use the regular theme color when the editor is not active, so it can be made to flush with the background more easily. And lightens the header (by +10, same value as before) when the editor is active, providing the wanted highlight. The motivations behind this change are: * Simplify picking a theme color for headers. * Widgets already become lighter on mouse hover, this change creates a connection with that concept. Left: current master, inactive header is darkened. Right: this patch, inactive header gets the theme color, active editor gets header in a slightly lighter color (like most widgets) {F11052503, size=full, loop, autoplay} Reviewed By: #user_interface, HooglyBoogly Differential Revision: https://developer.blender.org/D12856
2021-10-17UI: Visual style update to panelsPablo Vazquez
Back in Blender 2.30, the GUI project brought panels into Blender among other important visual updates. For the first time it was possible to move the wall of buttons around. Providing a clear separation between sections (it even allowed the grouping of panels in tabs!) During the 2.5 redesign, the separation between panels became a line on top of each panel, and panels received theme settings for background and header colors. The default theme used the same color for both. In 2.8 the background color of panels was different from headers in the default theme, so the separator line was removed. While the separator line wasn't elegant (only on top, non-themeable, hard-coded emboss effect), it provided a sort of separation between panels. This patch solves the panels-separation by simply adding a margin space around them (not visible in default theme yet). Even though the margin reduces the width of the working area slightly, it makes room for the upcoming always-visible scrollbars. Other adjustments: * Use arrow icon instead of triangle to collapse/expand * Use rounded corners to match the rest of the UI (editor corners, nodes, etc). {F10953929, size=full} Margin on panels makes use of the `style->panelouter` property that hasn't been used in a while. Also slight tweaks to `boxspace` and `templatespace` style properties so they are multiples of 2 and operations on them round better. There is technically no need to update the themes for them to work, so no theme changes are included in this patch. {F10953931, size=full} {F10953933, size=full} {F10953934, size=full} {F10954003, size=full} ---- A new theme setting under Style controls the roundness of all panels (added it to Style instead of ThemeSpace because I think controlling the panel roundness per editor is a bit overkill): {F11091561, size=full, autoplay, loop} Reviewed By: HooglyBoogly Differential Revision: https://developer.blender.org/D12814
2021-10-14Filebrowser: Expose file select functions for File Browser to Python API.Paul Golter
This patch adds activate_file_by_relative_path(relative_path="") and deselect_all() function to the space api of the File Browser. While the first sets the active file and adds it to the selection based on a relative path to the current File Browser directory the second one deselects all files but does not change the active file. Differential Revision: https://developer.blender.org/D12826 Reviewed by: Julian Eisel
2021-10-14Cleanup: clang-tidy, clang-format & spellingCampbell Barton
2021-10-13Cleanup: Snap Context RefactorGermano Cavalcante
Move runtime parameters out of context creation. Not being able to choose another region and v3d limits the use of the snap API.
2021-10-12XR Controller Support Step 4: Controller DrawingPeter Kim
Addresses T77127 (Controller Drawing). Adds VR controller visualization and custom drawing via draw handlers. Add-ons can draw to the XR surface (headset display) and mirror window by adding a View3D draw handler of region type 'XR' and draw type 'POST_VIEW'. Controller drawing and custom overlays can be toggled individually as XR session options, which will be added in a future update to the VR Scene Inspection add-on. For the actual drawing, the OpenXR XR_MSFT_controller_model extension is used to load a glTF model provided by the XR runtime. The model's vertex data is then used to create a GPUBatch in the XR session state. Finally, this batch is drawn via the XR surface draw handler mentioned above. For runtimes that do not support the controller model extension, a a simple fallback shape (sphere) is drawn instead. Reviewed By: Severin, fclem Differential Revision: https://developer.blender.org/D10948
2021-10-08UI: Add context menu support for tree-view itemsJulian Eisel
Tree-view items can now easily define their own context menu. This works by overriding the `ui::AbstractTreeViewItem::build_context_menu()` function. See the documentation: https://wiki.blender.org/wiki/Source/Interface/Views#Context_Menus Consistently with the Outliner and File Browser, the right-clicked item also gets activated. This makes sure the correct context is set for the operators and makes it clear to the user which item is operated on. An operator to rename the active item is also added, which is something you'd typically want to put in the context menu as well.
2021-10-08UI: Support tooltips for superimposed iconsJulian Eisel
In a couple of places in the UI, we show superimposed icons on buttons to execute an operation (called "Extra Icons" internally). Hovering them would show the tooltip of the underlying button, which is misleading and confusing. There are cases where it's not obvious what an icon does, so a tooltip would be quite useful here. It's likely we are going to use superimposed icons in more places in the future, e.g. see D11890. The extra icon basically acts as an override for the button in the tooltip code. Differential Revision: https://developer.blender.org/D11894 Reviewed by: Campbell Barton