WIP: Pass on color_attribute metadata through instancing, only for mesh #107066
Since color attributes don't use the CustomData active/render/clone index system
anymore the active status is no longer embedded in the CustomData itself.
In 3.4 and earlier if you use an
Instance on Points node to instance mesh data
on the vertices of a base mesh and then realize the instances the first color attribute
in the resulting mesh (which can be inherited from the base mesh or the instances)
gets set as the active color attribute. This is useful because it allows rendering
pointcloud data in a fast way in solid mode (see #106563).
However with the named system this no longer works and the resulting mesh after realize
does not have an active color attribute (even though the attribute data itself is inherited just fine)
This patch shows one approach.
It stores the active/default color attribute from the instancer mesh on the Instances level and then uses that to set the active/default in the resulting mesh. If the instancer mesh does not have an active/default color attribute it uses the first one it encounters in the list of instanced meshes.
Questions/doubts I have:
- I used std::string, but maybe this is overkill? Could probably just be a char * referencing the base mesh? I guess the base mesh will always stay alive at least up till the 'realize instances' node?
- I now have to include "DNA_mesh_types.h" in node_geo_instance_on_points.cc just to get at those strings. I don't really like it.
Another approach would be to just check if there are color attributes present on the resulting mesh after a realize instances just make the first one active+default. Slightly less control, but maybe easier to implement and probably more or less equivalent to what happened in 3.4.
Yet another approach would be to build a full system of priorities and collect all this metadata in the gather phase and then use the priorities to pick the best option. I'd imagine the instancer mesh to have the highest priority. Direct mesh instances a lower one and instances in instances an even lower one. That might be slightly better than what I do in this patch (just pick the first I encounter in the list of instanced meshes) at the cost of considreably more complexity.
Another approach would be to leave the strings alone completely and if a mesh has no active/default set just always use the first one as active/default. That would have the added benefit of fixing #107206
- It might be nice to also have this active/default metadata on other objects (PointCloud? Curves?)
- Eventually we want to get rid of the active/render/clone layer indices in CustomData I guess. Because that would make CD layers implicitly shareable between meshes with different active layers. Having these be name based is (I think) more robust than the constant jugging of indices anyway.
With these 2 possible future developments in mind it might be better to eventually store this metadata in some sort of easier to handle container then as bare
char * on the object data. Maybe a key-value based system?
This reverts commit
Use timecode.GetValue() to fix warning about passing correct 'double' type to 'WM_reportf' Co-authored-by: DESKTOP-ON14TH5\Sonny Campbell <firstname.lastname@example.org> Pull Request: #108008
Adds type safety and enables compiler features like warnings on missing enumerator in switches.
The usage of the lib pointer was cryptic to say the least, it was essentialy used to allow or not local IDs results in the mapping old_id_pointer -> new_id_pointer lookup result. Now: - Explicitely pass a boolean to allow or not local ID as result in lower-level code. - Pass the 'self ID' pointer instead of its library to the whole liblinking code (that was already the case in a few places). Note that naming of the 'self id' pointer is currently very inconsistent throughout the readfile liblink code, this will have to be cleaned up in a separate step later. For now, `self_id` has been chosen for new code as it matches the terminology in lib_query code. The later change can also allow finer handling of lookup on undo, based on how it was re-read (or not), should the need for this arise.
`PREFERENCES_OT_copy_prev` handling of versionning was for older release cycles type (pre-3.0), now that we are in 4.0, we can use a simpler logic: Just look for startup data from this major release cycle (i.e. 4.x currently) and the previous one (i.e. all 3.x releases). Fixes the 're-use previous settings' option not showing when first starting 4.0 build.
The UI list and asset view preview size calculations were out of sync, so the UI list made more space than the preview actually used. Making them match made the previews quite large though, so compensate that by scaling the layout down. Remove the related TODO comment, since this uses a common function for getting the preview size now. Before/after: ![Screenshot from 2023-05-17 17-33-19.png](/attachments/0ac713a3-12d9-41b6-ab50-85790da765a9) ![Screenshot from 2023-05-17 17-42-15.png](/attachments/0def65b5-6b16-4431-9a9e-592ed3d9675f) Pull Request: #108017
The highlighting of preview tiles would be too strong in asset view templates and grid views (only used in branches so far). This is because two buttons are overlayed on top of each other, and both would highlight. Ensure the overlayed preview tile button doesn't use any highlighting.
The text under previews would be quite close to the preview, so that there was more space below it than above. Center it vertically in the available space now. Also, the horizontal padding was only applied to the right side of the text rectangle, meaning horizontally centered text would be too far left. Apply the padding equally, this doesn't affect available space for the text too much. See #108018 for before/after pictures. Pull Request: #108018
No user visible changes expected (since grid-views are only used in branches right now). This just makes grid view UIs feel more "stable" while scaling areas, since things don't move around as much anymore. The tradeoff is that there may be some empty space on the right, if there's not enough space for a full column. This is how the file browser already behaves, and can be mitigated by a smaller preview size.
Finish the transition from #95966 and
fe38715600by writing files with the new format for meshes and some movie clip fields. This removes overhead when saving files, and makes meshes saved in files smaller (a file with a 1 million face grid changed from 32 to 28 MB). 3.6 can still read files saved with this format, but older versions will crash. Older files are automatically converted by versioning code when opened. This also allows removing all the code that converts from the new format to the legacy format, previously used when saving files. Pull Request: #108015
f7bbc7cdbb, these were never exposed in an official release, and were eventually replaced by the attribute system. Ref #100153
Remove six collection properties from Mesh that are redundant with the attribute API which has a nicer API and more features. - `vertex_layers_float` - `vertex_layers_int` - `vertex_layers_string` - `polygon_layers_float` - `polygon_layers_int` - `polygon_layers_string`
Face sets are now always saved with the generic float type
This simplifies #108014 and is consistent with the existing function for face corners, `sample_corner_normals`.
The goal is to make it more explicit and centralized operation to assign and steal buffer data, with proper ownership tracking. The buffers and ownership flags are wrapped into their dedicated structures now. There should be no functional changes currently, it is a preparation for allowing implicit sharing of the ImBuf buffers. Additionally, in the future it is possible to more buffer-specific information (such as color space) next to the buffer data itself. It is also possible to clean up the allocation flags (IB_rect, ...) to give them more clear naming and not have stored in the ImBuf->flags as they are only needed for allocation. The most dangerous part of this change is the change of byte buffer data from `int*` to `uint8_t*`. In a lot of cases the byte buffer was cast to `uchar*`, so those casts are now gone. But some code is operating on `int*` so now there are casts in there. In practice this should be fine, since we only support 64bit platforms, so allocations are aligned. The real things to watch out for here is the fact that allocation and offsetting from the byte buffer now need an explicit 4 channel multiplier. Once everything is C++ it will be possible to simplify public functions even further. Pull Request: #107609
9f78530d80, the -1 coarse_edge_index values in the foreach_edge calls would return false in BLI_BITMAP_TEST_BOOL, which made them look like loose edges. BitSpan doesn't have this problem, so the return for negative indices must be explicit.
44e4f077a9and related commits, geometry nodes doesn't try to hide the difference between real geometry data and instances from the user. Other nodes were updated to only support real geometry, but the "Mesh Boolean" node was never updated and still implicitly gathered all the instances. This commit removes the special instance behavior in the boolean node and adds realize instances nodes to keep existing behavior in most cases. Typically this doesn't make a difference in the result, though it could in the union mode for instance inputs. Shifting more of the work to realizing instances should generally be better for performance, since it's much faster.
Used to be https://archive.blender.org/developer/D17123. Internally these are already using the same code path anyways, there's no point in maintaining two distinct nodes. The obvious approach would be to add Anisotropy controls to the Glossy BSDF node and remove the Anisotropic BSDF node. However, that would break forward compability, since older Blender versions don't know how to handle the Anisotropy input on the Glossy BSDF node. Therefore, this commit technically removes the Glossy BSDF node, uses versioning to replace them with an Anisotropic BSDF node, and renames that node to "Glossy BSDF". That way, when you open a new file in an older version, all the nodes show up as Anisotropic BSDF nodes and render correctly. This is a bit ugly internally since we need to preserve the old `idname` which now no longer matches the UI name, but that's not too bad. Also removes the "Sharp" distribution option and replaces it with GGX, sets Roughness to zero and disconnects any input to the Roughness socket. Pull Request: #104445
Increase precision of some rotational inputs so that they all show the same precision. And have the arrows change in full degrees. Pull Request: #106515
For File Browser "System" and "Volumes" lists, the item names cannot be changed by users yet the tooltip says "Double click to rename". This PR just removes that text for these non-editable lists. Pull Request: #106873
Also remove redundant CTX_wm_space_text(C) calls.
If there are no loose vertices or edges, it's basically free to propagate that information to the result and save calculating it later in case it's necessary. I observed a peformance increase from 3.6 to 4.1 FPS when extruding a 1 million face grid.
To match the more recently added `tag_loose_verts_none`.
While strcpy is safe in this case, it's use requires extra scrutiny and can cause problems if the strings are later translated. Also move the ID code assignment into material_init_data as the ID-code is more of an internal detail.
A mistake in the recent ImBuf API refactor: the Libmv image accessor was copying destination to destination (possibly using the wrong number of channels as well). Pull Request: #108070
Pull Request: #106053
Store bevel weights in two new named float attributes: - `bevel_weight_vert` - `bevel_weight_edge` These attributes are naming conventions. Blender doesn't enforce their data type or domain at all, but some editing features and modifiers use the hard-coded name. Eventually those tools should become more generic, but this is a simple change to allow more flexibility in the meantime. The largest user-visible changes are that the attributes populate the attribute list, and are propagated by geometry nodes. The method of removing this data is now the attribute list as well. This is a breaking change. Forward compatibility is not preserved, and the vertex and edge `bevel_weight` properties are removed. Python API users are expected to use the attribute API to get and set the values. Fixes #106949 Pull Request: #108023
The failure happens since the recent changes in the make_orthonormals. The only difference is the underwater caustics test file, and the difference seems to be a noise floor. There seems to be nothing wrong with the math in the function itself: the return values are all without quite small epsilon when comparing Linux with M2 macOS. The thing is: the very first input is already a bit different on different platforms. So the difference is already somewhere else. For now increase the threshold to avoid confusion of the rest of the team, and to allow builds to be deployed. Pull Request: #108080
AutoMerge is a property of transform operations, so it seems more convenient to have this option bundled with transform settings. Another thing is that the 'Live Unwrap' option has no real relation to Transform. Therefore, remove the 'AutoMerge' sub-panel and create two sub-panels for the Options Panel: - Transform - UVs Merge the 'AutoMerge' settings into the 'Transform' sub-panel. Move 'Live Unwrap' to the 'UVs' sub-panel. Pull Request: #108056
This forces the max thread count to be inlined with what blender expects. While this will make some shaders less eficient it avoid crashes / assert on shaders that could not compile. The performance impacts can be fixed by tackling the individual cases.
Pull Request: #108086
Texture clearing is done using framebuffer clear. To avoid adding the flag everywhere we add it as part of the texture creation process. This should have no performance impact.
The option was added
f5ce243a56when the node was rewritten to add support for propagating instance attributes.
Implements a new API consisting of: - `ED_view3d_navigation_init`, - `ED_view3d_navigation_do` and - `ED_view3d_navigation_free`, With these functions, any operator can create their own navigation context and navigate in the 3D View without having to use `PASS_THROUGH`.
Implements a new option in keymap settings: - "Navigate during Transform" Note that with the option enabled, the keymap changes as follows: |Modal Map (Blender):| Conflict: | Current: | New: |---|---|---|--- | Increase Proportional Influence | VIEW3D_OT_zoom | Wheel Down | Alt Wheel Down | Decrease Proportional Influence | VIEW3D_OT_zoom | Wheel Up | Alt Wheel Up | Adjust Proportional Influence | VIEW3D_OT_rotate | Mouse/Trackpad Pan | Alt Mouse/Trackpad Pan | Increase Max AutoIK Chain Length | VIEW3D_OT_zoom | Wheel Down | Alt Wheel Down | Decrease Max AutoIK Chain Length | VIEW3D_OT_zoom | Wheel Up | Alt Wheel Up | Automatic Constraint | VIEW3D_OT_rotate | Middle Mouse | Alt Middle Mouse | Automatic Constraint Plane | VIEW3D_OT_move | Shift Middle Mouse | Shift Alt Middle Mouse Design Task: #106008 Pull Request: #105764
Change display name of OBJECT_OT_vertex_group_copy to "Duplicate Vertex Group" from "Copy Vertex Group". The word "duplicate" is a better unambiguous descriptor of this operation. Pull Request: #107691
Pull Request: #108112
Previously, `tbb::parallel_for` was instantiated every time `threading::parallel_for` is used. However, when actual parallelism is used, the overhead of a function call is negilible. Therefor it is possible to move that part out of the header without causing noticable performance regressions. This reduces the size of the Blender binary from 308.2 to 303.5 MB, which is a reduction of about 1.5%.
Defining `operator-` for the iterator allows it to be used in more generic iterator code. The `index_range` method is the same that exists on many other containers like `Vector`.
This is useful when debugging how much memory a particular function allocates from this allocator. The change also reduces the size of `LinearAllocator`.
This can be useful when e.g. each thread has its own `LinearAllocator`, but in the end they are combined into one.
Alignment here means that the size of the range passed into callback is a multiple of the alignment value (which has to be a power of two). This can help with performance when loops in the callback are are unrolled and/or vectorized. Otherwise, it can potentially reduce performance by splitting work into more unequally sized chunks. For example, chunk sizes might be 4 and 8 instead of 6 and 6 when alignment is 4.
This is necessary for correctness of the code to avoid duplicate symbols. In practice, this wasn't necessary yet, because usually we pass lambdas into these functions which cause every instantiation to have a different signature.
Mistake in the
406cfd214awhich was calculating the offset wrongly. Pull Request: #108138
Some property labels need a context to disambiguate them from others which have the same name. The only way to show the proper text currently for such properties is to override it in the UI code with a translation context, like: ```python layout.prop(obj, "area", text="Area", context=i18n_contexts.amount) ``` Python properties already store a translation context though, but this context cannot be chosen from a Python script. For instance, typing: ```python bpy.types.Scene.test_area = bpy.props.BoolProperty(name="Area") print(bpy.context.scene.bl_rna.properties['test_area'].translation_context) ``` will print `*`, the default context for Python props. This commit allows specifying a context in this manner: ```python from bpy.app.translations import contexts as i18n_contexts bpy.types.Scene.test_number_area = bpy.props.BoolProperty( name="Area", translation_context=i18n_contexts.amount ) print(bpy.context.scene.bl_rna.properties['test_number_area'].translation_context) ``` will now print `Amount` and can be translated differently from other labels. In this instance, the word for a surface area measurement, instead of a UI area. ----- This is what translated properties look like using the existing ("Area", "") and ("Area", "Amount") messages: ![python_prop_contexts_test.png](/attachments/b0d9737e-4b31-4c91-a08e-b347db31225f) The panel can be generated with this script: [python_prop_contexts_test.py](/attachments/ab613cdc-8eba-46bc-8f3c-ad0a97e7a6e5) Pull Request: #107150
22f641e7f8, translation macros were removed and thus in many files inclusion of the translation header is no longer needed. Pull Request: #107986
In the DrawManager a dummy texture was attached to the a, au, c, ac binding points. In the shader those binding points are actual texture buffers. The reason for the dummy texture was to work around some OpenGL driver bugs. In Vulkan (and expected also in Metal) it is not allowed to attach a texture as a texel buffer. Fixing this would require copying buffers into a buffer during binding. This patch will remove the binding of the textures and use the vbos instead. Also it fixes an issue where a platform does support compute shaders, but don't support transform feedback. This is currently the case for the Vulkan backend. Pull Request: #108139
Avoid two GHash lookups when deleting an override property by its RNA path.
Adds stencil texture view support for Metal, allowing reading of stencil component during texture sample/read. Stencil view creation refactored to use additional parameter in textureview creation function, due to deferred stencil parameter causing double texture view creation in Metal, when this should ideally be provided upfront. Authored by Apple: Michael Parkin-White Pull Request: #107971
Use correct terminology "value" vs strength
Change terminology from Apply to Display. Apply suggests a destructive change to the base mesh. Display is also used in modifiers.
Relatively harmless as the length was shorter, however all callers used the larger size.
Rename `r_dir` to `dirpath` as this isn't a return only argument. Also add the maximum size in the argument as a hint for the maximum size.
Remove the guimode argument which used to set the cursor back in v2.4x.
Scripts can be updated by scaling the font size, e.g. blf.size(id, size, dpi) -> blf.size(id, size * (dpi / 72.0))
Also remove redundant call to snprintf.
Remove deprecated context override argument to operator execution and poll() method in favor of context.temp_override().
No functional changes.
Prefer BLI_strncpy as it ensures the string is null terminated.
This hard-coded assumption meant that operators would behave as if bl_property = "type" was assigned in the operator - when the variable wasn't found. Remove the hard coded name. Operators that depended on this now need to assign bl_property = "type" in the operator class explicitly. Remove this because it wasn't documented as means operator behavior could change unexpectedly when renaming a property.
Names passed to gpu.shader.from_builtin() no longer skip the 2D_/3D_ prefix.
Allows to share buffer data between the render result and image buffers. The storage of the passes and buffers in the render result have been wrapped into utility structures, with functions to operate on them. Currently only image buffers which are sharing buffers with the render results are using the implicit sharing. This allows proper decoupling of the image buffers from the lifetime of the underlying render result. Fixes #107248: Compositor ACCESS VIOLATION when updating datablocks from handlers Additionally, this lowers the memory usage of multi-layer EXR sequences by avoiding having two copies of render passes in memory. It is possible to use implicit sharing in more places, but needs some API to ensure the render result is the only owner of data before writing to its pixels. Pull Request: #108045
Covers the macro ARRAY_SIZE() and STRNCPY. The problem this change is aimed to solve it to provide cross-platform compiler-independent safe way pf ensuring that the functions are used correctly. The type safety was only ensured for GCC and only for C. The C++ language and Clang compiler would not have detected issues of passing bare pointer to neither of those macros. Now the STRNCPY() will only accept a bounded array as the destination argument, on any compiler. The ARRAY_SIZE as well, but there are a bit more complications to it in terms of transparency of the change. In one place the ARRAY_SIZE was used on float3 type. This worked in the old code because the type implements subscript operator, and the type consists of 3 floats. One would argue this is somewhat hidden/implicit behavior, which better be avoided. So an in-lined value of 3 is used now there. Another place is the ARRAY_SIZE used to define a bounded array of the size which matches bounded array which is a member of a struct. While the ARRAY_SIZE provides proper size in this case, the compiler does not believe that the value is known at compile time and errors out with a message that construction of variable-size arrays is not supported. Solved by converting the field to std::array<> and adding dedicated utility to get size of std::array at compile time. There might be a better way of achieving the same result, or maybe the approach is fine and just need to find a better place for such utility. Surely, more macro from the BLI_string.h can be covered with the C++ inlined functions, but need to start somewhere. There are also quite some changes to ensure the C linkage is not enforced by code which includes the headers. Pull Request: #108041
In previous implementation the first available render surface was selected. For NVIDIA platform this was the correct one, but for AMD and Intel GPUs this was incorrect. This PR goes over all the available render surfaces and selects a compatible one. For now when no compatible render surface is found it will still select the first available one. With the expectation that the screen is drawn incorrectly and users would report a bug so we can investigate. Pull Request: #108169
MSL require to use packed_int3 for compatibility with GLSL memory layout.
Pull Request: #108177
Move the instancing related code to a dedicated function, leaving the generic `build_collection()` dedicated to the building of the collection itself. Should be no functional changes: the code paths should effectively still be the same. This is because non-instancing cases were passing object as a null pointer, disabling the non-generic code path.
I found the small dent on the log to be bothersome and unnecessary. Although modifying the Blender output may cause some parsing issues, they can be quickly resolved. Before: ``` 22-05 16:26:02 (debug) Fra:96 Mem:3130.54M (Peak 11196.17M) | Time:11:58.38 | Remaining:00:09.02 | Mem:2890.45M, Peak:9039.80M | Scene | ViewLayer | Finishing 22-05 16:26:34 (debug) Saved: 'd:\sheep_gpu\sheepit\208726392_0096.png' 22-05 16:26:34 (debug) Time: 12:30.28 (Saving: 00:31.08) ``` After: ``` 22-05 16:26:02 (debug) Fra:96 Mem:3130.54M (Peak 11196.17M) | Time:11:58.38 | Remaining:00:09.02 | Mem:2890.45M, Peak:9039.80M | Scene | ViewLayer | Finishing 22-05 16:26:34 (debug) Saved: 'd:\sheep_gpu\sheepit\208726392_0096.png' 22-05 16:26:34 (debug) Time: 12:30.28 (Saving: 00:31.08) ``` Pull Request: #108187
This contains the basis of the new overlay engine. Only a few overlays are ported for proof of concept of the new design. This new design unifies the selection drawing with the overlay-next engine. It now becomes responsible of selection in object mode. For this we create a dedicated shader module that patches the shaders for selection. Note that the gizmo selection still uses the occlusion queries and edit-mode the current selection engine (select_engine.c). Related task #102179 Related task #102177 Co-authored-by: Clément Foucault <email@example.com> Pull Request: #107734
Method didn't modified the ShaderInterface but wasn't usable when trying to debug a const reference to the ShaderInterface. This PR just adds the const to the method. Pull Request: #108190
fc06a471f1was missing a file subversion bump.
Replace a template with a FunctionRef, reducing Blender's binary size by 63 KB, with a negligible performance impact.
The Catmull Rom curve subdivision arguments use runtime-typed spans, so the template doesn't help anyway. Makes Blender 27 KB smaller.
- Don't use the source string length +1 as the size of the destination (USD export & IMB_exr_get_handle_name). - Correct undersized buffer being passed into imb_exr_insert_view_name.
The strlen() was passed in as a size argument, in this case it couldn't have caused an overflow because the source & destination happened to be the same size. Also reduce the destination buffer size as this is used for an ID name.
`using namespace blender` didn't make it into the lambda, likely because of a compiler bug.
While these uses seemed safe, strcat is error prone enough that other functions are preferable.
Combine the newer less efficient C++ implementations and the older less convenient C functions. The maps now contain one large array of indices, split into groups by a separate array of offset indices. Though performance of creating the maps is relatively unchanged, the new implementation uses 4 bytes less per source element than the C maps, and 20 bytes less than the newer C++ functions (which also had more overhead with larger N-gons). The usage syntax is simpler than the C functions as well. The reduced memory usage is helpful for when these maps are cached in the near future. It will also allow sharing the offsets between maps for different domains like vertex to corner and vertex to face. A simple `GroupedSpan` class is introduced to make accessing the topology maps much simpler. It combines offset indices and a separate span, splitting it into chunks in an efficient way. Pull Request: #107861
The install target would fail when ASAN_OPTIONS was set for the environment that launched the build. Resolve by explicitly overriding these settings.
With light linking, lights can be set to affect only specific objects in the scene. Shadow linking additionally gives control over which objects acts a shadow blockers for a light. Usage: https://wiki.blender.org/wiki/Reference/Release_Notes/4.0/Cycles Implementation: https://wiki.blender.org/wiki/Source/Render/Cycles/LightLinking Ref #104972 Co-authored-by: Brecht Van Lommel <firstname.lastname@example.org>
This is useful for #108014, when determining whether there are any sharp faces and edges in a mesh.
Goals of this refactor: * Reduce memory consumption of `IndexMask`. The old `IndexMask` uses an `int64_t` for each index which is more than necessary in pretty much all practical cases currently. Using `int32_t` might still become limiting in the future in case we use this to index e.g. byte buffers larger than a few gigabytes. We also don't want to template `IndexMask`, because that would cause a split in the "ecosystem", or everything would have to be implemented twice or templated. * Allow for more multi-threading. The old `IndexMask` contains a single array. This is generally good but has the problem that it is hard to fill from multiple-threads when the final size is not known from the beginning. This is commonly the case when e.g. converting an array of bool to an index mask. Currently, this kind of code only runs on a single thread. * Allow for efficient set operations like join, intersect and difference. It should be possible to multi-thread those operations. * It should be possible to iterate over an `IndexMask` very efficiently. The most important part of that is to avoid all memory access when iterating over continuous ranges. For some core nodes (e.g. math nodes), we generate optimized code for the cases of irregular index masks and simple index ranges. To achieve these goals, a few compromises had to made: * Slicing of the mask (at specific indices) and random element access is `O(log #indices)` now, but with a low constant factor. It should be possible to split a mask into n approximately equally sized parts in `O(n)` though, making the time per split `O(1)`. * Using range-based for loops does not work well when iterating over a nested data structure like the new `IndexMask`. Therefor, `foreach_*` functions with callbacks have to be used. To avoid extra code complexity at the call site, the `foreach_*` methods support multi-threading out of the box. The new data structure splits an `IndexMask` into an arbitrary number of ordered `IndexMaskSegment`. Each segment can contain at most `2^14 = 16384` indices. The indices within a segment are stored as `int16_t`. Each segment has an additional `int64_t` offset which allows storing arbitrary `int64_t` indices. This approach has the main benefits that segments can be processed/constructed individually on multiple threads without a serial bottleneck. Also it reduces the memory requirements significantly. For more details see comments in `BLI_index_mask.hh`. I did a few tests to verify that the data structure generally improves performance and does not cause regressions: * Our field evaluation benchmarks take about as much as before. This is to be expected because we already made sure that e.g. add node evaluation is vectorized. The important thing here is to check that changes to the way we iterate over the indices still allows for auto-vectorization. * Memory usage by a mask is about 1/4 of what it was before in the average case. That's mainly caused by the switch from `int64_t` to `int16_t` for indices. In the worst case, the memory requirements can be larger when there are many indices that are very far away. However, when they are far away from each other, that indicates that there aren't many indices in total. In common cases, memory usage can be way lower than 1/4 of before, because sub-ranges use static memory. * For some more specific numbers I benchmarked `IndexMask::from_bools` in `index_mask_from_selection` on 10.000.000 elements at various probabilities for `true` at every index: ``` Probability Old New 0 4.6 ms 0.8 ms 0.001 5.1 ms 1.3 ms 0.2 8.4 ms 1.8 ms 0.5 15.3 ms 3.0 ms 0.8 20.1 ms 3.0 ms 0.999 25.1 ms 1.7 ms 1 13.5 ms 1.1 ms ``` Pull Request: #104629
Multiple random numbers were passed around separately, making some argument lists unnecessarily long. No functional changes expected. Pull Request: #108236
Windows file associations using ProgID, needed because of the launcher. This fixes "pin to taskbar" and Recent Documents lists, allow per- version jump lists and an "Open with" list with multiple versions. Pull Request: #107013
MacOS-specific behavior for arrow keys, delete, and backspace. Alt/Opt modifier to jump by word, CMD modifier to jump to beginning/end. Pull Request: #107522
Removal of thumbnail via regsvr32 requires /s argument to be silent to not show any messageboxes during WIX uninstallation Pull Request: #107013
Curves edit mode does select the selection filter feature.
Also use "values" and "indices" instead of elements, since they're more specific terms.
The mask was sliced, but the original mask was used from before the slicing, causing an unsliced mask to be used with the new offsets. This caused a crash in the hair styles demo file.
- Handle multithreading in caller, consistent with other multi-functions - Simplify IndexMask iteration (avoid logarithmic lookup)
Unify the handling of masks for affected curves in a few of the sculpt brushes. In the grow shrink brush, replace a more custom "influences per thread" solution. In the puff brush, use a full array of weights, and build the mask earlier. In the snake hook brush, use the selection properly (I observed a 2-3x improvement with a small selection).
Use the weird but at least consistent "from_groups" method in the sample curves node, and avoid one logarithmic lookups when merging points.
"ledge" and "lvert" sound very word, and "ledge" is also a word. It's clearer to use the full word and abbeviate the obvious part, "index."
When the new name was clipped to make room for the number, the string was clipped by the number size (including the null byte). Store the length in `numlen` instead of the size (including null byte).
A mistake in the recent API refactor for the buffer sharing. Pull Request: #108259
Extract vendor, driver and device information from the physical device properties. Note that driver version is implementation dependent and might fail as it is unclear which driver is being used. An open source driver could store the driver version in a different way than a closed source driver. But as it is not clear which driver version is being used it might extract the incorrect version. To solve this issue we check if the extracted version makes sense depending on the version schema of the driver and if they don't match we use another approach. Pull Request: #107872
A user-counter mistake caused by shallow-copy of the render result during its duplication. Pull Request: #108265
The original names were `...update_position()`, but no update in position is performed in these functions, rather, the entries in `LightSample` are updated. Also make clear that the functions are used by MNEE.
The runtime backup/restore logic was slightly wrong: it is possible that an object requires light linking runtime but does not need light linking itself. This is typical configuration for the receivers/blockers. Modified the logic so that the evaluated object light linking is allocated if there was a runtime field needed. This required to make it so light linking evaluation takes care of feeing the light_linking if it is empty. The downside of this approach is a redundant allocation from the object backup when removing light linking collection from emitter. But this is not a typical evaluation flow, and the more typical flows are cheap with this approach. Pull Request: #108261
The recent light linking commit changed some includes order, making compilation to fail on platforms where certain features are disabled. Pull Request: #108264
SculptSession now contains non-trivial types that must be initialized.
4d841e1b35incorrectly removed the clearing of mesh topology maps when the object is reevaluated.
Pull Request: #108252
2cfcb8b0b8this was only used in one place that was easily replaced. In practice this avoids creating a statically allocated array after the split edges code is called. Pull Request: #108249
The goal here is to get us closer to using C++ in RNA code. Pull Request: #108277
The intersection already has proper object assigned. Pull Request: #108275
In order to execute the navigation of type "VIEW3D_OT_move," the user is required to press both the `Shift` and `MMB` keys. However, pressing `Shift` also activates the precision modifier for the transform. Consequently, while the `MMB` is unpressed, the transform operation unintentionally remains in precision mode, altering the mouse position. To address this issue, the solution was to eliminate the precision changes immediately after the navigation is initiated. Unfortunately, we have no way of knowing whether the user actually unintentionally enabled precision, so this solution serves as a workaround. Ideally, keymap conflicts should be avoided.
Add Material::blend_flags to Shaderkey, to ensure Materials with different settings but the same shader don't end up using the same pass. Pull Request: #108283
fc854fc252caused the precision modification to be removed after navigation was complete. The ideal is when starting navigation. This is because the precision button can be released during navigation, thus confirming the precision change.
There are other events besides `MOUSEMOVE` that's passed in during modal handling, causes the `tgpi->mvalo` variable to be overwritten without moving the stroke in the first place, this results in inaccurate offsets during mouse/pen grabbing in primitive gizmo `IN_MOVE` mode. Now fixed. Also fixed the operator hint to include the grab functionality. Pull Request: #108172
Also use doxygen-comments in files where this is already the convention.
There is no reason to use case-sensitive path lookups on MS-Windows. Also replace BLI_str_endswith with BLI_path_basename since ends-with checks don't ensure a preceding path separator.
We have been chatting in the Animation&Rigging module meeting that the collection hotkeys (1, 2, 3 etc.) in Pose Mode are unwanted and could be replaced with something more useful. This patch only removes the hotkeys, we can later decide what should be in their place. Pull Request: #105120
Simple steps to reproduce: mark the default cube as an asset. Pull Request: #108306
Slightly increase threshold to avoid division by zero.
Turns out it is not enough to check for the receiver/blocker set, as the object might be hidden. This should not change the light behavior. Pull Request: #108307
Similar to objects, store the name of Blender's side light name on the Cycles side. This allows to have readable logs where a name and property is logged (while previously in the logs all lights will be called lamp). There is no user-measurable change. Pull Request: #108310
On a user level this fixes configuration when a spot light is linked to an object, and a sun light is not linked to anything. It used to be making non-linked receivers to be very noisy. This is because the distant light did not update the node's light linking settings when they are added to the node. A simple demo file will be added to the tests suit as light_link_distant_tree.blend. Pull Request: #108311
Pressing 'A' to select all pose bones in an armature caused a segfault, as `id->override_library->runtime->tag` was checked while `id->override_library->runtime` was `nullptr`. An extra check resolved the crash.
Renames `RNA_def_main_gpencil` to `RNA_def_main_gpencil_legacy`.
A mistake in the intersection picking logic: if a mesh was hit at least one intersection is to be recorded. Pull Request: #108320
Pull Request: #108324
This shows more clearly that there's nothing specific to curves here.
Using the new index mask implementation, things can be a bit simpler. It's also simpler to use `complement` instead of `to_ranges_invert`, which just made everything less standard. Also create the new curve offsets in place instead of copying, and use implicit sharing to share attributes when no curves were deleted. With a version of `IndexMask::complement()` optmized locally, I observed the following speedups with a 1.2 million point curve system: - Delete points: 29 FPS -> 45 FPS - Delete curves: 48 FPS -> 49 FPS - Delete tip points: 25 FPS -> 32 FPS Also add a method to apply the "gather" function to all attributes, mostly as a continued experiment of consolidating attribute propagation. This can be used more elsewhere in the future.
In several nodes, and sculpt brushes, use the proper `IndexMask` type instead of a span of ranges to encode a selection. This allows deleting the duplicate data copying utilities using the second format.
Pass the curves and points to keep instead of delete. In the same test file as the previous commit, this gave an increase from 50 to 60 FPS when deleting curves.
- Avoid using geometry sets from a different abstraction level - Deduplicate basic attribute copying propagation code - Allow more use of implicit sharing when data arrays are unchanged - Optimize for when a point cloud delete selection is empty - Handle face corners generically for "only face" case
This can be useful for example to add custom operators to the property context menu. Pull Request: #107280
Exposing these direct conversions separately just confuses the API, and they're not used anywhere else anyway.
Disable recently-added support for some Apple-specific key modifiers when editing UI text. Only until we can add support for same for text objects, console, and text editor. Keeping consistent between areas. Pull Request: #108333
It bothered me that in the Blender manual the `--debug-freestyle` was in the `Other Options` category. Now it should appear correctly in `Debug Options`. https://docs.blender.org/manual/en/3.6/advanced/command_line/arguments.html#other-options Pull Request: #108179
The Cycles-specific command line arguments are currently hidden on this page . To make the command visible in the manual  and in `blender --help`, I added this patch.  https://docs.blender.org/manual/en/3.6/advanced/command_line/render.html#cycles  https://docs.blender.org/manual/en/3.6/advanced/command_line/arguments.html#argument-order If this gets merged, please merge blender/blender-manual#104455 as well. Pull Request: #108232
Recently added cycles options weren't included in the help message. Also quiet extra token warning.
A minor change that makes text a little easier to follow for developers.
Keep "Misc" options last.
This flag isn't used, even going back to the initial commit.
The in-line ends-with check could read before the string began, as it happens this wouldn't have caused problem (based on the memory layout), nevertheless, out of bounds buffer access is best avoided.
Also remove doxygen block for comments in a functions body.
This reverts commit
9a9209d8e0. This commit caused an assert on factory startup, needs further investigation.
Simplify help text extraction which may be used by the manual & man-page generation.
Optionally extract all help text, even for options not available on the current platform or with the current build options. Useful so it's possible to extract help text for the user-manual which doesn't depend on the blender build used for extraction.
Call Blender directly to generate the man-page, instead of relying on the systems Python which called Blender twice and processed it's output.
Re-apply  with the assert on startup resolved & doc-string updated. :
Quiet ASAN leak reports so this isn't an issue.
The light tree dependent on the first threshold to evaluate to 1 when picking up an emitter. Pull Request: #108323
This patch improves how debug groups are displayed within captures. Passes are now split to align with debug groups, such that navigation of captures is more intuitive. To closer represent useful information, debug groups are now deferred to align with passes, with the addition of Macros to control capture display options. METAL_DEBUG_CAPTURE_MAX_NESTED_GROUPS limits debug group nesting, and METAL_DEBUG_CAPTURE_HIDE_EMPTY allows hiding of debug groups which do not contain any commands. Authored by Apple: Michael Parkin-White Pull Request: #108287
- BLENDER_STARTUP_FILE was included as a literal instead of expanding into 'startup.blend' as intended. - Single quote cycles device (matching image formats). - Include all GPU back-ends from bpy.app.help_text(all=True) - Minor changes to simplify conversion to RST.
Function naming made it seem main_args_setup might need to call main_args_setup_post, when this was in fact only needed for handing final arguments. Call BLI_args_parse directly and expose main_args_handle_load_file as a public function. Move handle_load_file into a separate function which is called by --open-last.
Don't create a new empty file when --open-last is used.
I think the conclusion from the last module meeting was that the thing this patch does for instances should be done for joining as well. I'll try to update the patch and add join handling.
rebased onto blender-v3.6-release again.
I had to untangle some erroneous merges with main.
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?