Commit Graph

99526 Commits

Author SHA1 Message Date
018f3dbf85 Cleanup: format 2023-05-14 11:11:51 +12:00
f44795ce17 Fix #107898: UV packer regression
Layouts with >1024 rectangle islands would leave empty UV space.

Regression from ccb2dbddac.
2023-05-14 11:07:24 +12:00
69d6210e38 UI: Improve description for shapekey pin
New tooltip provides more useful information.
2023-05-13 15:24:43 -06:00
eac620f7bf Cleanup in readfile code area.
Mostly some minor renaming of parameters and variables, adding a few
comments...

The only actual behavior change is a more correct handling of the
`LIB_TAG_KEEP_ON_UNDO` on ID tag. This should not have any consequences
in current code though.

So no actual change in behavior is expected from this commit.
2023-05-13 19:45:29 +02:00
2117af10ab Cleanup: Clear non-ID pointers in Outliner tree's readfile code.
Not really critical, but cleaner, and should ensure a hard crash in case
these (assumed invalid) pointers get ever accessed.
2023-05-13 19:35:17 +02:00
b960a4fdb8 Fix (unreported) BKE_main_id_refcount_recompute wrong handling of some ID types.
Scene, WindowManager and Workspace types of IDs should always have a
'virtual' user, to ensure they are always written to file.
2023-05-13 19:26:02 +02:00
5a2f159ba4 Cleanup: Minor fixes to comments and CLOG reports. 2023-05-13 19:24:41 +02:00
a23275a6ea Fix #107810: SVG exported line thickness wrong
Due a limitation in the precission of the thickness
calculation, the result could be wrong.

As the code tried to use the real thickness, in some
cases this was wrong.

Related to old fix for #103061

Pull Request: blender/blender#107835
2023-05-13 16:11:40 +02:00
79f4405039 RNA: correct BLI_strncpy buffer size argument 2023-05-13 17:55:02 +10:00
bfeb687cb4 Remove use of FILENAME_MAX
GCC documented FILENAME_MAX is the maximum length of a file that can
be opened, not to be used for allocation as it may be INT_MAX for e.g.

Even though this wasn't the case on supported systems,
prefer FILE_MAX which is used for full paths in most places.
2023-05-13 17:54:16 +10:00
169dd2a2b4 Use UTF8 copy function to ensure valid UTF8 output 2023-05-13 17:38:48 +10:00
4e85d17000 Cleanup: use native path separator 2023-05-13 17:38:46 +10:00
a534e05476 Cleanup: use dirpath & filename for directories and file names
Use `filename` instead of `names`, `dirpath` instead of `dir`.
2023-05-13 17:34:29 +10:00
557344b64c Cleanup: correct UTF8 code-commets, remove imbdds reference 2023-05-13 17:34:25 +10:00
e89939ca26 Cleanup: reserve the term 'len' for string length 2023-05-13 17:34:23 +10:00
b1a426eac7 Cleanup: use string copy & printf macros 2023-05-13 17:34:21 +10:00
302137b14b Fix #107759: Crash when running modal operator in load_post handler
Regression in [0] which caused the window to be NULL when the load_post
handler was called. While this can be worked around using
context.temp_override, keep the previous behavior as this
change wasn't intentional.

[0]: 46be42f6b1
2023-05-13 17:34:19 +10:00
3d45004552 Fix tangent layer extraction using an empty attribute name
The attribute name was always "" as the size argument was `sizeof(char)`
instead of the buffer length.
2023-05-13 17:34:17 +10:00
88938f03c7 Fix buffer overflow with seq_proxy_get_custom_file_fname
The file path was 256 bytes, passing in a buffer size of 1792
for string join & making the path absolute could also overflow
as it assumes a size of 1024.
2023-05-13 17:34:14 +10:00
7433f34c4d Fix incorrect buffer size passed to BLI_strncpy 2023-05-13 17:34:13 +10:00
654cfc06c5 Cleanup: format 2023-05-13 11:03:59 +12:00
a05a7988dc Fix #106929: Gap in node links when sockets are aligned
Fix an issue when drawing node links that caused gaps, when sockets were
horizontally or vertically aligned.

When the inner and outer points of the node link's bezier control
polygon overlap, the link's tangent can be a zero vector. The shader
didn't check for this before normalizing the tangent leading to an
undefined vector which prevented the outermost segments of the link
from being drawn.
Since this only happens when the end points of the node link are
horizontally or vertically aligned, we can use the vector between the
link's end points instead of the tangent.

Fix #106929
Fix #89282

Pull Request: blender/blender#107636
2023-05-12 20:35:22 +02:00
ee08b2ddff Geometry Nodes: Add display toggle for simulation cache in timeline
Similar to the existing options for toggling physics cache display.
2023-05-12 13:48:52 -04:00
34e29440f7 Fix #107151: Multires data from external file is not loaded
Making the custom data API const correct in 3a3d9488a1 caused
the issue, because it previously relied on non-threadsafe behavior. As a
workaround, just restore the thread-unsafety, and note the issue in a
new comment.
2023-05-12 13:48:11 -04:00
995802d68e Fix #107893: Attribute Statistic produces wrong Variance value
The division must be by the amount, not the index of the latter.

Pull Request: blender/blender#107894
2023-05-12 19:43:26 +02:00
3b647faec8 Fix (unreported) three wrong next/prev pointers order in ListBase link structs.
There was even one case in BLI ListBase tests!

Order was opposite of the one expected by the BLI ListBase code... Not
sure how, but this did not cause any issue apparently? But would expect
it to at least affect the order in which items in the list would be
iterated.
2023-05-12 19:02:39 +02:00
ddd6e05c8d BKE: Collection: Add a basic validation tool for collections.
Mainly for debug purposes, makes it easy to detect invalid collections
(e.g. having more than once a same collection as child).
2023-05-12 19:02:39 +02:00
d87d2dd4ba BLI: Add basic validation tool for ListBase.
Mainly a debug tool, makes it very easy to detect broken listbase.
2023-05-12 19:02:39 +02:00
d9f5ce2546 UI: Changes to NLA Solo Button
Move the NLA Solo button to right side of channel row.

Pull Request: blender/blender#107672
2023-05-12 18:55:06 +02:00
f5e3ed77c7 Geometry Nodes: Change "Separate Components" node output order to match Spreadsheet
The order of geometry components should match between
the Separate Components node and the spreadsheet editor.
This switches the Curve and Point Cloud outputs.

Resolves #107837

Pull Request: blender/blender#107868
2023-05-12 18:08:06 +02:00
846e0801ab Fix crash in transform code if there was no active pose channel 2023-05-12 17:42:46 +02:00
4ecbb3f1d5 Fix IDManagement remapping missing some required remapping with some liboverrides.
`BKE_library_id_can_use_filter_id` would not handle properly cases where
the ID is a liboverride - it's hierarchy root pointer can point back to
virtually any kind of ID (although typically a Collection or Object).

This was breaking liboverride resync process in some rare cases, by
failing to remap the 'hierarchy root' pointer of some liboverrides.
2023-05-12 17:02:18 +02:00
6491387fba Fix: Incorrect value retrieval in simulation subframe mixing 2023-05-12 10:40:51 -04:00
4d7a93930c Fix: Build error after previous commit 2023-05-12 10:15:57 -04:00
e6e6fb3a62 Geometry Nodes: Implement simulation subframe mixing
Generally render engines can do subframe mixing themselves, but the
purpose of subframe mixing in the simulation output node is to support
higher quality motion blur with bakes when there are topology-changing
operations after the simulation output node. Linear mixing can fill the
gaps while maintaining lower memory usage.

All point/instance domain attributes are mixed, but mixing is only
supported when the domain size is unchanged or when an `id` attribute
gives a mapping between elements. Theoretically it may be possible, but
nested instance geometry is not mixed in this commit due to the
difficulty of finding matching geometries across arbitrary instance
hierarchy changes. Attributes that are completely unchanged are ignored
using implicit sharing for better performance.

Pull Request: blender/blender#107599
2023-05-12 15:58:54 +02:00
fb584456e8 Revert "Fix #107759: Crash when running modal operator in load_post handler"
This reverts commit 95a114f3ca.

This broke bl_rigging_symmetrize, it seems likely the window was not
NULL on load in this case, setting it to NULL caused the the active
object not to be recognized.

This needs further investigation, reverting for now.
2023-05-12 23:23:49 +10:00
4f2ac09886 Cleanup: Reduce binary size by deduplicating attribute processing
This makes the Blender binary 350 KB smaller. The largest change comes
from using `FunctionRef` instead of a template when gathering indices to
mix in the extrude node (which has no performance cost). The rest of the
change comes from consolidating uses of code generation for all
attribute types. This brings us a bit further in the direction of
unifying attribute propagation.

Pull Request: blender/blender#107823
2023-05-12 14:44:39 +02:00
38416e7ad2 RNA: use correct ui scale type string in generated rna code
Previously, it printed the elements of `PropertyScaleType` as floats which does
not make sense. It also resulted in compile errors when attempting to compile
the generated code as c++ code.

Pull Request: blender/blender#107724
2023-05-12 13:50:06 +02:00
4cf7b95a15 Vulkan: Fix Compilation Issues on Windows
VKVertexAttributeObject was both defined as a class and a struct.
Settled on being a class.

Also removed an assert that is currently failing as workbench has
more attributes defined than actually used.

Pull Request: blender/blender#107874
2023-05-12 12:38:42 +02:00
7a52ad1161 Vulkan: Fix Incorrect Vertex Buffer State
After uploading the vertex buffer the state got corrupted.
Reason of this corruption is an assign-compare operation that should
just be an compare operation.

Pull Request: blender/blender#107875
2023-05-12 12:33:37 +02:00
cgtinker
aaf56d7aa5 Refactor: Anim, Symmetrize Armature operator
Remove some nested `if` statements to improve readablilty. My main
intention has been to improve readability and therefore making it easier
to implement changes in the future.

Seperating the symmetrize operator selection logic from the temp pointer
logic may reduces performance but it seems acceptable in this case. The
change allows focussing on the selection logic without taking care of
the temp pointers at the same time.

No functional changes.

Pull Request: blender/blender#106487
2023-05-12 12:13:35 +02:00
83a2904d1a Vulkan: IndexBuffer as Subrange
Add support for index buffers as subrange. When an index buffer
is a subrange it should bind the source buffer and use the index start
as an offset in the buffer.

Pull Request: blender/blender#107871
2023-05-12 12:12:43 +02:00
f9d094ba9e Vulkan: Initial Draw List
Dummy implementation of the VKDrawList that isn't caching the draw calls
but just execute them when they are appended to the list.

Pull Request: blender/blender#107873
2023-05-12 12:09:41 +02:00
149d364307 Fix #107863: Handles NULL pose constraint list
When the the armature doesn't have an active pose bone yet so
`ED_object_pose_constraint_list` returns NULL unhandled during
`edit_constraint_property_get`, now fixed.

Pull Request: blender/blender#107864
2023-05-12 10:56:53 +02:00
95a114f3ca Fix #107759: Crash when running modal operator in load_post handler
Regression in [0] which caused the window to be NULL when the load_post
handler was called. While this can be worked around using
context.temp_override, keep the previous behavior as this
change wasn't intentional.

[0]: 46be42f6b1
2023-05-12 17:23:56 +10:00
b2ebb01255 Fix crash when adding a modal operator from Python with no active window
Reported as part of #107759.
2023-05-12 16:19:24 +10:00
edc12436c6 UV: During packing, add progress bar and ability to cancel
Uses job system.

Co-authored-by: Campbell Barton <campbell@blender.org>
Pull Request: blender/blender#107859
2023-05-12 14:50:40 +12:00
85ddc1b0de Cleanup: Use OffsetIndices class in extrude node and merge by distance node 2023-05-11 22:15:41 -04:00
225d111357 UV: Rename ED_UVPACK_PIN_NORMAL to ED_UVPACK_PIN_DEFAULT 2023-05-12 11:09:27 +12:00
eb273143c6 Cleanup: format 2023-05-12 11:00:26 +12:00