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-11-05prepare for unity buildsJacques Lucke
2021-11-04Cleanup: Move object.c to C++Germano Cavalcante
This is useful to allow the use of features made in C++. Differential Revision: https://developer.blender.org/D13115
2021-11-04Fix T92799: handle undefined node group type in field inferencingJacques Lucke
A group node could reference an undefined group when the group was linked and its source file was not found on load. The field inferencing code did not handle that case before. With this change, the file provided in T92799 loads successfully.
2021-11-04Fix T92649: incorrect copying of anonymous attributes in many placesJacques Lucke
Many modifiers and other places use `CustomData_copy_data` to copy data between different meshes. This function assumes that assumes that the source and destination `CustomData` objects are "compatible" in some way. Usually modifiers use `CustomData_copy` to create a compatible new `CustomData` on the new mesh. The issue was that the optimization I added for anonymous attributes broke this compatibility. It avoided copying some attributes when they are no longer used. This lead to attributes being copied incorrectly. D13083 contains ideas for how this could be fixed more generally. For now I just removed the optimization. Differential Revision: https://developer.blender.org/D13083
2021-11-03Fix T92780: Lost material in case of local object, and missing linked obdata.Bastien Montagne
By default, when syncing materials slots between object and its obdata, the amount of slots in obdata is the reference. Missing linked obdata is replaced by an empty placeholder that has no material. In that specific case, if we have a valid object ID, we want to update the (placeholder) obdata's material count from the object one, and not the other way around.
2021-11-03Simplification: Use generic `BKE_object_materials_test` in object liblink code.Bastien Montagne
Better avoid own specific logic here, when we already have a proper 'API' function for that.
2021-11-03Fix T89709: avoid double node links after delete and reconnectColin
Differential Revision: https://developer.blender.org/D13062
2021-11-03Fix access to current preferences when version patching read preferencesJulian Eisel
The version patch for 0cf9794c7ef0 was checking and setting a data name using the macros for translation. These would access the current preferences which can mismatch the ones currently being version patched. See discussion in 0cf9794c7ef0 for details. Don't handle translation in this version patch, which is more of a "nice-to-have" version patch, no functionality depends on it.
2021-11-03Fix: make sure geometry owns mesh before taking ownershipJacques Lucke
Differential Revision: https://developer.blender.org/D13075
2021-11-03Cleanup: spellingCampbell Barton
2021-11-02Cleanup: Improve curve point attribute assertHans Goudey
This properly checks the order of point domain attributes on each spline, and avoids the map, which makes the code easier to understand. The assert is also added to realizing instances and the join node. Differential Revision: https://developer.blender.org/D13071
2021-11-02Fix T92652: Joining curves breaks point attribute orderHans Goudey
Currently the curve to mesh node relies on the order of attributes being the same on every spline. This is a worthwhile assumption, because it will allow removing the attribute name storage duplication on every spline in the future. However, the join geometry node broke this order, since it just created new attributes without any regard to the order. To fix this, I added a "reorder" step after all the merged attributes have been created, the types have been joined, etc. It should be possible to change this code so that the attributes are added with the right order in the first place, but I would like to do that after refactoring spline attribute storage, and not for 3.0. Differential Revision: https://developer.blender.org/D13074
2021-11-02Cleanup: Add function to get attribute ID from custom data layerHans Goudey
2021-11-02Images: refactor how failed image load attempts are rememberedJacques Lucke
Previously, `ImageTile->ok` and `ImageUser->ok` were used to indicate whether an image failed to load. There were three possible values which (probably) had the following meanings: * `0`: There was an error while loading the image. Don't try to load again. * `1`: Default value. Try to load the image. * `2`: The image was loaded successfully. This image-wide flag did not make sense unfortunately, because loading may work for some frames of an image sequence but not for others. Remember than an image data block can also contain a movie. The purpose of the `->ok` flag was to serve as an optimization to avoid trying to load a file over and over again when there is an error (e.g. the file does not exist or is invalid). To get the optimization back, the patch is changing `MovieCache` so that it can also cache failed load attempts. As a consequence, `ibuf` is allowed to be `NULL` in a few more places. I added the appropriate null checks. This also solves issues when image sequences are used with the Image Texture node in Geometry nodes (also see D12827). Differential Revision: https://developer.blender.org/D12957
2021-11-01Fix T92662: Curve to mesh start cap invalid topologyHans Goudey
rBbe3e09ecec5372f switched the order for vertices referenced by the start cap's corners, but it failed to account for the offset necessary for edge indices, since the order changed.
2021-11-01Fix crash when "HOME" environment variable isn't definedCampbell Barton
Accessing the default directory in the file selector would crash if HOME was undefined. Add BKE_appdir_folder_default_or_root which never returns NULL.
2021-10-29Geometry Nodes: do cache invalidation after writing attributesJacques Lucke
This is a better and more general fix for T92511 and T92508 than the ones that I committed before. Previously, we tagged caches dirty when first accessing attributes. This led to incorrect caches when under some circumstances. Now cache invalidation is part of `OutputAttribute.save()`. A nice side benefit of this change is that it may make things more efficient in some cases, because we don't invalidate caches when they don't have to be invalidated. Differential Revision: https://developer.blender.org/D13009
2021-10-29Fix T92552: Spline evaluation with all points at the originHans Goudey
In this case, the uniform index sampling loop would fail to assign any data to the samples, so fill the rest with the largest value possible, corresponding to the end of the spline. Animation Nodes has the same fix for this case.
2021-10-28Fix (unreported) potential issue in new `BKE_libblock_relink_to_newid_new`Bastien Montagne
Remapping code could call collection resync code while processing remapping, which is a good way to crash by accessing no-more-valid pointers. Similar issue as with liboverrides resync, fixed the same way by preventing any collection resync until whole remapping has been done. This was probably not an issue in practice in current code, since this is only used by append code currently, which should not affect layers/collections in current scene yet.
2021-10-27Fix T92264: incorrect field inferencing when muting link between reroutesJacques Lucke
Previously, muted links were just ignored considered by field inferencing. Now muted links behave like normal links in the inferencing process.
2021-10-27Fix T92328: crash during field inferencing when there is a link cycleJacques Lucke
The toposort did not handle link cycles which it should.
2021-10-27Fix: missing cache invalidation when there is only one splineJacques Lucke
This fixes T92511, but there is still the more general problem described in T92508.
2021-10-27Cleanup: Rename `scene.c`'s `FOREACHID_PROCESS` macro to ↵Bastien Montagne
`FOREACHID_PROCESS_IDSUPER`. Follow-up of rBf11ed418e5fa.
2021-10-27Cleanup: clang-format, clang-tidy, spellingCampbell Barton
2021-10-27Revert "Revert "Eevee: support accessing custom mesh attributes""Germano Cavalcante
This reverts commit e7fedf6dba5fe2ec39260943361915a6b2b8270a. And also fix a compilation issue on windows. Differential Revision: https://developer.blender.org/D12969
2021-10-26Revert "Eevee: support accessing custom mesh attributes"Ray Molenkamp
This reverts commit 03013d19d16704672f9db93bc62547651b6a5cb8. This commit broke the windows build pretty badly and I don't feel confident landing the fix for this without review. Will post a possible fix in D12969 and we'll take it from there.
2021-10-26Geometry Nodes: Get and set nodes for ID attributeHans Goudey
These nodes allow accessing and changing the stable/random ID used for motion blur with instances and stable randomness. Since rB40c3b8836b7a, the stable ID is a built-in attribute, so to be consistent and allow changing it in the node tree like other built-in attributes, it has get and set nodes.
2021-10-26Assets: Rename "Default" asset library to "User Library"Julian Eisel
Feedback was that "Default" is a bit of a weird name, so switching it to "User Library". Added versioning code which won't be entirely bullet proof (e.g. will also rename libraries named "Default" by the user), but it doesn't have to be. Addresses T90298.
2021-10-26Geometry Nodes: geometry component type warning systemJacques Lucke
Previously, every node had to create warnings for unsupported input geometry manually. Now this is automated. Nodes just have to specify the geometry types they support in the node declaration. Differential Revision: https://developer.blender.org/D12899
2021-10-26Fix: Inverted normal for one curve to mesh capHans Goudey
2021-10-26Geometry Nodes: Only create instance IDs when they existHans Goudey
Instance IDs serve no purpose for rendering when they aren't stable from one frame to the next, and if the index is used in the end anyway, there is no point in storing a vector of IDs and copying it around. This commit exposes the `id` attribute on the instances component, makes it optional-- only generated by default with the distribute points on faces node. Since the string to curves node only added the index as each instance's ID, I removed it. This means that it would be necessary to add the ID data manually if the initial index actually helps (when deleting only certain characters, for example). Differential Revision: https://developer.blender.org/D12980
2021-10-26Eevee: support accessing custom mesh attributesKévin Dietrich
This adds generic attribute rendering support for meshes for Eevee and Workbench. Each attribute is stored inside of the `MeshBufferList` as a separate VBO, with a maximum of `GPU_MAX_ATTR` VBOs for consistency with the GPU shader compilation code. Since `DRW_MeshCDMask` is not general enough, attribute requests are stored in new `DRW_AttributeRequest` structures inside of a convenient `DRW_MeshAttributes` structure. The latter is used in a similar manner as `DRW_MeshCDMask`, with the `MeshBatchCache` keeping track of needed, used, and used-over-time attributes. Again, `GPU_MAX_ATTR` is used in `DRW_MeshAttributes` to prevent too many attributes being used. To ensure thread-safety when updating the used attributes list, a mutex is added to the Mesh runtime. This mutex will also be used in the future for other things when other part of the rendre pre-processing are multi-threaded. `GPU_BATCH_VBO_MAX_LEN` was increased to 16 in order to accommodate for this design. Since `CD_PROP_COLOR` are a valid attribute type, sculpt vertex colors are now handled using this system to avoid to complicate things. In the future regular vertex colors will also use this. From this change, bit operations for DRW_MeshCDMask are now using uint32_t (to match the representation now used by the compiler). Due to the difference in behavior for implicit type conversion for scalar types between OpenGL and what users expect (a scalar `s` is converted to `vec4(s, 0, 0, 1)` by OpenGL, vs. `vec4(s, s, s, 1)` in Blender's various node graphs) , all scalar types are using a float3 internally for now, which increases memory usage. This will be resolved during or after the EEVEE rewrite as properly handling this involves much deeper changes. Ref T85075 Reviewed By: fclem Maniphest Tasks: T85075 Differential Revision: https://developer.blender.org/D12969
2021-10-26Geometry Nodes: Handle multiple grids in the volume to mesh nodeHans Goudey
In future use cases, a volume can contain many grids that represent the density information. In this case, it's better if the volume to mesh node creates a mesh based on all of the grids in the volume. This is also a benefit to share-ability, since one doesn't have to specify the grid name in the node. Instead, in the future we can have a way to split particular grids into separate volumes, if only one grid should be considered. The code changes are relatively simple: - Move the old volume to mesh node to the legacy folder. - Run the volume to mesh node on all instance geometry, like elsewhere. - Make the blenkernel's volume to mesh API a bit more specific. Differential Revision: https://developer.blender.org/D12997
2021-10-26Cleanup: clang-formatBrecht Van Lommel
2021-10-26Geometry Nodes: remove reference to anonymous attributes in tooltipsJacques Lucke
This changes socket inspection for fields according to T91881. Differential Revision: https://developer.blender.org/D13006
2021-10-26Cleanup: LibQuery: Rename `BKE_LIB_FOREACHID_PROCESS` to ↵Bastien Montagne
`BKE_LIB_FOREACHID_PROCESS_IDSUPER`. More in-line name with the rest of that macro-based API, especially since this will be extended in the future.
2021-10-26Cleanup: `else` after `continue`.Bastien Montagne
2021-10-26Fix crash in liboverride/pointcache handling code after recent changes.Bastien Montagne
In some cases code would try to access NULL pointer. Reported by @dfelinto, thanks.
2021-10-26Cleanup: build warnings.Bastien Montagne
`NULL` instead of `nullptr` in cpp code, and `else` statements after returns.
2021-10-25Assets: Snapping with visual feedback while draggingGermano Cavalcante
The drag and drop feature of objects in 3D View has been modified to include: - Snap the object being dragged. - Visual feedback through a box and the placement tool grid. Maniphest Tasks: T90198 Differential Revision: https://developer.blender.org/D12912
2021-10-25Geometry Nodes: Add "Fill Caps" option to curve to mesh nodeHans Goudey
This adds an option to fill the ends of the generated mesh for each spline combination with an N-gon. The resulting mesh is manifold, so it can be used for operations like Boolean. Differential Revision: https://developer.blender.org/D12982
2021-10-25Tests: assets, add BKE callback init/finalize to test setup/teardownSybren A. Stüvel
Add calls to `BKE_callback_global_init()` and `BKE_callback_global_finalize()` to ensure unit tests mimick Blender (and don't trip the assertions added in rBbeea601e7253). No functional changes to Blender.
2021-10-25Assets: Add Author field to asset metadataJulian Eisel
This is information you'd typically want to be visible in the UI. It's optional of course, so if not relevant, it can just remain unset.
2021-10-25Assets/IDs: Don't generate previews for object types with no real geometryJulian Eisel
Object types like empties, cameras or lamps will just end up as empty preview images. We can think about ways to visualize them still, but meanwhile, don't create such an empty preview. Differential Revision: https://developer.blender.org/D10334 Reviewed by: Bastien Montagne, Sybren Stüvel
2021-10-25Geometry Nodes: new Image Texture nodeJacques Lucke
This adds a new image texture node for geometry nodes. It does not reuse the same node that is used in shading, because we want to be able to expose the image and frame as sockets. There is a known update issue when a movie or image sequence is used. That will be fixed separately (also see D12957). Currently, the image socket is just a pointer to an Image ID data block. This can contain single images but also movies and image sequences. In the future, the definition of an image socket can be expanded to include images that are generated from scratch in the node tree. For more details read the discussion in D12827. Some of the code is a direct port from cycles and should be cleaned up a bit in the future. For example `image_cubic_texture_lookup`. For still images, the frame input is ignored. Otherwise, the frame has to be in a valid range for the node to work. In the future we may add e.g. automatic looping functionality. Differential Revision: https://developer.blender.org/D12827
2021-10-25Asset Catalogs: be more accepting of backslashes as separatorsSybren A. Stüvel
Asset Catalog Paths should only contain forward slashes as separators, but now the UI is more resilient to people using blackslashes instead. Manifest Task: T90553
2021-10-25Cleanup: asset catalog path test, improve sub-test separationSybren A. Stüvel
Put related lines in a block of their own, such that each block doesn't have access to the variables of the previous blocks. This makes it easier to correctly copy-paste some tests, as the compiler forces you to update the code afterwards.
2021-10-25BKE Callbacks: more explicit initialisation checkSybren A. Stüvel
Add static boolean to track whether the callbacks system has been initialised. This makes it possible to make the `BKE_callback_remove()` function more noisy in case of programming errors, and avoids accessing `funcstore->alloc` when `funcstore` was potentially already freed. Thanks @campbellbarton for pointing this out.
2021-10-25Image: Fix Crash During Undo.Jeroen Bakker
Fixes T91294.
2021-10-24Cleanup: spelling in commentsCampbell Barton