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
path: root/source
AgeCommit message (Collapse)Author
2021-12-22Fix T93799: Outliner: Remaping objects could result in duplicates in a ↵Bastien Montagne
collection. Fix is similar to how CollectionObject with NULL object pointers are handled. Using one of the 'free' pad bytes in Object_Runtime struct instead of a gset (or other external way to detect object duplicates), as this is several times faster. NOTE: This makes remapping slightly slower again (adds 10 extra seconds to file case in T94059). General improvements of remapping time complexity, especially when remapping a lot of IDs at once, is a separate topic currently investigated in D13615.
2021-12-22Fix part of T93799: Outliner: Remap Users crash (for `ID Type` `Object`).Bastien Montagne
This commit fixes the crash itself, however this can still lead to a same collection 'owning' the same object several time. Issue here was a bad assumption in layer resync code, that would lead to removing valid objects from the viewlayer's `object_bases_hash` in `BKE_layer_collection_sync`, when deleting no-more-used bases, in case of bases duplicate.
2021-12-22Fix: Build issue on 32 bit archsRay Molenkamp
The cast to size_t leads to a build issue on 32 bit archs. cursor_delim_type_utf8 expects an int so an additional cast to size_t is not required. Reported by user frispete on devtalk.
2021-12-22Fix T93999: GPencil Box tool allows decreasing subdiv, but not increaseAntonio Vazquez
The problem was the number of points for each edge of the box was wrong and the wheelmouse effect was anulated. Also fixed the value displayed in the status bar to keep consistency with subdivision value. Reviewed By: lichtwerk Maniphest Tasks: T93999 Differential Revision: https://developer.blender.org/D1363
2021-12-22Nodes: Improve node tree copy performanceHans Goudey
When copying a full node tree, we can avoid an O(n^2) loop finding a unique name for every node if we assume they already have unique names. That is a reasonable assumption, since unique names are verified elsewhere when adding a new node. Copying a node tree with about 4000 nodes took 42 ms before, now it takes 6 ms. Differential Revision: https://developer.blender.org/D13644
2021-12-22Nodes: Refactor to remove node and socket "new" pointersHans Goudey
These pointers point to the new nodes when duplicating, and their even used to point to "original" nodes for "localized" trees. They're just a bad design decision that make code confusing and buggy. Instead, node copy functions now optionally add to a map of old to new socket pointers. The case where the compositor abused these pointers as "original" pointers are handled by looking up the string node names. Differential Revision: https://developer.blender.org/D13518
2021-12-22Geometry Nodes: improve multi socket handling in evaluatorJacques Lucke
Previously, the values passed to a multi-input socket were stored in the order that they arrived in. Then, when the values are accessed, they are sorted depending on the link order. Now, the ordering is determined in the beginning before execution starts. Every value is assigned to the right index directly, avoiding the sort in the end. This makes the ordering more explicit.
2021-12-21Cleanup: Clang tidy, restore alphabetical sortingHans Goudey
2021-12-21Fix T94191: correct (time) translation headers not showing DeltaXGermano Cavalcante
Caused by {rBb0d9e6797fb8} For the header (both Graph Editor case in general `headerTranslation` as well as `headerTimeTranslate`) we are interested in deltas values (not absolute values). Since culprit commit, `snapFrameTransform` was not working with deltas anymore, but we have to compensate for this. For the Graph Editor, this only worked "by accident" in rB7192e57d63a5, since `ival` is still zero at this point. So now, reacquire the delta right after the snap operation. Also use a more appropriate center value in the translate operator. Maniphest Tasks: T94191 Differential Revision: https://developer.blender.org/D13641
2021-12-21Cleanup: use BKE_pose_is_layer_visible in more placesPhilipp Oeser
This was added in rBd13970de8627, now use in more places.
2021-12-21Nodes: Improve performance when freeing a node treeHans Goudey
This commit makes freeing a node tree about 25 to 30 times faster. Freeing a node tree happens whenever it is edited. Freeing a node tree with about 4000 nodes went from 30-50ms to about 2 ms. This was so slow before because for every node that was freed when freeing the node tree, `node_free_node` looped over all other nodes to detach frames, and then looped over all links to remove any links connected to the node. That was all pointless work because everything else is about to be freed anyway. Instead, move that "detaching" behavior to the dedicated function for removing a single node, and to the "local" version of the free function to be safe, since I know less about what that version expects. Differential Revision: https://developer.blender.org/D13636
2021-12-21Fix T93960: Asset Catalogs I/O fails with unicode file paths on WindowsSybren A. Stüvel
On Windows, encode file paths as UTF-16 before trying to open the file for reading/writing. This introduces a new class `blender::fstream`, which wraps `std::fstream` and provides this UTF-16 encoding. This class should also be used in other areas, like the Alembic importer/exporter. Manifest Task: T93960 Reviewed By: JacquesLucke Differential Revision: https://developer.blender.org/D13633
2021-12-21Assets: log message when catalog definitions cannot be loadedSybren A. Stüvel
Log a message (via `CLOG`) when asset catalog definitions cannot be loaded. Reviewed by @jacqueslucke in D13633
2021-12-21Nodes: refactor node tree update handlingJacques Lucke
Goals of this refactor: * More unified approach to updating everything that needs to be updated after a change in a node tree. * The updates should happen in the correct order and quadratic or worse algorithms should be avoided. * Improve detection of changes to the output to avoid tagging the depsgraph when it's not necessary. * Move towards a more declarative style of defining nodes by having a more centralized update procedure. The refactor consists of two main parts: * Node tree tagging and update refactor. * Generally, when changes are done to a node tree, it is tagged dirty until a global update function is called that updates everything in the correct order. * The tagging is more fine-grained compared to before, to allow for more precise depsgraph update tagging. * Depsgraph changes. * The shading specific depsgraph node for node trees as been removed. * Instead, there is a new `NTREE_OUTPUT` depsgrap node, which is only tagged when the output of the node tree changed (e.g. the Group Output or Material Output node). * The copy-on-write relation from node trees to the data block they are embedded in is now non-flushing. This avoids e.g. triggering a material update after the shader node tree changed in unrelated ways. Instead the material has a flushing relation to the new `NTREE_OUTPUT` node now. * The depsgraph no longer reports data block changes through to cycles through `Depsgraph.updates` when only the node tree changed in ways that do not affect the output. Avoiding unnecessary updates seems to work well for geometry nodes and cycles. The situation is a bit worse when there are drivers on the node tree, but that could potentially be improved separately in the future. Avoiding updates in eevee and the compositor is more tricky, but also less urgent. * Eevee updates are triggered by calling `DRW_notify_view_update` in `ED_render_view3d_update` indirectly from `DEG_editors_update`. * Compositor updates are triggered by `ED_node_composite_job` in `node_area_refresh`. This is triggered by calling `ED_area_tag_refresh` in `node_area_listener`. Removing updates always has the risk of breaking some dependency that no one was aware of. It's not unlikely that this will happen here as well. Adding back missing updates should be quite a bit easier than getting rid of unnecessary updates though. Differential Revision: https://developer.blender.org/D13246
2021-12-21Cleanup: clang formatPhilipp Oeser
Missed in rB7c9e4099854a, sorry.
2021-12-21Fix T92930: Outliner "Show Active" bone fails in certain situationsPhilipp Oeser
Outliner would frame the armature object instead of the bone if the bone was on a hidden armature layer. Similar to issues reported in e.g. T58068 and T80464, this is due to the fact that `BKE_pose_channel_active` always checks for the armature layer (and returns NULL if a bone is not on a visible armature layer). Now propose to make this layer check **optional** (and e.g. from the Outliner be more permissive). This also introduces `BKE_pose_channel_active_if_layer_visible` which just wraps `BKE_pose_channel_active` with the check being ON. Maniphest Tasks: T92930 Differential Revision: https://developer.blender.org/D13154
2021-12-21Tests: initialise BKE callbacks before loading blend fileSybren A. Stüvel
Initialise the BKE callback system in `BlendfileLoadingBaseTest::SetUpTestCase()`. This allows certain tests to run in debug mode (when `BLI_assert` is enabled).
2021-12-21Fix T93757: Do not force-instantiate indrectly linked objects in linking case.Bastien Montagne
2021-12-21Fix T93839: Copy/Paste of empty instantiating a collection.Bastien Montagne
Do not also instantiate a collection in the view layer, if it is already instantiated through an empty object.
2021-12-21Fix build error in debug builds from recent commitHans Goudey
r7acd3ad7d8e58b913c5 converted a pointer to a reference, but an assert still compares the variable to a pointer.
2021-12-21Fix T94280: Crash when splitting meta stripRichard Antalik
This happens because in `SEQ_time_update_sequence` function `SEQ_get_meta_by_seqbase` returns uninitialized value. This isn't nice, but it shouldn't happen in first place. Problem is, that `SEQ_edit_strip_split` does move strips into detached `ListBase`, so other functions can't see them anymore. Detached `ListBase` is used solely to preserve relationships during duplication. Move strips to original `ListBase` immediately after duplication and return `NULL` if `SEQ_get_meta_by_seqbase` can't find meta strip. Splitting itself can still rely on fact, that number of original and duplicated strips is same and they are placed next to each other in exactly same order at the end of original `ListBase`.
2021-12-21Cleanup: Use span instead of raw pointerHans Goudey
This is a followup to the previous commit.
2021-12-21Cleanup: Use simpler loops in weld modifierHans Goudey
In this commit I changed many loops to range-based for loops. I also removed some of the redundant iterator variables, using indexing inside the loop instead. Generally an optimizing compiler should have no problem doing the smartest thing in that situation, and this way makes it much easier to tell where data is coming from. I only changed the loops I was confident about, so there is still more that could be done in the future. Differential Revision: https://developer.blender.org/D13637
2021-12-20Fix T94262: Grease Pencil Blur Effect DoF mode wrongPhilipp Oeser
This was visible outside of camera view and was not respecting the "Depth of Field" checkbox on the Camera properties. Now return early if DoF should not be visible. Maniphest Tasks: T94262 Differential Revision: https://developer.blender.org/D13631
2021-12-20Run clang-formatJoseph Eagar
2021-12-20Sculpt: split sculpt.c into three filesJoseph Eagar
Sculpt.c is now three files: * Sculpt.c: main API methods and the brush stroke operator * Sculpt_brushes.c: Code for individual brushes. * Sculpt_ops.c: Sculpt operators other than the brush stroke operator. TODO: split brush stroke operator into a new file (sculpt_stroke.c?).
2021-12-20Fix T94144: Duplicate edges in dual mesh nodeWannes Malfait
The duplicated edges were caused by 'oversubdivided' edges, i.e. edges where some of the vertices on them are only connected to two polygons. The fix finds these vertices and 'dissolves' them so that only one edge is created. For most 'normal' meshes this shouldn't occurr, or only very little, so the performance impact of this change should be neglegible. In practice this is also avoidable by triangulating the mesh first. Differential Revision: https://developer.blender.org/D13445
2021-12-20Cleanup: Remove mesh valid assertions in debug buildsHans Goudey
These are useful for development, but when the primitive nodes aren't actively changing, the performance cost is not worth it.
2021-12-20Fix: Incorrect assert conditions in NURBSplinePiotr Makal
This fix provides better conditions for asserts in `NURBSpline::knots` method accounting for cyclic NURBS curves. Differential Revision: https://developer.blender.org/D13620
2021-12-20Cleanup: Remove unused node type flagHans Goudey
This flag was checked, but not set anywhere.
2021-12-20Cleanup: Comment formatting in node.ccHans Goudey
Also remove a SCOPED_TIMER I added by mistake in a previous commit.
2021-12-20Geometry Nodes: Parallelize mesh grid primitiveHans Goudey
On a Ryzen 3700x, this ended up 2.5x faster than before. More benchmarking details are included in the differential revision. For smaller grids, all this should do is increase the code size a bit, and add a few more if statements. Differential Revision: https://developer.blender.org/D13617
2021-12-20Cleanup: Remove unused argumentsHans Goudey
2021-12-20BLI: fix Vector.prepend declarationJacques Lucke
Using `&&` there was a typo. With `&&` the `prepend` method could not be called with a const reference as argument.
2021-12-20Fix T93570: VSE image transforms in preview dont autokeyPhilipp Oeser
This was basically not implemented, do this via `ED_autokeyframe_property` in a new dedicated function in special_aftertrans_update. Maniphest Tasks: T93570 Differential Revision: https://developer.blender.org/D13608
2021-12-20Docs: use doxygen formatting for BLICampbell Barton
Differentiate doc-strings from title/section text.
2021-12-20Docs: use doxygen formatting for DNACampbell Barton
Differentiate doc-strings from title/section text. Also use explicit doxygen references to struct members so it's not ambiguous which member is being referenced. Note that these changes aren't complete (some files weren't touched).
2021-12-20Docs: minor correction to doc-stringCampbell Barton
The text editor no longer accumulates changes.
2021-12-20Fix T94254: Crash using view_all operator in VSERichard Antalik
Caused by `NULL` dereference in `SEQ_meta_stack_active_get()`. Check if `Editing` is `NULL` before accessing meta stack.
2021-12-20Fix: Meta strip not created with alpha over blend modeRichard Antalik
Meta add function wasn't updated. All strips now use alpha over blending, so set it in `SEQ_sequence_alloc()`.
2021-12-20Cleanup: Remove more texture nodes preview handlingHans Goudey
Similar to the previous commit, this allowed removing a function to set a single pixel of a node preview.
2021-12-20VSE: Clamp sound strip when adding movie stripRichard Antalik
When adding multiple movie strips and sound stream is longer than video, this results in gaps between video strips, which is undesirable.
2021-12-20Cleanup: Remove more no-op node preview codeHans Goudey
This is a follow-up to rB43875e8dd1d76ee, removing some processing of non-existent node previews in the shader and texture nodes systems.
2021-12-20Cleanup: Const arguments, remove unused argumentHans Goudey
2021-12-19Cleanup: Clang tidy lamda function nameHans Goudey
2021-12-18Cleanup: Move weld modifier to C++Hans Goudey
This moves `MOD_weld.cc` to C++, fixing compiler warnings coming from the change. It also goes a little bit further and converts the code to use C++ data structures: `Span`, `Array`, and `Vector`. This makes the code more shorter and easier to reason about, and makes memory maneagement more automatic. Differential Revision: https://developer.blender.org/D13618
2021-12-18Fix: Build error from missing includeHans Goudey
2021-12-18Fix: Link drag search missing field nodes from function nodesHans Goudey
When dragging from the inputs of function nodes, other function nodes wouldn't connect, because their socket declaration field types weren't set correctly. Instead, they relied on code properly checking the *node* declaration's `is_function_node()` method. However, that increases complexity and requires passing the node instead of just the socket in more places. Instead, set the proper field types in the socket declaration during building. Differential Revision: https://developer.blender.org/D13600
2021-12-18Fix T94173: Missing update for frame node sizeHans Goudey
Before d56bbfea7b420d7, nodes were updated (size calculated and buttons added) in reverse order. Instead, now calculate the size of frame nodes after all other nodes. Separating the drawing further may be a good step to removing the O(n^2) loop later on.
2021-12-18Cleanup: compiler warnings with clangBrecht Van Lommel
Includes use of memcpy to avoid warnings about deprecated members.