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-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.
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-21Cleanup: spellingLeon Zandman
Includes fixes to misspelled function names. Ref D11280
2021-05-21Cleanup: conversion warningCampbell Barton
2021-05-21Eevee Wavelength Node SupportIyad Ahmed
This patch adds wavelength node support to Eevee, similar to how Eevee Blackbody node works, thus it is a little off from Cycles. Reviewed By: #eevee_viewport, fclem, brecht Differential Revision: https://developer.blender.org/D11326
2021-05-19Fix T87621: Win32 Do Not Create Preview Thumbnails for Offline FilesHarley Acheson
This patch turns off the creation of file thumbnails for files that are offline and therefore not fully-present on the file system. These types of files - typically cloud-based or stored on slower backup media - only have their contents available when actually accessed, at which point there will be a short delay. If we allow thumbnail creation in this state then all offline files in a folder will be downloaded just to view a listing, which can take a long time. Files in this state will instead get a more generic thumbnail that still indicates file type (icon in center) and that shows offline state will a special icon at the bottom-left. Although this currently only affects Windows users, most of this patch is platform-agnostic. So other platforms inherit this behavior if they only add FILE_ATTR_OFFLINE attribute to files in this state. See D11101 for more information. Differential Revision: https://developer.blender.org/D11101 Reviewed by Julian Eisel
2021-05-13BLI: simplify supporting heterogeneous lookup for new typesJacques Lucke
Heterogeneous lookup is useful when constructing a key in a map/set is relatively expensive (e.g. `std::string`). When doing lookups in the map/set, one usually does not want to construct the type to avoid overhead. Instead, heterogeneous lookup allows for using a different type (such as `StringRef`) as key. This change makes it easier to implement heterogeneous lookup for custom types. Before, one had to specialize `blender::DefaultHash`. Now, one just has to implement a `static uint64_t hash_as(value)` on the type itself. One still has to provide the equality operator in addition to the hash function of course.
2021-05-13BLI: support looking up a key stored in Map or VectorSetJacques Lucke
Sometimes it is useful to find the key that compares equal to a known key. Typically that happens when the key itself has additional data attached that is not part of its hash. Note that the returned key reference/pointer is const, because the caller must not change the key in a way that changes its hash or how it compares to other keys.
2021-05-13BLI: add initial wrapper for tbb::enumerable_thread_specificJacques Lucke
The wrapper is necessary to support building without TBB. This class is used by the upcoming new evaluator for geometry nodes.
2021-05-13BLI: add LinearAllocator.construct_array methodJacques Lucke
Previously, one could allocate an array, but not construct its elements directly. This method just adds some convenience.
2021-05-06Cleanup: spellingCampbell Barton
2021-05-04Merge branch 'blender-v2.93-release'Germano Cavalcante
2021-05-04Fix (unreported): 'CoInitializeEx' being called without 'CoUninitialize'Germano Cavalcante
Problem introduced in {rB1f223b9a}. This was possibly causing random crashes in Blender file browser when compiled with ASAN. Microsoft documents indicate that any call to `CoInitializeEx` must be balanced by a corresponding call to `CoUninitialize`. https://docs.microsoft.com/en-us/windows/win32/api/combaseapi/nf-combaseapi-coinitializeex#remarks
2021-05-03Geometry Nodes: Initial basic curve data supportHans Goudey
This patch adds initial curve support to geometry nodes. Currently there is only one node available, the "Curve to Mesh" node, T87428. However, the aim of the changes here is larger than just supporting curve data in nodes-- it also uses the opportunity to add better spline data structures, intended to replace the existing curve evaluation code. The curve code in Blender is quite old, and it's generally regarded as some of the messiest, hardest-to-understand code as well. The classes in `BKE_spline.hh` aim to be faster, more extensible, and much more easily understandable. Further explanation can be found in comments in that file. Initial builtin spline attributes are supported-- reading and writing from the `cyclic` and `resolution` attributes works with any of the attribute nodes. Also, only Z-up normal calculation is implemented at the moment, and tilts do not apply yet. **Limitations** - For now, you must bring curves into the node tree with an "Object Info" node. Changes to the curve modifier stack will come later. - Converting to a mesh is necessary to visualize the curve data. Further progress can be tracked in: T87245 Higher level design document: https://wiki.blender.org/wiki/Modules/Physics_Nodes/Projects/EverythingNodes/CurveNodes Differential Revision: https://developer.blender.org/D11091
2021-05-03Cleanup: clang-tidyJacques Lucke
2021-05-02Merge branch 'blender-v2.93-release'Howard Trickey
2021-05-02Fix T87554 Exact Boolean performance bug.Howard Trickey
There was a quadratic algorithm extracting triangles from a coplanar cluster. This is now linear. Also found and fixed a bug in the same area related to the triangulator added recently: it didn't get the right correspondence between new edges and original edges.
2021-04-30BLI: support removing Map elements during iterationJacques Lucke
While it was technically safe to call Map.remove while iterating over a map, it wasn't really designed to work. Also it wasn't very efficient, because to remove the element, the map would have to search it again. Now it is possible to remove an element given an iterator into the map. It is safe to remove the element while iterating over the map. Obviously, the removed element must not be accessed anymore after it has been removed.
2021-04-30BLI: add a common base class for Map iteratorsJacques Lucke
This is useful for an upcoming commit that allows removing an element based on an iterator.
2021-04-30BLI: improve VectorSet data structureJacques Lucke
This adds two new methods: * `clear` just removes all keys from the vector set. * `index_of_or_add` returns the index of a key and adds it if has not been added before.
2021-04-30Cleanup: Mismatched array bounds in function declarationHans Goudey
2021-04-29Functions: make copying virtual arrays to span more efficientJacques Lucke
Sometimes functions expect a span instead of a virtual array. If the virtual array is a span internally already, great. But if it is not (e.g. the position attribute on a mesh), the elements have to be copied over to a span. This patch makes the copying process more efficient by giving the compiler more opportunity for optimization.
2021-04-28Cleanup: Fix inconcistent array lengths in function declarationsHans Goudey
In some cases functions were defined with arguments of different array lengths in headers vs. implementations. This commit fixes some of the cases I ran into, but probably not all of them.
2021-04-28BLI: improve Vector.remove_and_reorderJacques Lucke
The old version was correct as well but did a move even when not necessary.
2021-04-27Cleanup: clang formatJacques Lucke
2021-04-25BLI: Add "first" method to MutableSpan and VectorHans Goudey
This is convenient because having a uniform interface is nice, and because of the similarity to "last". Differential Revision: https://developer.blender.org/D11076
2021-04-24Fix T87682 Boolean Exact crash.Howard Trickey
The triangulator I made (using CDT) doesn't work if the face self-intersects. Fall back to the polyfill triangulator when that happens.
2021-04-24Fix T87682 Boolean Exact crash.Howard Trickey
The triangulator I made (using CDT) doesn't work if the face self-intersects. Fall back to the polyfill triangulator when that happens.
2021-04-23Modifiers: Performance Simple DeformationJagannadhan Ravi
Use multiprocessing with simple deform modifiers. Master 2.92 fps this patch 3.13 fps on Ryzen 1700X With Vega 64 GPU. 3970X: 2.85 fps -> 2.95 fps 3990X: 3.15 fps -> 3.41 fps 3995WX: 3.21 fps -> 3.38 fps Reviewed By: jbakker Differential Revision: https://developer.blender.org/D10609
2021-04-21Merge branch 'blender-v2.93-release'Campbell Barton
2021-04-21BLI_string: add a utility to replace strings using a tableCampbell Barton
Useful to simplify versioning code when identifiers need updating in multiple places.
2021-04-19Cleanup: spellingCampbell Barton
2021-04-17Merge branch 'blender-v2.93-release'Howard Trickey
2021-04-17Fix T86805 Inconsistent results for exact boolean.Howard Trickey
The fast triangulator from Blenlib could leave a non-manifold mesh after removing degenerate triangles. Switched to an exact triangulator.
2021-04-17BLI: add unit tests for recently added methodsJacques Lucke
2021-04-17BLI: support multiple parameters in Stack.push_asJacques Lucke
2021-04-17BLI: add Vector.append_as methodJacques Lucke
This method is similar to `std::vector::emblace_back` in that it constructs the new object inplace in the vector, removing the need for a move. The `_as` suffix is consistent with similar behavior in Map and Set data structures.