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-09-27Cleanup: remove workarounds and version checks for unsupported compilersCampbell Barton
Match minimum supported versions from the WIKI [0] by raising them to: - GCC 9.3.1 - CLANG 8.0 - MVCS 2019 (16.9.16 / 1928) Details: - Add CMake checks that ensure supported compiler versions early on. - Previously GCC per-processor version checks served to exclude `__clang__`, in some cases this has been replaced by explicitly excluding `__clang__`. This was needed as CLANG treated some of these flags differently to GCC, causing the build to fail. - Remove USE_APPLE_OMP_FIX GCC-4.2 OpenMP workaround. - Remove linking error workaround for old MSVC versions. [0]: https://wiki.blender.org/wiki/Building_Blender Reviewed by: brecht, LazyDodo Ref D16068
2022-09-26Cleanup: replace C-style casts with functional casts for numeric typesCampbell Barton
Use function style casts in C++ headers & source.
2022-09-26Cleanup: remove redundant parenthesisCampbell Barton
2022-09-26Cleanup: use ELEM/STR_ELEM/STREQ macrosCampbell Barton
2022-09-26Cleanup: use 'u' prefixed integer types for brevity in C codeCampbell Barton
This also simplifies using function style casts when moving to C++.
2022-09-26Cleanup: replace unsigned with uint, use function style casts for C++Campbell Barton
2022-09-26Cleanup: replace C-style casts with functional casts for numeric typesCampbell Barton
Some changes missed from f68cfd6bb078482c4a779a6e26a56e2734edb5b8.
2022-09-25BLI: simplify removing elements from containers with predicateJacques Lucke
Previously removing elements based on a predicate was a bit cumbersome, especially for hash tables. Now there is a new `remove_if` method in some data structures which is similar to `std::erase_if`. We could consider adding `blender::erase_if` in the future to more closely mimic the standard library, but for now this is using the api design of the surrounding code is used.
2022-09-25Cleanup: follow C++ type cast style guide in some filesJacques Lucke
https://wiki.blender.org/wiki/Style_Guide/C_Cpp#C.2B.2B_Type_Cast This was discussed in https://devtalk.blender.org/t/rfc-style-guide-for-type-casts-in-c-code/25907.
2022-09-25Cleanup: replace C-style casts with functional casts for numeric typesCampbell Barton
2022-09-25Cleanup: replace static_casts with functional casts for numeric typesCampbell Barton
2022-09-25Cleanup: use 'u' prefixed integer types for brevity & cast styleCampbell Barton
To use function style cast '(unsigned char)x' can't be replaced by 'unsigned char(x)'.
2022-09-25Cleanup: remove redundant double parenthesisCampbell Barton
2022-09-23Cleanup: use lowercase function calls & macros in for CMakeCampbell Barton
This is already the case for most CMake usage. Although some find modules are an exception to this, as they were originally maintained externally they use some different conventions. Also corrected bad indentation in: intern/cycles/CMakeLists.txt
2022-09-23Cleanup: spelling in commentsCampbell Barton
2022-09-21Refactor: Move file browser filelist.c to C++Julian Eisel
I'm adding some asset APIs/types in C++ that the file-listing code would use. I prefer porting this code to C++ over adding a C-API for the asset code. Includes some minor cleanups that shouldn't change behavior, like using `MEM_new()`/`MEM_cnew()`, C++ style C-library includes, `LISTBASE_FOREACH()`, removing unnecessary typedefs, etc.
2022-09-21Cleanup: remove vector adaptor data structureJacques Lucke
This was used in early node based particle system development but is not used anymore. The code also didn't match the standards of other data structures in blenlib.
2022-09-21Cleanup: spelling in commentsCampbell Barton
2022-09-20Move workspace.c to C++Jacques Lucke
Differential Revision: https://developer.blender.org/D16020
2022-09-20Geometry Nodes: improve evaluator with lazy threadingJacques Lucke
In large node setup the threading overhead was sometimes very significant. That's especially true when most nodes do very little work. This commit improves the scheduling by not using multi-threading in many cases unless it's likely that it will be worth it. For more details see the comments in `BLI_lazy_threading.hh`. Differential Revision: https://developer.blender.org/D15976
2022-09-20Cleanup: quite compiler warningJacques Lucke
Warning: P3204.
2022-09-19Cleanup: spellingCampbell Barton
2022-09-19Cleanup: Fix grammar in IndexRange headerHans Goudey
Also make it more clear by avoiding repeating the name of the function.
2022-09-18Build: fix gtest build flags affecting actual libraryBrecht Van Lommel
Switch to target_ functions to avoid this.
2022-09-18BLI: Add generic utlity for gathering values with indicesMattias Fredriksson
Add new functions to `array_utils` namespace called `gather(..)`. Versions of `GVArray::materialize_compressed_to_uninitialized(..)` with threading have been reimplemented locally in multiple geometry node contexts. The purpose of this patch is therefore to: * Assemble these implementations in a single file. * Provide a naming convention that is easier to recognize. Differential Revision: https://developer.blender.org/D15786
2022-09-17IndexRange: Add new `intersect` methodClément Foucault
Returns a new range, that contains the intersection of the current one with the given range. This is helpful to select a portion of a range without having to deal with all the asserts of other functions. The resulting range being always a valid subrange, it can be used to iterate or copy a part of a vector.
2022-09-17Cleanup: spelling, punctuation & repeated words in commentsCampbell Barton
2022-09-16Cleanup: spelling in commentsCampbell Barton
2022-09-15Cleanup: quiet sign-conversion warning in OFFSETOF_STRUCT_AFTERCampbell Barton
BLI_strict_flags.h raised a build error when this macro was used.
2022-09-15Cleanup: spelling in comments, comment blocksCampbell Barton
2022-09-14Cleanup: Add missing licence headersHans Goudey
Missed in eaf416693dcb
2022-09-13Geometry Nodes: Port the trim curve node to the new data-blockMattias Fredriksson
The trim functionality is implemented in the geometry module, and generalized a bit to be potentially useful for bisecting in the future. The implementation is based on a helper type called `IndexRangeCyclic` which allows iteration over all control points between two points on a curve. Catmull Rom curves are now supported-- trimmed without resampling first. However, maintaining the exact shape is not possible. NURBS splines are still converted to polylines using the evaluated curve concept. Performance is equivalent or faster then a 3.1 build with regards to node timings. Compared to 3.3 and 3.2, it's easy to observe test cases where the node is at least 3 or 4 times faster. Differential Revision: https://developer.blender.org/D14481
2022-09-13CMake: exclude BLI_args when building as a Python moduleCampbell Barton
2022-09-13Geometry Nodes: new evaluation systemJacques Lucke
This refactors the geometry nodes evaluation system. No changes for the user are expected. At a high level the goals are: * Support using geometry nodes outside of the geometry nodes modifier. * Support using the evaluator infrastructure for other purposes like field evaluation. * Support more nodes, especially when many of them are disabled behind switch nodes. * Support doing preprocessing on node groups. For more details see T98492. There are fairly detailed comments in the code, but here is a high level overview for how it works now: * There is a new "lazy-function" system. It is similar in spirit to the multi-function system but with different goals. Instead of optimizing throughput for highly parallelizable work, this system is designed to compute only the data that is actually necessary. What data is necessary can be determined dynamically during evaluation. Many lazy-functions can be composed in a graph to form a new lazy-function, which can again be used in a graph etc. * Each geometry node group is converted into a lazy-function graph prior to evaluation. To evaluate geometry nodes, one then just has to evaluate that graph. Node groups are no longer inlined into their parents. Next steps for the evaluation system is to reduce the use of threads in some situations to avoid overhead. Many small node groups don't benefit from multi-threading at all. This is much easier to do now because not everything has to be inlined in one huge node tree anymore. Differential Revision: https://developer.blender.org/D15914
2022-09-12BLI: Add utility functions to generic spansHans Goudey
Generally we don't want to do per-element operations on these spans because of the overhead of the runtime type system, but these operations on the whole span avoid ugly pointer arithmetic in other areas.
2022-09-12Tests: add tests for leading (relative) slashes for BLI_path_joinCampbell Barton
Also note that leading slashes are kept in the doc-string.
2022-09-10Cleanup: replace strncpy with BLI_strncpyCampbell Barton
Also replace strncpy+strcat with BLI_string_join
2022-09-09Cleanup: remove BLI_make_file_stringCampbell Barton
This function did multiple things making it difficult to know what was intended by the caller: - Directory & file join. - Expand relative '//' prefix to an optional directory. - Expand drive letters on windows (guessing with fall-backs). - Switch slashes to native direction. This functionality wasn't needed as the full directory was always passed in, so guessing the drive letter wasn't needed. If functionality to add drive letters onto paths is needed in the future a function that only does this can be added.
2022-09-09Realtime Compositor: Implement pixelate nodeOmar Emara
This patch implements the pixelate node for the realtime compositor. Differential Revision: https://developer.blender.org/D15662 Reviewed By: Clement Foucault
2022-09-09Cleanup: remove paranoid NULL checksCampbell Barton
2022-09-09License headers: use SPDX identifiersCampbell Barton
2022-09-09Cleanup: spelling in commentsCampbell Barton
2022-09-08Fix: Integer type in linear probing strategyHans Goudey
Probing strategies must iterate over every possible hash, but the linear strategy only did 2^32 iterations, not 2^64. Updating this was missed in 8cbbdedaf4dfec9e3. Also fix an unnecessary comma. Differential Revision: https://developer.blender.org/D15913
2022-09-07BLI: new C++ BitVector data structureJacques Lucke
This adds a new `blender::BitVector` data structure that was requested a couple of times. It also replaces usages of `BLI_bitmap` in C++ code. See the comment in `BLI_bit_vector.hh` for more details about the advantages and disadvantages of using a bit-vector and how the new data structure compares to `std::vector<bool>` and `BLI_bitmap`. Differential Revision: https://developer.blender.org/D14006
2022-09-07Cleanup: spelling in comments, correct doxy slashes, replace '/w'Campbell Barton
2022-09-06BLI: Add new `blender::Pool` containerClément Foucault
A `blender::Pool` can construct and destruct elements without reordering. Freed items memory will be reused by next allocations. Elements are allocated in chunks to reduce memory fragmentation and avoid reallocation. Reviewed By: JacquesLucke Differential Revision: https://developer.blender.org/D15894
2022-09-06Cleanup: spelling in comments, formatting, move comments into headersCampbell Barton
2022-08-31Mesh: Move material indices to a generic attributeHans Goudey
This patch moves material indices from the mesh `MPoly` struct to a generic integer attribute. The builtin material index was already exposed in geometry nodes, but this makes it a "proper" attribute accessible with Python and visible in the "Attributes" panel. The goals of the refactor are code simplification and memory and performance improvements, mainly because the attribute doesn't have to be stored and processed if there are no materials. However, until 4.0, material indices will still be read and written in the old format, meaning there may be a temporary increase in memory usage. Further notes: * Completely removing the `MPoly.mat_nr` after 4.0 may require changes to DNA or introducing a new `MPoly` type. * Geometry nodes regression tests didn't look at material indices, so the change reveals a bug in the realize instances node that I fixed. * Access to material indices from the RNA `MeshPolygon` type is slower with this patch. The `material_index` attribute can be used instead. * Cycles is changed to read from the attribute instead. * BMesh isn't changed in this patch. Theoretically it could be though, to save 2 bytes per face when less than two materials are used. * Eventually we could use a 16 bit integer attribute type instead. Ref T95967 Differential Revision: https://developer.blender.org/D15675
2022-08-31Nodes: move NodeTreeRef functionality into node runtime dataJacques Lucke
The purpose of `NodeTreeRef` was to speed up various queries on a read-only `bNodeTree`. Not that we have runtime data in nodes and sockets, we can also store the result of some queries there. This has some benefits: * No need for a read-only separate node tree data structure which increased complexity. * Makes it easier to reuse cached queries in more parts of Blender that can benefit from it. A downside is that we loose some type safety that we got by having different types for input and output sockets, as well as internal and non-internal links. This patch also refactors `DerivedNodeTree` so that it does not use `NodeTreeRef` anymore, but uses `bNodeTree` directly instead. To provide a convenient API (that is also close to what `NodeTreeRef` has), a new approach is implemented: `bNodeTree`, `bNode`, `bNodeSocket` and `bNodeLink` now have C++ methods declared in `DNA_node_types.h` which are implemented in `BKE_node_runtime.hh`. To make this work, `makesdna` now skips c++ sections when parsing dna header files. No user visible changes are expected. Differential Revision: https://developer.blender.org/D15491
2022-08-31Cleanup: reduce scope, quiet unused variable warningsCampbell Barton
When building without thumbnails some variables weren't used, reduce their scope as well as the BlPath sub-string.