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
2021-07-12Blenlib: Add BLI_assert_msg() for printing an extra string if the assert failsJulian Eisel
It always bothered me that we'd do the `BLI_assert(... || !"message")` trick to print a message alongside the assert, while it should be trivial to have a way to pass an extra string as additional argument. This adds `BLI_assert_msg()` with a second argument for a message. E.g.: ``` BLI_assert_msg( params->rename_id == NULL, "File rename handling should immediately clear rename_id when done, because otherwise it will keep taking precedence over renamefile."); ``` On failure this will print like this: ``` 0 Blender 0x00000001140647a3 BLI_system_backtrace + 291 [...] 13 Blender 0x00000001092647a6 main + 3814 14 libdyld.dylib 0x00007fff203d8f5d start + 1 BLI_assert failed: source/blender/editors/space_file/file_ops.c:2352, file_directory_new_exec(), at 'params->rename_id == ((void*)0)' File rename handling should immediately clear rename_id when done, because otherwise it will keep taking precedence over renamefile. ``` Reviewed by: Sybren Stüvel, Jacques Lucke, Sergey Sharybin, Campbell Barton Differential Revision: https://developer.blender.org/D11827
2021-07-09Fix a compiler warning on Windows for Exact Boolean.Howard Trickey
For some reason, the Windows compiler didn't like the static function being used in the parallel_reduece.
2021-07-09Cleanup: use 'uint' for BLI_arrayCampbell Barton
2021-07-09BLI_array: add BLI_array_deduplicate_ordered utility & testsCampbell Barton
2021-07-08BLI: avoid calling deleted copy constructor in some compilersJacques Lucke
Previously, this did not compile in VS 2017, because `new T(initializer_())` would try to call the copy constructor of `T`. Now, `initializer_` will construct the `T` inplace.
2021-07-08Cleanup: spellingCampbell Barton
2021-07-08CMake: add missing headers, sort file listsCampbell Barton
2021-07-07Cleanup: spelling in commentsCampbell Barton
2021-07-06Various Exact Boolean parallelizations and optimizations.Erik Abrahamsson
From patch D11780 from Erik Abrahamsson. It parallelizes making the vertices, destruction of map entries, finding if the result is PWN, finding triangle adjacencies, and finding the ambient cell. The latter needs a parallel_reduce from tbb, so added one into BLI_task.hh so that if WITH_TBB is false, the code will still work. On Erik's 6-core machine, the elapsed time went from 17.5s to 11.8s (33% faster) on an intersection of two spheres with 3.1M faces. On Howard's 24-core machine, the elapsed time went from 18.7s to 10.8s for the same test.
2021-07-05Fix performance regression in Exact boolean due to exact triangulation.Howard Trickey
Went back to using Blender's polyfill for triangulation, which is much faster (time for a 3.1M face boolean went from 103s to 48s). Had to put in detection for the case that needs the exact triangulator (bug T86805), and also a fix for non-convex quads (bug T89330).
2021-07-05Cleanup: spelling, punctuationCampbell Barton
2021-07-05BLI: wrap more features off tbb::enumerable_thread_specificJacques Lucke
* Make the wrapper enumerable. * Support an initializer function.
2021-07-05BLI: add conversion constructor for destruct_ptrJacques Lucke
This allows converting between different `destruct_ptr` types (which is just a `std::unique_ptr` with a custom deleter). The most common use case is to convert from a derived type to the type of the base class.
2021-07-05Cleanup: spelling in commentsCampbell Barton
2021-07-03Cleanup: consistent use of tags: NOTE/TODO/FIXME/XXXCampbell Barton
Also use doxy style function reference `#` prefix chars when referencing identifiers.
2021-07-02Copy Transforms: implement Remove Target Shear and more Mix options.Alexander Gavrilov
This constraint can be naturally viewed as a prototype for a future 4x4 matrix math node (or subset thereof), since its basic semantics already is matrix assignment. Thus it makes sense to add math options to this constraint to increase flexibility in the meantime. This patch adds support for several operations that would be useful: - An option to remove shear in the incoming target matrix. Shear is known to cause issues for various mathematical operations, so an option to remove it at key points is useful. Constraints based on Euler like Copy Rotation and Limit Rotation already have always enabled shear removal built in, because their math doesn't work correctly with shear. In the future node system shear removal would be a separate node (and currently Limit Rotation can be used as a Remove Shear constraint). However removing shear from the result of the target space conversion before mixing (similar to Copy Rotation) has to be built into Copy Transforms itself as an option. - More ways to combine the target and owner matrices. Similar to multiple Inherit Scale modes for parenting, there are multiple ways one may want to combine matrices based on context. This implements 3 variants for each of the Before/After modes (one of them already existing). - Full implements regular matrix multiplication as the most basic option. The downside is the risk of creating shear. - Aligned emulates the 'anti-shear' Aligned Inherit Scale mode, and basically uses Full for location, and Split for rotation/scale. (This choice already existed.) - Split Channels combines location, rotation and scale separately. Looking at D7547 there is demand for Split Channels in some cases, so I think it makes sense to include it in Copy Transforms too, so that the Mix menu items can be identical for it and the Action constraint. Differential Revision: https://developer.blender.org/D9469
2021-07-02Cleanup: spelling in commentsCampbell Barton
2021-07-01BLI_linklist_stack: use cast to prevent warnings when used in C++Campbell Barton
2021-06-30Cleanup: use const arguments for accessor functionsCampbell Barton
2021-06-29Cleanup: clang-tidyCampbell Barton
2021-06-28Cleanup: Add function to create a CurveEval from a nurbs listHans Goudey
Sometimes the current spline list isn't part of the original curve, like when using the deformed control points, etc. This will be helpful in the curve modifier stack.
2021-06-28BLI: improve enum operatorsJacques Lucke
* Use unsigned integer types for bit operations. * Use 64 bit integer instead of 32 bit. * Support scoped enumes (aka `enum class`) by adding some more casts.
2021-06-28BLI_rand: support for randomizing bitmapsPiotr Makal
Add utility functions: - BLI_bitmap_randomize - BLI_rng_shuffle_bitmap Part of D11685
2021-06-28Cleanup: repeated terms in code comments & error messagesCampbell Barton
2021-06-27Fix T89330 Exact Boolean fails on a simple model.Howard Trickey
The problem was an optimization I put in to triangulate quads. It was wrong if the quad, after projecting onto a 2d plane, was not convex. Handling quads the same as other faces fixes the bug. Unfortunately, this will slow down Exact Boolean when the input has many quads (the usual case, of course). Will attempt to fix that with a later change, but for now, this at least restores correctness.
2021-06-26Cleanup: full sentences in comments, improve comment formattingCampbell Barton
2021-06-25Fixes a warning where dst array size was wrong in theFabian Schempp
signiture of BLI_str_format_attribute_domain_size. Reviewer: Hans Goudey (Hoogly Boogly) Differential Revision: https://developer.blender.org/D11710
2021-06-25Cleanup: Clang formatHans Goudey
2021-06-25Spreadsheet: Dataset region for spreadsheet editorFabian Schempp
This patch adds a left aligned sidebar to the spreadsheet editor. This Sidebar can be used to navigate the geometry component types and attribute domains. It also provides a quick overview of domain sizes. It replaces the two dropdowns in the regions header. Next step will be to add the domain cycling shortcut using the CTRL + mouse wheel. Reviewer: Dalai Felinto (dfelinto), Julian Eisel (Severin), Hans Goudey (HooglyBoogly). Differential Revision: https://developer.blender.org/D11046
2021-06-24Cleanup: compiler warnings with clangBrecht Van Lommel
* Mark either all or no class methods with override * Don't use zero sized array since it has a different size in C and C++. Using a little more memory here is not significant. * Don't use deprecated mechanism to mark private GSet members in clang just like we don't for MSVC, it warns even for simple zero initialization.
2021-06-24Cleanup: comment blocks, trailing space in commentsCampbell Barton
2021-06-23Cleanup: clang-tidy quiet equals-default, nullptr warningsCampbell Barton
2021-06-23Cleanup: suppress clang-tidy warningsCampbell Barton
2021-06-22Cleanup: Spelling MistakesLeon Zandman
This patch fixes many minor spelling mistakes, all in comments or console output. Mostly contractions like can't, won't, don't, its/it's, etc. Differential Revision: https://developer.blender.org/D11663 Reviewed by Harley Acheson
2021-06-22Minor cleanup to previous commit introducing `BLI_math_time`.Bastien Montagne
Forgot to address latest review comments, sorry for the noise.`:wq
2021-06-22Add initial `BLI_math_time` with a 'seconds decompose' function.Bastien Montagne
Allows to decompose a given amount of seconds into a random set of days/hours/minutes/seconds/milliseconds values. Also add matching test. Differential Revision: https://developer.blender.org/D11581
2021-06-21Fix T89291: Objects with rotation deltas don't rotate in correct axesGermano Cavalcante
Quaternion correction was not implemented and Euler values were being incorrectly combined.
2021-06-21Cleanup: swap top/bottom args to planes_from_projmatCampbell Barton
X & Z were ordered min/max, where as Y was max/min.
2021-06-21Delaunay add support for detecting and removing holes from output.Howard Trickey
Adds two new output modes to the CDT api which detect and remove holes. A hole is a face from which a ray shot to the outside intersects an even number of constraint edges, except we don't count constraint edges in the same connected region of faces, where a region is connected via non-constraint edges. These modes are useful for filling in outlines meant to represent text characters and the like. Original patch was from Erik Abrahamsson, modified by me to work with the "valid Bmesh" output type too. I also added tests for the new modes.
2021-06-20Docs: improve poly_to_tri_count doc-stringCampbell Barton
It wasn't obvious this can be used for calculating the triangle index from the polygon and loop index.
2021-06-20Mesh: minor optimization to concave quad check for tessellationCampbell Barton
Use the face normal (when available) for a faster concave quad test.
2021-06-18Cleanup: clang-tidyCampbell Barton
2021-06-16BLI: add C++ wrapper for task isolationJacques Lucke
This makes it easier to use task isolation in c++ code. Previously, one either had to check `WITH_TBB` (possibly indirectly through `WITH_OPENVDB`) or one had to use the C function which is less convenient.
2021-06-16BLI: add threading namespaceJacques Lucke
This namespace groups threading related functions/classes. This avoids adding more threading related stuff to the blender namespace. Also it makes naming a bit easier, e.g. the c++ version of BLI_task_isolate could become blender::threading::isolate_task or something similar. Differential Revision: https://developer.blender.org/D11624
2021-06-15BLI: use explicit task isolation, no longer part of parallel operationsBrecht Van Lommel
After looking into task isolation issues with Sergey, we couldn't find the reason behind the deadlocks that we are getting in T87938 and a Sprite Fright file involving motion blur renders. There is no apparent place where we adding or waiting on tasks in a task group from different isolation regions, which is what is known to cause problems. Yet it still hangs. Either we do not understand some limitation of TBB isolation, or there is a bug in TBB, but we could not figure it out. Instead the idea is to use isolation only where we know we need it: when holding a mutex lock and then doing some multithreaded operation within that locked region. Three places where we do this now: * Generated images * Cached BVH tree building * OpenVDB lazy grid loading Compared to the more automatic approach previously used, there is the downside that it is easy to miss places where we need isolation. Yet doing it more automatically is also causing unexpected issue and bugs that we found no solution for, so this seems better. Patch implemented by Sergey and me. Differential Revision: https://developer.blender.org/D11603
2021-06-14UI: Windows Blend File AssociationHarley Acheson
This patch allows Windows users to specify that their current blender installation should be used to create thumbnails and be associated with ".blend" files. This is done from Preferences / System. The only way to do this currently is from the command-line and this is sometimes inconvenient. Differential Revision: https://developer.blender.org/D10887 Reviewed by Brecht Van Lommel
2021-06-14Fix possible C-linkage warning on ClangJulian Eisel
The warning would appear when using the `ENUM_OPERATORS()` macro inside of an `extern "C"` block. Didn't cause a warning in master currently, but in the `asset-browser-poselib` branch. After macro expansion, there would be C++ code in code with C linkage (`extern "C"`). So make sure the expanded C++ code always uses C++ linkage. The syntax used is totally C++ compliant: the C++ standard requires that in such nested linkage specifications, the innermost one determines the linking language (e.g. see https://timsong-cpp.github.io/cppwp/n4659/dcl.link#4).
2021-06-14Fix build error in release builds after recent changesBrecht Van Lommel
2021-06-14BLI_math: Cleanup: Use `mul_`/`madd_` functions.Bastien Montagne
Better to avoid explicit vectors components direct manipulation when a generic operation for whole vector exists, if nothing else it avoids potential mistakes in indices.
2021-06-14BLI_math: Fix several division-by-zero cases.Bastien Montagne
Those were caused by various tools used on degenerate geometry, see T79775. Note that fixes are as low-level as possible, to ensure they cover as much as possible of unreported issues too. We still probably have many more of those hidden in BLI_math though.