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
2022-09-18Curves: Correct and improve Catmull Rom interpolationMattias Fredriksson
Correct interpolation of integer POD types for Catmull Rom interpolation as implemented in eaf416693dcb. **Problem description** `attribute_math::DefaultMixer<T>::mix_in()` assumes/asserts positive weights but the basis function for Catmull-Rom splines generates negative weights (see image in revision). Passing negative weights will yield correct result as sum(weights) = 1 (after multiplication by 0.5) but the assert is still triggered in debug builds. This patch adjusts the behavior by extending the mix functions with mix4(). The benefit of using mix#() over a DefaultMixer is that the result no longer needs to be divided by the weight sum, instead utilizing that the basis weight sum is constant (see plot). **Changes** * Added mix4() and updated catmull_rom::interpolate() to use it. * Removed TODOs from catmull_rom functions. * Moved mix definitions to be ordered as 2, 3, 4 in the header. **Implementation specifics** `catmull_rom::interpolate()` uses a constexpr to differentiate between POD types which multiplies the result with 0.5 after weighting the values, this reduces the number of multiplications for 1D, 2D, 3D vectors (https://godbolt.org/z/8M1z9Pxx6). While this could be considered unnecessary, I didn't want to change the original behavior as it could influence performance (did not measure performance here as this should ensure the logic is ~identical for FP types). Differential Revision: https://developer.blender.org/D15997
2022-09-18Curves: Don't allow resolutions less than 1Hans Goudey
While this worked, the result for curves with a resolution of zero was just a single evaluated point, which isn't useful or intuitive. Using the attribute validation from 8934f00ac5701ea34, make sure users can't set values 0 or less.
2022-09-18LineArt: Force intersection option.YimingWu
This option allows easier setup of intersection overrides on more complex scene structures. Setting force intersection would allow objects to always produce intersection lines even against no-intersection ones. Reviewed By: Aleš Jelovčan (frogstomp) Antonio Vazquez (antoniov) Differential Revision: https://developer.blender.org/D15978
2022-09-18Fix: Crash after recent attributes commitHans Goudey
Fixes test failures from 8934f00ac5701ea349f2b.
2022-09-18GHOST: support left/right OS-keyCampbell Barton
Handling the OS key now match other modifiers in GHOST which detect each key separately, making the behavior simpler to reason about since mapping a single key to a modifier state is simpler, avoiding handling that only applied to the OS-Key. This means simulating key up/down events can use the correct modifier. In the window-manager this is still only accessed accessed via KM_OSKEY.
2022-09-17Attributes: Validate some builtin attributes for untrusted inputsHans Goudey
We expect some builtin attributes to have positive values or values within a certain range, but currently there some cases where users can set attributes to arbitrary values: the store named attribute node, and the output attributes of the geometry nodes modifier. The set material index node also needs validation. This patch adds an `AttributeValidator` to the attribute API, which can be used to correct values from these untrusted inputs if necessary. As an alternative to D15548, this approach makes it much easier to understand when validation is being applied, without the need to add arguments to every attribute API method or complicate the virtual array system. Currently validation is provided with a multi-function. That integrates well with the field evaluations that set these values now, but it could be wrapped to be friendlier to other areas of Blender in the future. The Python API is not handled here either. Currently I would prefer to wait until we can integrate the C++ and C attribute APIs better before addressing that. Fixes T100952 Differential Revision: https://developer.blender.org/D15990
2022-09-17Fix: lite build on windowsRay Molenkamp
writefile.cc includes BLI_winstuff.h which includes Windows.h which supplies definitions of min/max that conflict with the c++ headers previously windows.h was only included when TBB was enabled, the inclusion of BLI_winstuff.h now makes this define mandatory for all configurations
2022-09-17WM: send a modifier press when activating a window with modifier heldCampbell Barton
Previously the a simulated event was sent for releasing modifiers on activation but pressing only set the eventstate flag. Prefer the simulated events since press/release events are used in some modal key-maps.
2022-09-17WM: refactor modifier hold/release logic when activating a windowCampbell Barton
Initial support for matching left/right modifier keys for simulated events - no functional changes.
2022-09-17PyDoc: correct parameter doc-strings & exception messageCampbell Barton
2022-09-17Fix T100330: Remove Render Slot not working for first slotLukas Stockner
This bug was caused by the weird ownership logic for render results. Basically, the most recent render result is owned by the Render, while all others are owned by the RenderSlots. When a new render is started, the previous Render is handed over to its slot, and the new slot is cleared. So far, so good. However, when a slot is removed and happens to be the one with the most recent render, this causes a complication. The code handles this by making another slot the most recent one, along with moving its result back to the Render, as if that had always been the most recent one. That works, unless there is no most recent render because you haven't rendered anything yet. Unfortunately, there is no way to store "there hasn't been a render yet", so the code still tries to perform this handover but can't. Previously, the code handled that case by just refusing to delete the slot. However, this blocks users from deleting this slot. But of course, if there hasn't been a render yet, the slots will not contain anything yet, so this entire maneuver is pointless. Therefore, the fix for the bug is to just skip it altogether if there is no Render instead of failing the operation. Technically, there is a weird corner case remaining, because Renders are per-scene. Therefore, if a user renders images in one scene, switches to a different scene, deletes a slot there and then switches back, in some situations the result in the deleted slot might end up in the next slot. Unfortunately this is just a limitation of the weird split ownership logic and can't just be worked around. The proper fix for this probably would be to hand over ownership of the result from the Render to the RenderSlot once the render is done, but this is quite complex. Also fixes a crash when iuser->scene is NULL.
2022-09-17GPencil: Remove Leak SizeAntonio Vazquez
This value was used to close gaps, but now with the new system is not needed. Internally, still we need to keep a small leak size, but after doing a lot of test a value of 3 is perfect, so it's harcoded.
2022-09-17GPencil: Change prop text to `Closure Mode`Antonio Vazquez
2022-09-17GPencil: Hide the help Circles for gaps when gap is closedAntonio Vazquez
To avoid too much noise, the help circles are only visible if the the gap is still open. When the gap is closed, the circles are hidden. Hiding the circles makes it easier to focus on what is problematic. instead, to see many circles that are already resolved.
2022-09-17GPencil: Rename Fill closure methodsAntonio Vazquez
The new names are: * Radius * Extend The mode Radius + Extend has been removed. Also, some code cleanup and format.
2022-09-17GPencil: Add more types of stroke extensions when fillingDave Pagurek
The motivation for this change: while working on an animation recently, I found that there are some gaps that won't close easily via stroke extension or leak size checking. In D14698, I attempted to address this by changing the algorithm of the raster-space flood fill. This patch attempts to address the same issue in vector space by adding two new cases where stroke extensions are added, as suggested by @frogstomp: # **Points of high curvature:** when the curvature at a point is high enough that it's hard to visually distinguish between it and an endpoint, add a stroke extension out along the normal (pointing in the opposite direction of the stroke's acceleration.) This addresses cases where technically the endpoint points up, but there's a sharp corner right below it that should extend to connect. # **Stroke endpoints within a radius**: when two endpoints are close together, regardless of the angle they make, connect them if they are within a radius. This addresses cases like where the two endpoints have effectively parallel tangents, so extensions won't close the gap. Reviewed By: antoniov, mendio, frogstomp Differential Revision: https://developer.blender.org/D14809
2022-09-17IndexRange: Add new `intersect` methodClément Foucault
Returns a new range, that contains the intersection of the current one with the given range. This is helpful to select a portion of a range without having to deal with all the asserts of other functions. The resulting range being always a valid subrange, it can be used to iterate or copy a part of a vector.
2022-09-17DRW: Debug: Fix row / column counters not being reset on initClément Foucault
This fixes the issues with CPU debug print not being in the right order.
2022-09-17DRW: GPU wrapper: Add new StorageVectorBufferClément Foucault
Same as `StorageArrayBuffer` but has a length counter and act like a `blender::Vector` you can clear and append to.
2022-09-17Geometry Nodes: use stringref instead of string in loggerJacques Lucke
This reduces logging overhead. The performance difference is only significant when there are many fast nodes. In my test file with many math nodes, the performance improved from 720ms to 630ms.
2022-09-17GL: Framebuffer: Add support for empty framebuffer (no attachments)Clément Foucault
This allows to reduce the memory footprint of very large framebuffers if there is no need for any attachment.
2022-09-17Cleanup: formatCampbell Barton
2022-09-17Cleanup: compiler warningsCampbell Barton
2022-09-17Cleanup: spelling, punctuation & repeated words in commentsCampbell Barton
2022-09-17Cleanup: Use dedicated function to offset VSE strip handlesRichard Antalik
2022-09-17Fix T101098: Moving meta strip can change its lengthRichard Antalik
Caused by clamping handle translation to strip bounds in functions `SEQ_time_*_handle_frame_set()` to prevent strip ending in invalid state. Issue happens when meta strip is moved so quickly, such that immediate offset is greater than strip length. Currently meta strip bounds are updated when any contained strip changes its position, but this update always preserves meta strip position. Transforming meta strip is not possible directly and all contained strips are moved instead. Therefore this is 2-step process and fix needs to be applied on update function and on translation function. Inline offset handling without clamping in function `SEQ_time_update_meta_strip_range()`. Add new function `seq_time_translate_handles()` to move both handles at once in `SEQ_transform_translate_sequence()`.
2022-09-16Sculpt: add .sculpt to allow_procedural_attribute_accessJoseph Eagar
Also cleaned up a comment.
2022-09-16Sculpt: Improve performance when initializing face setsHans Goudey
Avoid conversion to `BMesh` for basic topology operations and data access. Instead use a mesh map to retrieve the faces connected to each edge. I observed performance improvements of 5x (600ms to 100ms) to 10x (15s to 1s), with bigger changes for large meshes with more data layers Switching to `std::queue` over Blender's `GSQueue` gave another 25% improvement. Differential Revision: https://developer.blender.org/D15988
2022-09-16Fix: Missing updates for multires sculptingHans Goudey
Caused by ee23f0f3fb58ce56, which removed the update tag when entering sculpt mode, and by b5f7af31d6d474c, which made these layers lazily created, so they weren't always available at the start of a stroke. Now update the evaluated mesh/multires CCG as necessary. Some updates could potentially avoided when switching modes in the future, but for now do it all the time. Fixes T101116 Also fixes a crash when painting multires mask for the first time
2022-09-16Sculpt: New attribute APIJoseph Eagar
New unified attribute API for sculpt code. = Basic Design = The sculpt attribute API can create temporary or permanent attributes (only supported in `PBVH_FACES` mode). Attributes are created via `BKE_sculpt_attribute_ensure.` Attributes can be explicit CustomData attributes or simple array-based pseudo-attributes (this is useful for PBVH_GRIDS and PBVH_BMESH). == `SculptAttributePointers` == There is a structure in `SculptSession` for convenience attribute pointers, `ss->attrs`. Standard attributes should assign these; the attribute API will automatically clear them when the associated attributes are released. For example, the automasking code stores its factor attribute layer in `ss->attrs.automasking_factor`. == Naming == Temporary attributes should use the SCULPT_ATTRIBUTE_NAME macro for naming, it takes an entry in `SculptAttributePointers` and builds a layer name. == `SculptAttribute` == Attributes are referenced by a special `SculptAttribute` structure, which holds all the info needed to look up elements of an attribute at run time. All of these structures live in a preallocated flat array in `SculptSession`, `ss->temp_attributes`. This is extremely important. Since any change to the `CustomData` layout can in principle invalidate every extant `SculptAttribute`, having them all in one block of memory whose location doesn't change allows us to update them transparently. This makes for much simpler code and eliminates bugs. To see why this is tricky to get right, imagine we want to create three attributes in PBVH_BMESH mode and we provide our own `SculptAttribute` structs for the API to fill in. Each new layer will invalidate the `CustomData` block offsets in the prior one, leading to memory corruption. Reviewed by: Brecht Van Lommel Differential Revision: https://developer.blender.org/D15496 Ref D15496
2022-09-16Fix: Geometry nodes crash with undefined nodeHans Goudey
The new evaluator crashes for multi-input sockets coming from undefined nodes. The multi-input socket lazy node tries to retrieve the default value since the undefined node never created output values. But there is no default value stored because the socket is linked. Differential Revision: https://developer.blender.org/D15980
2022-09-16Cleanup: Remove unused member variable in lazy function graphHans Goudey
2022-09-16Fix T101100: missing smooth shading with linked subdivision surface in editmodeBrecht Van Lommel
Smooth flag should come from the evaluated mesh, only selection and hidding state should be mapped to the original bmesh. Pre-existing issue revealed by refactor in b247588dc0f4.
2022-09-16Fix: crash when evaluating geometry nodes after deleting an unlinked nodeJacques Lucke
This was essentially a use-after-free issue. When a geometry nodes group changes it has to be preprocessed again before it can be evaluated. This part was working, the issue was that parent node groups have to be preprocessed as well, which was missing. The lazy-function graph cached on the parent node group was still referencing data that was freed when the child group changed. Now the depsgraph makes sure that all relevant geometry node groups are preprocessed again after a change. This issue was found by Simon Thommes.
2022-09-16Sculpt: Move sculpt_face_set.c to C++Hans Goudey
2022-09-16Eevee: Add support for Nishita sky textureLukas Stockner
Sun Disc is currently not supported because it'll need special handling - on the one hand, I'm not sure if Eevee would handle a 1e6 coming out of a background shader without issues, and on the other hand it won't actually cast sharp shadows anyways. I guess we'd want to internally add a sun to the lamps if Sun Disc is enabled, but getting that right is tricky since the user could e.g. swap RGB channels in the node tree and the lamp wouldn't match that. Anyways, that can be handled later, the sky itself is already a start. Reviewed By: fclem Differential Revision: https://developer.blender.org/D13522
2022-09-16Fix 101000: color picker colors drift above 1 for some OCIO configurationsBrecht Van Lommel
Increase threshold to avoid float precision issues.
2022-09-16Revert "EEVEE: Fix volumetric resolve in large scenes."Jeroen Bakker
This reverts commit 34051fcc12f388375697dcfc6da53e9909058fe1. Although for normal use this doesn't make a difference. But when working with huge scenes and volumetrics + NVIDIA it made a work-around not possible anymore. For the heist production we added a fix on the render-farm (enable GPU workarounds). {rB34051fcc12f388375697dcfc6da53e9909058fe1} made another work-around not accessible anymore and it and was requested to revert this change.
2022-09-16Fix T101040: Blender Crashes When snap roll a bone in armatureGermano Cavalcante
The modes that don't support individual projection shouldn't support FACE_NEAREST either. Differential Revision: https://developer.blender.org/D15970
2022-09-16Cleanup: formatCampbell Barton
2022-09-16Cleanup: spelling in commentsCampbell Barton
2022-09-16Make File Select dialog update operator's file & path propertiesColin Basnett
When an operator is attached to a file select dialog, the update callback function for the operator's directory, filename and filepath properties will be called as the user navigates through the dialog. This will allow add-on authors to make more interactive import operators. Differential Revision: https://developer.blender.org/D15543
2022-09-16Revert "UI: Use full word for face set operator name, tweak description"Hans Goudey
This reverts commit 15d85c54c3f960814068074bcdff0a5546fa4d5a. Included a separate change/new file by mistake. Sorry for the noise.
2022-09-16UI: Use full word for face set operator name, tweak descriptionHans Goudey
"Init" shouldn't be used in the UI, and avoid repeating the operator name in its description.
2022-09-16Sculpt: Respect hiding when creating face sets from loose partsHans Goudey
Different areas of the mesh can be "loose parts" visually when separated by hidden areas. This is consistent with other areas of sculpt mode that also treat hidden areas differently.
2022-09-16Cleanup: formatCampbell Barton
2022-09-15Cleanup: Rename attribute required functionsHans Goudey
Avoid "customdata" in the name, since that's an implementation detail in this context.
2022-09-15Fix: Merging mesh and non-empty BMesh creates "flag" attributesHans Goudey
We need to use the custom data copy function that skips mesh-only attributes like the hide status attributes, the generic material index attribute, etc. Otherwise the BMesh has those attributes which conflict with their builtin counterparts.
2022-09-15BLO: move blenloader to C++Jacques Lucke
Differential Revision: https://developer.blender.org/D15965
2022-09-15Fix warning-as-errors in older GCC's, take 2.Bastien Montagne
rBf4e6616b835e did not work for `some reason`, this one has been verified with gcc 10!