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-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.
2021-06-14Fix T87867: file open dialog triggers OneDrive file downloads on macOSLeon Zandman
Until OneDrive supports macOS's native placeholder file implementation, detect the com.microsoft.OneDrive.RecallOnOpen extended file attribute. Differential Revision: https://developer.blender.org/D11466
2021-06-13Cleanup: redundant initializationCampbell Barton
These were limited to obvious cases. Some less obvious cases were kept as refactoring might make them necessary in future.
2021-06-13Cleanup: use ATTR_RETURNS_NONNULL function attributeCampbell Barton
2021-06-10Cleanup: BLI_path_slash_native: use separator defines instead of literal values.Bastien Montagne
Even though this function is alredy using system-specific code, it's still cleaner to use `SEP` and `ALTSEP` here.
2021-06-10BLI_mempool: split thread-safe iteration into the private APICampbell Barton
Splitting out thread safe iteration logic means regular iteration isn't checking for the thread-safe pointer each step. This gives a small but measurable overall performance gain of 2-3% when redrawing a high-poly mesh. Ref D11564 Reviewed By: mont29
2021-06-10Cleanup: move endian values from BKE_global into BLI_endian_definesCampbell Barton
This change was prompted by D6408 which moves thumbnail extraction into a shared function that happens use these endian defines but only links blenlib. There is no need for these defines to be associated with globals so move into their own header.
2021-06-10Cleanup: quiet array-parameter warning from GCC11Campbell Barton
2021-06-09Cleanup: use doxy sections for task_iterator.cCampbell Barton
2021-06-09Cleanup: spelling in commentsCampbell Barton
2021-06-09Fix uninitialized variable in task.MempoolIterTLS testCampbell Barton
Error in 14f3b2cdad2d7b00ce3ea27bf8eb0087ac2a6cbd.
2021-06-09BLI_task: add TLS support to BLI_task_parallel_mempoolCampbell Barton
Support thread local storage for BLI_task_parallel_mempool, as well as support for the reduce and free callbacks. mempool_iter_threadsafe_* functions have been moved into a private header thats only shared between task_iterator.c and BLI_mempool.c so the TLS can be made part of the iterator array without having to rely on passing in struct offsets. Add test task.MempoolIterTLS that ensures reduce and free are working as expected. Reviewed By: mont29 Ref D11548
2021-06-09Fix missing free calls for task iteratorCampbell Barton
A single threaded task with thread data over 8192 bytes would leak. While this didn't happen in practice, it could cause issues in the future. The free call for `task_parallel_iterator_do` wasn't running if callbacks weren't set, also not an issue in practice but avoids potential problems in the future too.
2021-06-08Cleanup: Apply clang-format (`make format`)Julian Eisel
2021-06-08BLI: support disabling task isolation in task poolJacques Lucke
Under some circumstances using task isolation can cause deadlocks. Previously, our task pool implementation would run all tasks in an isolated region. Now using task isolation is optional and can be turned on/off for individual task pools. Task pools that spawn new tasks recursively should never enable task isolation. There is a new check that finds these cases at runtime. Right now this check is disabled, so that this commit is a pure refactor. It will be enabled in an upcoming commit. This fixes T88598. Differential Revision: https://developer.blender.org/D11415
2021-06-06Exact Boolean: fix last commit: pass an arg by reference instead of value.Howard Trickey
2021-06-05Exact Boolean: speed up when there are many separate components.Howard Trickey
Use bounding box tests quickly tell that two components cannot have a containment relation between each other. This change cut about 0.6s off a test with 25 big icospheres.
2021-06-05Fix assert check in BLI_polyfill_beautifyCampbell Barton
2021-06-05Cleanup: spelling in commentsCampbell Barton
Also remove reference to function that never existed for adding `bNode`.
2021-06-04Math: Added max_uu/min_uu variations.Jeroen Bakker
2021-06-02Boolean exact: speedup by parallelizing a plane calculation.Erik Abrahamsson
This patch is from erik85, who says: This patch makes populate_plane inside polymesh_from_trimesh_with_dissolve run in parallel. On a test file with a boolean between two subdivided cubes (~6 million verts) this gives a 10% speed increase (49.5s to 45s) on my 6 core CPU. Also there is an optimization of other_tri_if_manifold to skip the contains-call and get the pointer directly. This reduces CPU time for find_patches from 5s to 2.2s on the same test file.
2021-06-02Boolean exact: speedup when there are many components.Howard Trickey
When there are many components (separate pieces of connected mesh), a part of the algorithm to determine component containment was slow. Using a float version of finding the nearest point on a triangle as a prefilter sped this up enormously. A case of 25 icospheres subdivided twice goes 11 seconds faster on my Macbook pro with this change.
2021-06-02Cleanup: Correct commentsHans Goudey
This corrects an outdated comment in the vector header and a typo in the index mask header.
2021-06-01Speedup exact boolean by avoiding some mallocs and frees.Erick Abrahammson
This is from patch D11432 from Erik Abrahamsson. He found that in some mpq3 functions called frequently from loops, passing in buffers for termporary mpq3 values can save substantial time. On my machine, his example in that patch went from 9.48s to 7.50s for the boolean part of the calculation. On his machine, a running time went from 17s to 10.3s.
2021-05-31Cleanup: Replace fseek() calls with BLI_fseek()Harley Acheson
The fseek() function on Windows only accepts a 32-bit long offset argument. Because of this we have our own version, BLI_fseek(), which will use 64-bit _fseeki64() on Windows. This patch just replaces some fseek() calls with BLI_fseek(). Differential Revision: https://developer.blender.org/D11430 Reviewed by Brecht Van Lommel
2021-05-30Boolean: applying patch D11431 to speed up hole-tolerant raycast.Howard Trickey
This patch from Erik Abrahamsson uses a parallel_for to speed up the case where the input is not manifold and the "hole_tolerant" option is set. In a test case on a 24 core (48 thread) machine, this sped up a the boolean part on an object with 221k triangles from 12.06s to 0.46s.
2021-05-27Fix incorrect BLI_snprintf usageCampbell Barton
Event though in practice this wasn't causing problems as the fixed size buffers are generally large enough not to truncate text. Using the result from `snprint` or `BLI_snprintf` to step over a fixed size buffer allows for buffer overruns as the returned value is the size needed to copy the entire string, not the number of bytes copied. Building strings using this convention with multiple calls: ofs += BLI_snprintf(str + ofs, str_len_max - ofs); .. caused the size argument to become negative, wrapping it to a large value when cast to the unsigned argument.
2021-05-27Cleanup: spellingCampbell Barton
2021-05-27Win: Add launcher to hide the console window flashRay Molenkamp
This patch fixes a long-standing complaint from users: the console window shortly flashing when they start blender. This is done by adding a new executable called blender-launcher.exe which starts blender.exe while hiding the console. Any command line parameters given to blender-launcher will be passed on to blender.exe so it'll be a drop in replacement. Starting blender.exe on its own will still function as a proper console app so no changes required here for users that use blender for batch processing. Notable changes: Registering blender (-R switch) will now register blender-launcher as the preferred executable. This patch updates the installer and updates the shortcuts to start blender-launcher.exe rather than blender.exe Differential Revision: https://developer.blender.org/D11094 Reviewed by: brecht, harley
2021-05-25Blenlib: Explicit Colors.Jeroen Bakker
Colors are often thought of as being 4 values that make up that can make any color. But that is of course too limited. In C we didn’t spend time to annotate what we meant when using colors. Recently `BLI_color.hh` was made to facilitate color structures in CPP. CPP has possibilities to enforce annotating structures during compilation and can adds conversions between them using function overloading and explicit constructors. The storage structs can hold 4 channels (r, g, b and a). Usage: Convert a theme byte color to a linearrgb premultiplied. ``` ColorTheme4b theme_color; ColorSceneLinear4f<eAlpha::Premultiplied> linearrgb_color = BLI_color_convert_to_scene_linear(theme_color).premultiply_alpha(); ``` The API is structured to make most use of inlining. Most notable are space conversions done via `BLI_color_convert_to*` functions. - Conversions between spaces (theme <=> scene linear) should always be done by invoking the `BLI_color_convert_to*` methods. - Encoding colors (compressing to store colors inside a less precision storage) should be done by invoking the `encode` and `decode` methods. - Changing alpha association should be done by invoking `premultiply_alpha` or `unpremultiply_alpha` methods. # Encoding. Color encoding is used to store colors with less precision as in using `uint8_t` in stead of `float`. This encoding is supported for `eSpace::SceneLinear`. To make this clear to the developer the `eSpace::SceneLinearByteEncoded` space is added. # Precision Colors can be stored using `uint8_t` or `float` colors. The conversion between the two precisions are available as methods. (`to_4b` and `to_4f`). # Alpha conversion Alpha conversion is only supported in SceneLinear space. Extending: - This file can be extended with `ColorHex/Hsl/Hsv` for different representations of rgb based colors. `ColorHsl4f<eSpace::SceneLinear, eAlpha::Premultiplied>` - Add non RGB spaces/storages ColorXyz. Reviewed By: JacquesLucke, brecht Differential Revision: https://developer.blender.org/D10978
2021-05-25Revert "Blenlib: Explicit Colors."Jeroen Bakker
This reverts commit fd94e033446c72fb92048a9864c1d539fccde59a. does not compile against latest master.