Commit Graph

124057 Commits

Author SHA1 Message Date
Pablo Vazquez
54855dcec3 UI: Add timeline to Geometry Nodes workspace
With simulations integrated into geometry nodes it makes more sense than
ever to have a timeline in the Geometry Nodes workspace by default.

Pull Request: https://projects.blender.org/blender/blender/pulls/107982
2023-05-16 18:31:27 +02:00
Julian Eisel
122adc9e69 Fix asset list not providing some previews
Fixes preview images not showing up in asset-view templates or the in
development asset shelf.

The sliding-window optimization to only load previews that are in view
(or close to it) can't really be used by the asset-list API, since
figuring out what's actually in view is a bit tricky. So we have to
ensure all previews are loaded for now.
2023-05-16 17:48:02 +02:00
Michael Kowalski
74b5e62d2a Fix #107633: USD import: duplicate shader nodes
This pull request addresses bug https://projects.blender.org/blender/blender/issues/107633

Added logic to avoid creating duplicate Blender shader nodes when
converting USD Preview Surface shaders that are connected to more
than one input.

This change adds a `NodePlacementContext::node_cache` map to record
Blender nodes converted for given USD shaders.  The node creation
logic has been updated to query this cache to check if a node was
previously created for a given USD shader, before creating a
new node.

Pull Request: https://projects.blender.org/blender/blender/pulls/107945
2023-05-16 17:46:25 +02:00
Hans Goudey
859c0d9edf Cleanup: Remove redundant node type lookup function
Using the topology map gives a constant time lookup, since it has a map
of nodes per type. The collada code used the old function, but had been
ifdef'd for four years, so it's removed here.
2023-05-16 11:09:42 -04:00
Hans Goudey
216cb9e3f0 Fix: Assert loading undefined geometry node 2023-05-16 11:09:42 -04:00
Miguel Pozo
eb0e03bae7 Workbench Next: Volumes
Port of the Workbench volumes to Workbench Next using the new Draw Manager API.

Pull Request: https://projects.blender.org/blender/blender/pulls/105501
2023-05-16 16:56:21 +02:00
Michael B Johnson
ce83b26a33 Fix #107903: USD export: output emissiveColor in UsdPreviewSurface
Added support for emissiveColor in UsdPreviewSurface export, mapping the
PrincipledShader's Emission input to it.

Co-authored-by: pwflocal <drwave@apple.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/107947

A similar solution was also proposed and discussed in pull request
https://projects.blender.org/blender/blender/pulls/104490
by Ashley Ruglys <ashley.ruglys@gmail.com>.
2023-05-16 15:57:26 +02:00
Hans Goudey
d87547abd5 Cleanup: Remove unused node function for finding link
Nowadays it's much better to use the topology cache.
2023-05-16 09:44:41 -04:00
Hans Goudey
320ac28f75 Cleanup: Remove unnecessary struct keywords in node header 2023-05-16 09:43:05 -04:00
Hans Goudey
f3babec2df Cleanup: Undo move of functions in previous node cleanup commit
Functions were moved as part of f7388e3be5bbdfa21691, which was
unnecessarily noisy. Instead of reverting, move the definitions back
to their original place in node.cc. Also move a few more things to
the blender::bke namespace.
2023-05-16 09:39:53 -04:00
Miguel Pozo
3b4354d4fb EEVEE Next: Default world null check before free
Fix previous commit
2023-05-16 15:35:44 +02:00
Miguel Pozo
d0e635d077 EEVEE Next: Fix crash on Scenes without a World
Create a default world when scenes don't have one.
This is a 1:1 copy of the current EEVEE implementation.

Pull Request: https://projects.blender.org/blender/blender/pulls/107891
2023-05-16 15:06:43 +02:00
Germano Cavalcante
932baa18b7 Fix #106558: Add Primitive tool options not saving
Since a generic snap cursor was implemented (which can be used by Tools and by DragDrop), the Placement Settings are no longer a settings of the "VIEW3D_OT_interactive_add" Operator.

With that implementation, those properties started to be defined in a
static struct, filled in at runtime and accessed in the UI through
workarrounds.

As they are properties initialized at runtime, they are not saved in
the file.

The solution is to move the Placement Settings to `ToolSettings`.

Co-authored-by: Germano Cavalcante <germano.costa@ig.com.br>
Pull Request: https://projects.blender.org/blender/blender/pulls/107951
2023-05-16 15:00:45 +02:00
Damien Picard
3f1ea280cf I18n: translate node group socket type and subtype
Node group sockets have user-exposed data types, and sometimes
subtypes for some data types (e.g. Percentage or Angle for floats).
The UI to select these types and subtypes use an operator menu with a
text depending on the current type or subtype.

This button needs to be manually translated since its label is
manually defined.

Additionally, some subtypes need to be extracted from the Property
class's RNA_ENUM_PROPERTY_SUBTYPE_NUMBER_ITEMS, so this commit also
removes Property from the extraction blacklist in
bl_extract_messages.py. This has the side effect that it introduces a
few dozens translations, which are probably not used anywhere.

Pull Request: https://projects.blender.org/blender/blender/pulls/107100
2023-05-16 14:53:28 +02:00
Damien Picard
b905b02222 Remove newly added "Theme" i18n context, replace its use by "Color"
Pull Request: https://projects.blender.org/blender/blender/pulls/107139
2023-05-16 14:52:05 +02:00
Damien Picard
dc999d83b4 I18n: disambiguate a few messages
- "Out" meaning "one end of a bone". Same as in 9120c86c3f.
- "Canvas" meaning a painting support for Dynamic Paint.
- "Twist" meaning an action verb, as opposed to an amount.
- "Solid" meaning a textureless, single-color material.
- "Blend mode" meaning material opacity blending, as opposed to color
  blending.
- "Pixel Size" meaning "a size measured using pixels as the unit".
- "Light" meaning "not dark", as in "Light Theme".

Ref #43295
2023-05-16 14:51:52 +02:00
Damien Picard
22f641e7f8 Cleanup: I18n: Remove extraction macros from node socket declarations
The previous two commits introduced new regexes to extract node socket
names and descriptions automatically from the i18n Python module,
including socket labels.

This commit removes the extraction macros from all node files since
they are now redundant.

Pull Request: https://projects.blender.org/blender/blender/pulls/107258
2023-05-16 14:12:54 +02:00
Damien Picard
f7ffcd84cc I18n: Add message extraction regexes for node socket labels
Some node sockets get their names from a "label", instead of the
declaration. These labels are not necessarily the same as the
declaration, so they need to be extracted to the translation files.

They are always in a `node_sock_label()` function. It has two args,
the second of which is the string we want to extract.
2023-05-16 14:12:51 +02:00
Damien Picard
6d39ba7b41 I18n: Add message extraction regexes for node socket declarations
The node socket declarations use the `N_()` macro to extract the name
and description of the socket.

This is quite redundant because since the syntax is always the same,
the extraction can be done automatically from the Python translation
module using regexes.

Four new regexes are introduced in bl_i18n_utils.settings:
- one extracts contextless messages from `add_input()` and
  `add_output()`, the basic socket declarations with the names;
- one does the same, but for those sockets which declare a context
  through `.translation_context()`;
- one extracts descriptions and error messages;
- one extracts geometry nodes field inputs.

In addition to making the code simpler and more legible, this change
extracts a few dozen messages which were not tagged with the proper
macro.
2023-05-16 14:12:51 +02:00
Brecht Van Lommel
f0701bdf73 Refactor: add reduce functions for float2 for consistency
Pull Request: https://projects.blender.org/blender/blender/pulls/107970
2023-05-16 13:56:08 +02:00
Clément Foucault
8fb6b51410 GPU: Fix false positive include of debug_draw
This created unfulfilled resources binds that would
trigger an assert when running with Metal Backend.
2023-05-16 12:54:29 +02:00
88f536dc02 Add always-positive modulo function
Add modulo function `mod_f_positive(f, n)` that returns a positive result,
regardless of the sign of `f`.

For example, `mod_f_positive(-0.1, 1.0)` returns `0.9`, whereas the
standard `fmodf()` function would return `-0.1`.

This is useful for rewrapping values to a specific interval.
2023-05-16 11:41:17 +02:00
Damien Picard
072002a672 I18n: translate Quick Fur data
The Quick Fur operator creates a curves object with hair modifiers and
a material.
These modifiers' and material's names can be translated if the user
chose to translate data in the preferences.

Only the modifier names are translated, the node groups are not
because they may be reused instead of appended again.

Pull Request: https://projects.blender.org/blender/blender/pulls/107909
2023-05-16 10:46:10 +02:00
Damien Picard
56df93bfc6 I18n: Asset browser: do not translate non-editable tags
Asset tags are data and should not be translated, even if they are
built-in data such as hair nodes.

Issue reported by @SatoshiYamasaki in #43295.

Pull Request: https://projects.blender.org/blender/blender/pulls/107907
2023-05-16 10:45:15 +02:00
Damien Picard
7849857dfb I18n: extract messages related to paint curves
Two new messages are extracted:
- "New" in the context of paint curves. Used for the template_ID to
  create a new curve;
- "PaintCurve", the default name of a newly-created paint curve.

Pull Request: https://projects.blender.org/blender/blender/pulls/107888
2023-05-16 10:42:32 +02:00
Damien Picard
e268f42e02 I18n: extract a few messages
A few new messages were extracted.

- "Catalog", the default name when creating a new catalog.
- Tooltips related to drag and dropping catalogs in the asset browser.
  Some use `fmt::format()` as a possible solution to messages
  currently extracted with string concatenation as mentioned in
  #92758.

Pull Request: https://projects.blender.org/blender/blender/pulls/107710
2023-05-16 10:41:25 +02:00
Brad Smith
02202dd5a1 Glog: fixed OpenBSD support
- Usage of syscall() is not allowed
- Use getthrid() to retreive the thread ID

Pull Request: https://projects.blender.org/blender/blender/pulls/107818
2023-05-16 09:30:35 +02:00
Chris Blackbourn
6daa3f6b8a UV: Fix packing problem with locked-position and large island count 2023-05-16 17:19:31 +12:00
Campbell Barton
36c682c551 Cleanup: remove redundant call to mat4_to_size 2023-05-16 14:41:21 +10:00
Campbell Barton
0de1791164 Cleanup: quiet C4189 warning for MSVC 2023-05-16 14:33:02 +10:00
Campbell Barton
802af4e04b BLI_file: split BLI_rename into two functions
Include the term "overwrite" so users of this function are aware
this function will delete the destination file (unlike LIBC rename).

- Add BLI_rename_overwrite (previously called BLI_rename).
- BLI_rename is now a wrapper for rename.

Use BLI_rename when renaming in the file selector.
2023-05-16 13:15:48 +10:00
Campbell Barton
d2a3689b4a Docs: add doc-string for BLI_rename
Since this may delete the destination file,
it's important to note when that happens.

Also note why path comparison isn't used in code-comments.
2023-05-16 13:01:39 +10:00
Campbell Barton
8ab0196607 BLI_file: BLI_rename no longer checks for the destination path on WIN32
This change was made to prevent renaming files in the file selector from
deleting the file, see: #12255 & [0]. This check is no longer needed as
file selectors now checks the destination doesn't exist before renaming.

Generally, having low level file handling functions behave differently
between platforms is something to avoid with the potential of leading
to unexpected behavior.

Also unify WIN32/UNIX BLI_rename.

[0]: 41ad6f9d0a5923a5f4607417c607d37a10317ee1
2023-05-16 12:59:50 +10:00
Campbell Barton
8d5255d6a1 Fix BLI_rename returning success on failure for WIN32
When the `from` file didn't exist, BLI_rename returned success,
the in-line doc-string was incorrect - remove in favor of the header's
doc-string. This error existed since the initial revision.
Note that this was fixed [0] for other systems.

[0]: 622019a085c4a1e4290d588307cd8ab095c70231
2023-05-16 11:24:49 +10:00
Campbell Barton
5d695b4f06 Fix memory leak in BLI_file_older for WIN32
Error from [0] which added UTF16 path support,
resolve using `BLI_stat` to avoid inline allocation.

[0]: f11a6d3a847e8e18faefd8694373d2f11b5ec802
2023-05-16 11:24:14 +10:00
Chris Blackbourn
4b4babae8b UV: Improve correctness of uv packer
Minor corrections including:
* Fast packer wasn't treating locked islands correctly.
* Pointer aliasing.
* Fix and some assumptions that might not be always true.
* Improve variable names.
* Improved comments.
2023-05-16 11:00:35 +12:00
Chris Blackbourn
0b1a5dfba4 Cleanup: format 2023-05-16 10:15:56 +12:00
Damien Picard
dd32dac60f I18n: disambiguate Mix node A and B inputs
In some languages, the A and B sockets need to be disambiguated
because because they can have different letters depending on context.

In Spanish, A is used for B (Blue -> Azul), while the greek letter
alpha is used for A, to disambiguate Azul / alpha.

Pull Request: https://projects.blender.org/blender/blender/pulls/107706
2023-05-15 19:55:36 +02:00
Damien Picard
a3a36e7f75 I18n: remove operator categories from the translation files
Many messages were no longer needed since Blender 2.80.

Those messages appeared in the operator search menu and described what
category each operator belonged to. After Blender 2.80, this was
replaced by a place in the UI from where the operator can be called.

Pull Request: https://projects.blender.org/blender/blender/pulls/107700
2023-05-15 19:53:01 +02:00
Damien Picard
9603c38ab8 I18n: translate node assets in Add Search menu
Asset nodes got translated in the Add Node menu, but not in the Add
Search menu.

Pull Request: https://projects.blender.org/blender/blender/pulls/107316
2023-05-15 19:00:31 +02:00
Damien Picard
9b64abc236 I18n: Fix some language names from #105461
Some language names were confirmed by native speakers to be
incorrectly spelled (Dutch and Hindi).

Two others were simply capitalized (Vietnamese and Kazakh).

Suspicions remain for other language names, see #105461 for details.

Pull Request: https://projects.blender.org/blender/blender/pulls/107707
2023-05-15 18:06:06 +02:00
Xavier Hallade
66df452df2 Cycles: oneAPI: enable hardware raytracing by default 2023-05-15 16:36:51 +02:00
Michael Kowalski
42342124f8 USD export: option to add a root prim.
This  pull request adds a 'root_prim_path' USD export string parameter.  If this option is set to a well-formed prim path (e.g., '/World'), a transform primitive with the given path will be added to the stage as the parent of all exported primitives. This will allow transforming the scene by this root node in other applications and is also required for loading the exported scene as a reference in other USDs.

As part of this change, the '_materials' node, which contains all exported materials, is also created under the root prim.   This is required so that materials are imported correctly when the USD is referenced in another stage.

Finally, added an export_params_valid() function to verify that the 'root_prim_path' is valid before starting the export job.  This function can be extended in the future to perform additional validation of other export parameters.

This update combines work in pull request
https://projects.blender.org/blender/blender/pulls/104506
and an implementation in the 'universal-scene-description' branch.

Co-authored-by: Ashley Ruglys <ashley.ruglys@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/107855
2023-05-15 16:00:59 +02:00
Damien Picard
1d6464cf97 Fix error when adding a simulation zone while using i18n
When adding a new simulation zone, the input and output would be
accessed by their name, however the name can be translated if the user
has enabled translation of data.

Instead, get the first socket of type 'GEOMETRY' in the simulation
input and output nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/107819
2023-05-15 15:38:35 +02:00
Iliya Katueshenock
f7388e3be5 Cleanup: Move BKE_node.h to C++
See: https://projects.blender.org/blender/blender/issues/103343

Changes:
1. Added `BKE_node.hh` file. New file includes old one.
2. Functions moved to new file. Redundant `(void)`, `struct` are removed.
3. All cpp includes replaced from `.h` on `.hh`.
4. Everything in `BKE_node.hh` is on `blender::bke` namespace.
5. All implementation functions moved in namespace.
6. Function names (`BKE_node_*`) changed to `blender::bke::node_*`.
7. `eNodeSizePreset` now is a class, with renamed items.

Pull Request: https://projects.blender.org/blender/blender/pulls/107790
2023-05-15 15:14:22 +02:00
Bastien Montagne
2a8c20853c Fix LibOverride broken resync behavior in some cases after recent changes.
The issue was that in case an ID was only related to its liboverride
hierarchy through a 'to' pointer (e.g. the parent pointer of an object),
it would now be tagged as 'isolated' from its hierarchy, since nothing
in said hierarchy actually points to it. It would then be deleted during
resync process.

This is once again the infamous 'inverted dependency logic of object
parenting' case...

Note that this did not have any consequences on typical liboverride
usages (based on using a hierarchy of collections0, since all objects
would then be referenced by one or more collection.

Reported by @dr.sybren while investigating #102662.
2023-05-15 13:47:15 +02:00
Sahar A. Kashi
b196109dac Cycles: enable HIP-RT for AMD hardware ray-tracing
Upgrade to the latest SDK, and enable in daily and release builds where it's
available as an option under Preferences > System.

There are some known limitations, see #104110 and release notes.

Pull Request: https://projects.blender.org/blender/blender/pulls/105538
2023-05-15 13:46:06 +02:00
Campbell Barton
a85ad2d0eb Cleanup: remove f-string use, single quote enums 2023-05-15 20:58:00 +10:00
Campbell Barton
98dd91f418 WM: make all blend file paths absolute & normalized on read/write
Ensure the file path G.main->filepath is always absolute and normalized.

- It was possible to call WM_OT_open_mainfile with only a filename,
  if this resolved from the CWD, Blender's internal filepath
  would not be absolute as expected.

- It was possible to open files on UNIX with an additional forward slash
  causing the blend file path it's self to contain a '//' prefix,
  this is error prone as running BLI_path_abs(..) multiple times would
  add the blend file prefix each time.

- Remove requirement for "filepath" to be an absolute path when saving.
  Instead, expand the path - making it absolute, as this constraint
  wasn't applied open opening files, prefer making save/open behave
  consistently.

- Assert when BLI_path_abs/BLI_path_rel receive a basepath that has
  a "//" (relative) prefix itself.
2023-05-15 19:58:40 +10:00
Campbell Barton
5285cd9a7b BLI_path: use native normalize (avoids // prefix on UNIX) 2023-05-15 19:58:39 +10:00