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-16Sculpt: Multires Displacement SmearPablo Dobarro
This tool implements smearing for multires displacement over the limit surface, similar to how smearing for colors and topology slide works. When used the displacement values of the vertices "slide" over the topology, creating the effect of smearing the surface detail. As the brush just modifies displacement values instead of coordinates, the total displacement of the affected area doesn't change. This means that this smearing effect can be used multiple times over the same area without generating any artifacts in the topology. When the brush is used with the pinch or expand smear modes, displacement differences are pushed into the same area, creating hard surface effects without pinching the topology. As any other brush that relies on the limit surface (like displacement erasers), this will work better after using apply base. Reviewed By: sergey, JulienKaspar, dbystedt Differential Revision: https://developer.blender.org/D9659
2020-12-16Fix: Python warning in windows debug buildsRay Molenkamp
When doing a debug build on windows, blender will start with the following warning: "Unable to find the python binary, the multiprocessing module may not be functional!" The root cause for this issue is: for a debug build the python binary is called python_d.exe rather than just python.exe This change fixes BKE_appdir_program_python_search to look for the _d suffix for debug builds on windows Differential Revision: https://developer.blender.org/D9775 Reviewed by: Campbell Barton
2020-12-16LibOverride: Better handling of missing linked data during resync.Bastien Montagne
We do not generate overrides for missing data-blocks (aka placeholder ones) anymore, and properly delete the remaining old overrides of those during the resync process. This should prevent constant 'missing data-blocks' messages when opening blend files with overrides whose libraries have beed edited. Issue reported by @andy from Blender studio, thanks.
2020-12-16Fix T83557: Alpha blend + emissive colors renders white artifactsJeroen Bakker
Issue was that not all code paths were taken to determine if the GPU Texture was premultiplied or not. In this case the result was set to unpremultiplied what is incorrect. This fixes broken test case image alpha blend from image_colorspace.
2020-12-16Geometry Nodes: rename node to Attribute RandomizeJacques Lucke
Previously, the node was called Random Attribute. For consistency reasons, we move the "Attribute" part of the name to the front.
2020-12-16Cleanup: sort struct blocksCampbell Barton
2020-12-16Cleanup: remove redundant struct declarationsCampbell Barton
2020-12-16VSE: Add Overlay popover panelsPeter Fog
Add panels with overlay settings for strips and preview and overlay enable/disable button. Entries from the View menus moved to the overlay panels, which will simplify cluttered View menus. Additional options have been added: - Strip Name - Strip Source(ex. path) - Strip Duration So users can now select what info they need to see on the strips. When No text is displayed, waveforms are drawn in full height. Reviewed By: ISS, HooglyBoogly, pablovazquez Differential Revision: https://developer.blender.org/D9751
2020-12-15Sculpt: Fair Face Sets operation for Face Set EditPablo Dobarro
This implements a mesh fairing algorithm and implements the fair operations for Face Set edit. This edit operations create a smooth as possible geometry patch in the area of the selected Face Set. The mesh fairing algorithm is designed by Brett Fedack for the addon "Mesh Fairing": https://github.com/fedackb/mesh-fairing, with some modifications: - The main fairing function in BKE_mesh_fair.h does not triangulate the mesh. For the test I did in sculpt mode results are good enough without triangulating the topology. Depending on the use and the result quality needed for a particular tool, the mesh can be triangulate in the affected area before starting fairing. - Cotangents loop weights are not implemented yet. The idea is to also expose the vertex and loop weights in a different function in case a tool needs to set up custom weights. This algorithm will also be used to solve the limitations of line project and implement the Lasso Project and Polyline Project tools. It can also be used in tools in other areas of Blender, like Edit Mode or future retopology tools. Reviewed By: brecht Differential Revision: https://developer.blender.org/D9603
2020-12-15Cleanup: Use nullptr instead of NULL in C++ codeHans Goudey
2020-12-15Fix redundant declaration warningJulian Eisel
Function was declared twice (caused by merge conflicts) which GCC would rightfully complain about.
2020-12-15Fix failing assert when generating material previewJulian Eisel
The `!BKE_previewimg_is_finished()` in `icon_preview_startjob_all_sizes()` would fail. Caused by 990bd9acf243ae. We have to be more picky about tagging previews as unfinished after file read. But we also have to consider files stored in old versions and set the unfinished tag as needed.
2020-12-15Assets: Better path for the default asset libraryJulian Eisel
In D9722 we agreed on using `[home-directory]/Documents/Blender/Assets` for the default asset library. I just forgot to do the change before committing. (The default repository is just a named path, it's *not* a default library with bundled assets.)
2020-12-15Fix asset previews not showing in "Current File" repository after readingJulian Eisel
Previews would be flagged as unfinished when reading. Instead clear the flag and always consider them finished upon reading. If we wouldn't do this, the File Browser would keep running the preview updating to wait for the preview to finish. It could be smarter and also check if there's actually a preview job running. Instead, I think it will just display an unfilled buffer for now. Up until today we wouldn't even know if a stored preview is finished or not, so it would always assume they are finished. We do the same now, but have the option to make it smarter.
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 custom asset library paths through PreferencesJulian Eisel
One of the core design aspects of the Asset Browser is that users can "mount" custom asset libraries via the Preferences. Currently an asset library is just a directory with one or more .blend files in it. We could easily support a single .blend file as asset library as well (rather than a directory). It's just disabled currently. Note that in earlier designs, asset libraries were called repositories. Idea is simple: In Preferences > File Paths, you can create custom libraries, by setting a name and selecting a path. The name is ensured to be unique. If the name or path are empty, the Asset Browser will not show it in the list of available asset libraries. The library path is not checked for validity, the Asset Browser will allow selecting invalid libraries, but show a message instead of the file list, to help the user understand what's going on. Of course the actual Asset Browser UI is not part of this commit, it's in one of the following ones. {F9497950} 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/D9722 Reviewed by: Brecht Van Lommel, Hans Goudey
2020-12-15Asset System: Various changes to previews in preparation for Asset BrowserJulian Eisel
* Support defining (not necessarily rendering) icons in threads. Needed so the File Browser can expose file previews with an icon-id to scripts. ** For that, ported `icons.c` to C++, to be able to use scope based mutex locks (cleaner & safer code). Had to do some cleanups and minor refactoring for that. * Added support for ImBuf icons, as a decent way for icons to hold the file preview buffers. * Tag previews as "unfinished" while they render in a thread, for the File Browser to dynamically load previews as they get finished. * Better handle cases where threaded preview generation is requested, but the ID type doesn't support it (fallback to single threaded). This is for general sanity of the code (as in, safety and cleanness) * Enabled asset notifier for custom preview loading operator, was just disabled because `NC_ASSET` wasn't defined in master yet. 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/D9719 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-15Asset System: Data-block asset metadata storage, reading and APIJulian Eisel
Asset metadata is what turns a regular data-block into an asset. It is a small data-structure, but a key part of the technical design of the asset system. The design foresees that asset data-blocks store an `ID.asset_data` pointer of type `AssetMetaData`. This data **must not** have dependencies on other data-blocks or data-block data, it must be an independent unit. That way we can read asset-metadata from .blends without reading anything else from the file. The Asset Browser will use this metadata (together with the data-block name, preview and file path) to represent assets in the file list. Includes: * New `ID.asset_data` for asset metadata. * Asset tags, description and custom properties. * BKE code to manage asset meta-data and asset tags. * Code to read asset data from files, without reading IDs. * RNA for asset metadata (including tags) 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/D9716 Reviewed by: Bastien Montagne, Brecht Van Lommel
2020-12-15Geometry Nodes: support evaluating mesh object to geometry setJacques Lucke
This implements the design proposed in T83357. The goal is to allow the geometry nodes modifier on mesh objects to output instances and potentially other geometry types. Both problems are tackled by allowing mesh objects to evaluate to a geometry set, instead of just a single mesh id data block. The geometry set can contain a mesh but also other data like instances and a point cloud. I can't say that I'm sure that this commit won't introduce bugs. Mainly the temporary object creation during rendering seems a bit brittle. BUT, we can be reasonably sure that this commit will not introduce regressions (at least not ones, that are hard to fix). This is because the code has been written in a way that minimizes changes for existing functionality. Given that we intend to hide the point cloud object for the next release, we won't even have to worry about temporary object creation for now. An important part of the technical design is to make sure that `ObjectRuntime->data_eval` contains the same data before and after this patch. This helps to make sure, that existing code paths are impacted as little as possible. Instead of fully replacing `data_eval`, there is `geometry_set_eval`, which contains all the geometry components an object evaluated to (including the data referenced by `data_eval`). For now, not much code has to be aware of `geometry_set_eval`. Mainly the depsgraph object iterator and the instances system have to know about it. Reviewers: brecht Differential Revision: https://developer.blender.org/D9851
2020-12-15Fix: upward compatibility of cryptomatte matte id.Jeroen Bakker
The matte_id is stored in a different structure in 2.92. This patch will write the old matte_id field so the files can be opened correctly in older versions.
2020-12-15Cleanup: make formatJacques Lucke
2020-12-15Fix: mattes of cryptomatte node lost after writeJeroen Bakker
Fix an issue introduced by {f4df036bc497} where the read/write code missed to store and read the mattes from its new location.
2020-12-15Cleanup: doxy comments (use colon after parameter name)Campbell Barton
Also remove colon after `\note`.
2020-12-15Cleanup: spellingCampbell Barton
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-15Cleanup: type check failure, discarded-qualifiers warningsCampbell Barton
Caused by 7f6ffe9195c105a2ed9776b907aa2e6e34ed4bf3
2020-12-15NLA: Action Strip Defaults Sync Length OnWayde Moss
See T82309#1055564 {T63675} and their duplicates for how Default-off can cause confusion. This is just for convenience since it allows animators to keyframe outside of the strip's bounds by default. This was likely off by default before since Syncing Length would undesirably shift the whole animation after leaving tweak mode (fixed by {D7602}) and the animator wasn't able to keyframe outside the strip bounds anyways (fixed by {D7533}). Now it's better if the flag was on by default. While the animator is still roughly developing their animation NLA-wise they won't have to worry about strip bound keying failures. When they are more certain of the strip bounds, they can disable the flag to prevent affecting the rest of the NLA system. Reviewed By: sybren Differential Revision: https://developer.blender.org/D9661
2020-12-15Nla Refactor: Blend functions explicit Div0 checkWayde Moss
It's an explicit check to prevent division by zero if caller hasn't done the check. Future patch {D8867} will not use the nla remap function and thus not do the check. This patch also replaces some float (==) equality checks with IS_EQF(). Split from {D9247} Reviewed By: sybren Differential Revision: https://developer.blender.org/D9694
2020-12-15Nla Refactor: nlaevalchan_validate_index_ex()Wayde Moss
And removes redundant index local variable. Future patches {D8296} and {D8867} make use of this function. No functional changes. Split from {D9247} Reviewed By: sybren Differential Revision: https://developer.blender.org/D9693
2020-12-14Cryptomatte: Data structure in compositor nodeJeroen Bakker
This changes the way how the mattes are stored in the compositor node. This used to be a single string what was decoded/encoded when needed. The new data structure stores all entries in `CryptomatteEntry` and is converted to the old `matte_id` property on the fly. This is done for some future changes in the workflow where a more structured approach leads to less confusing and easier to read code.
2020-12-14Fix memory leak and possible other issues with custom previewsJulian Eisel
Mistake in 812ea9184221. Fixed that same one before in the branch, I may have brought it back when resolving merge conflicts.
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-14Blenkernel: move DerivedMesh.c to c++Jacques Lucke
Required changes to make it compile with clang tidy: * Use c++ includes like (e.g. climits instead limits.h). * Insert type casts when casting from void* to something else. * Replace NULL with nullptr. * Insert casts from int to enum. * Replace designed initializers (not supported in C++ yet). * Use blender::Vector instead of BLI_array_staticdeclare (does not compile with C++). * Replace typedef statements. Ref T83357.
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-14LibOverride: Do not store some heavy data from override IDs.Bastien Montagne
This commit removes geometry from meshes and shapekeys, and embedded files, from liboverride IDs. This data is never overrideable, there is no reason to store extra useless copies of it in production files. See T78944. Note that we may add more data to be skipped on write for liboverrides in the future, but this commit should address all the most important cases already. Reviewed By: brecht Differential Revision: https://developer.blender.org/D9810
2020-12-14Fix missing string escape for RNA path creationCampbell Barton
2020-12-14Fix version patching sequence strip alpha from 2.4x filesCampbell Barton
Regression in 4f5f868a523430aa41de8bd63f888878aaf63002
2020-12-12GPencil: Add uniform subdivide BKE to improve interpolationFalk David
This patch introduces a new BKE function that performs a uniform subdivide. The goal of this function is to subdivide the stroke to reach a target number of points while maintaining its shape, color, and weights. This is done by repeatedly subdividing the longest edge in the stroke. Every subdivision adds a new point at the exact middle point of an edge. The function is intended to be used in the interpolation operators to give better results when interpolating between different sized strokes. Reviewed By: antoniov Differential Revision: https://developer.blender.org/D9835
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-12UI: Allow Outliners to pass selected data-blocks to operators via contextJulian Eisel
The way the Outliner integrates operations on selected tree elements is known to be quite problematic amongst developers. The context menu is generated in an unusual way and doesn't use the normal operator system. Instead, changes are applied via a recursive callback system. Things are quite ad-hoc, and the callbacks often implement logic that should not be in the Outliner, but in entirely different modules. Often these modules already contain the logic, but as proper operators. This commit is a step into a hopefully better direction that should allow us to put actual operators into Outliner context menus. It starts solving the problem of: How can the Outliner pass selected data to operators. It implements it for data-blocks only, but other data could do it in the same way. Idea is to keep doing what operators were initially designed to do: Operate on context. Operators can now query a "selected_ids" context member (`CTX_data_selected_ids()` in C, `bpy.context.selected_ids` in .py). If an Outliner is active, it will generate a list of selected data-blocks as a response, via its `SpaceType.context` callback. Any other editor could do the same. 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-11Fix T83050: Crash dragging shared collection to master collectionHans Goudey
The flag syncing code expects to find collection flags in same view layer before and after the move, it even has an assert for it. However, there is one case where this doesn't happen, when dragging a collection that exists in two scenes to the master collection. This commit removes this assert, frees the temporary flag structs separately, and updates some comments with this information. There is more detail in the adjusted comment. Differential Revision: https://developer.blender.org/D9785
2020-12-11Fix T83280: Crash when deleting hair collision collection.Bastien Montagne
Root of the issue was missing management of ID pointers in the cloth modifier data stored in ParticleSystem for hair physics, in the 'foreach_id' particle system code. Using modifier's 'foreach_id' code in psys one unfortunately requires some ugly conversion gymnastics, but this is still better than having dedicated code for that case. Note that this is actually a fairly critical issue, fix should be backported to 2.91.1 should we do it, and to 2.83 LTS as well I think.
2020-12-11Geometry Nodes: support instancing collectionsJacques Lucke
The Point Instance node can instance entire collections now. Before, only individual collections were supported. Randomly selecting objects from the collection on a per point basis is not support, yet. Last part of D9739. Ref T82372.
2020-12-11Geometry Nodes: support collection socketsJacques Lucke
Part of D9739.
2020-12-11Nodes: add Collection socket typeJacques Lucke
The implementation is pretty much the same as for Object sockets. The socket color is the one that is used for collections in the outliner. Part of D9739.
2020-12-11Refactor/extend BKE API to get special user directoriesJulian Eisel
The previous `BKE_appdir_folder_default()` was confusing, it would return the home directory on Linux and macOS, but the Documents directory on Windows. Plus, for the Asset Browser, we want to use the Documents directory for the default asset library on all platforms. This attempts to clean up the API to avoid confusion, while adding the newly needed functionality. * `BKE_appdir_folder_default()` should behave as before, but the implementation changed: ** Removes apparently incorrect usage of `XDG_DOCUMENTS_DIR` on Unix systems - this seems to be a config file variable, not an environment variable. Always use `$HOME` instead, which this ended up using anyway. ** On Windows it doesn't attempt to use `%HOME%` anymore and gets the Documents directory directly. * Add `BKE_appdir_folder_home()` to gives the top-level user directory on all platforms. * Add `BKE_appdir_folder_documents()` to always get the user documents directory on all platforms. There should be no user noticable behavior change. Differential Revision: https://developer.blender.org/D9800 Reviewed by: Brecht Van Lommel
2020-12-11Geometry Nodes: add Attribute Mix nodeJacques Lucke
This node can be used to mix two attributes in various ways. The blend modes are the same as in the MixRGB shader node. Differential Revision: https://developer.blender.org/D9737 Ref T82374.
2020-12-11Cleanup: remove some forward declared enumsJacques Lucke
Forward declaring enums are not allowed in C++. Differential Revision: https://developer.blender.org/D9811
2020-12-11Cleanup: sort cmake file listsCampbell Barton