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-03-25Cleanup: use count or num instead of nbrCampbell Barton
Follow conventions from T85728.
2022-03-25Cleanup: spelling in comments, stringsCampbell Barton
2022-03-25Cleanup: sort cmake file listsCampbell Barton
2022-03-24BLI: Add utility for tacking average and min runtimeHans Goudey
This is useful to save time manually averaging many timing results. The minimum is included because often it can be more stable than an average, and it can help to expose calls from other contexts with lower times that would make the average useless. Differential Revision: https://developer.blender.org/D14417
2022-03-24Geometry Nodes: Improve performance writing to vertex groupsHans Goudey
In a test file from T96282, this commit reduces the runtime of the delete geometry node from 82 ms to 23 ms, a 3.6x improvement. Writing to vertex groups in other cases should be faster too. The largest improvement comes from not writing a new weight of zero if the vertex is not in the group. This mirrors the behavior of custom data interpolation in `layerInterp_mdeformvert`. Other improvements come from using `set_all` for writing output attributes and implementing that method for vertex groups. I also implemented `materialize` methods. Though I didn't obverse an improvement from this, I think it's best to remove virtual method call overhead where it's simple to do so. The test file for the delete geometry node needs to be updated. These methods could be parallelized too, but better to do that later. Differential Revision: https://developer.blender.org/D14420
2022-03-23Curves: improve Comb brushJacques Lucke
New supported features: * 3D/spherical brush that samples a good position on the curves. * Falloff. The custom falloff curve mapping is not yet available in the ui because that requires some more ui reorganization. This is better done when we have a better understanding of what settings we need exactly. Currently, the depth of the 3d brush is only sampled once per stroke, when first pressing LMB. Sometimes it is expected that the depth of the brush can change within a single brush. However, implementing that in a good way is not straight forward and might need additional options. Therefore that will be handled separately. Some experimentation results are in D14376. Ref T96445. Differential Revision: https://developer.blender.org/D14376
2022-03-23Cleanup: move documentation to headers, other minor correctionsCampbell Barton
2022-03-23Cleanup: spelling in commentsCampbell Barton
2022-03-22Fix build when using WITH_TBB=OFF after recent changesBrecht Van Lommel
And wrap tbb::parallel_sort in blender namespace similar to other TBB functionality.
2022-03-21Curves: new Add brushJacques Lucke
This adds a new Add brush for the new curves object type in sculpt mode. The brush is used to insert new curves (typically hair) on the surface object. Supported features: * Add single curve exactly at the cursor position when `Add Amount` is 1. * Front faces only. * Independent interpolate shape and interpolate length settings. * Smooth and flat shading affects curve shape interpolation. * Spherical and projection brush. This also adds the `surface_triangle_index` and `surface_triangle_coordinate` attributes. Those store information about what position on the surface each added curve is attached to: * `surface_triangle_index` (`int`): Index of the internal triangle that a curve is attached to. `-1` when the curve is not attached to the surface. * `surface_triangle_coordinate` (`float2`): First two numbers of a barycentric coordinate that reference a specific position within the triangle. Ref T96444. Differential Revision: https://developer.blender.org/D14340
2022-03-19BLI: generalize converting CPPType to static typeJacques Lucke
Previously, the conversion was done manually for a fixed set of types. Now, there is a more general utility that can be used in other contexts (outside of geometry nodes attribute processing) as well.
2022-03-19BLI: move generic data structures to blenlibJacques Lucke
This is a follow up to rB2252bc6a5527cd7360d1ccfe7a2d1bc640a8dfa6.
2022-03-18Cleanup: Compilation warningsSergey Sharybin
Mainly -Wset-but-unused-variable. Makes default compilation on macOS way less noisy. Differential Revision: https://developer.blender.org/D14357
2022-03-18BLI: move CPPType to blenlibJacques Lucke
For more detail about `CPPType`, see `BLI_cpp_type.hh` and D14367. Differential Revision: https://developer.blender.org/D14367
2022-03-17BLI: add probabilistic rounding utilityJacques Lucke
2022-03-17Cleanup: spelling in commentsCampbell Barton
Use <pre>..</pre> for pseudo-code.
2022-03-16Cleanup: rename cnt to countCampbell Barton
Follow naming from T85728.
2022-03-11Cleanup: use M_PI_2 and M_PI_4 where possibleHallam Roberts
The constant M_PI_4 is added to GLSL to ensure it works there too. Differential Revision: https://developer.blender.org/D14288
2022-03-11Cleanup: fix source typos homogenous->homogeneousBrecht Van Lommel
Contributed by luzpaz. Differential Revision: https://developer.blender.org/D14306
2022-03-11Cleanup: remove duplicate compiler attributeCampbell Barton
2022-03-09Cleanup: use ELEM macroCampbell Barton
2022-03-08Cleanup: spelling in commentsCampbell Barton
2022-03-03BLI: Add functions to IndexRange to mirror SpanHans Goudey
Adds functions for special cases of slicing and an `is_empty` method.
2022-03-03Fix: BLI math clamp doesn't workHans Goudey
Return type was wrong, output of std::clamp wasn't used.
2022-03-02UI: Comments Misspellings of Vertex/VerticesNikhil Shringarpurey
Correct misspellings in code comments of "vertex" and "vertices". See D13932 for more details. Differential Revision: https://developer.blender.org/D13932 Reviewed by Harley Acheson
2022-03-02Search: take word order into account in string searchJacques Lucke
Differential Revision: https://developer.blender.org/D14223
2022-03-02Curves: add brush to add curves on surfaceJacques Lucke
This adds a prototype for the first brush that can add new curves by painting on a surface. Note that this can only be used when the curves object has a surface object set in the properties panel. The brush can take minimum distance into account. This allows distributing curves with a somewhat consistent density. Differential Revision: https://developer.blender.org/D14207
2022-03-02BLI: add scoped-defer utility to add RAII-like behavior to C typesJacques Lucke
This utility is useful when using C types that own some resource in a C++ file. It mainly helps in functions that have multiple return statements, but also simplifies code by moving construction and destruction closer together. Differential Revision: https://developer.blender.org/D14215
2022-02-24Cleanup: Typo in commentHans Goudey
2022-02-24BLI: support accessing nth last element in Array/Span/VectorJacques Lucke
This often helps to make the intend of code more clear compared to computing the index manually in the caller.
2022-02-23Fix: Build issue on windowsRay Molenkamp
tbb/enumerable_thread_specific.h drags in windows.h which will define min/max macro's unless you politely ask it not to. it's bit of an eyesore, but it is what it is
2022-02-23Fix: Attempt to fix build error on windowsHans Goudey
`index_mask.cc` ends up including this header, but not much else, the `<algorithm>` include is necessary on Windows for `std::max`.
2022-02-23Curves: initial brush implementations for curves sculpt modeJacques Lucke
The main goal here is to add the boilerplate code to make it possible to add the actual sculpt tools more easily. Both brush implementations added by this patch are meant to be prototypes which will be removed or refined in the coming weeks. Ref T95773. Differential Revision: https://developer.blender.org/D14180
2022-02-23BLI: add index mask utilitiesJacques Lucke
Sometimes it is useful to get the index ranges that are in an index mask. That is because some algorithms can process index ranges more efficiently than generic index masks. Extracting ranges from an index mask is relatively efficient, because it is cheap to check if a span of indices contains a contiguous range.
2022-02-23Cleanup: Remove repeated word in commentsCampbell Barton
2022-02-23CMake: include missing filesCampbell Barton
Also use SRC_ prefix for source variables so cmake_consistency_check.py detects these files as being known to CMake.
2022-02-22Cleanup: clang-formatCampbell Barton
2022-02-21BLI_array: add BLI_array_trim utility to re-allocate the current sizeCampbell Barton
Use this in BKE_view_layer_array_* functions.
2022-02-18Merge remote-tracking branch 'origin/blender-v3.1-release'Sybren A. Stüvel
2022-02-18Fix T95724: boundary error in `BLI_str_unescape_ex`Sybren A. Stüvel
Fix boundary error in `BLI_str_unescape_ex`. The `dst_maxncpy` parameter indicates the maximum buffer size, not the maximum number of characters. As these are strings, the loop has to stop one byte early to allow space for the trailing zero byte. Thanks @mano-wii for the patch!
2022-02-17Fix: Debug build error with vector type divisionHans Goudey
The idea is to keep `is_any_zero` in the `blender::math` namespace, so instead of trying to be clever, just move it there and expand the function where it was used in the class.
2022-02-17License headers: use SPDX identifiersCampbell Barton
2022-02-16BLI: Generalize short algorithm for finding boundsHans Goudey
Finding the greatest and/or smallest element in an array is a common need. This commit refactors the point cloud bounds code added in 6d7dbdbb44f379682 to a more general header in blenlib. This will allow reusing the algorithm for curves without duplicating it. Differential Revision: https://developer.blender.org/D14053
2022-02-16BLI: Implement templated math functions for basic typesHans Goudey
This is meant to complement the `blender::math` functions recently added by D13791. It's sometimes desired to template an operation to work on vector types, but also basic types like `float` and `int`. This patch adds that ability with a new `BLI_math_base.hh` header. The existing vector math header is changed to use the `vec_base` type more explicitly, to allow the compiler's generic function overload resolution to determine which implementation of each math function to use. This is a relatively large change, but it also makes the file significantly easier to understand by reducing the use of macros. Differential Revision: https://developer.blender.org/D14113
2022-02-16BLI: Fix compilation error caused by rBa9f023e22638Clément Foucault
Explicitly referencing the typename fixes the issue.
2022-02-16Cleanup: spelling in commentsCampbell Barton
2022-02-15Fix: Build error in debug buildHans Goudey
Error in a9f023e226389461b1140
2022-02-15BLI: Change dependencies in vector math filesHans Goudey
This patch reverses the dependency between `BLI_math_vec_types.hh` and `BLI_math_vector.hh`. Now the higher level `blender::math` functions depend on the header that defines the types they work with, rather than the other way around. The initial goal was to allow defining an `enable_if` in the types header and using it in the math header. But I also think this operations to types dependency is more natural anyway. This required changing the includes some files used from the type header to the math implementation header. I took that change a bit further removing the C vector math header from the C++ header; I think that helps to make the transition between the two systems clearer. Differential Revision: https://developer.blender.org/D14112
2022-02-15Cleanup: Use C++ math functionsHans Goudey
Use functions from the `math` and `std` namespaces instead of from `BLI_math_vector.h`.
2022-02-11File headers: manually convert files to use SPDX headersCampbell Barton
Also add BSD-2-Clause to SPDX license list.