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
2022-01-06Cleanup: move public doc-strings into headersCampbell Barton
Some recent changes re-introduced public-style doc-strings in the source file.
2022-01-06Cleanup: sort cmake file listsCampbell Barton
2022-01-06Cleanup: spelling in commentsCampbell Barton
2022-01-06Cleanup: Spelling/grammar in commentsHans Goudey
2022-01-04Fix soft light blend mode mathRichard Antalik
Function `blend_color_softlight_float` used math different to compositor and produced result that had abrupt value changes. Use math based on modified screen blend mode as compositor does.
2022-01-04Fix out of range color in blend modesRichard Antalik
Result of Exclusion and Pin Light blend modes could be greater than 255 which caused artifacts. Limit color value to 0-255 range.
2022-01-04BLI: Add slice method to MutableSpanHans Goudey
Span had a slice method with an IndexRange argument, but MutableSpan did not, yet. This commit makes the two types consistent.
2022-01-03Cleanup: Renamed to_object_value to to_dictionary_value.Jeroen Bakker
2022-01-03Cleanup: rename ValueType.Object to ValueType.Dictionary.Jeroen Bakker
2022-01-03Cleanup: Rename ObjectValue to DictionaryValue (Serialization).Jeroen Bakker
ObjectValue was to confusing as it is the term from JSON.
2022-01-03UDIM: Support virtual filenamesJesse Yurkovich
This implements the design detailed in T92696 to support virtual filenames for UDIM textures. Currently, the following 2 substitution tokens are supported: | Token | Meaning | | ----- | ---- | | <UDIM> | 1001 + u-tile + v-tile * 10 | | <UVTILE> | Equivalent to u<u-tile + 1>_v<v-tile + 1> | Example for u-tile of 3 and v-tile of 1: filename.<UDIM>_ver0023.png --> filename.1014_ver0023.png filename.<UVTILE>_ver0023.png --> filename.u4_v2_ver0023.png For image loading, the existing workflow is unchanged. A user can select one or more image files, belonging to one or more UDIM tile sets, and have Blender load them all as it does today. Now the <UVTILE> format is "guessed" just as the <UDIM> format was guessed before. If guessing fails, the user can simply go into the Image Editor and type the proper substitution in the filename. Once typing is complete, Blender will reload the files and correctly fill the tiles. This workflow is new as attempting to fix the guessing in current versions did not really work, and the user was often stuck with a confusing situation. For image saving, the existing workflow is changed slightly. Currently, when saving, a user has to be sure to type the filename of the first tile (e.g. filename.1001.png) to save the entire UDIM set. The number could differ if they start at a different tile etc. This is confusing. Now, the user should type a filename containing the appropriate substitution token. By default Blender will fill in a default name using the <UDIM> token but the user is free to save out images using <UVTILE> if they wish. Differential Revision: https://developer.blender.org/D13057
2021-12-30Cleanup: clang-tidy modernize-redundant-void-argAaron Carlisle
2021-12-29Geometry Nodes: Accumulate Fields NodeJohnny Matthews
This function node creates a running total of a given Vector, Float, or Int field. Inputs: - Value: The field to be accumulated - Group Index: The values of this input are used to aggregate the input into separate 'bins', creating multiple accumulations. Outputs: - Leading and Trailing: Returns the running totals starting at either the first value of each accumulations or 0 respectively. - Total: Returns the total accumulation at all positions of the field. There's currently plenty of duplicate work happening when multiple outputs are used that could be optimized by a future refactor to field inputs. Differential Revision: https://developer.blender.org/D12743
2021-12-27BLI: add utility to check if type is any specific typeJacques Lucke
This adds `blender::is_same_any_v` which is the almost the same as `std::is_same_v`. The difference is that it allows for checking multiple types at the same time. Differential Revision: https://developer.blender.org/D13673
2021-12-25Cleanup: use new c++ guarded allocator APIAaron Carlisle
API added in rBa3ad5abf2fe85d623f9e78fefc34e27bdc14632e
2021-12-22Mesh: Parallelize bounding box calculation (WIP)Hans Goudey
This replaces the single-threaded calculation of mesh min and max positions with a `parallel_reduce` loop. Since the bounding box of a mesh is retrieved quite often (at the end of each evaluation, currently 2(?!) times when leaving edit mode, etc.), this makes for a quite noticeable speedup actually. On my Ryzen 3700x and a 4.2 million vertex mesh, I observed a 4.4x performance increase, from 14 ms to 4.4 ms. I added some methods to `float3` so they would be inlined, but they're also a nice addition, since they're used often anyway. Differential Revision: https://developer.blender.org/D13572
2021-12-22Fix: Build issue on 32 bit archsRay Molenkamp
The cast to size_t leads to a build issue on 32 bit archs. cursor_delim_type_utf8 expects an int so an additional cast to size_t is not required. Reported by user frispete on devtalk.
2021-12-21Fix T93960: Asset Catalogs I/O fails with unicode file paths on WindowsSybren A. Stüvel
On Windows, encode file paths as UTF-16 before trying to open the file for reading/writing. This introduces a new class `blender::fstream`, which wraps `std::fstream` and provides this UTF-16 encoding. This class should also be used in other areas, like the Alembic importer/exporter. Manifest Task: T93960 Reviewed By: JacquesLucke Differential Revision: https://developer.blender.org/D13633
2021-12-20BLI: fix Vector.prepend declarationJacques Lucke
Using `&&` there was a typo. With `&&` the `prepend` method could not be called with a const reference as argument.
2021-12-20Docs: use doxygen formatting for BLICampbell Barton
Differentiate doc-strings from title/section text.
2021-12-17Fix T94116: Drivers can have multiple variables with same nameSybren A. Stüvel
The RNA setter now ensures that driver variables are uniquely named (within the scope of the driver). Versioning code has been added to ensure this uniqueness. The last variable with the non-unique name retains the original name; this ensures that the driver will still evaluate to the same value as before this fix. This also introduces a new blenlib function `BLI_listbase_from_link()`, which can be used to find the entire list from any item within the list. Manifest Task: T94116 Reviewed By: mont29, JacquesLucke Maniphest Tasks: T94116 Differential Revision: https://developer.blender.org/D13594
2021-12-17Allocator: simplify using guarded allocator in C++ codeJacques Lucke
Using the `MEM_*` API from C++ code was a bit annoying: * When converting C to C++ code, one often has to add a type cast on returned `void *`. That leads to having the same type name three times in the same line. This patch reduces the amount to two and removes the `sizeof(...)` from the line. * The existing alternative of using `OBJECT_GUARDED_NEW` looks a out of place compared to other allocation methods. Sometimes `MEM_CXX_CLASS_ALLOC_FUNCS` can be used when structs are defined in C++ code. It doesn't look great but it's definitely better. The downside is that it makes the name of the allocation less useful. That's because the same name is used for all allocations of a type, independend of where it is allocated. This patch introduces three new functions: `MEM_new`, `MEM_cnew` and `MEM_delete`. These cover the majority of use cases (array allocation is not covered). The `OBJECT_GUARDED_*` macros are removed because they are not needed anymore. Differential Revision: https://developer.blender.org/D13502
2021-12-16Docs: add doc-strings for BLI_path functionsCampbell Barton
2021-12-16Fix compile error on Windows.Thomas Dinges
2021-12-16WM: various changes to file writing behaviorCampbell Barton
Saving with only a filename (from Python) wasn't being prevented, while it would successfully write the file to the working-directory, path remapping and setting relative paths wouldn't work afterwards as `Main.filepath` would have no directory component. Disallow this since it's a corner case which only ever occurs when path names without any directories are used from Python, the overhead of expanding the working-directory for all data saving operations isn't worthwhile. The following changes have been made: - bpy.ops.wm.save_mainfile() without a filepath argument fails & reports and error when the file hasn't been saved. Previously it would write to "untitled.blend" and set the `G.main->filepath` to this as well. - bpy.ops.wm.save_mainfile(filepath="untitled.blend") fails & reports and error as the filename has no directory component. - `BLI_path_is_abs_from_cwd` was added to check if the path would attempt to expand to the CWD.
2021-12-14Cleanup: resolve parameter mis-matches in doc-stringsCampbell Barton
Renamed or removed parameters which no longer exist.
2021-12-14Cleanup: correct unbalanced doxygen groupsCampbell Barton
Also add groups in some files.
2021-12-13UI: String Search: Add an optional weight parameterHans Goudey
This builds off of rBf951aa063f7, adding a weight parameter which can be used to change the order of items when they have the same match score. In the future, if string searching gets a C++ API, we could use an optional parameter for the weight, since it is not used yet. This will be used for the node link drag search menu (D8286). Differential Revision: https://developer.blender.org/D13559
2021-12-13Cleanup: spelling in commentsCampbell Barton
Also move notes about where noise functions come from into the function body as it's not relavant to the public doc-string.
2021-12-11macOS: add tilde-based path expanderAnkit Meel
Replaces `HOME` environment variable usage for user directories like in D12802. Reviewed By: #platform_macos, brecht Differential Revision: https://developer.blender.org/D13212
2021-12-10Cleanup: move public doc-strings into headers for various API'sCampbell Barton
Some doc-strings were skipped because of blank-lines between the doc-string and the symbol and needed to be moved manually. - Added space below non doc-string comments to make it clear these aren't comments for the symbols directly below them. - Use doxy sections for some headers. Ref T92709
2021-12-10Cleanup: spelling in commentsCampbell Barton
2021-12-09Cleanup: spelling in commentsCampbell Barton
2021-12-09Cleanup: move public doc-strings into headers for 'blenlib'Campbell Barton
- Added space below non doc-string comments to make it clear these aren't comments for the symbols directly below them. - Use doxy sections for some headers. - Minor improvements to doc-strings. Ref T92709
2021-12-09Fix T93858: Zstd-compressed .blend files from external tools aren't recognizedLukas Stockner
The issue here was that after the seek table check, the underlying file wasn't rewound to the start, so the code that checks for the BLENDER header immediately reaches EOF and fails. Since Blender always writes files with a seek table, this bug isn't triggered by files saved in Blender itself. However, files compressed in external tools generally don't have a seek table.
2021-12-08Cleanup: Clang-Tidy modernize-redundant-void-argAaron Carlisle
2021-12-07Cleanup: Use rcti marking dirty regions when texture painting.Jeroen Bakker
Dirty regions when painting are not using rcti. Meaning less understandable code. Found issue when refactoring the image_gpu partial update. In a future change gpu partial update API will be using rcti also what makes the code even cleaner. Reviewed By: campbellbarton Differential Revision: https://developer.blender.org/D13260
2021-12-02BLI: avoid invoking tbb for small workloadsJacques Lucke
We often call `parallel_for` in places with very variable sized workloads. When many elements are processed, using multi-threading is great, but when processing few elements (possibly many times) using `parallel_for` can result in significant overhead. I measured that this improves performance by >20% in the refactored realize instances code I'm working on separately. The change might also help with debugging sometimes, because the stack trace is smaller and contains fewer irrevelant symbols.
2021-11-30Cleanup: capitalize NOTE tagCampbell Barton
2021-11-30Cleanup: spelling in comments & stringsCampbell Barton
2021-11-27Merge branch 'blender-v3.0-release'Brecht Van Lommel
2021-11-27Fix build error with TBB 2021 and booleansBrecht Van Lommel
Linux distributions are using newer TBB versions than official releases, and TBB 2021 is an API breaking release. In general we should avoid using TBB directly and go through the abstractions in BLI_task.hh, though there is no abstraction for this. For 3.0 the safe option is to just not cancel the task but instead early out in the lambda function. Given the grain size of 2048 there should be no significant performance difference. Differential Revision: https://developer.blender.org/D13382
2021-11-26Cleanup: remove warningsJacques Lucke
This assert was producing warning in debug builds because it was never hit under some circumstances.
2021-11-26Geometry Nodes: optimize Set Position nodeJacques Lucke
This implements four optimizations in the Set Position node: * Check whether the position input is the current position and ignore it if it is. This results in a speedup when only the Offset input is used. * Use multi-threading when copying to computed values to the position attribute. All geometry types benefit from this. * Use devirtualization for the offset and position input. This optimizes the common case that they are either single values or computed in the fly in a span. * Write to `Mesh->mvert` directly instead of creating a temporary span. This makes setting mesh vertex positions even more efficient. In my simple benchmark I'm using a White Noise node to offset the position of 1,000,000 vertices. The speed is `20 ms -> 4.5 ms` in the multi-threaded case and `32 ms -> 22 ms` in the single-threaded case.
2021-11-26Geometry Nodes: deduplicate virtual array implementationsJacques Lucke
For some underlying data (e.g. spans) we had two virtual array implementations. One for the mutable and one for the immutable case. Now that most code does not deal with the virtual array implementations directly anymore (since rBrBd4c868da9f97a), we can get away with sharing one implementation for both cases. This means that we have to do a `const_cast` in a few places, but this is an implementation detail that does not leak into "user code" (only when explicitly casting a `VArrayImpl` to a `VMutableArrayImpl`, which should happen nowhere).
2021-11-25BLI: remove special cases for is_span and is_single methodsJacques Lucke
Those were not implemented consistently and don't really help in practice.
2021-11-24Fix T92962 Boolean output indices unstable.Howard Trickey
A parallel loop to create the interesection meshes for each triangle meant that with parallelism, the output order of the created meshes could vary with each execution. Keep the parallelism for doing the CDTs for interesection, but move the extraction of the new faces into a serial loop afterwards, for repeatability.
2021-11-24BLI: add slice method to index mask and generic spanJacques Lucke
2021-11-24Geometry Nodes: use simpler types when devirtualizing virtual arrayJacques Lucke
The compiler is more likely to optimize away the function call overhead when the used type is simpler and not virtual.
2021-11-23Cleanup: clang tidyJacques Lucke
The parameter name was inconsistent with the declaration.