Commit Graph

122049 Commits

Author SHA1 Message Date
Campbell Barton bd0aa88909 Fix invalid path references after moving tools & scripts 2023-03-01 22:00:46 +11:00
Bastien Montagne 1ed783eed3 Fix #99836: Blender SEGV when open .blend file in blender.
Use recent 'abort file reading' mechanism to simply not try to load such
purposedly broken .blend files at all.
2023-03-01 11:50:50 +01:00
Bastien Montagne b3f42d8e98 Add a mechanism to abort a blend file reading on critical error.
This commit introduces a new Main boolean flag that marks is as invalid.

Higher-level file reading code does checks on this flag to abort reading
process if needed.

This is an implementation of the #105083 design task.

Given the extense of the change, I do not think this should be
considered for 3.5 and previous LTS releases.
2023-03-01 11:50:50 +01:00
Bastien Montagne 3e5ce23c99 Fix (unreported) potential leak in Main freeing function.
Could happen in case a 'split-by-libraries' Main is passed to
`BKE_main_free`.
2023-03-01 11:50:50 +01:00
Campbell Barton e35afd8a1d Merge branch 'blender-v3.5-release' 2023-03-01 21:16:37 +11:00
Campbell Barton e9fefcd298 Merge branch 'blender-v3.5-release' 2023-03-01 21:16:33 +11:00
Campbell Barton ff89dfd6d2 Fix #105328: unit system does not affect cavity 2023-03-01 21:15:11 +11:00
Jeroen Bakker cf572f1a64 Python: Add range and instance drawing to GPUBatch
GPUBatch.draw supports basic drawing methods. Although all
supported GPU backends support range based and instance based drawing.

This patch adds 2 methods to GPUBatch to add support to range based and
instance based drawing.

my_batch.draw_range(my_shader, elem_start=10, elem_count=5)
Will draw my_batch using my_shader. From the attached index buffer
elements 10-14 will be drawn.

my_batch.draw_instance_range(my_shader, instance_start=0, instance_count=10)
will draw my_batch using my_shader 10 times. Inside the vertex
shader the current instance number is held by gl_InstanceID.

Pull Request #104457
2023-03-01 10:23:38 +01:00
Marc Chéhab 52064bf5da Fix #104824: GPencil natural drawing building with 1 subdivision very slow
1. Changes the subdivision function to not fill in time but add 0 to fix bug #104824
2. Fixes a bug in sanitization function noticed while fixing this bug.

Pull Request #105306
2023-03-01 10:09:23 +01:00
Chris Blackbourn 159958e52b Cleanup: Simplify storage and comments in UV Unwrapper.
Rename `single_pin_uv` to `origin`.

Remove `PChartPack`.

No functional changes.
2023-03-01 20:38:41 +13:00
Chris Blackbourn c7d38b643b Cleanup: Simplify storage and comments in UV Unwrapper.
Simplify PChart handling of area_uv and area_3d.
2023-03-01 20:01:40 +13:00
Chris Blackbourn 6766a7911f UV: Merge both UV Packing engines into one.
Affects Geometry Nodes:
* UV Unwrap
* UV Pack

No functional changes.

Pull Request #105286
2023-03-01 07:28:28 +01:00
Campbell Barton 09c4d6bd7b Cleanup: avoid looping over layer collections again when freeing 2023-03-01 15:14:50 +11:00
Campbell Barton ea97bb1641 Use hash for Collection.gobject lookup, speedup object linking
Add a hash for faster look-ups on collection->gobject,
This avoids a full list lookup for every object added via Python's
CollectionObject.link as well as linking via BKE_collection_object_add_*
functions.

While the speedup is non-linear, linking & unlinking 100k objects from
Python is about 50x faster. Although unlinking all objects in order
(a best-case for linked lists) is approximately the same speed.

Ref !104553.
2023-03-01 12:34:45 +11:00
Campbell Barton e65671c1ed Merge branch 'blender-v3.5-release' 2023-03-01 11:21:02 +11:00
RedMser 337e68aeb5 Test: update bl_rna_defaults
- Remove Group test
- Add Brush, Collection, GreasePencil, HairCurves,
  LightProbe, PointCloud, Volume tests

Ref !105172.
2023-03-01 11:18:47 +11:00
PiloeGAO 6f4d36ca8f Python: Change console banner color-style to info
Update the style of the Python Console banner to "INFO" instead of
"OUTPUT".

This change makes it easier to difference user generated output from the
initial banner text.

This also has an advantage that "Copy as Script" excludes the banner.

Ref !105188.
2023-03-01 11:10:06 +11:00
Hans Goudey 6fe2fabbff Merge branch 'blender-v3.5-release' 2023-02-28 17:47:10 -05:00
Hans Goudey d90d6f8674 Fix #105259: Copy & paste boolean custom property as driver doesn't work
A copy and paste mistake in ef68a37e5d.
2023-02-28 17:46:26 -05:00
Hans Goudey 71a79a7a7c Cleanup: Small cleanups to flip faces node
Decrease indentation, simplify variable names, use IndexRange more.
2023-02-28 17:30:25 -05:00
Hans Goudey ce25209e26 Cleanup: Clarify mirror modifier copying and face flipping
Rewrite the logic to depend less on local variables and prefer spans
and indices over points and pointer arithmetic. Also make use of the
IndexRange type for some basic logic, correct the mesh that the
sharp edge layer was chosen from, and reduce variable scope.
2023-02-28 17:29:35 -05:00
Hans Goudey f2ea7ae751 Fix #105319: Crash in weighted normal modifier after recent cleanup 2023-02-28 16:44:26 -05:00
Hans Goudey 8aa1a7db3e Cleanup: Use clearer variable names in mirror modifier
It wasn't clear what "max" referred to.
2023-02-28 16:03:49 -05:00
Hans Goudey eb5e7b1b4e Merge branch 'blender-v3.5-release' 2023-02-28 15:39:55 -05:00
Hans Goudey 079dbf4d1b Fix #105162: Array modifier cap material index ignored
The material indices from the caps were only copied if the base mesh had
a material index attribute. Fix that by copying them manually if the cap
has the attribute.
2023-02-28 15:39:19 -05:00
Hans Goudey f911a9280b Merge branch 'blender-v3.5-release' 2023-02-28 14:03:22 -05:00
Hans Goudey 15f59470a3 Fix #105314: Custom node groups missing sockets
`ShaderNodeCustomGroup` and others lost their UI with
7026096099 without a dynamic declaration callback.
2023-02-28 13:59:28 -05:00
Hans Goudey 4ffae99d6d Cleanup: Remove unnecessary declarations in laplacian smooth modifier 2023-02-28 13:03:42 -05:00
Hans Goudey 08e20376b1 Cleanup: Use simpler for loop syntax for mesh polys in two modifiers 2023-02-28 13:03:42 -05:00
Hans Goudey 62c6eb12bf Fix #105165: Weighted normal modifier crash after recent cleanup
Mistake in cb62ab5b28
2023-02-28 13:03:42 -05:00
Harley Acheson 9b67e883dd Fix #105257: Incorrect Search Region Size
Search list's region is having its size members (winx and winy) set
to values that are one pixel too small. This causes text to look bad
as they are slightly off their pixel alignment.

See #105308 for more details and an illustration of the issue.

Pull Request #105308
2023-02-28 18:21:07 +01:00
Hans Goudey 8fbc80be8f Merge branch 'blender-v3.5-release' 2023-02-28 11:36:20 -05:00
Hans Goudey 076a33ccd1 Fix #104219: Node links dragged from wrong socket after selection
Nodes are sorted based on the selection. In some cases (even depending
on processor speed, nodes can be selected and reordered, and another
operation can run before the next redraw). That gives a window where
operators mapped to the same input as selection can run with invalid
socket locations (which aren't updated after the nodes are reordered,
since they are stored in a separate array).

To fix this, move the socket locations from the node editor runtime
data to the node tree, tag them as invalid when the nodes are
reordered, and check for that status in a few more places.

A better longer term solution is not reordering nodes based on
UI status and instead storing the UI drawing order separately.

Pull Request #104420
2023-02-28 11:35:32 -05:00
Harley Acheson 480e467ac9 Fix #104726: Allow loading of 2.48 file without active window
Add check to WM_check for lack of wmWindowManager->winactive. Sets it
if there is a window and makes that one wmWindow->active as well.

Pull Request #105225
2023-02-28 17:08:30 +01:00
Hans Goudey eb68334b58 Cleanup: Mesh: Access looptris with Span
Similar to cb62ab5b28 but for mesh triangulation.

Pull Request #105297
2023-02-28 14:52:31 +01:00
Germano Cavalcante 3c94e2ab4c Cleanup: split 'transform_gizmo_3d.cc' in more specific units
Split `transform_gizmo_3d.cc` in:
- `transform_gizmo_3d.cc`
- `transform_gizmo_3d_cage.cc`
- `transform_gizmo_3d_shear.cc`

Split `transform.h` in:
- `transform.h`
- `transform_gizmo.h`

Also:
- Move functions `gimbal_axis_pose` and `gimbal_axis_object` to
`transform_orentations.c` (they are not used in `transform_gizmo_3d.cc`)

Pull Request #105256
2023-02-28 14:12:14 +01:00
Weizhen Huang 5edca02d08 Fix cage2d gizmo setting uniform size when uniform scaling is required 2023-02-28 13:00:20 +01:00
YimingWu 30a81f1b55 GPencil: UV parameters for the first point in sample modifier.
Simplify modifier sample mode failed to transfer uv parameters for the first point, now fixed.

Continuation of #104942

Pull Request #105284
2023-02-28 12:15:50 +01:00
Michael Jones 7842347ec8 Cycles: Fix hanging unit tests when MetalRT is enabled
This patch fixes hanging unit tests when MetalRT is enabled. It simplifies and fixes the kernel selection logic by baking the MetalRT-specific options into `kernels_md5` rather than expanding out and testing MetalRT bit flags explicitly.

Pull Request #105270
2023-02-28 11:42:08 +01:00
Julian Eisel 0786b05175 Cleanup: More clear variable name in File Browser drawing 2023-02-28 11:29:59 +01:00
Campbell Barton 09e848deec Cleanup: use term "filepath" instead of "name" / "fname" 2023-02-28 17:31:08 +11:00
Campbell Barton 707af21afd Merge branch 'blender-v3.5-release' 2023-02-28 17:14:02 +11:00
Campbell Barton 9fccd2dc24 Fix #100819: Built-in VFont has an additional user by default
New built-in fonts would have an additional user when added for the
first time.

BKE_vfont_builtin_get now always borrows the reference.
2023-02-28 17:08:23 +11:00
Jeroen Bakker 3cba2911e0 Vulkan: Add Initial VKFrameBuffer.
This was backported from tmp-vulkan. When disabling the fence check
in ghost it is able to start blender. It will show a black screen
so not usable for users.
2023-02-28 06:20:12 +01:00
Campbell Barton c2df623e86 Merge branch 'blender-v3.5-release' 2023-02-28 16:01:42 +11:00
Campbell Barton 1e6aaf5f65 Merge branch 'blender-v3.5-release' 2023-02-28 16:01:26 +11:00
Campbell Barton 9cee0eb7fa Cleanup: format 2023-02-28 15:44:49 +11:00
illua1 e885973ea9 Fix #104894: Toggle comments assumes '#' prefix (failing for OSL)
Add comment line prefix to format struct so each language can define
it's own comment prefix.

Ref !104953.
2023-02-28 15:43:11 +11:00
Jeroen Bakker 8d9819e07f Fix: Not all vulkan code-paths where compiled.
Fix issue where old `WITH_VULKAN` was still used. It should
have used `WITH_VULKAN_BACKEND`.
2023-02-28 05:36:06 +01:00
Campbell Barton 8859b1cd3c Cleanup: quiet mypy type checking warnings
- make_update.external_script_add_origin_if_needed
  returned None or an empty string. As neither where checked simply
  return None.
- git_get_remote_url had an incorrect annotation.
2023-02-28 15:12:04 +11:00