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-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.
2021-04-17BLI: support multiple arguments for value in *_as methods of MapJacques Lucke
This allows us to build more complex values in-place in the map. Before those values had to be build separately and then moved into the map. Existing calls to the Map API remain unchanged.
2021-04-17Geometry Nodes: use virtual arrays in internal attribute apiJacques Lucke
A virtual array is a data structure that is similar to a normal array in that its elements can be accessed by an index. However, a virtual array does not have to be a contiguous array internally. Instead, its elements can be layed out arbitrarily while element access happens through a virtual function call. However, the virtual array data structures are designed so that the virtual function call can be avoided in cases where it could become a bottleneck. Most commonly, a virtual array is backed by an actual array/span or is a single value internally, that is the same for every index. Besides those, there are many more specialized virtual arrays like the ones that provides vertex positions based on the `MVert` struct or vertex group weights. Not all attributes used by geometry nodes are stored in simple contiguous arrays. To provide uniform access to all kinds of attributes, the attribute API has to provide virtual array functionality that hides the implementation details of attributes. Before this refactor, the attribute API provided its own virtual array implementation as part of the `ReadAttribute` and `WriteAttribute` types. That resulted in unnecessary code duplication with the virtual array system. Even worse, it bound many algorithms used by geometry nodes to the specifics of the attribute API, even though they could also use different data sources (such as data from sockets, default values, later results of expressions, ...). This refactor removes the `ReadAttribute` and `WriteAttribute` types and replaces them with `GVArray` and `GVMutableArray` respectively. The `GV` stands for "generic virtual". The "generic" means that the data type contained in those virtual arrays is only known at run-time. There are the corresponding statically typed types `VArray<T>` and `VMutableArray<T>` as well. No regressions are expected from this refactor. It does come with one improvement for users. The attribute API can convert the data type on write now. This is especially useful when writing to builtin attributes like `material_index` with e.g. the Attribute Math node (which usually just writes to float attributes, while `material_index` is an integer attribute). Differential Revision: https://developer.blender.org/D10994
2021-04-17Functions: extend virtual array functionalityJacques Lucke
This adds support for mutable virtual arrays and provides many utilities for creating virtual arrays for various kinds of data. This commit is preparation for D10994.
2021-04-15Spreadsheet: breadcrumbs and node pinningJacques Lucke
This introduces a context path to the spreadsheet editor, which contains information about what data is shown in the spreadsheet. The context path (breadcrumbs) can reference a specific node in a node group hierarchy. During object evaluation, the geometry nodes modifier checks what data is currently requested by visible spreadsheets and stores the corresponding geometry sets separately for later access. The context path can be updated by the user explicitely, by clicking on the new icon in the header of nodes. Under some circumstances, the context path is updated automatically based on Blender's context. This patch also consolidates the "Node" and "Final" object evaluation mode to just "Evaluated". Based on the current context path, either the final geometry set of an object will be displayed, or the data at a specific node. The new preview icon in geometry nodes now behaves more like a toggle. It can be clicked again to clear the context path in an open spreadsheet editor. Previously, only an object could be pinned in the spreadsheet editor. Now it is possible to pin the entire context path. That allows two different spreadsheets to display geometry data from two different nodes. The breadcrumbs in the spreadsheet header can be collapsed by clicking on the arrow icons. It's not ideal but works well for now. This might be changed again, if we get a data set region on the left. Differential Revision: https://developer.blender.org/D10931
2021-04-09Fix use of uninitialized memory in BKE_scene_objects_as_gsetCampbell Barton
Share macro for setting BLI_Iterator defaults to ensure this doesn't happen again in cases the ITER_* macros aren't used. Oversight in 14d74fb34174a91190d35d7fe595f8dd64cb79d1.
2021-04-08Cleanup: spellingCampbell Barton
2021-04-08Cleanup: enable modernize-use-equals-default checkJacques Lucke
This removes a lot of unnecessary code that is generated by the compiler automatically. In very few cases, a defaulted destructor in a .cc file is still necessary, because of forward declarations in the header. I removed some defaulted virtual destructors, because they are not necessary, when the parent class has a virtual destructor already. Defaulted constructors are only necessary when there is another constructor, but the class should still be default constructible. Differential Revision: https://developer.blender.org/D10911
2021-04-06BLI: return pointer to added resourceJacques Lucke
Without this, the caller often has to get the pointer to the resource before adding it to the resource scope.
2021-04-05BLI: fix axis order in 'BLI_array_iter_spiral_square'Germano Cavalcante
x and y were inverted.
2021-04-01BLI: rename resource collector to resource scopeJacques Lucke
Differential Revision: https://developer.blender.org/D10857
2021-04-01Curve: Remove 'CU_2D' flag used for nurbsGermano Cavalcante
This fixes T86440 As the CU_2D flag is set for nurbs, a Curve can have 2D nurbs mixed with 3D. But the UI does not allow this mixing. It updates all nurbs to 2D or 3D when set. So remove this specific flag for nurbs. This may break old files, since 2D curves with mixed 3D are now set as 3D. Differential Revision: https://developer.blender.org/D10738
2021-04-01Cleanup: spellingCampbell Barton
2021-04-01BLI: add call_safe method for FunctionRefJacques Lucke
This is useful to avoid nullity checks in some places.
2021-04-01BLI: return early when copying empty arrayJacques Lucke
2021-04-01BLI_math: add orthogonalize_m#_zero_axesCampbell Barton
Expose a this function to initialize any zeroed axes to an orthogonal vector based on other non-zeroed axes. This functionality already existed for `invert_m#_m#_safe_ortho`, expose as a public function as it's useful to be able to fill in zeroed axes of transformation matrices since they may be used in matrix multiplication which would create degenerate matrices.
2021-03-30MSVC: ASAN support for VS 16.9Ray Molenkamp
This enables ASAN support when used with VS 16.9 enable as usual in cmake with the WITH_COMPILER_ASAN option, or when using make.bat just tag on `asan' to the invocation, ie: `make lite 2019 asan` MSVC: Asan support for 16.9 This enables ASAN support when used with VS 16.9 enable as usual in cmake with the WITH_COMPILER_ASAN option, or when using make.bat just tag on `asan' to the invocation, ie: `make lite 2019 asan` Differential Revision: https://developer.blender.org/D7794 Reviewed By: brecht, sergey
2021-03-29Compositor: Add Anti-Aliasing nodeHabib Gahbiche
This is an implementation of Enhanced Subpixel Morphological Antialiasing (SMAA) The algorithm was proposed by: Jorge Jimenez, Jose I. Echevarria, Tiago Sousa, Diego Gutierrez This node provides only SMAA 1x mode, so the operation will be done with no spatial multisampling nor temporal supersampling. See Patch for comparisons. The existing AA operation seems to be used only for binary images by some other nodes. Using SMAA for binary images needs no important parameter such as "threshold", so we perhaps can switch the operation to SMAA, though that changes existing behavior. Notes: 1. The program code assumes the screen coordinates are DirectX style that the vertical direction is upside-down, so "top" and "bottom" actually represent bottom and top, respectively. Thanks for Habib Gahbiche (zazizizou) to polish and finalize this patch. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D2411
2021-03-26CMake: add headers to source lists, sort file-listsCampbell Barton
2021-03-25BLI: simplify using DefaultHashJacques Lucke
2021-03-25BLI: fix Set.lookup_key_or_addJacques Lucke
2021-03-24Fix T86891: only sort query results for shortest string if there is a queryDirk
Differential Revision: https://developer.blender.org/D10802
2021-03-24Cleanup: remove stdio.h header from MEM_guardedalloc.hCampbell Barton
This was included for `FILE *` which isn't used in the header. Ref D10799
2021-03-23Cleanup: use BLI_assert_unreachable in some placesJacques Lucke
2021-03-23BLI: add macro to indicate unreachable codeJacques Lucke
This adds a `BLI_assert_unreachable()` macro, that should be used instead of `BLI_assert(false)` in many places. * `BLI_assert_unreachable` provides more information than `BLI_assert(false)` to people reading the code. * `BLI_assert_unreachable` will print an error to `stderr` in a release build. This makes it more likely that we will get bug reports when the assumptions of a developer were wrong. Differential Revision: https://developer.blender.org/D10780
2021-03-23Nodes: Add Refract and Faceforward functions to Vector Maths nodesCharlie Jolly
Cycles, Eevee, OSL, Geo, Attribute Based on outdated refract patch D6619 by @cubic_sloth `refract` and `faceforward` are standard functions in GLSL, OSL and Godot shader languages. Adding these functions provides Blender shader artists access to these standard functions. Reviewed By: brecht Differential Revision: https://developer.blender.org/D10622
2021-03-23Cleanup: single quotes for Python enums, spellingCampbell Barton