Commit Graph

114591 Commits

Author SHA1 Message Date
Campbell Barton
e7ba34599c Merge branch 'blender-v3.2-release' 2022-05-04 19:32:09 +10:00
Campbell Barton
79e94caa6b Fix error pasting text containing tabs
Regression in [0] which missed updating the string length
when converting tabs to spaces - the pasted string would be shorter.

[0]: e2f4c4db8d6cbe4694c24d599e16ee3889871bdd
2022-05-04 19:28:11 +10:00
Sergey Sharybin
5f8f436dca Allow surface deform when target mesh increases number of vertices
A studio request actually.

The goal is to cover rather typical situation: when the mesh was
bound to target when the target was on subdivision level 0 but
uses a higher subdivision level for rendering. Example of such
setup is a facial hair bound to the face.

The idea of this change is to use first N vertices from the target
where N is the number of vertices on target during binding process.
While this sounds a bit arbitrary it covers typical modifier setup
used for rigging. Arguably, it is not more arbitrary than using a
number of polygons (which is how the modifier was checking for
changes on target before this change).

Quite straightforward change. A bit tricky part was to not break
the behavior since before this change we did not track number of
vertices sued when binding. The naming I'm also not super happy
with and just followed the existing one. Ideally the variables in
DNA will be prefixed with `target_` but doing it for an existing
field would mean compatibility change, and only using prefix for
the new field will introduce weird semantic where the polygons
count will be even more easily confused with a count on the
deforming mesh.

Differential Revision: https://developer.blender.org/D14830
2022-05-04 10:56:33 +02:00
Sergey Sharybin
aa1fb4204d Cleanup: More clear name in surface deform modifier
Make it explicit that counter is about target mesh.

Use DNA rename for it so that the files stay compatible.

Also renamed some purely runtime fields to replace `t`
prefix with `target` as the short `t` is super easy
to miss.

Differential Revision: https://developer.blender.org/D14835
2022-05-04 10:56:33 +02:00
Hans Goudey
2d80f814cc Curves: Use copied original data for invalid NURBS curves
NURBS curves can be invalid when the order is less than the number
of points, or in a few other situations. Currently the evaluated data of
an invalid NURBS curve is empty. This is inconvenient because it
requires checking for empty curves when it otherwise wouldn't be
necessary. This patch replaces that fallback with copying the original
data to the evaluated points. This makes conceptual sense too, as if
the curve couldn't be evaluated-- which wouldn't necessarily delete it.

Usually the UI protects against this happening, but it's currently
possible to create an invalid curve with some operations like the
delete geometry node.

Differential Revision: https://developer.blender.org/D14837
2022-05-04 10:27:46 +02:00
Jacques Lucke
7dc94155f6 Curves: support symmetry in curves sculpting brushes
This adds support for X/Y/Z symmetry for all brushes in curves
sculpt mode. In theory this can be extended to support radial
symmetry, but that's not part of this patch.

It works by essentially applying a brush stroke multiple with
different transforms. This is similiar to how symmetry works in
mesh sculpt mode, but is quite different from how it worked in
the old hair system (there it tried to find matching hair strands
on both sides of the surface; if none was found, symmetry did
not work).

Differential Revision: https://developer.blender.org/D14795
2022-05-04 09:51:32 +02:00
Jeroen Bakker
0375720e28 Fix T95165: Custom Normals tools dont update immediately.
Recalc selection count at the end of the circle selection.
This was removed from circle selection as it became a performance
bottleneck, helas some operators rely on it.
2022-05-04 09:22:17 +02:00
Campbell Barton
aa21087d56 Merge branch 'blender-v3.2-release' 2022-05-04 14:02:23 +10:00
Campbell Barton
78e8fae346 Merge branch 'blender-v3.2-release' 2022-05-04 14:02:21 +10:00
Campbell Barton
b1cd3be0d0 Merge branch 'blender-v3.2-release' 2022-05-04 14:02:18 +10:00
Campbell Barton
f8c8abae38 Merge branch 'blender-v3.2-release' 2022-05-04 14:02:15 +10:00
Campbell Barton
0383047257 Cleanup: quiet strict-prototypes warning 2022-05-04 14:01:18 +10:00
Campbell Barton
2a89509e45 License headers: add missing license headers
Add missing license headers based on files in the same directory.
2022-05-04 13:58:53 +10:00
Campbell Barton
10b1e993f4 Cleanup: make format 2022-05-04 13:52:22 +10:00
Campbell Barton
8cb30c079d Cleanup: duplicating doc-strings 2022-05-04 13:44:23 +10:00
Campbell Barton
db63945c36 Docs: add doc-string for ED_view3d_viewcontext_init_object 2022-05-04 11:20:04 +10:00
Campbell Barton
dc57ab8941 Cleanup: quiet strict-prototypes warning 2022-05-04 11:07:19 +10:00
Brecht Van Lommel
e86b62f195 Fix wrong task priority for particle distribution and tanget computation
These kinds of depsgraph evaluations should not be marked as low priority as
this could negatively affect playback performance. Low priority should mainly
be used for background tasks.
2022-05-03 23:08:29 +02:00
Brecht Van Lommel
5b2a6b6ebb Fix T96880: viewport render animation hangs Blender
Isolate frame writing task so that multithreaded image operations don't cause
the thread to start writing another frame. If that happens we may reach the
MAX_SCHEDULED_FRAMES limit, and cause the render thread and writing threads to
deadlock waiting for each other.

Additionally, don't set task priority to low because this may cause the task
scheduler to be slow in scheduling the write and color management tasks.
2022-05-03 23:08:29 +02:00
Kévin Dietrich
502c707e0e Merge remote-tracking branch 'origin/blender-v3.2-release' 2022-05-03 22:59:31 +02:00
Ethan-Hall
1d668b6356 Alembic: Enable operator presets when exporting
This patch enables operator presets for Alembic exports.
The export menu has many options, so enabling the feature
will help users manage their export settings in the same
way they can with other filetypes.

This also fixes restoring the default operator value for
setting the frame range.

Differential Revision: https://developer.blender.org/D12849
2022-05-03 22:58:18 +02:00
Kévin Dietrich
281bcc1c1d Fix T93179: geonodes UVs and Vertex colors do not work in EEVEE
Overwriting UV map or vertex color data in Geometry nodes will move the
layers to another CustomData channel, and as such, will make attribute
lookup fail from the UVMap and Vertex Color nodes in EEVEE as the
CustomDataType will also be modified (i.e. no longer `CD_MTFACE` or
`CD_MCOL`).

As discussed in T93179, the solution is to use `CD_PROP_AUTO_FROM_NAME`
so that the render engine is able to find the attributes. This also makes
EEVEE emulate Cycles behaviour in this regard. `attr_load_uv` and
`attr_load_color` are also removed in favor of the generic attribute
API in the various GLSL shaders.

Although `CD_PROP_AUTO_FROM_NAME` is now used even for UV maps, the
active UV map is still used in case the attribute name is empty, to
preserve the old behavior.

Differential Revision: https://developer.blender.org/D13730
2022-05-03 22:50:04 +02:00
Brecht Van Lommel
94205e1d02 Fix T96822: Cycles motion blur + persistent data not updating properly
At the frame before/after an object starts moving, it's transform may not be
modified but its motion would be and requires an update.
2022-05-03 22:16:08 +02:00
Kévin Dietrich
947f8ba300 Fix T96338: GPU subdiv crash switching to UV editing
The crash is caused as the data for the UV editor is requested before
the data for the mesh as a separate draw update. Since building the UV
stretch angle buffer requires the position buffer, the latter is not
created yet in this case.

To fix this, create a local position buffer from the subdivision data. An
alternate fix was considered to remove the dependency on the position
buffer by interpolating on the GPU the coarse stretch angle buffer but
this did work. Maybe this will be revisited.
2022-05-03 18:02:10 +02:00
Dalai Felinto
04df0a3b8c Sculpt Curves Puff icon 2022-05-03 17:49:10 +02:00
Kévin Dietrich
2062116924 BPY types: add default Geometry Node poll function
Contrary to `CompositorNodeCustomGroup` or `ShaderNodeCustomGroup`,
`GeometryNodeCustomGroups` have to define their own poll function.
This is because their is no predefined poll function for `GeometryNode`,
and it may not be clear for addon developers why `GeometryNode` would
be special here.

This adds `GeometryNode` to `bpy_types.py` and defines such a function
for it like for other builtin node types.

Differential Revision: https://developer.blender.org/D14775
2022-05-03 17:43:03 +02:00
Hans Goudey
9fb98735ea Refactor: Use boolean array for curves delete brush
No functional or performance changes expected. This change
makes it simpler to run multiple operation "delete" operations
but only reallocate the curves data arrays a single time.
2022-05-03 17:41:09 +02:00
Aras Pranckevicius
f586c3ba21 Merge branch 'blender-v3.2-release' 2022-05-03 14:49:53 +03:00
Aras Pranckevicius
5962db093f Fix T97793, Fix T97795: Use correct defaults for missing values in new OBJ importer
- Fix T97793: when a UV coordinate after vt is missing, use zero. While
  at it, also use zeroes for positions & normals, since "maximum
  possible float" is very likely to cause issues in imported meshes.
- Fix T97795: use 1.0 default if -bm value is missing, instead of zero.

Reviewed By: Howard Trickey
Differential Revision: https://developer.blender.org/D14826
2022-05-03 14:45:44 +03:00
Aras Pranckevicius
5f5e7ac317 Fix T97757: Some MTL import correctness issues in the new OBJ importer
Fix several correctness issues where the new OBJ/MTL importer was not
producing the same results as the old one, mostly because the code for
some reason had slightly different logic. Fixes T97757:

- When .obj file tries to use a material that does not exist, the code
  was continuing to use the previous material, instead of creating new
  default one, as the previous importer did.
- Previous importer was always searching/parsing "foo.mtl" for a
  "foo.obj" file, even if the file itself does not contain
  "mtllib foo.mtl" statement. One file from T97757 repros happens to
  depend on that, so resurrect that behavior.
- When IOR (Ni) or Alpha (d) are not specified in .mtl file, do not
  wrongly set -1 values to the blender material.
- When base (Kd) or emissive (Ke) colors are not specified in the .mtl
  file, do not set them on the blender material.
- Roughness and metallic values used by viewport shading were not set
  onto blender material.
- The logic for when metallic was set to zero was incorrect; it should
  be set to zero when "not using reflection", not when "mtl file does
  not contain metallic".
- Do not produce a warning when illum value is not spelled out in .mtl
  file, treat as default (1).
- Parse illum as a float just like python importer does, as to not
  reintroduce part of T60135.

Reviewed By: Howard Trickey
Differential Revision: https://developer.blender.org/D14822
2022-05-03 14:44:49 +03:00
Hans Goudey
11d075f07d Cleanup: Move color attribute enums to be reusable
These enum property arrays are used by a few patches
in review. Moving them here means they don't have to
be duplicated.
2022-05-03 12:23:17 +02:00
Nate Rupsis
61e8310b75 NLA: improve visibility of action & active channel
Selecting Action channel in NLA now sets the context in the N-panel. The
actively selected channel is now also drawn in a different way, so that
it's visible which one is selected.

Old:
- The NLA sidebar didn't refresh with the creation of a new action.
- There was no indication of the action channel being selected.

New:
- NLA side bar now refreshed when keyframes are added (new action is created)
- Clicking on the action channel now gives visual indication of being selected

Reviewed By: RiggingDojo, sybren

Maniphest Tasks: T97372

Differential Revision: https://developer.blender.org/D14820
2022-05-03 12:00:42 +02:00
Richard Antalik
46d7bcc068 Merge branch 'blender-v3.2-release' 2022-05-03 10:56:24 +02:00
Richard Antalik
a2e3005b42 Fix VSE view clamping not working
Clamping was set up, but `v2d->cur` was never actually modified.
2022-05-03 10:55:05 +02:00
Richard Antalik
2ea9d1fccf Fix T97720: Fix meta strip shows incorrect mute state.
Caused by only checking mute state for meta strip itself and not the
children.
2022-05-03 10:55:05 +02:00
Bastien Montagne
6b74c8e486 Merge branch 'blender-v3.2-release' 2022-05-03 10:34:46 +02:00
Bastien Montagne
20f819d708 Fix T95541: Broken vertex weight with mirror modifier.
Regression from rB1a7757b0bc69/rBa0acb9bd0cc0. Special handling
(averaging) of weights on merged center vertices also requires to be
'reversed' when new correct merge order is used, compared to previous
behavior.
2022-05-03 10:33:38 +02:00
Campbell Barton
cd1044fb2b Merge branch 'blender-v3.2-release' 2022-05-03 18:33:24 +10:00
Campbell Barton
31bf70e35c Merge branch 'blender-v3.2-release' 2022-05-03 18:33:21 +10:00
Campbell Barton
cfdec85cd9 Cleanup: auto-format 2022-05-03 18:32:12 +10:00
Campbell Barton
4824cad580 GNUmakefile: include autopep8 in the "make format" target
Run autopep8 as well as clang-format when calling "make format",
the PATHS argument is passed to both utilities which will only operate
on files they support.

For example: `make format PATHS=release/scripts` formats Python scripts,
`make format PATHS=source/blender/blenlib` would format C/C++.
If users really want they can format C/C++ & Python files at the same
time since both formatting utilities filter on file extension.

`make format PATHS="release/scripts/startup/nodeitems_builtins.py source/creator/creator.c"`

A LIBDIR variable has been added to the GNUmakefile to simplify
references to this directory which can be one of 3 possible values.

Reviewed By: sybren, brecht

Ref D14789
2022-05-03 18:32:00 +10:00
Campbell Barton
61b65e9c9b Merge branch 'blender-v3.2-release' 2022-05-03 18:24:29 +10:00
Campbell Barton
4196772ae8 Merge branch 'blender-v3.2-release' 2022-05-03 18:24:26 +10:00
Campbell Barton
3a002bff7a Merge branch 'blender-v3.2-release' 2022-05-03 18:24:22 +10:00
Campbell Barton
74dfb7ca23 Fix T97731: Python traceback no longer includes line-numbers
Regression caused by [0] that caused the error message to be
created based on a normalized exception (which hid line numbers).

PyC_ExceptionBuffer{_Simple} & BPy_errors_to_report
no longer clears the exception.

This could have been resolved by changing python_script_error_jump
however that would involve changes to reference counting that are more
risky (noted in code-comment).

[0]: 2d2baeaf04d481f284bc2f098fb6d7ee9268151f
2022-05-03 18:22:54 +10:00
Campbell Barton
a821a2db3d Cleanup: remove redundant PyErr_Clear calls after PyErr_Fetch 2022-05-03 18:22:54 +10:00
Campbell Barton
1fc95d829f CMake: fix error building when CUDA_NVCC_EXECUTABLE is missing 2022-05-03 18:22:54 +10:00
Richard Antalik
f5dc675537 Merge branch 'blender-v3.2-release' 2022-05-03 10:21:35 +02:00
Richard Antalik
daa9edc9be Fix T97744: Speed effect causes memory leak
Leak was caused because output image buffer was initialized twice. Once
in speed effect strip and then by cross effect strip used for
interpolation feature.
2022-05-03 10:20:41 +02:00
Richard Antalik
fd98403211 Fix T97733: Crash when adding new scene
Caused by NULL dereference if sequencer data does not exist.
2022-05-03 10:20:41 +02:00