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-12-08Cleanup: Clang-Tidy modernize-redundant-void-argAaron Carlisle
2021-12-08Cleanup: spelling in commentsCampbell Barton
2021-12-07Cleanup: Extend a few comments in BKE_spline.hhHans Goudey
2021-12-07Docs: Add more comments to geometry set headerHans Goudey
This adds a bit more information to `GeometrySet` and each of the geometry components. There is probably still more that can be written, but this includes the most important information that I could think of. I'd like to include some more general information about the attribute API in a separate patch. Differential Revision: https://developer.blender.org/D13501
2021-12-07Geometry Nodes: Edge Neighbors NodeJohnny Matthews
Creates a new Edge Neighbors node which outputs a field containing the number of faces connected to each edge. Differential Revision: https://developer.blender.org/D13493
2021-12-07Geometry Nodes: new Geometry to Instance nodeJacques Lucke
This adds a new Geometry to Instance node that turns every connected input geometry into an instance. Those instances can for example be used in the Instance on Points node. Differential Revision: https://developer.blender.org/D13500
2021-12-07Geometry Nodes: move type conversions to blenkernelJacques Lucke
The type conversions do not depend on other files in the nodes module. Furthermore we want to use the conversions in the geometry module without creating a dependency to the nodes module there.
2021-12-07Cleanup: Add macro and functions for node storageHans Goudey
The `node_storage` functions to retrieve const and mutable structs from a node are generated by a short macro that can be placed at the top of each relevant file. I use this in D8286 to make code snippets in the socket declarations much shorter, but I thought it would be good to use it consistently everywhere else too. The functions are also useful to avoid copy and paste errors, like the one corrected in the cylinder node in this commit. Differential Revision: https://developer.blender.org/D13491
2021-12-07Revert moving all shader nodes to c++Jacques Lucke
This reverts to following commits: * rB5cad004d716da02f511bd34983ac7da820308676 * rB97e3a2d935ba9b21b127eda7ca104d4bcf4e48bd * rBf60b95b5320f8d6abe6a629fe8fc4f1b94d0d91c * rB0bd3cad04edf4bf9b9d3b1353f955534aa5e6740 * rBf72cc47d8edf849af98e196f721022bacf86a5e7 * rB3f7014ecc9d523997062eadd62888af5fc70a2b6 * rB0578921063fbb081239439062215f2538a31af4b * rBc20098e6ec6adee874a12e510aa4a56d89f92838 * rBd5efda72f501ad95679d7ac554086a1fb18c1ac0 The original move to c++ that the other commits depended upon had some issues that should be fixed before committing it again. The issues were reported in T93797, T93809 and T93798. We should also find a better rule for not using c-style casts going forward, although that wouldn't have been reason enough to revert the commits. Introducing something like a `MEM_new<T>` and `MEM_delete<T>` function might help with the the most common case of casting the return type of `MEM_malloc`. Going forward, I recommend first committing the changes that don't require converting files to c++. Then convert the shading node files in smaller chunks. Especially don't mix fairly low risk changes like moving some simple nodes, with higher risk changes.
2021-12-07Cleanup: note that functions in BKE_node.h aren't part of blenkernelCampbell Barton
2021-12-07Cleanup: remove BKE_ptcache_removeCampbell Barton
No longer needed as the temporary directory is cleared on exit.
2021-12-07Cleanup: clarify source/destination args for BKE_spacedata_copylistCampbell Barton
2021-12-07Cleanup: remove incorrect/unhelpful commentsCampbell Barton
2021-12-07Cleanup: replace int with bool typeCampbell Barton
2021-12-07Cleanup: move public doc-strings into headers for 'blenkernel'Campbell Barton
- Added space below non doc-string comments to make it clear these aren't comments for the symbols directly below them. - Use doxy sections for some headers. - Minor improvements to doc-strings. Ref T92709
2021-12-07Cleanup: Fix various source typosluzpaz
This is a continuation of D13462 to clean up source typos. Differential Revision: https://developer.blender.org/D13471
2021-12-07Cleanup: Remove unused includesHans Goudey
2021-12-06Shader Nodes: Split each node into own fileAaron Carlisle
This improves both code finding, for example "color ramp" now has its own file. And now each node has its own namespace so function names can be simplified similar to rBfab39440e94 This commit also makes all file names use snake case instead of camel case. Reviewed By: HooglyBoogly Differential Revision: https://developer.blender.org/D13482
2021-12-06Geometry Nodes: reduce code duplication with new GeometyrFieldInputJacques Lucke
Most of our field inputs are currently specific to geometry. This patch introduces a new `GeometryFieldInput` that reduces the overhead of adding new geometry field input. Differential Revision: https://developer.blender.org/D13489
2021-12-06Geometry Nodes: 4 Field Inputs for Mesh Topology DataJohnny Matthews
Creates 4 new nodes which provide topology information for the mesh. Values are interpolated from the primary domain in each case using basic attribute interpolation. Vertex Neighbors - Vertex Count - Face Count Face Neighbors - Vertex Count - Neighboring Face Count Edge Vertices - Vertex Index 1 - Vertex Index 2 - Position 1 - Position 2 Face Area - Face Area Differential Revision: https://developer.blender.org/D13343
2021-12-06Cleanup: remove unnecessary extern template implementationsJacques Lucke
This technique isn't really necessary anymore, because unity builds avoid instantiating the same template too many times already.
2021-12-06Fix T93707: Dragging the tweaked NLA strip causes crashSybren A. Stüvel
Earlier code assumed that the active strip was on the active track. This commit detects when this assumption doesn't hold, and adds a more thorough search of the active strip.
2021-12-06Cleanup: remove some temp dev asserts in new link/append code.Bastien Montagne
No longer needed now that all code uses that new BKE_blendfile_link_append module, and that instantiation code in BLO_readfile has been removed.
2021-12-06Cleanup: Remove unused next and prev pointers in bNodeTypeHans Goudey
2021-12-06Cleanup: Remove unnecesary node type draw callbackHans Goudey
As a followup to 338c1060d5d7, apply the same change to the node drawing callback. This helps to simplify code when the complexity of a callback isn't necessary right now.
2021-12-06Cleanup: Remove unnecessary node type callbacks for drawingHans Goudey
Currently there are a few callbacks on `bNodeType` that do the same thing for every node type except reroutes and frame nodes. Having a callback for basic things complicates code and makes it harder to understand, and reroutes and frames are special cases in larger way. Arguably frame nodes shouldn't even be drawn like regular nodes, given that it adds a case of O(N^2) looping through all nodes. "Unrolling" the callbacks makes it easier to see what's happening, and therefore easier to optimize. Differential Revision: https://developer.blender.org/D13463
2021-12-05Geometry Nodes: use array instead of map in GeometrySetJacques Lucke
`GeometrySet` contains at most one component of each type. Previously, a map was used to make sure that each component type only exists once. The overhead of a map (especially with inline storage) is rather large though. Since all component types are known at compile time and the number of types is low, a simple `std::array` works as well. Some benefits of using `std::array` here: * Looking up the component of a specific type is a bit faster. * The size of `GeometrySet` becomes much smaller from 192 to 40 bytes. * Debugging a `GeometrySet` in many tools becomes simpler because one can easily see which components exists and which don't
2021-12-04Cleanup: Use references in node editor, other improvementsHans Goudey
This helps to tell when a pointer is expected to be null, and avoid overly verbose code when dereferencing. This commit also includes a few other cleanups in this area: - Use const in a few places - Use `float2` instead of `float[2]` - Remove some unnecessary includes and old code The change can be continued further in the future.
2021-12-03Cleanup: Use typed enum for node resize directionHans Goudey
2021-12-03ImBuf: Made Wrapping and Cropping optional in IMB_transform.Jeroen Bakker
`IMB_transform` is used in VSE. It had a required crop parameter for cropping the source buffer. This is not always needed. In the image engine we want to use the use the `IMB_transform` with wrap repeat. Both options are mutual exclusive and due to performance reasons the wrap repeat is only available when performing a nearest interpolation.
2021-12-02Cleanup: Avoid using C++ keyword as variable nameHans Goudey
2021-12-02Fix (unreported): incorrect custom data layer createdJacques Lucke
Without this fix `CustomDataAttributes::create_by_move` did not work on named attributes.
2021-12-02Cleanup: Move public docs to BKE_spline.hh headerHans Goudey
2021-12-02Merge remote-tracking branch 'origin/blender-v3.0-release'Sybren A. Stüvel
2021-12-02Fix `Action.asset_data["is_single_frame"]` set incorrectlySybren A. Stüvel
The asset metadata custom property `["is_single_frame"]` was set incorrectly. Since this is intended for forward compatibility, including being covered by the asset metadata indexing, it's important to have it set correctly from the first release of Blender that includes the asset browser. Differential Revision: https://developer.blender.org/D13452
2021-12-02Fix: don't use `BLI_strncpy_utf8` for copying file pathsSybren A. Stüvel
File paths can be any encoding, so using some UTF-8-specific function is not the right way to go.
2021-12-02Merge branch 'blender-v3.0-release'Julian Eisel
2021-12-02Fix T93548: Appended (material) assets don't have a fake userJulian Eisel
Since our design is to always keep data-blocks marked as assets on exit, and our technical design for this is to do this via fake users, ensure the fake user is set for an appended asset. Reviewed by: Bastien Montagne Differential Revision: https://developer.blender.org/D13443
2021-12-02Blendread: Remove all instantiation logic from `BLO_library_link_` code.Bastien Montagne
Instantiation is now fully handled by BKE_blendfile_link_append module. Note that this also allows removal of the `BLO_LIBLINK_NEEDS_ID_TAG_DOIT` flag. Part of T91414: Unify link/append between WM operators and BPY context manager API, and cleanup usages of `BKE_library_make_local`.
2021-12-02Cleanup: spelling in commentsCampbell Barton
2021-12-02Cleanup: Rename curve struct fieldsHans Goudey
These existing names were unhelpful at best, actively confusing at worst. This patch renames them to be consistent with the terms used to refer to the values in the UI. - `width` -> `offset` - `ext1` -> `extrude` - `ext2` -> `bevel_radius` Differential Revision: https://developer.blender.org/D9627
2021-12-02UI: Add an option to display the node editor context pathHans Goudey
Since we have the overlays popover, it makes sense to allow toggling the context path like in the 3D viewport. This commit adds a property, and turns it on by default in existing files. Differential Revision: https://developer.blender.org/D13248
2021-12-01Cleanup: clarify material copying for hair and pointcloudsBrecht Van Lommel
No functional change, just more clear this way it comes from src.
2021-12-01Fix: Remove incorrect asserts for empty attributesHans Goudey
While it is an edge case, it isn't incorrect for the attribute storage to have a zero size, it will just return an empty span or nothing.
2021-12-01Fix: Instances component does not copy attributesHans Goudey
2021-12-01Geometry Nodes: Dual Mesh NodeWannes Malfait
This node calculates the dual of the input mesh. This means that faces get replaced with vertices and vertices with faces. In principle this only makes sense when the mesh in manifold, but there is an option to keep the (non-manifold) boundaries of the mesh intact. Attributes are propagated: - Point domain goes to face domain and vice versa - Edge domain and Face corner domain gets mapped to itself Because of the duality, when the mesh is manifold, the attributes get mapped to themselves when applying the node twice. Thanks to Leul Mulugeta (@Leul) for help with the ascii diagrams in the code comments. Note that this does not work well with some non-manifold geometry, like an edge connected to more than 2 faces, or a vertex connected to only two faces, while not being in the boundary. This is because there is no good way to define the dual at some of those points. This type of non-manifold vertices are just removed for this reason. Differential Revision: https://developer.blender.org/D12949
2021-12-01Geometry Nodes: Generalized Compare NodeJohnny Matthews
Replace compare floats node with a generalized compare node. The node allows for the comparison of float, int, string, color, and vector. The datatypes support the following operators: Float, Int: <, >, <=, >=, ==, != String: ==, != Color: ==, !=, lighter, darker (using rgb_to_grayscale value as the brightness value) Vector Supports 5 comparison modes for: ==, !=, <, >, <=, >= Average: The average of the components of the vectors are compared. Dot Product: The dot product of the vectors are compared. Direction: The angle between the vectors is compared to an angle Element-wise: The individual components of the vectors are compared. Length: The lengths of the vectors are compared. Differential Revision: https://developer.blender.org/D13228
2021-12-01Cleanup: Store instances id attribute with other attributesHans Goudey
Now that we can store any dynamic attribute on the instances component, we don't need the special case for `id`, it can just be handled by the generic attribute storage. Mostly this just allows removing a bunch of redundant code. I had to add a null check for `update_custom_data_pointers` because the instances component doesn't have any pointers to inside of custom data. Differential Revision: https://developer.blender.org/D13430
2021-12-01Fix T92561: unstable particle distribution with Alembic filesKévin Dietrich
When enabling or disabling a Mesh Sequence Cache modifier of an Object with a hair particle system, the hair would switch positions. This is caused because original coordinates in Blender are expected to be normalized, and toggling the modifier would cause the usage of different orco layers: one that is normalized, and the other which isn't. This bug exposes a few related issues: - if the Alembic file did not have orco data, `MOD_deform_mesh_eval_get`, used by the particle system modifier, would add an orco layer without normalization - `MOD_deform_mesh_eval_get` would also ignore the presence of an orco layer (e.g. one that could have been read from Alembic) - if the Alembic file did have orco data, the data would be read unnormalized To fix those various issues, original coordinates are normalized when read from Alembic and unnormalized when written to Alembic; and a new utility function `BKE_mesh_orco_ensure` is added to add a normalized orco layer if none exists on the mesh already, this function derives from the code used in the particle system. Reviewed By: brecht Maniphest Tasks: T92561 Differential Revision: https://developer.blender.org/D13306
2021-11-30LibLink/Append: Some cleanup and addition to comments.Bastien Montagne