WIP: Asset Shelf Grid-View #106316
- checkout the asset-shelf addons branch (
make updatetakes care of that)
This is the main change needed to properly implement the asset shelf main region. Loading, displaying, catalog based and type based filtering work, custom drag & activation operators don't yet. There is no paginated scrolling or so yet, but scrolling is vertical now (to be evaulated).
Some material slots could be empty, the operator could encounter a python exception. Now fixed. Pull Request: #106418
Reduce register spill to global memory in raytrace_resolve function. Results in a 20% uplift for this particular shader on Apple Silicon GPUs. Contributing to 3-5% uplift for scenes which have SSR enabled. This is achieved via reducing memory pressure using a packed data type for the sampling kernel. Authored by Apple: Michael Parkin-White Pull Request: #106231
Splitting workload dependency chains such that they only exist within the context of a single frame. Dependencies are required to ensure sequential command buffer submissions execute in order, but the additional dependencies between frames could incur GPU timeouts, if a signal was delayed. This could be triggered by both CPU/GPU cycles texture updates and Viewport Compositor operations. Should also resolve #106401 Authored by Apple: Michael Parkin-White Pull Request: #106443
OpenEXR has some dependecies that other other modules in Blender requires. When disabling OpenEXR these dependecies could not match and building blender would fail. This PR disables the next options when `WITH_IMAGE_OPENEXR=Off` - `WITH_OPENVDB` - `WITH_ALEMBIC` - `WITH_VULKAN_BACKEND` - `WITH_CYCLES_OSL` Additionally windows stores the IMath libraries in `IMATH_LIBRARIES` Linux and Mac stored the IMath libraries in `IMATH_LIBRARY`. This change will also adds `IMATH_LIBRARIES` variable to all platforms. Pull Request: #106209
so that the function can also be used by other classes. Also change `!bounds.valid()` to `!is_traceable()` so zero-sized objects are skipped.
Remove comments from `eBConstraint_Types` that - were used long ago during a big refactor effort, but are no longer necessary, or - just repeated the name of the enum constant. No functional changes.
Was only needed for the old asset shelf main region implementation, and caused some issues (e.g. too small buttons in status bar).
A bit more space efficient this way, and looks better IMO.
Looks visually more appealing IMHO.
This just makes the UI feel more "stable" since things don't move around as much anymore.
Set the default size later as part of regular area/region setup, when DPI is available. Also use `uiStyle` paddings.
This means the view always scrolls by a full row, so that asset previews are never partially in view. The paginated scrolling is implemented as a standard View2D feature. This doesn't work well with zooming yet, and it's tricky to get that to work right.
We want to support different preview sizes, but the regular region zooming makes things overly complicated (because of the pagination and region size snapping mostly). Plus region zooming would usually zoom text as well. So the preview size is better managed separately.
This PR silences some compilation warnings in the command buffer. Pull Request: #107541
This PR adds support to convert host/device data from floats to GPU_SRGB8_A8 and GPU_DEPTH_COMPONENT24. Pull Request: #107544
Due to index-only referencing in insertion of new NLA tracks in liboverride data, it may happen that the source of an inserted track cannot be found. This index-only based handling of NLA tracks in liboverrides is very weak, in the future this will be solved by ensure uniqueness of their names, then name-based reference can be used instead, as already done with modifiers, constraints, etc.
This commit mainly addresses issues when a part of an override hierarchy does not match anymore the linked reference data, and gets isolated form the hierarchy root (there is no parenting chain to the root anymore). The typical case being an object or sub-collection being moved to another subcollection in the linked data. Case identified while working on some Pets production files. Note that in some cases this isolated chunk of the hierarchy will be linked back into the appropriate place, in others it should be fully removed (instead of staying as unused data). The later will be handled in a another future commit. This commit mainly detect and use a new tag for such cases, and correct the checks to take it into account. It also does a bit of cleanup, and replaces some asserts by `CLOG_ERROR` reports.
These should not be needed anymore. Follow-up to previous commit.
In some cases, some partial resync roots would be missed during the partial resync process, leading to incomplete resync of all the needed data. This was caused by tagging some liboverrides for resync _after_ they had already be evaluated as part of parenting hierarchy of other liboverrides. Fix is simply to split both steps apart, such that all IDs that need it are tagged to resync first, and then hierarchies are evaluated to find the required partial resync roots whithin a hierarchy.
Mainly use a shorter, straight-forward prefix (`LIBOVERRIDE`), and unify/make these enum names more consistant. No functional changes expected here.
Vulkan spec only wants to have a single aspect bit when a texture contains both a stencil and a depth part. As for Blender depth is more used than stencil we standardize to depth aspect. Pull Request: #107542
Sorry for the noise.
This patch implements the Stabilize 2D node for the realtime compositor. Pull Request: #107401
`ptcache_baker_create` falsely assumed the PointCache owner id is always an **object**, but when baking rigid body world it is a **scene**. Code would cast the ID to an object and passed that to `BKE_ptcache_id_find` / `BKE_ptcache_ids_from_object` (which can get terribly wrong -- reading _something_ on the scene as something from the assumed object). Prior to
f61ff22967this was less likely to be a problem, but that commit introduced a `DrawDataList` into the `struct Scene`. In the file from the report, this would lead to `foreach_object_particle_ptcache` now recognizing garbage memory as a particle system, accessing its `ParticleSettings` `phystype` would then crash (buffer-overflow). Now pass a NULL object to `BKE_ptcache_id_find` in case we are having a scene, following code still handles rigid bodies just fine (the scene is actually passed separately as well). Pull Request: #107536
Found investigating #107420. Steps to reproduce were: - remove all objects from the scene - add rigid body world - bake - crash BKE_ptcache_bake would assume a cache can always be found, but with an empty rigid body world this is not the case -- accessing flags would then crash. Now just check if we actually have a cache. Pull Request: #107537
Now, when link drag search is used to create new input value nodes, it also moves socket values into node storage. This means, by design, that result of evaluation on node tree will not be changed. For data blocks, the original value is set to null, thus avoiding the existence of unused pointers. Right now a few nodes (in shader in many cases) are implemented without node storage, but by storing value in socket itself. Float value input node is unsupported in this way too. Pull Request: #107470
Allow mouse text selection and cursor positioning to work correctly when the text box has overflow mode set to "Scale to Fit." Pull Request: #107510
In some cases the Geometry Nodes Volume Cube generates a Volume grid that doesn't contain any leaf nodes. This can happen when only tiles are needed to represent the volume. This PR changes the `empty_grid` check function to also check if there are any active tiles in the grid before returning `true`. Pull Request: #107551
The distances array was filled but never used.
The slider operators in the Graph Editor were missing operator flags for the cursor wrapping to work. I've added it to the operators that allow overshoot, because for those it is really important to have no limits on scrolling. Pull Request: #107435
The helper function `move_key` did exactly the same things as `BKE_fcurve_keyframe_move_value_with_handles` It was only created because I wasn't aware that such logic already existed No functional changes Pull Request: #107402
The data indices for all loops in a fan weren't set, only the first.
Explicitly list ATTR_NONNULL indices in most cases so it's explicit that arguments aren't NULL (and adding new arguments that can be NULL isn't such a hassle).
A NULL defname would early exit (doing nothing) this isn't good behavior as this function should always make the name unique and a NULL defname is likely an error in the code which would allow duplicate names. This is also inconsistent with BLI_uniquename_cb which always wrote the defname into the name if it was empty. Mark this argument as never-NULL.
Rename BLI_filename_make_safe -> BLI_path_make_safe_filename.
Rename BLI_make_existing_file to BLI_file_ensure_parent_dir_exists. The previous name read as if it would make (touch) the file, where as it ensures the directory component of the path exists. Move from BLI_path to BLI_fileops as path utilities should only manipulate paths and not deal with file IO creation (this has more in common with BLI_file_touch for e.g.).
- Rename name/filename/path to filepath when it's used for full paths. - Rename name/path to dirpath when it refers to a directory. - Rename file to filepath or path (when it may be a file or dir). - Rename ImBuf::name & anim::name to filepath.
Loading a font in BLF would search a list of directory presets however these presets were never used. Remove them as all callers pass in full paths. Also rename FontBLF::name to mem_name as it's only needed as an ID for in-memory fonts (to prevent them being loaded multiple times). Non-unique font loading now compares against the filepath or mem_name when loading from files or memory (before both used `name` which was often the filepath, sometimes the full ID-name).
Use STRNCPY macro so these don't get out of sync.
Rename layout_old to layout_ref as the layout is a reference (the old layout has been freed). Also use boolean for save_copy argument.
ImBuf paths don't support blend file relative prefix, make absolute after copying.
BLI_path_split_file_part ran for every filename comparison, replace with BLI_path_basename and run once. Also rename FaceDetails::name -> filename.
Adds support for Storage buffers, including changes to the resource binding model to ensure explicit resource bind locations are supported for all resource types. Storage buffer support also includes required changes for shader source generation and SSBO wrapper support for other resource types such as GPUVertBuf, GPUIndexBuf and GPUUniformBuf. Authored by Apple: Michael Parkin-White Pull Request: #107175
Add brace-placement formatting commit.
This adds support for building simulations with geometry nodes. A new `Simulation Input` and `Simulation Output` node allow maintaining a simulation state across multiple frames. Together these two nodes form a `simulation zone` which contains all the nodes that update the simulation state from one frame to the next. A new simulation zone can be added via the menu (`Simulation > Simulation Zone`) or with the node add search. The simulation state contains a geometry by default. However, it is possible to add multiple geometry sockets as well as other socket types. Currently, field inputs are evaluated and stored for the preceding geometry socket in the order that the sockets are shown. Simulation state items can be added by linking one of the empty sockets to something else. In the sidebar, there is a new panel that allows adding, removing and reordering these sockets. The simulation nodes behave as follows: * On the first frame, the inputs of the `Simulation Input` node are evaluated to initialize the simulation state. In later frames these sockets are not evaluated anymore. The `Delta Time` at the first frame is zero, but the simulation zone is still evaluated. * On every next frame, the `Simulation Input` node outputs the simulation state of the previous frame. Nodes in the simulation zone can edit that data in arbitrary ways, also taking into account the `Delta Time`. The new simulation state has to be passed to the `Simulation Output` node where it is cached and forwarded. * On a frame that is already cached or baked, the nodes in the simulation zone are not evaluated, because the `Simulation Output` node can return the previously cached data directly. It is not allowed to connect sockets from inside the simulation zone to the outside without going through the `Simulation Output` node. This is a necessary restriction to make caching and sub-frame interpolation work. Links can go into the simulation zone without problems though. Anonymous attributes are not propagated by the simulation nodes unless they are explicitly stored in the simulation state. This is unfortunate, but currently there is no practical and reliable alternative. The core problem is detecting which anonymous attributes will be required for the simulation and afterwards. While we can detect this for the current evaluation, we can't look into the future in time to see what data will be necessary. We intend to make it easier to explicitly pass data through a simulation in the future, even if the simulation is in a nested node group. There is a new `Simulation Nodes` panel in the physics tab in the properties editor. It allows baking all simulation zones on the selected objects. The baking options are intentially kept at a minimum for this MVP. More features for simulation baking as well as baking in general can be expected to be added separately. All baked data is stored on disk in a folder next to the .blend file. #106937 describes how baking is implemented in more detail. Volumes can not be baked yet and materials are lost during baking for now. Packing the baked data into the .blend file is not yet supported. The timeline indicates which frames are currently cached, baked or cached but invalidated by user-changes. Simulation input and output nodes are internally linked together by their `bNode.identifier` which stays the same even if the node name changes. They are generally added and removed together. However, there are still cases where "dangling" simulation nodes can be created currently. Those generally don't cause harm, but would be nice to avoid this in more cases in the future. Co-authored-by: Hans Goudey <email@example.com> Co-authored-by: Lukas Tönne <firstname.lastname@example.org> Pull Request: #104924
Change the implementation of the raycast and sample nearest surface node to split separate loops into separate multi-functions. This clarifies the task of each function, gives more information to the field evaluator, and gives more opportunity for memory reuse. Sampling mesh attributes with triangle barycentric weights is now implemented in a single place. Two other new multi-functions handle conversion of sampled positions into barycentric weights. Normalizing the ray directions for the raycast node is split out too, so it can be skipped in some cases in the future. The mesh attribute interpolator helper class is also removed, since it didn't give much benefit over a more functional approach. I didn't notice a performance improvement from this change. Pull Request: #107563
Fixed bug where texture alpha was incorrectly remapped to red when exporting material shaders. Now connecting the UsdPreviewSurface 'opacity' input to the UsdUVTexture 'a' output if the Blender texture image node source socket identifier is 'Alpha'. Changes include the following: The InputSpec::source_name struct member was removed, as the connection source name is now determined at runtime based on the Blender node input socket identifier. The traverse_channel() utility function now returns a bNodeLink*, so that the source socket identifier can be queried from the link. In create_usd_preview_surface_materia(), the code for creating and connecting a UsdUVTexture shader was reorganized to group it within one conditional block, to make it easier to follow. Also replaced a call to a deprecated version of UsdShadeInput::ConnectToSource(). Pull Request: #107022
The logic in the initial commit (
97dd107070) was broken in some cases, and would end up tagging as unused IDs that had valid usages. It is reverted by this commit.. For this new solution to #98029 (deleting unused archipelagos of data), the logic handling dependency loops detection is reworked to rely on a new tag in the relations entry of the relevant IDs, instead of pre-tagging as unused the ID itself. Further more, when a dependency loop is detected, the IDs in it cannot be immediately tagged as unused, since it may be that the entry point of that loop is later detected as actually used. So their relations entries are not tagged as processed, and only the entry point of the potential archipelago can be checked in that case, outside of the recursive processing of dependencies. The other IDs of the archipelago will then be processed again later, in a state where at least one ID in the archipelago has a known state for sure, which then allows for a safe evaluation of the other related data. This commit should be backported to 3.3LTS.
Use span slicing instead of the POINTER_OFFSET macro
The "Evaluate at Index" and "Sample Index" nodes are exactly the same once they retrieve the values to copy and the indices (apart from the clamping option anyway). This also allows devirtualizing the index input in the evaluate at index node like the sample index node.
The fact that blenlib doesn't know about the set of attribute types is actually an important detail right now that can influence how things are designed. Longer term it would be good to consolidate many of these attribute propagation algorithms anyway.
The grab tool in Grease Pencil sculpt mode doesn't work correctly on strokes affected by modifiers. You had to grab over the original vertex positions to see any effect. Pull Request: #106744
- Use C++ float3 type, and math function - Remove non-helpful braces, comment - Use slightly longer variable name
Pass the size of the string passed in, although in practice this didn't cause any problems.
- Avoid inline ifdef checks for DEBUG_STRSIZE - Add BLI_string_debug_size_after_nil to ensure strings to manipulate have the expected buffer size after the nil terminator. - Add checks to more string manipulation functions. Further changes are required for this to be enabled during regular development as the RNA currently allocates the strings length but passes in the buffer size as a limit which conflicts with DEBUG_STRSIZE.
The size limit used in RNA string access wasn't meaningful as the size of buffers passed into these functions is defined by the length+1 which uses strlen, unterminated strings would already cause a buffer overflow. Note that strcpy for accessing RNA is already widely used, there were just some cases that used BLI_strncpy too. This also removes use of BLI_strncpy_utf8 in texture slot access as names are expected to be utf8, sanitizing when copying in this particular case doesn't make sense and isn't done elsewhere.
- Names ending with len sometimes referred to the buffer size. The same names were used for both buffer size and string length depending on the function in some cases. - Rename str/string to path for generic path functions. - Rename BLI_path_rel arguments (file, relfile) to (path, basename) as it wasn't so clear which is being made relative, `file` can be a directory so rename to `path` (matches naming for BLI_path_abs).
Add assertion on free because the final path isn't always known on creation.
Previous GHOST_ContextVK would create a logical device for each context. Blender uses multiple contexts at the same time and wasn't able to share resources between them as the logical device where different. This patch will create a single logical device and share them between multiple contexts. This allows sharing memory/shaders between contexts and make sure that all memory allocations are freed from the device it was allocated from. Some allocations in Blender are freed when there isn't a context, this was failing in the previous implementation. We didn't noticed it before as we didn't test multiple contexts. This patch also moves device specific data structures from VKContext to VKDevice like the descriptor pools, debug layers etc. Pull Request: #107606
This addresses #95855 by prioritizing the selection of keys in the following order: 1. Keys on the active curve. 2. Keys on any selected curve. 3. Other keys. Additionally, this fixes an as-yet unreported issue where you couldn't select the main vertex of a key if it was overlapping with another one and one or more of its handle vertices were already selected. This was due to the selection status of a key and its handles not being properly considered separately. Pull Request: #107223
In recent changes to vulkan.
The metal shader compiler can produce `note` reports. Treat them as warnings.
This is a really rough implementation. Since the MSL sources do not correspond 1:1 to the GLSL sources, some mapping is needed to retreive the GLSL source file for a given generated line. This will be implemented in a later commit.
This allow the compilation tests to finish even on failure.
The simulation cache is allocated lazily during evaluation when the depsgraph is active. However, during rendering, the depsgraph is not active, so it's not created.
Apple Silicon uses tile rendering and can discard tiles if it is covered. The retopology overlay made some changes to the shader that introduced some blocking and striping artifacts when the overlay was disabled. This PR changes the minimum used offset to reduce the drawing artifacts. Tweaking the GLSL shader itself didn't work. Fix #105830 Pull Request: #107611
* remove "Keyframe" label from the Key menu * "Jump To Keyframe" -> "Jump to Selected" * added a new menu "Density" with Decimate, Sample and Clean operators * removed the "Clean Channels" entry. It does the same as the "Clean" operator but also removes channels IF the remaining keys are at the default value. The feature is still available in the redo panel * Split the slider operators out by functionality * Move Euler filter to Channel menu * Remove "Add F-Curve modifier" from Key menu (it already is in the Channel menu) * Move Bake/Unbake Curve functions to Channel menu * Move "Bake Sound to FCurves" to Channel menu Pull Request: #106113
Gesture face set selection (box and lasso selection) didn't respect hidden faces, causing selection to bleed unexpectedly, now fixed. Pull Request: #107575
Conditional blocks introduce scopes that need to be kept track of, linear code is easier to follow. So use early exiting to reduce cognitive load, a number of devs (including myself) consider this good practice.
For derived mesh triangulation information, currently the three face corner indices are stored in the same struct as index of the mesh polygon the triangle is part of. While those pieces of information are often used together, they often aren't, and combining them prevents the indices from being used with generic utilities. It also means that 1/3 more memory has to be written when recalculating the triangulation after deforming the mesh, and that the entire triangle data has to be read when only the polygon indices are needed. This commit splits the polygon index into a separate cache on `Mesh`. The triangulation data isn't saved to files, so this doesn't affect .blend files at all. In a simple test deforming a mesh with geometry nodes, the time used to recalculate the triangulation reduced from 2.0 ms to 1.6 ms, increasing overall FPS from 14.6 to 15. Pull Request: #106774
Solves the warning C4060: switch statement contains no 'case' or 'default' labels warning with lite builds. Pull Request: #107619
1. Early return needs inverted null checking. 2. `BLO_expand` macros expect value, not a pointer. Pull Request: #107622
Rather than forcing the user to initiate a transform operation to edit the `Proportional Size`, allow editing of the `Proportional Size` through the UI. The affected headers are: - View 3D - Dop Sheet - Image Editor - Graph Editor - Mask Editor Pull Request: #107507
Pull Request: #107615
Flickering observed when snapping to edge or face with axis constraint. It was probably introduced in
4eda60c2d8The snapping code has a timer, so `t->tsnap.snapElem` isn't always set. So avoid changing the value of `t->tsnap.snapElem`.
To prevent invalid links, simply disable them for this socket type. Other nodes with such sockets may appear in the future. Pull Request: #107628
No need to perform inline, and it would not have worked properly for *.blend1 files.
Also note that BLI_path_basename can be used in place of BLI_path_split_file_part when a copy isn't needed.
foreach_faces now passes looptri index instead of a MLoopTri pointer.
Visibility invert should not use OPTYPE_DEPENDS_ON_CURSOR.
Previously accessing the extension needed to ensure an extension on an empty path. This conflicted with DEBUG_STRSIZE as it was assumed the input was FILE_MAX, where as it was a small buffer with RNA, see: !107602. Resolve by separating the function that ensures the extension with the function that finds valid extensions for a format. Also pass the size of the filepath to functions that ensure the extension.
Follow up on  handle remaining cases where BLI_strncpy was used it RNA string get callbacks. :
There is no advantage in using BLI_strncpy/BLI_strncpy_utf8 when the destination string has been allocated and won't be concatenated. Also no need to calloc memory which is filled by strcpy afterwards.
The `do_update` boolean would be overridden with false whenever a single directory didn't add new items. It should not modify it in this case.
Conditional blocks introduce scopes that need to be kept track of, linear code is easier to follow. So use early exiting (`continue`s in this case) to reduce cognitive load, a number of devs consider this good practice.
This only fixes the culling tile group size.
(UI views: https://wiki.blender.org/wiki/Source/Interface/Views) Noticed while working on asset UIs with views, when async loading of assets wouldn't trigger redraws.
* add const where possible * reduce calls to `ED_slider_factor_get` and instead store that in `const float factor` * rename variables from camel case to snake case, using full words, to conform to naming convention * use interpf where possible no functional changes Pull Request: #107610
This will make further changes for light linking easier, where we want to build multiple trees specialized for each light linking set. It's also easier to understand than the stack used previously. Pull Request: #107560
Enables the triangle showing this popup was spawned from a button, uses more padding (consistent with other popovers) and simplifies code.
View items now always display mouse hover highlight, regardless of the embossing (might want to give more precise control for this though). - Made the active state of items visible, so had to add a way to disable that. - Had to make the view item mouse hover highlight work in popups.
AFAIK this doesn't work in master either. Issue is that the operator relies on context that is only available in the asset shelf region (or with the mouse over the asset-view template). So the correct region has to be restored for redo to make this work.
This is merged into the
asset-shelf branch now, PR blender/blender#104831.
Pull request closed
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?