1
1
Commit Graph

122263 Commits

Author SHA1 Message Date
a903e7bb32 Merge remote-tracking branch 'origin' into microfacet_hair 2023-03-07 14:59:54 +01:00
b7070df8a7 Merge remote-tracking branch 'origin' into microfacet_hair 2023-03-07 14:20:17 +01:00
7f5d1fb05a Merge branch 'blender-v3.5-release' into main 2023-03-07 13:23:43 +01:00
4eb88bca58 Gitea: use full URL for referencing pull requests
For easy clicking in commit logs.

Pull Request: blender/blender#105493
2023-03-07 13:21:51 +01:00
a668e3b73a I18n: do not translate a message already translated using iface_()
This follows #105417, which allowed detection of this message.

Pull Request #105420
2023-03-07 12:32:00 +01:00
ae530592fe I18n: disambiguate messages
- "Lines" in the sense of number of lines
- "Number" can mean "amount, count" or "index, offset"
- "Second" can be an ordinal number or a unit
- "Root": add the brush curve to the "square root falloff" sense
- "Strip" can be a sequence or a type of hair rendering
- "Constant" in the sense of a value, for the Geometry Nodes add
  submenu (#105447).

Additionally, extract:
- "Press a key" from the Keymap preferences.
- "MaskLayer", upon new mask layer creation

Ref #43295, #105447
2023-03-07 12:31:59 +01:00
2a3d945dc5 Armature drawing: prevent crash on unknown draw type
While developing a new armature draw type, I was switching between
branches and opening the same test file. It would crash Blender because
it assumed that the `else` clause could only mean `(arm->drawtype ==
ARM_OCTA)`. This is now explicitly tested for.

The result is that an armature with unknown draw type is not drawn at
all, but I prefer that over either resetting the draw type to something
valid (thus altering the blend file) or downright crashing.
2023-03-07 11:48:26 +01:00
5ed8d3537b Merge branch 'blender-v3.5-release' 2023-03-07 11:34:07 +01:00
e7606139ba Fix #105467: NaN values resulting from curve editing with collision
This was caused by an incorrect assumption in the solver:
It tries to solve both collision and length constraints simultaneously,
using the projected movement of a point as a slide direction along the surface.
This only works if the distance of the previous curve point to the surface
is less than the allowed segment length. Otherwise the segment will
exceed the allowed length even with zero slide and NaN values are computed.

The case of larger surface distance can occur if the previous segment
solve was already stretching the current segment and then the point
moves further away. In this case we can simply clamp the segment length
without violating the contact constraint.

Pull Request #105499
2023-03-07 11:30:07 +01:00
64faa31bb7 Revert "Fix for NaN values resulting from curve editing with collision"
This reverts commit 98b56aadec.

Causes a compile error due to incomplete rename, and should go to release branch.
2023-03-07 11:18:05 +01:00
067fc67bdd Merge branch 'blender-v3.5-release' 2023-03-07 11:06:19 +01:00
98b56aadec Fix for NaN values resulting from curve editing with collision
This was caused by an incorrect assumption in the solver:
It tries to solve both collision and length constraints simultaneously,
using the projected movement of a point as a slide direction along the surface.
This only works if the distance of the previous curve point to the surface
is less than the allowed segment length. Otherwise the segment will
exceed the allowed length even with zero slide and NaN values are computed.

The case of larger surface distance can occur if the previous segment
solve was already stretching the current segment and then the point
moves further away. In this case we can simply clamp the segment length
without violating the contact constraint.

Fixes #105467

Pull Request #105499
2023-03-07 11:05:04 +01:00
38cba7a843 Cleanup: remove old AST code in I18n message extraction
Pre-Python 3.8, the string nodes in an AST were of type ast.Str.
Post, they are of type ast.Constant.

Remove the old naming.

Pull Request #105418
2023-03-07 10:41:57 +01:00
2e5452ee87 I18n: do not extract messages explicitly marked as not translatable
Some UI functions have a "translate" argument, which if set to False
specifies that the message is not to be translated. This sometimes
means that it was already translated beforehands.

But many messages were still getting extracted, sometimes twice in
different contexts. Some featured errors because the arguments of
various functions would be concatenated, such as:

```
col.label(text=iface_("Branch: %s") % bpy.app.build_branch.decode('utf-8', 'replace'), translate=False)
```

which would get extracted as:

```
msgid "Branch: %sutf-8replace"
```

Pull Request #105417
2023-03-07 10:41:18 +01:00
5a004ccc6a Cleanup: use function style casts, nullptr 2023-03-07 15:59:14 +11:00
5b152a4880 Docs: correct doc-string for wmEvent::customdata
Also cross-reference custom-data with GHOST_TEventType.
2023-03-07 15:57:18 +11:00
dbb4c4a687 Cleanup: use gz_prop_type for wmGizmoPropertyType
This is already the convention, missed renaming this case.
2023-03-07 15:18:18 +11:00
0e64d1e652 Docs: add comments to bNodeType init & free callbacks
When investigating ID user-count issues, it wasn't clear how nodes
were meant to handle user-count for ID's. Specifically that the
initfunc should _not_ increment the ID's user count.
2023-03-07 15:13:06 +11:00
90dc655951 Cleanup: spelling in comments 2023-03-07 15:00:05 +11:00
175b1b449e Fix #105433: Offset Tracking Shortcut no longer working
Regression caused by 03f17c42d0

The `TFM_MODAL_TRANSLATE` is used in a special way in the tracking
transformation.
2023-03-06 19:38:46 -03:00
91e191bd21 Transform: split tracking conversion
The conversion of curve tracking points is not integrated into `Tracks`
and `PlaneTracks` so its logic can be separated from the file.
2023-03-06 19:38:35 -03:00
1658de6769 Merge branch 'blender-v3.5-release' 2023-03-06 23:14:18 +01:00
83f28793c0 Fix missing data role in color management fallback
This would show as warning in gtests. Does not affect normal operation as
OpenColorIO should have a valid configuration file for Blender itself.
2023-03-06 23:01:50 +01:00
a3b0a77f50 Cleanup: UV: simplify types
No functional changes.
2023-03-07 10:33:06 +13:00
b309feb71c Cleanup: format 2023-03-07 10:24:05 +13:00
51cd560b47 Fix PLY exporter test writing files to install directory
Doing such writes leaves dangling file in the installation directory which
then is packaged as well. Not only this makes it so a random file gets
packaged for installation, it also makes notarization process to fail because
of not-so-clear reason.

The `ply_exporter_ply_data_test.SuzanneLoadPLYDataUV` fixture seems to be
unreliable and fails at random, even before this change. This makes it
hard to reliably get green light on all tests.

Pull Request #105504
2023-03-06 22:07:14 +01:00
b756915206 Cleanup: Avoid recursion for node parenting
Don't call recursion where it's redundant. The recursive algorithm
can carry dangerous behavior due to stack growth and overflow. The
probability is low for something like the frame nodes. But using a loop
is cheap, providing O(N = const) memory cost. A loop through the links
in a singly linked list is sufficient. The use of 2D vectors for
location mapping and other things can be separate.

Pull Request #105394
2023-03-06 18:39:20 +01:00
a23102528c Fix failing test after own recent commit regarding Main freeing function.
3e5ce23c99 introduced a regression in case the freed Main was part of a
list, and was supposed to be removed from it, since calling
`BLI_remlink` does _not_ clear the `prev`/`next` pointers of the removed
link.

This commit also contains a few more tweaks to recent related b3f42d8e98
commit.

Pull Request #105485
2023-03-06 16:11:35 +01:00
1f2823291a Cleanup: Add warning to ListBase's BLI_remlink regarding not cleared prev/next pointers.
While this behavior can be useful in some cases, it can also create
issues (as in one of own recent commits, 3e5ce23c99), since it
implicetly keeps the removed linknode 'linked' to the listbase.

At least warn about it in the documentation of `BLI_remlink`.
2023-03-06 16:08:45 +01:00
08bd6deb57 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-06 16:08:45 +01:00
f49a995b2c 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-06 16:08:45 +01:00
f1df811899 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-06 16:08:45 +01:00
c26566ad27 Drivers: Introduce the Context Properties
Drivers: Introduce the Context Properties

The goal: allow accessing context dependent data, such as active scene camera
without linking to a specific scene data-block. This is useful in cases when,
for example, geometry node setup needs to be aware of the camera position.

A possible work-around without changes like this is to have some scene
evaluation hook which will update driver variables for the currently evaluating
scene. But this raises an issue of linking: it is undesirable that the asset
scene is linked to the shot file.
Surely, it is possible to have post-evaluation handler to clear the variables,
but it all starts to be quite messy. Not to mention possible threading
conflicts.

Another possibility of introducing a way to achieve the goal is to make it so
the dependency graph somehow parses the python expression where artists can
(and already are trying to) type something like:

  depsgraph.scene.camera.matrix_world.col[3][0]

But this is not only tricky to implement properly and reliably, it hits two
limitations:

- Currently dependency graph can only easily resolve dependencies to a RNA
  property.

- Some properties access which are valid in Python are not considered valid
  RNA properties by the existing property resolution functions:

  `camera.matrix_world[3][0]` is a valid RNA property, but
  `camera.matrix_world.col[3][0]` is not.

Using driver variables allows to have visual feedback when the path resolution
fails, and there is no way to visualize errors in the python expression itself.

This change introduces the new variable type: Context Property. Using this
variable type makes allows to choose between Active Scene and Active View
Layer. These scene and view layer are resolved during the driver evaluation
time, based on the current dependency graph.

This allows to create a driver variable in the following configuration:

- Type: Context Property
- Context Property: Active Scene
- Path: camera.matrix_world[3][0]

The naming is a bit confusing. Tried my best to keep it clear keeping two
aspects in mind: using UI naming when possible, and follow the existing
naming.

A lot of the changes are related on making it so the required data is available
from the variable evaluation functions. It wasn't really clear what the data
would be, and the scope of the changes, so it is done together with the
functional changes.

It seems that there is some variable evaluation logic duplicated in the
`bpy_rna_driver.c`. This change does not change it. It is not really clear why
this separate code path with much more limited scope of supported target types
is even needed.

There is also a possible change in the behavior of the dependency graph: it
is now using ID of the resolved path when building driver variables. It used
to use the variable ID. In common cases they match, but when going into nested
data-blocks it is actually correct to use relation to the resolved ID. Not sure
if there was some code to ensure that, which now can be resolved. Also not sure
whether it is still needed to ensure the ID specified in the driver target is
build as well. Intuitively it is not needed.

Pull Request #105132
2023-03-06 16:01:47 +01:00
4fb6e45b37 Curves: change default font offset from 1.0 to 0.0
Currently, curves have a default offset of 1.0, while the initial (and
expected) value is 0.0. When resetting this value to its default, the
curve is now modified unexpectedly. This is most noticeable with text
objects: when resetting the offset of a new text, it will look very
broken.

Internally the value is stored with an offset of 1.0, with custom
setter and getter adding and subtracting 1.0 respectively. To give
this property a default of 0.0, we also need to add 1.0 to the initial
value upon curve creation.

Pull Request #105182
2023-03-06 14:28:40 +01:00
4dc59c7311 I18n: add per-socket translation contexts for nodes
In order to properly translate UI messages, they sometimes need to be
disambiguated using translation contexts. Until now, node sockets had
no way to specify contexts and collisions occurred.

This commit adds a way to declare contexts for each socket using:
`.translation_context()`

If no context is specified, the default null context is used.

Pull Request #105195
2023-03-06 14:24:36 +01:00
214b24e025 Cleanup: Fix incorrectly formatted multi-line docstring
This has the effect that the message is cut off at the end of the
first line. I copied the solution from other similar docstrings
elsewhere in the code.

As far as my regex-fu can tell, there are no other occurrences of this
in the codebase.

Issue reported by Joan Pujolar in #43295.

Pull Request #105474
2023-03-06 14:09:44 +01:00
61b457d390 Vulkan: Push constants
**What are push constants?**

Push constants is a way to quickly provide a small amount of uniform data to shaders.
It should be much quicker than UBOs but a huge limitation is the size of data - spec
requires 128 bytes to be available for a push constant range.

**What are the challenges with push constants?**

The challenge with push constants is that the limited available size. According to
the Vulkan spec each platform should at least have 128 bytes reserved for push
constants. Current Mesa/AMD drivers supports 256 bytes, but Mesa/Intel is only 128
bytes.

**What is our solution?**

Some shaders of Blender uses more than these boundaries. When more data is needed
push constants will not be used, but the shader will be patched to use an uniform
buffer instead. This mechanism will be part of the Vulkan backend and shader
developers should not see any difference on API level.

**Known limitations**

Current state of the vulkan backend does not track resources that are in the
command queue. This patch includes some test cases that identified this issue as
well. See #104771.

Pull Request #104880
2023-03-06 12:28:55 +01:00
08db6bf215 IO: factor out axis validation logic between OBJ and PLY
The up_axis_update/forward_axis_update was the same logic between
the two, so factor that out.

Also use the same time reporting logic in PLY as in OBJ/USD/Alembic.
2023-03-06 10:22:01 +02:00
62c4dce83b Merge remote-tracking branch 'upstream/blender-v3.5-release' 2023-03-06 09:18:42 +01:00
c3fdb02b91 Updated translations from SVN trunk (r6369). 2023-03-06 09:17:14 +01:00
4e32864786 Cleanup: Remove compilation warning.
In MTLTexture it was checked that this was valid. What in that
case should always be true.
2023-03-06 08:40:30 +01:00
5a20c63975 Fix #104534: Image editor doesn't refresh after render.render.
When render is triggered from python and the render result is displayed
it isn't being updated as it wasn't tagged as being invalid.

Pull Request #105480
2023-03-06 08:38:53 +01:00
3674de160d Fix #105395: Handle quoted paths better in the OBJ importer
If the texture image path in the MTL is a "quoted" absolute path, the importer will fail to find the
file. It was only attempting to un-quote the path for the relative case. Now we attempt to un-quote
in all cases.

Pull Request #105478
2023-03-05 21:32:24 -08:00
049027d697 Cleanup: Fix a few messages in the UI
Issues reported by Joan Pujolar in #43295.

- uv -> UV everywhere.
- Wrong plurals.

Pull Request #105473
2023-03-05 21:32:23 -08:00
68d5784802 Fix #105395: Handle quoted paths better in the OBJ importer
If the texture image path in the MTL is a "quoted" absolute path, the importer will fail to find the
file. It was only attempting to un-quote the path for the relative case. Now we attempt to un-quote
in all cases.

Pull Request #105478
2023-03-06 06:29:40 +01:00
507c442289 Cleanup: UV: simplify types
No functional changes.
2023-03-06 17:27:45 +13:00
96263368b5 Cleanup: Unused variables, missing includes in PLY IO 2023-03-05 22:31:43 -05:00
3c5a15db57 Cleanup: Small tweaks to new PLY code
- Add missing braces for if statements
- Tweak variable naming to use snake case
- Use more common name for `MLoop`s of a face
- Use `std::move` when appending an array
- Use const for a few variable declarations
2023-03-05 22:12:26 -05:00
9eee008691 Fix Cycles oneAPI build error due to conflicting CONSTANT define 2023-03-06 00:13:21 +01:00
7d5754b8b6 Cycles: Reuse random variable for principled hair BSDF sampling
This lets us skip the hash and use a proper stratified variable instead.
Suggested by Christophe Hery.
2023-03-06 00:09:04 +01:00