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-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-16Asset Browser: For assets without preview, show type icon in sidebarJulian Eisel
Otherwise it would just show empty space where the icon is supposed to be. Unfortunately this icon is upscaled quite a bit and doesn't look too great. Would be good to improve but not a high priority.
2020-12-16Assets: Add operator & button to regenerate the automatic previewJulian Eisel
This makes it possible to trigger a refresh of the data-block preview, available next to the preview in the Asset Browser sidebar. The previews get easily outdated and automatically refreshing it all the time is not an option because it would be a consistently running, quite expensive process. So a button to cause a refresh should be reasonable. This button can also be used to switch back from a custom preview to a generated one. Although that may not be clear, and we should probably think of a way to explain that better. Addresses T82719.
2020-12-16Cleanup: sort struct blocksCampbell Barton
2020-12-16Cleanup: remove redundant struct declarationsCampbell Barton
2020-12-15Fix various issues with temporary, maximized File BrowsersJulian Eisel
If Preferences > Interface > Temporary Editors > File Browser is set to "Maximized Area", opening a File Browser from a File or Asset Browser as regular editor would cause some issues. For example after closing the temporary File Browser, the regular browser would take over the file path and display settings from the temporary one. This is because they used to share the same area data. Some similar issues may have happend with temporary image editors. Now, this commit finally separates the space data of temporary maximized editors from the regular ones. So the editor data is entirely independent now, as it should be.
2020-12-15Asset System: Prepare File Browser backend for the Asset BrowserJulian Eisel
The Asset Browser will be a sub-editor of the File Browser. This prepares the File Browser code for that. **File-Lists** * Support loading assets with metadata read from external files into the file-list. * New main based file-list type, for the "Current File" asset library. * Refresh file-list when switching between browse modes or asset libraries. * Support empty file-lists (asset library with no assets). * Store file previews as icons, so scripts can reference them via icon-id. See previous commit. **Space Data** * Introduce "browse mode" to differeniate between file and asset browsing. * Add `FileAssetSelectParams` to `SpaceFile`, with `FileSelectParams` as base. Makes sure data is separated between asset and file browsing when switching between them. The active params can be obtained through `ED_fileselect_get_active_params()`. * `FileAssetSelectParams` stores the currently visible asset library ID. * Introduce file history abstraction so file and asset browsing can keep a separate history (previous and next directories). **General** * Option to only show asset data-blocks while file browsing (not exposed here). * Add "active_file" context member, so scripts can get and display info about the active file. * Add "active_id" context member, so `ED_OT_lib_id_load_custom_preview` can set a custom ID preview. (Only for "Current File" asset library) * Expose some of `FileDirEntry` in RNA as (non-editable). That way scripts can obtain name, preview icon and asset-data. 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/D9724 Reviewed by: Bastien Montagne
2020-12-15Asset System: Support dragging assets and appending on dropJulian Eisel
For the Asset Browser, it needs to be possible to drag assets into various editors, which may not come from the current .blend file. In other words, the dragging needs to work with just the asset metadata, without direct access to the data-block itself. Idea is simple: When dragging an asset, store the source file-path and data-block name and when dropping, append the data-block. It uses existing drop operators, but the function to get the dropped data-block is replaced with one that returns the local data-block, or, in case of an external asset, appends the data-block first. The drop operators need to be adjusted to use this new function that respects assets. With this patch it only works for dragging assets into the 3D view. Note that I expect this to be a short-lived change. A refactor like D4071 is needed to make the drag & drop system more future proof for assets and other use cases. 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/D9721 Reviewed by: Bastien Montagne, Brecht Van Lommel
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-15Cleanup: reduce indirect DNA header inclusionCampbell Barton
Remove DNA headers, using forward declarations where possible. Also removed duplicate header, header including it's self and unnecessary inclusion of libc system headers from BKE header.
2020-12-14UI/Assets: Support generating object preview imagesJulian Eisel
Object previews are really helpful for visual data-block selection, like asset browsing. Having them be generative should also be quite handy and should work well enough in many, if not most cases. What this does is simple: * Place the object (actually a deep copy of it, for thread safety) in a virtual .blend into an empty scene/view-layer. * Add a camera, point it towards the front of the object, assuming that means pointing towards its +Y axis. * Use "Camera Fit Frame to Selected" logic to put the object into frame. * Create a threaded off-screen render. Of course, such an automatic preview will not work in all situations. E.g. it currently does a bad job capturing a single plane. We could add options for more advanced automatic previews, but probably custom previews is more important, which I committed already (812ea9184221). Part of the first Asset Browser milestone. Check the #asset_browser_milestone_1 project milestone on developer.blender.org. Reviewed as part of https://developer.blender.org/D9719. Reviewed by: Bastien Montagne, Brecht Van Lommel
2020-12-14UI/Assets: Operator to load custom preview images for data-blocksJulian Eisel
No automatic preview generation will ever be good enough to cover all cases well. So custom preview images are a must for a preview driven data-block selection - like for asset browsing. The operator simply allows selecting an image file, which will then be read and copied into the data-blocks preview (resized if necessary). There's no UI for this currently and the operator won't be available in the search menu yet. It will later once the Asset Browser UI is merged. Reviewed as part of https://developer.blender.org/D9719. Reviewed by: Bastien Montagne, 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-08File Browser: Refactor access to the selection parameters structJulian Eisel
* Avoid direct access to `SpaceFile.params`, use a getter instead. This matters because once the asset-browser changes are in, there will be an alternative selection parameter object. The getter can return the correct one. * Rename the function to ensure the parameters. The old name `ED_fileselect_get_params()` wasn't a mere getter, it would create the parameters if necessary. Now we have an actual getter, so better be clear. * In some instances, I replaced the old "get" function with the new mere getter. So the ensure logic is called less often. However, in these cases we should be able to assume the selection parameters were created already as part of the editor creation routine. The term "active" in the new function names may seem a bit odd in the current context, but that is a preparation for the Asset Browser merge as well. Like said, there will be two file selection parameter objects in the space.
2020-12-06UI: Alert Dialog Helper FunctionYevgeny Makarov
Shared helper function to create a split layout with an alert icon for popup dialogs. Differential Revision: https://developer.blender.org/D9486 Reviewed by Julian Eisel
2020-12-06UI: 'About Blender' with Full LogoYevgeny Makarov
New layout for the 'About' dialog featuring the full version of the Blender logo. Differential Revision: https://developer.blender.org/D9507 Reviewed by Hans Goudey
2020-12-04Cleanup: Use typedef for button string info typeHans Goudey
Before, it wasn't clear what the int in `uiStringInfo` was supposed to store. Using a typedef can make this someone more explicit.
2020-12-02UI: Add new node colors for geometry nodesHans Goudey
During the development of the new nodes in the `geometry-nodes` branch the color of the new nodes wasn't considered, so all of the nodes ended up red, the color for "input" nodes. This patch introduces two new colors, one for "Geometry" and one for "Attributes". There are only two attribute nodes currently, but the next sprint will add two more, attribute mix, and sample from texture. The attribute nodes are conceptually different enough from the nodes that modify the geometry that they deserve their own color. Differential Revision: https://developer.blender.org/D9682
2020-12-02Geometry Nodes: initial scattering and geometry nodesJacques Lucke
This is the initial merge from the geometry-nodes branch. Nodes: * Attribute Math * Boolean * Edge Split * Float Compare * Object Info * Point Distribute * Point Instance * Random Attribute * Random Float * Subdivision Surface * Transform * Triangulate It includes the initial evaluation of geometry node groups in the Geometry Nodes modifier. Notes on the Generic attribute access API The API adds an indirection for attribute access. That has the following benefits: * Most code does not have to care about how an attribute is stored internally. This is mainly necessary, because we have to deal with "legacy" attributes such as vertex weights and attributes that are embedded into other structs such as vertex positions. * When reading from an attribute, we generally don't care what domain the attribute is stored on. So we want to abstract away the interpolation that that adapts attributes from one domain to another domain (this is not actually implemented yet). Other possible improvements for later iterations include: * Actually implement interpolation between domains. * Don't use inheritance for the different attribute types. A single class for read access and one for write access might be enough, because we know all the ways in which attributes are stored internally. We don't want more different internal structures in the future. On the contrary, ideally we can consolidate the different storage formats in the future to reduce the need for this indirection. * Remove the need for heap allocations when creating attribute accessors. It includes commits from: * Dalai Felinto * Hans Goudey * Jacques Lucke * Léo Depoix
2020-11-20Add Object Tool: support placing objects in orthographic axis viewsCampbell Barton
When an projecting onto a plane that is orthogonal to the views Z axis, project onto a view aligned axis then map it back to the original plane. see: ED_view3d_win_to_3d_on_plane_with_fallback Since the depth can't be properly visualized in 3D, display a 2D so it's possible to to tell the depth from the cursor motion.
2020-11-20Cleanup: remove unused off-screen drawing structCampbell Barton
2020-11-20Cleanup: rename do_sky argument to draw_backgroundCampbell Barton
This was leftover from Blender internal, follow the naming already used by the draw manager.
2020-11-20Cleanup: remove unused perspective argument to off-screen drawingCampbell Barton
Some callers were passing in dummy values, this can be accessed from `RegionView3D.is_persp` can be used to check this.
2020-11-19Merge branch 'blender-v2.91-release'Campbell Barton
2020-11-19Fix T82540: Smart UV project ignores seamsCampbell Barton
The seam check was missed in 9296ba867462f7ff3c55bc0c9129af4121243bed which calculates islands from the BMesh.
2020-11-18GPencil: Automerge last drawn stroke with previous strokesAntonio Vazquez
This option joins any stroke with an end near the actual stroke. Now it is not limited to the last stroke, any stroke in the same layer for the actual frame can be joined. The join can join two strokes drawing a third stroke. If the end and the start of the result stroke are very small, the stroke is changed to be cyclic automatically. There is a limit distance to join the stroke, if the distance is greater than this value, the strokes are not joined. Actually, a constant, threshold distance is used, but we could expose as a parameter in the UI in the future. The tool can be used with freehand drawing or with primitives. Note: Great part of the patch is just a refactor of the old code to make it accessible and to keep code organized. Reviewed By: mendio Maniphest Tasks: T82377 Differential Revision: https://developer.blender.org/D9440
2020-11-18Merge branch 'blender-v2.91-release'Nathan Craddock
2020-11-18Fix grease pencil draw mode icon color in outlinerNathan Craddock
ICON_GREASEPENCIL was defined as an object data icon when it was used as a mode icon. This caused it to draw green in the outliner.
2020-11-17Merge branch 'blender-v2.91-release'Campbell Barton
2020-11-17Fix T82637: pack UV islands fails with some non-manifold meshesCampbell Barton
Edges with 3 or more connected UV's caused UV pack to fail. Instead of using functions from uvedit_parametrizer.c which are intended specifically for ABF/LSCM unwrapping, use a simpler method for packing which stores arrays of BMesh faces.
2020-11-16Cleanup: clang-formatCampbell Barton
2020-11-13GPencil: Merge GSoC curve edit modeFalk David
Differential Revision: https://developer.blender.org/D8660 This patch is the result of the GSoC 2020 "Editing Grease Pencil Strokes Using Curves" project. It adds a submode to greasepencil edit mode that allows for the transformation of greasepencil strokes using bezier curves. More information about the project can be found here: https://wiki.blender.org/wiki/User:Filedescriptor/GSoC_2020.
2020-11-13GPencil: Remove ID from operators to fix T82597Antonio Vazquez
Instead to use the ID of the object, now the parameter is an Enum with Selected object or New. If use selected mode, the first grease pencil object selected is used. If none of the selected objects is a grease pencil object, a new object is created. Small cleanup changes to the original patch. Differential Revision: https://developer.blender.org/D9529
2020-11-12Fix T82388: Sculpt mode: Unexpected undo behavior.Bastien Montagne
Issue exposed by rB4c7b1766a7f1. Main idea is that non-memfile first undo step should check into previous memfile and tag the ID it is editing as `future_changed`. That way, when we go back and undo to the memfile, said IDs are properly detected as changed and re-read from the memfile. Otherwise, undo system sees them as unchanged, and just re-use the current data instead. Note that currently only Sculpt mode seems affected (probably because it is storing the mode switch itself as a Sculpt undo step instead of a memfile one), but similar action might be needed in some other cases too. Maniphest Tasks: T82388 Differential Revision: https://developer.blender.org/D9510
2020-11-12Merge branch 'blender-v2.91-release'Jeroen Bakker
2020-11-12Fix T82093: Sampled Colors Mismatch When Painting (Partial)Jeroen Bakker
When painting in the image editor on data images (Non-color, Raw) the color mismatched between the sampled color and the actual effect that the painting has on the image. The root cause is that the sampling is color managed, but the painting still uses a fixed color management pipeline with a lot of assumptions. Due to recent changes the drawing of the image editor is color managed, but the painting isn't what made these changes show up. This patch is a work-a-round so that the sampled colors and the effect the paint has on the texture matches. This isn't the correct solution as that would be to migrate all the painting tools to use proper color management. Reviewed By: Pablo Dobarro Differential Revision: https://developer.blender.org/D9411
2020-11-07View3D: take clipping into account for Frame AllCampbell Barton
Clamp the min/max used for Frame All/Selected by the clipping region if it's set. Resolve T81050
2020-11-06Cleanup: transform.h comments, use doxy sectionsCampbell Barton
2020-11-06Cleanup: sort structs, filesCampbell Barton
2020-11-05Spelling: Predefined, Look Up, No OneHarley Acheson
Fixes 18 misspellings of 'predefined', 'Look Up', 'Lookup', and 'No One'. Differential Revision: https://developer.blender.org/D9466 Reviewed by Hans Goudey
2020-11-05Cleanup: Use const for function argumentsHans Goudey
2020-11-05Cleanup: Make panel function staticHans Goudey
These functions were not used elsewhere, and the handling for the panel tabs should be kept local to this file where possible. Also remove another unused function and removed an unecessary "_ex" function.
2020-11-03Fix possible use-after-free when closing Blender with File Browser openJulian Eisel
I think there wasn't actually any issue currently, but only by luck. We still passed around and NULL-checked a pointer to freed memory (the file operator, `SpaceFile.op`) which is easy to break and should be avoided. Noticed while testing D8598.
2020-11-02Fix T77819: Snap Incremental does not match grid in all casesGermano Cavalcante
The behavior of the incremental snap did not take into account the relative dimensions of the window, which resulted in a different behavior if the area height was greater than the width.
2020-11-02Cleanup: Sanitise return value of `ED_object_parent_set()`Sybren A. Stüvel
Consistently return `false` from `ED_object_parent_set()` when parenting is not possible. Before, when parent and child were the same object, the function would return `true` even though the parent-child relation was not made. Just returning `false` in the `parent == child` case would break the parenting operator, as `false` stops its loop over all selected objects. This tight coupling caused T82312. The loop now has its own check for this, so that it properly continues, and the implementation of `ED_object_parent_set()` is decoupled from its surrounding code. No functional changes.
2020-10-30Merge branch 'blender-v2.91-release'Campbell Barton
2020-10-30Undo System: support for grouping steps with begin/end callsCampbell Barton
This adds support for treating multiple undo steps as a single step from the user perspective. This is needed for outliner mode switching and `object.switch_object` operator which change active object and mode in a single action.
2020-10-30Text: support "Text to 3D Object" for read-only dataCampbell Barton
Add poll function for read-only text data, for operators that don't require the text to be editable.
2020-10-28Outliner: Properties editor sync on selectionNathan Craddock
When outliner datablocks are selected, switch to the corresponding tab for that datablock in properties editors. Only properties editors that share an edge with the outliner will change tabs. Additionally, when modifiers, constraints, and shader effects are selected from the outliner, the panel will be expanded in all properties editors. Part of T77408 Manifest Task: https://developer.blender.org/T63991 Differential Revision: https://developer.blender.org/D8638
2020-10-20UV/Image: Remove Legacy DrawingJeroen Bakker
With D8234 a new drawing method for UV/Image editor was introduced. For debugging reasons we left the old drawing method in the code base. This patch will remove the old drawing method. Reviewed By: Clément Foucault Differential Revision: https://developer.blender.org/D9011