Compare commits

...

1172 Commits

Author SHA1 Message Date
3ce788e015 Progress on input properties, currently crashes 2023-04-12 16:48:59 -04:00
8be481fbd8 Fix missing update tag 2023-04-12 16:18:46 -04:00
a385a00821 Merge branch 'main' into node-group-operators 2023-04-12 15:58:29 -04:00
e35f971da1 Mesh: Avoid unnecessarily initializing corner topology arrays
This data should be initialized when building the mesh. If the arrays
aren't already initialized, there is already a bug. Theoretically this
could improve performance, since we can use `malloc` instead of
`calloc`. In practice I observed less than a 1% difference though.
2023-04-12 15:49:09 -04:00
a04098ebba Fix: Incorrect creation of deform mesh with no deform modifiers
Logic error in 99c630cd9c, hidden by a null check
in `BKE_id_copy_ex`.
2023-04-12 15:42:14 -04:00
16de3ba759 Fix #106845: Extrude node crash when no faces added
The non-individual face mode needs to check if there are any new faces
before accumulating their corner offsets.
2023-04-12 15:40:55 -04:00
e03da77033 Curves: Avoid unnecessary allocations in copy and move constructors
These aren't used much in current code, but currently they created
offsets on the result curves, then just freed them again when copying
from the source data. In the future it might be better to completely
avoid using the base constructor in the first place.
2023-04-12 15:32:30 -04:00
dccd42766c Cleanup: Use swap to take ownership of mesh data
Swap is commonly used to implement move assignment since it's short
and the logic is relatively simple. Use is here to avoid the need to
spell out the copying and freeing manually. The `BKE_id_free` call
at the end of the function will free whatever data was swapped.
2023-04-12 15:08:15 -04:00
642bc5546a Cleanup: Access curves offsets in RNA with C wrapper function
This simplifies the process of adding implicit sharing to the curve
offsets in the future.
2023-04-12 14:58:17 -04:00
b7e9906337 Cleanup: Remove unnecessary check when allocating mesh face offsets
The assert already checks this, but even in release builds,
doing nothing is probably worse than a memory leak here.
2023-04-12 14:56:28 -04:00
dd229a9d54 Cleanup: Slightly CurvesGeometry reorganize read function
The curve types and the runtime always have to be created when reading
the file from disk, so we might as well do that in `blend_read`, which
will help in the future when the offsets use implicit sharing.
2023-04-12 14:54:18 -04:00
87cd22f643 Cleanup: Use early return in legacy curve conversion
Return null instead of an empty curves data-block, which amounts to
the same thing in geometry nodes, with less potential for error in
the rest of the function.
2023-04-12 14:51:24 -04:00
2b6c1600cf UI: Allow Float Kerning for Text Objects
Change Text Object character `kern` member to float from int, and allow
fractional changes to kerning with Shift-Alt-arrows.

Pull Request: blender/blender#105181
2023-04-12 19:11:53 +02:00
0ee0e8c0d4 UI: Tooltips for Assets
Show tooltips for Asset Browser items.

Pull Request: blender/blender#106189
2023-04-12 18:44:47 +02:00
000aef6e5e Cleanup: Use references in mesh.cc 2023-04-12 11:49:43 -04:00
baf6892270 Cleanup: Add utility function for clearing mesh geometry
The existing utility cleared vertex group names and active attribute
names, which doesn't always make sense when the geometry is
replaced but the custom data layout remains mainly unchanged.
2023-04-12 11:49:43 -04:00
2771f53cb7 UI: Fix disconnected and non-clickable checkbox labels in popovers
For popovers, draw the checkbox in header as usual with label, but
hide the panel header label, see ed870f87b9.

Patch by Yevgeny Makarov (@jenkm) in
https://archive.blender.org/developer/D9586

Co-authored-by: Yevgeny Makarov <jenkm>
Pull Request: blender/blender#105657
2023-04-12 17:00:51 +02:00
c738d8df84 Cleanup: VSE clipboard: Remove code in blo_lib_link_restore.
This code (looking for matching new IDs to restore by name) is called
from `set_app_data` after a .blend file has been read (also in memfile
undo case).

The part handling VSE clipboard to restore ID pointers is not really
needed, since pasting VSE strips already ensures stored ID pointers are
still valid, and tries to find a new matching one otherwise.
2023-04-12 16:18:25 +02:00
c40ce3baae Cleanup: I18n: sort disambiguation contexts from BLT_translation.h
The contexts appear twice, in the list of #defines and in the
BLT_I18NCONTEXTS_DESC. Both had gotten out of alphabetical order, and
out of sync.

Pull Request: blender/blender#106718
2023-04-12 15:09:21 +02:00
5cf365554b I18n: disambiguate a few messages
- "Lens" can be a transparent object used in cameras, or specifically
  its property of focal length
- "Empty" can be an adjective meaning void, or an object type. The
  latter is already disambiguated using `ID_ID`
- "New" and "Old" are adjectives that can have agreements in some
  languages
- "Modified" is an adjective that can have agreement in some languages
- "Clipping" can be a property of a camera, or a behavior of the
  mirror modifier
- "Value" in HSV nodes, see #105113
- "Area" in the Face Area geometry node, can mean a measurement or a
  window type
- "New" is an adjective that can have agreement
- "Tab" can be a UI element or a whitespace character
- "Volume" can mean a measurement or an object type. The latter is
  already disambiguated using `ID_ID`

These changes introduce the new `BLT_I18NCONTEXT_TIME` translation
context.

They also remove `BLT_I18NCONTEXT_VIRTUAL_REALITY`, which I added at
one point but then couldn't find which messages I wanted to fix with
it.

Ref #43295

Pull Request: #106718
2023-04-12 15:09:17 +02:00
c31434a570 Cleanup: Remove setting polygon loop total from Python
This property is not editable after 7966cd16d6,
though doing so didn't seem to give an error. It doesn't have
to be set anymore, since the data is redundant with the
"loop_start" anyway.
2023-04-12 08:38:32 -04:00
30d8cb3be8 Fix #106246: Outliner: Crash on deleting the multi-level objects hierarchy.
Existing code was intrisically wrong, and also potentially very
innefficient.

Now tagging objects for deletion and removal is separated from actual
collection removal and object deletion. This makes the code safer,
simpler and more efficient.

NOTE: There is still an unsolved (already existing in original code)
issue with checks on objects that should not be deleted, noted in code.

Pull Request: blender/blender#106821
2023-04-12 14:25:40 +02:00
81815681d0 Python API: Add function to create links to virtual sockets
Links created through the normal Python API are invalid since
7026096099. Before then, one could create links to or from virtual
sockets from Python (grayed out sockets in Group Input and Group
Output nodes), as is still possible in the GUI.

This is documented as an API change, and it broke at least Node
Wrangler, see blender/blender-addons#104470. Instead of just fixing
that, let's introduce an API to make this operation simpler.

Pull Request: blender/blender#105975
2023-04-12 14:18:29 +02:00
9ffd413008 macOS/Linker: support mold and lld
If someone buys "sold", mold should work on macOS too.
With lld, Blender (700 MB) intel i5: 26s -> 17s.

Pull Request #106843
2023-04-12 17:01:53 +05:30
da75495ada Fix user add-ons not showing up with "User" filter in Preferences
Mistake in ba25023d22, updated the drawing code with the wrong function
call. So when setting the add-ons category to "User", add-ons installed
in the user paths (custom paths configured in Preferences) wouldn't show
up.
2023-04-12 13:04:54 +02:00
ac09d18e4e Fix #106840: Add-ons not loading from custom script directories
`script_paths()` wasn't updated correctly, but that was hidden by some
compabtibility logic that was in the patch earlier. Only with my last
change to the PR before merging it that was removed and the error became
quite visible.
2023-04-12 13:02:31 +02:00
3f4f975228 I18n: fix footer in the text editor when loading an external file
When loading an external file in the text editor, the footer text
stating "File: <file>" or "File: <file> (unsaved)" was not translated,
because the translation happened after string formatting, and the
message was thus not found in the po files.

Pull Request: blender/blender#106716
2023-04-12 12:19:00 +02:00
007c9e4e47 Fix #106427: Vector Math node does not appear in node search
When trying to search for the Vector Math node with a translated
interface, the node did not come up because it did not use the proper
translation context.

The Vector Math node's RNA had a translation context added in
db87e2a638, in order for the Floor operation to be disambiguated. I
made a mistake and added the context to the entire node struct instead
of just the Operation prop. This had the result that the Vector Math
was searched with an empty context in the search menu, but could not
be found.

Replacing the translation context from the struct to the property
fixes the issue, and actually allows disambiguating operations such as
Floor, which wasn't achieved previously.

Pull Request: blender/blender#106579
2023-04-12 12:01:48 +02:00
1771ded381 Fix: Call OpenImageIO correctly when creating grayscale images
The call to `channel_sum` requires that the `weights` array is at least
as large as the number of channels in the originating buffer.

Switch to use the span overload as well since the method that takes a
raw weights array is deprecated.

Thanks to @aras_p for debugging the issue.

Pull Request: blender/blender#106847
2023-04-12 10:23:34 +02:00
022652beb9 Fix #106794: Changing active camera changes other viewport local cameras
f36543c5f5 took care of syncing multiple viewport`s cameras, but wasnt
fully meeting intentions [which was to only do this if both viewports
are locked to the scene camera].

Check was only done for the viewport this was executed in (if this was
locked to the scene camera, it would change all other viewports as
well), now also check if the target viewport prefers to use its own
local camera instead and skip it in that case.

Pull Request: blender/blender#106799
2023-04-12 10:10:12 +02:00
13d9a6c929 Cleanup: improve comments for makesrna dependency workaround 2023-04-12 17:23:08 +10:00
28a8a3c086 Fix crash on startup under the RIVER Wayland compositor
Defer acting on the tag to update scale as it caused the window
to use the wrong scale on startup & exit.

GTK/KDE applications seem to postpone updating scale so use this by
default as glitches with scale tend to be caused by updating the scale
too frequently instead of not quickly enough.
2023-04-12 15:54:06 +10:00
ddb6928882 GHOST/Wayland: resize the EGL buffer & change surface scale immediately
There is no need to postpone these operations when configuring the frame
only postpone committing the surface change.

Deferring these operations caused flickering when moving windows
between monitors of different scale on both GNOME & KDE.
2023-04-12 15:54:06 +10:00
1f3949f1cf Fix building WITH_CINEON=OFF 2023-04-12 15:54:06 +10:00
aa3bdfd76a Image: Use OpenImageIO for loading and saving a variety of image formats
This checkin will use OIIO to replace the image save/load code for BMP,
DDS, DPX, HDR, PNG, TGA, and TIFF.

This simplifies our build environment, reduces binary duplication,
removes large amounts of hard to maintain code, and fixes some bugs
along the way.

It should also help reduce rare differences between Blender and Cycles
which already uses OIIO for most situations. Or potentially makes them
easier to solve once discovered.

This is a continuation of the work for #101413

Pull Request: blender/blender#105785
2023-04-12 05:22:26 +02:00
c6d6869171 GHOST/Wayland: suppress EGL_BAD_SURFACE error on exit
Freeing ContextEGL would attempt to free the context's EGLSurface,
which was already freed by the native-window, causing 2x bad-surface
errors on exit.

Suppress the warning by clearing the surface from releaseNativeHandles
when the surface was created by a native window.
2023-04-12 13:12:01 +10:00
b6457dc568 Fix #106740: VSE Image sequence can't be loaded from python
Caused by introduction of `SEQ_SINGLE_FRAME_CONTENT` flag (66eedc542b).
The flag was not updated in `SequenceElements` `append` and `pop`
functions.
2023-04-12 03:40:07 +02:00
6fa80d1e1d Cleanup: add doc-strings to upper/lowecase functions
Move detailed note into the implementation.
2023-04-12 11:24:12 +10:00
ccea39b538 Cleanup: spelling in comments 2023-04-12 11:24:10 +10:00
5df8e35da7 UI: Add slash separators to Hue/Saturation/Value
It was that names of related "combo" operations
like Hue/Saturation/Value, *Dilate/Erode*
and Brightness/Contrast should be separated
by slashes in their names.

This patch changes this for the multiple nodes
and operators concerning Hue/Saturation/Value
across Blender.

Note1: This patch should only touch UI names
which do not need versioning and should not
break scripts.

Note2: This breaks first letter fuzzy search
for "hsv". It was noted by @HooglyBoogly that
the "/" character needs to be added to the
fuzzy search split list. Note however that such
search is already broken in Main for nodes like
Brightness/Contrast and Dilate/Erode which
already use slash separators

Pull Request: blender/blender#106721
2023-04-11 23:48:05 +02:00
4170545dc5 Fix #106828: Extrude individual mode crash on mesh with no faces
Caused by 7966cd16d6
2023-04-11 15:34:03 -04:00
f8108d6dfd UI: Rename Bright/Contrast to Brightness/Contrast
Rename *Bright/Contrast* to *Brightness/Contrast* in order to avoid the use of shortened names and improve consistency within Blender and with industry conventions.

Reasoning:

The modified color characteristic is called *brightness*, not *bright*. You don't modify the *bright* of an image.

This also interferes with search in case someone searches for brightness, producing no results.

*Note: This patch should only touch UI names which do not need versioning. It leaves the actual property name in nodes for a future breaking release.*

Pull Request: blender/blender#104998
2023-04-11 21:32:29 +02:00
fd234fe1ce Fix #106745: Subdivision surface crash with more than 8 UV maps
Before 6c774feba2, the maximum number of UV maps was
enforced throughout Blender. Now it has to be enforced in the few places
that actually have the limit. In the future the limit of the subsurf
could be lifted, but that isn't done now to keep the crash fix simple.
2023-04-11 15:28:08 -04:00
99c630cd9c Fix #106802: Incorrect modifier deform evaluation result
Since the positions of the final mesh are modified rather than a
separate array after d20f992322, the final mesh has
to become the deformed mesh after the deform modifiers, rather
than the input mesh. The arrays can't be shared anymore, but that
performance loss will be solved by implicit sharing shortly.
2023-04-11 14:00:16 -04:00
1a6cfa1ae1 Fix: Incorrect mesh data used in mesh remap code
Mistake in 7966cd16d6
Related to #106671
2023-04-11 13:29:12 -04:00
c7995f3185 Fix #106366: Handle exceptions in add fur operator
Give errors in a few cases:
- The mesh has no UV map
- The faces have no area
- The applied modifier has no curve data (it may have been modified)

Use errors instead of cancelling the operator completely so the
operator can still do something useful when many meshes are
selected and only some fail.

Pull Request: blender/blender#106823
2023-04-11 19:19:41 +02:00
03c4173d81 Fix #106780: Crash with sculpt undo and poly offsets
The poly offsets need to be copied when converting a geometry
undo step into a full mesh, they were only assigned.
2023-04-11 12:35:52 -04:00
cd30bce7f1 Fix #106743: Crash writing with legacy mesh format
The new poly offsets were needed to interpolate attribute to a different
domain, but they were cleared when the legacy MPoly array was built.
Instead just clear the offsets a bit later after the other conversions.
2023-04-11 12:27:41 -04:00
90ad930a01 Fix #106778: Incomplete copy of curves radius to Cycles
The number of curves was used as a number of points by mistake.
Caused by ae017b3ab7.
2023-04-11 12:02:05 -04:00
4472717de2 Cleanup: Remove unnecessary PBVH attribute pointer
Material indices are only used when the structure is built. It's simpler
not to keep a longer-term reference available if it isn't needed.
2023-04-11 11:06:36 -04:00
b03174782e Fix #106775: File Draw Negative Width Buttons
Do not include Fake Draggable button in file lists if the space is so
constrained that they have negative widths. Avoids debug assert.

Pull Request: blender/blender#106777
2023-04-11 17:00:52 +02:00
9477ab65a4 ImageEngine: Improve Performance and Quality.
Blender 3.5 has a performance regression in the image engine
that made the image engine 3-4x slower then 3.4. The cause of
this was the new way how panning was implemented.

This PR disables the new panning for now as a short term fix.
In the future the panning and improvements we did ensured
better performance when dealing with higher resolution images.
But the regression for regular images weren't acceptable.

This fix might introduce other performance regressions on
lower end systems.

In the future we still want to improve the performance to
get back to Blender 3.0 performance, but that requires more
work and has a different priority.

Pull Request: blender/blender#106803
2023-04-11 16:20:26 +02:00
43b37fbc93 Fix #106722: Motion tracking data lost on recovering autosave
This is mistake in the refactor of the DNA storage which unified
the camera and object storage. The bit which was missed from the
initial logic is that the autosave does not use regular file
write.

Detect this in the do-versioning code and rely on the new data
format when it exists.

A candidate for 3.5.1 release.

Pull Request: blender/blender#106811
2023-04-11 15:59:39 +02:00
d299b1157f Cleanup: Update versioning code after subversion bump
Subversion was bumped in ba25023d22, so no need to execute this always
now, just do it for necessary file versions.
2023-04-11 15:34:31 +02:00
ba25023d22 Python: Support multiple custom script directories in Preferences
Makes it possible to select multiple custom script directories in Preferences >
File Paths, replacing the single Scripts path option. Each of these directories
supports the regular script directory layout with a startup file (or files?),
add-ons, modules and presets.
When installing an add-on, the script directory can be chosen.

NOTE: Deprecates the `bpy.types.PreferencesFilePaths.script_directory`
property, and replaces `bpy.utils.script_path_pref` with
`bpy.utils.script_paths_pref`.

Pull Request: blender/blender#104876
2023-04-11 15:20:52 +02:00
dc402a8b96 Core: Fix ASAN on Clang-14 / Linux
When using ASAN on Clang / Linux, the call to `find_library(... asan ...)`
works against us, as it finds GCC's `libasan.so`. To work with Clang,
we should simply not pass any explicit library, as Clang will figure things
out by itself with the `-fsanitize=xxx` options.

Furthermore, Clang is incompatible with `-fsanitize=object-size`, so that's
now also no longer passed on Linux (mimicking the Apple) configuration.

For the long run, it would be better to rewrite this entire section to
select behaviour on a per-compiler basis, rather than per platform. That's
tracked in #105956

Pull Request: blender/blender#106675
2023-04-11 14:15:34 +02:00
d07b82d16d GPU: Use Same Type in Comparisons.
Legacy drivers don't support auto type casting in comparisons.
This PR fixes some comparisons cast.

Thanks to Johannes J. for working/thinking along with the PR.

Pull Request: blender/blender#106789
2023-04-11 13:46:09 +02:00
cd5ada3f7d I18n: Updated UI translations from SVN repo (r6454). 2023-04-11 12:49:36 +02:00
bca2090724 Gitea: update bug report template for security policy 2023-04-11 12:14:01 +02:00
2884f92de1 GPU: Fix Crash Sampling in Texture Paint Mode.
Added additional check if occlude pass is created.

Fix: #106762

Pull Request: blender/blender#106791
2023-04-11 11:24:17 +02:00
28a11c007e Fix #106440: EEVEE: World lighting does not affect volumetrics
The shader was compiled without the right define, disabling the world
volume lighting.

This had nothing to do with the light path node as the lighting
was totally disabled.

Pull Request: blender/blender#106787
2023-04-11 11:08:12 +02:00
43eb3fe21a UI: enable string properties for alt-click buttons for multiple objects
This came up in #106591 which reported that changing a Light Group would
not work when alt-clicking the property field (which is the usual method
to edit a property for multiple objects at once).

This is because string properties were not supported in
`ui_selectcontext_apply` which is now done.

Similar to 1318660b04 [which added support for pointer properties].

Adding general support for string properties means this method can now
be used for many more things:
- changing all sorts of ID names (objects, meshes, ...)
- many settings in modifiers (e.g. vertexgroups)
- geometry nodes modifier properties (e.g. attribute names)
- ...

Fixes #106591

Pull Request: blender/blender#106599
2023-04-11 10:27:51 +02:00
17e2862603 Fix new windows on Hi-DPI monitors having incorrect size under Wayland
Updating the buffer scale increased the window size based on the
previous window scale. Since the previous scale (DPI) newly created
windows restored from a `.blend` file isn't known, don't scale the
window size when updating the window's scale for the first time.
2023-04-11 16:05:27 +10:00
4fe2685615 GHOST/Wayland: avoid up-scaling window content
When a window overlaps multiple outputs, always use the resolution
on the output with the highest resolution. This means Blender never
shows low resolution content up-scaled.
2023-04-11 16:00:59 +10:00
f50c319a4b GHOST/Wayland: refactor window scaling logic
Share logic between fractional & non-fractional window scaling.

This also enables fractional-scaling without scaling fixed sized buffers
for compositors without support for fractional_scale_manager_v1.
2023-04-11 16:00:56 +10:00
34f386c730 GHOST/Wayland: store API compatible fractional scaling values
Use values compatible with Wayland's fractional-scale API.

No funcitonal changes.
2023-04-11 16:00:54 +10:00
8dae058768 Fix: Crash in install_linux_packages.py script
There is a `KeyError` exception when the `install_linux_packages.py` build script is ran with `--distro-id`:

```console
$ ./build_files/build_environment/install_linux_packages.py --distro-id arch
INFO:     Distribution identifier forced by user to arch.
Traceback (most recent call last):
  File "file:///blender/./build_files/build_environment/install_linux_packages.py", line 1656, in <module>
    main()
  File "file:///blender/./build_files/build_environment/install_linux_packages.py", line 1646, in main
    distro_package_installer = PackageInstaller(settings) if settings.show_deps else get_distro_package_installer(settings)
  File "file:///blender/./build_files/build_environment/install_linux_packages.py", line 1570, in get_distro_package_installer
    return DISTRO_IDS_INSTALLERS[get_distro(settings)](settings)
KeyError: None
```

This happens because the `get_distro` function returns `None` if the distribution ID is forced with the `--distro-id` option, when it should return the provided value.

Pull Request: blender/blender#106461
2023-04-10 21:12:56 +02:00
f7029bc960 Cleanup: Incorrect assignment in previous cleanup commit 2023-04-10 14:02:32 -04:00
47ab0403f0 Cleanup: Slight improvements to Python BVH tree utility
- Reduce indentation
- Use Span instead of raw pointers in a few places
- Decrease variables scope
2023-04-10 13:48:37 -04:00
c71f66daa8 Cleanup: Remove commented code 2023-04-10 13:47:36 -04:00
0c01e0f489 Realtime Compositor: Implement Map UV node
This patch implements the Map UV node for the realtime compositor. This
is different from the CPU implementation in that it relies on the
approximate EWA filtering provided by the driver's implementation of
anisotropic filtering to displace the texture. This is easier and faster
than implementing EWA manually in the shader and has identical quality
where it matters.

Pull Request: blender/blender#106765
2023-04-10 17:29:39 +02:00
ad7e6d5e43 Fix wrong gradients in Displace node shader
This patches fixes a typo in the Displace node shader for the realtime
compositor where the vertical gradient used the horizontal table index.
2023-04-10 15:18:22 +02:00
f8c964de87 GPU: Improve the shader cache GC behavior
Improves the shader cache GC behavior, so the passes are only
deleted after being orphaned for over 1 minute.

Pull Request: blender/blender#106386
2023-04-10 11:39:00 +02:00
4bbbad49c8 Fix missing includes 2023-04-10 15:10:04 +10:00
0a460d4707 UV: refactor uv packing for readability and performance 2023-04-10 11:42:24 +12:00
cc5128f6ca Realtime Compositor: Implement Fog Glow Glare node
This patch implements the Fog Glow option in the Glare node. The
implementation does not match the existing implementation in the CPU
compositor, because it is computationally infeasible for the realtime
compositor. Instead, this implementation is similar to how Bloom is
implemented in EEVEE, based on the talk:

"Next Generation Post Processing in Call of Duty: Advanced Warfare".

This is just a temporary solution as requested by users until we either
implement an accurate implementation using FFT, provide a separate
option for EEVEE bloom, or roll out a different solution altogether.

Pull Request: blender/blender#106042
2023-04-09 15:42:20 +02:00
625ba3cb5d Realtime Compositor: Implement Displace node
This patch implements the Displace node for the realtime compositor.
This is different from the CPU implementation in that it relies on the
approximate EWA filtering provided by the driver's implementation of
anisotropic filtering to displace the texture. This is easier and faster
than implementing EWA manually in the shader and has identical quality
where it matters.

Pull Request: blender/blender#106681
2023-04-09 09:15:28 +02:00
b939b60c3f Realtime Compositor: Implement Z Combine node
This patch implements the Z Combine node for the realtime compositor.
The patch also extends the SMAA implementation to work with float
textures as a prerequisite to the Z Combine implementation. Moreover, a
mechanism for computing multi-output operations was implemented, in
which unneeded outputs will allocate a dummy 1x1 texture for a correct
shader invocation, then those dummy textures will be cleaned up by
calling a routine right after evaluation.

This is different from the CPU implementation in that the while combine
mask is anti-aliased, including the alpha mask, which is not considered
in the CPU case.

The node can be implemented as a GPU shader operation when the
anti-aliasing option is disabled, which is something we should do when
the evaluator allows nodes be executed as both standard and GPU shader
operations.

Pull Request: blender/blender#106637
2023-04-09 09:06:41 +02:00
7a267aa000 DRW: Selection Occlusion
#### Summary
Occlude edit mode selection behind objects in object mode.

#### Problem
When doing retopology, you want to be able to select your edit mesh,
but only when you can see it.
Being able to select geometry behind reference objects is not
desirable.

#### Solution
Make it so reference objects occlude selection, while the edit mesh is
pushed towards the view using retopology offset.

#### Limitations
Poly Build is not supported, because it doesn't use the depth buffer.
It behaves the same as normal, unoccluded by reference meshes.

#### Notes
Selection occlusion is not used when xray is enabled. This is
intentional.

Pull Request: blender/blender#105498
2023-04-09 08:08:01 +02:00
bc86223975 Cleanup: readability improvements in uv packer
Moved alpaca_rotate code closer to alpaca_turbo.
Improve const correctness.
Added some simple optimizations which improve readability.
2023-04-09 11:23:31 +12:00
cde565c26c PBVH: update mesh data pointers stored in pbvh
This is necessary for #106228. Without this, `PBVH` might contain pointers to
data that either does not exist anymore or that must not be edited because
it is shared.

Pull Request: blender/blender#106271
2023-04-08 13:29:37 +02:00
5cc5d6391b Cleanup: simplify customData_resize
There is no point in checking if the allocation of this relatively
small array was successful. We only do that in very few places,
but here it just adds unnecessary complexity.
2023-04-08 13:09:30 +02:00
9182851afe Cleanup: use BLO_CODE_ prefix for BHead codes
Having names like `DATA`, `TEST` and `USER` in the global namespace feels a bit wrong.

Pull Request: blender/blender#106673
2023-04-08 12:42:40 +02:00
68af6f6836 Audaspace: porting changes from upstream. 2023-04-08 10:36:40 +02:00
677273eb41 Merge branch 'main' into node-group-operators 2023-04-07 17:45:51 -04:00
e369bf4a6d UI: Text Object International Case Change
Allow Text Object operator FONT_OT_case_set to correctly transform the case
of strings written in almost all scripts that differentiate letter case.

Pull Request: blender/blender#106581
2023-04-07 23:40:42 +02:00
8906aa77cd Cleanup: Comment formatting, remove debug print
Also rename a few functions from "hair" to "curves"
2023-04-07 16:33:11 -04:00
5a86c4cc88 Fix: Cycles ignores point cloud and curves byte color attributes
Support was never added for byte color attributes, since for a while
it wasn't obvious that they were also considered "generic attributes."
2023-04-07 16:19:41 -04:00
ae017b3ab7 Cycles: Optimize Blender curves attribute extraction
Similar to 8d0920ec6d and aef0e72e5a.

In a test case with 2 million curves and 15 million points
I observed a 10x performance improvement, from 2.2s to 0.2s
to copy the data from Blender to Cycles.
2023-04-07 16:05:23 -04:00
aef0e72e5a Cycles: Optimize Blender point cloud attribute extraction
Similar to 8d0920ec6d.

In a test case with 8 million points and 3 attributes, I observed
around a 9x performance improvement, from 1.8s to 0.2s to copy
the data from Blender to Cycles. For some attribute types, using
implicit sharing could remove the need to copy entirely, but removing
the overhead from the RNA API makes sense anyway.
2023-04-07 16:04:12 -04:00
44d5a894c1 Fix #106667: Cycles: Multi-device denoise runs denoising data passes
Only use the denoised buffer for access of denoised passes, and
access the rest of the passes from the original render buffer.

This allows in-place modification of the guiding passes needed
by the denoiser without affecting the final render result pixels.

Pull Request: blender/blender#106668
2023-04-07 16:49:43 +02:00
ade103d7b8 Depsgrpah: Fix 'use after free' invalid access to stored keys names.
Stored `ComponentIDKey` and `OperationIDKey` would still use string
references (char pointers) to data in related IDs, instead of using the
already locally stored std::string name of their matching `ComponentNode`
or `OperationNode` for that.

During undo, to reduce updates and speedup undo steps, a lot of IDs get
'replaced in place', i.e. new data read from the undo memfile is moved
into the existing 'old' ID memory address. And the depsgraph is also
re-used from the old BMain.

Calling `DEG_id_tag_update` and similar on the ID could then cause
depsgraph code to access freed memory from the 'old' data.

Joint effort with @sergey and the rest of the depsgraph team, thanks!
2023-04-07 15:46:19 +02:00
abe86a6a5d Merge branch 'main' into node-group-operators 2023-04-07 08:14:34 -04:00
4ab7bb5b1f Fix : Show 'Exit group' menu entry also for non group nodes.
The Exit Group menu entry was mistakenly only whown for nodes who are
themselves also group nodes. It should be show for any node inside a
group.

Pull Request: blender/blender#106643
2023-04-07 13:09:33 +02:00
75c0e808b8 Fix #106103: Resolve texture paint selection in Metal
Issue caused by inconsistency in GPUFramebuffer viewport state
between Metal and OpenGL. The MTLFramebuffer code has been
modified such that framebuffer viewport/scissor state is retained
and only updated if attachments are modified during bind.

This is consistent with OpenGL. Previously, other updates to the
framebuffer in Metal would reset the viewport region, especially
if attachments were temporarily removed. This caused the color
picker selection to be misaligned.

Authored by Apple: Michael Parkin-White

Pull Request: blender/blender#106619
2023-04-07 13:05:51 +02:00
d85520f297 Python: bl_ui_utils.layout.operator_context context manager
Introduce a context manager that temporarily overrides a UILayout's
operator context.

Instead of writing this:

```py
default_op_context = layout.context
layout.context = 'OTHER_VALUE'
layout.do_stuff()
layout.context = default_op_context
```

you can now write this:

```py
from bl_ui_utils.layout import operator_context

with operator_context(layout, 'OTHER_VALUE'):
    layout.do_stuff()
```

This is also exception-safe; it will always ensure the layout's operator
context is restored when the `with` body is exited, regardless of
whether that's done with an exception or regularly.

Idea in-the-hallway approved by @Sergey.
2023-04-07 11:34:48 +02:00
564418f6a4 UV: support for non-square bitmaps in uv packer, alpaca_rotate 2023-04-07 20:17:19 +12:00
520c112732 GHOST: comment on use of libunity for the taskbar in X11
While the DBUS API's libunity uses are still in wide use,
libunity.so it's self isn't. Note that we should use DBUS directly.
2023-04-07 13:39:19 +10:00
43476e2d71 UV: improve layout efficiency of uv packing when rotation enabled
Add rotation support to the `xatlas` strategy.
2023-04-07 13:33:58 +12:00
984da82283 Cleanup: format 2023-04-07 12:58:46 +12:00
fcd4b58427 CMake/Windows: Fix debug ONEAPI build
the debug dll does not have an _d just a regular d as postfix
issue introduced in 17800e0c03
2023-04-06 18:02:59 -06:00
dc71530d9c Core: Fix broken CustomData IO with Autosave files
Autosave files are created from memfile undo, which
doesn't save legacy mesh data. This leads to a crash
on file load.

In addition the mesh code can now add CustomData
layers when saving files, which did not work if
the original domain had no layers.  In that case
CustomData.layers is NULL and DNA has nothing to
key off of when loading the file later.

Pull Request: blender/blender#106648
2023-04-07 02:02:20 +02:00
3681ed377b Fix #106628: Use correct function to get active uv layer
CustomData_get_active_layer_index() was used by accident. But that
returns the CustomData layer index (in all layers) as opposed to
CustomData_get_active_layer(), which returns the active UV layer.

Pull Request: blender/blender#106644
2023-04-06 22:17:19 +02:00
972dad8fbf Cleanup: Add forgotten const to function parameter. 2023-04-06 21:32:41 +02:00
11ba8c6ab4 Fix #106622: Various errors filling cone/cylinder primitive faces
The change in 7966cd16d6 had a few logical mistakes.
2023-04-06 12:48:46 -04:00
a041297e54 Fix: build error after moving lightprobe.c to c++
Error introduced in 3dd24b9ae7

Pull Request: blender/blender#106635
2023-04-06 18:40:58 +02:00
3dd24b9ae7 Cleanup: Move lightprobe.c to c++
This is to allow clearner code in the new object-level lightprobe
cache. See #106449 .
2023-04-06 17:41:59 +02:00
390a63b264 Refactor: de-duplicate motion triangle vertices and normals computation
Barycentric coordinate convention was changed at some point, which is
reflected in `motion_triangle_shader.h` (1c2c468abc) but not in
`motion_triangle.h`, this is also fixed by sharing functions between the
two header files.

Pull Request: blender/blender#106629
2023-04-06 17:28:41 +02:00
65da3a3c5a Fix 106590: GPencil Paste stroke duplicates to the next selected
If the multiframe is not enabled, the loop must be not done or
the first selected frame is pasted too.

Now, the loop is only done in multiframe mode.
2023-04-06 15:30:24 +02:00
e9ec506890 Fix #106548: Repeat Last operator reuses orientation for extrusion
Check the specific case of `OP_IS_REPEAT_LAST` and recalculate
the orientation.

To that, pass the `OP_IS_REPEAT` and `OP_IS_REPEAT_LAST` flags as
inheritance to macro operators.
2023-04-06 15:17:03 +02:00
7d8740f06d Fix #103571: Force field absorption for rigid bodies
Force field absorption allows dampening of force fields by colliders, but it does not currently work when the scene only contains a rigid body simulation. It requires a particle simulation, cloth, dynamic paint, fluid sim, or softbodies for the feature to work correctly.

The reasons is that the effector function computing force field strength uses depsgraph relations to determine which colliders "absorb" the force field. If there are no dependencies between colliders and effectors registered in the depsgraph, the visibility function `eff_calc_visibility` does not add any absorption.

There is a function build_collision_relations which adds a dependency between the absorption object (the one with a collision modifier) and the forcefield object. It's currently only called by
1. Particle systems (DepsgraphRelationBuilder::add_particle_collision_relations)
2. Cloth, DynPaint, Fluid, and Softbody (DEG_add_collision_relations and indirectly through DEG_add_forcefield_relations).

The `DepsgraphRelationsBuilder` now adds the effector relations also when building rigid body relations.

Pull Request: blender/blender#106503
2023-04-06 14:49:04 +02:00
792da15d53 Fix #106394: motion triangles could have unnormalized normals 2023-04-06 13:48:45 +02:00
bd319f6561 Texture Paint: always respect edit mode hiding
Since e3801a2bd4, we would always respect
hiding for vertex paint and weight paint (drawing code and stroke based
painting), leaving an inconsistency between the different paintmodes.

To rectify this, now also always respect edit mode hiding for projection
painting as well.

Some feedback was gathered in #sculpt-paint-texture-module to ensure
this is desired behavior.

Note: this does not change the (experimental) texture painting in
sculptmode [this already respects hiding via PBVH, albeit in a manner
that bleeds into hidden faces if the brush center is over visible faces]

ref #106354

Pull Request: blender/blender#106544
2023-04-06 09:28:25 +02:00
ce9be92adf Fix 106278: Intel iGPU Crashes When Switching to Eevee
After investigating the crash logs it looked like the macro
unrolling wasn't working on Windows systems with these GPUs.

Macro unrolling was changed in order to cross compile to Metal and
in the future to Vulkan. The macro unrolling in OpenGL can be removed
by using a different naming scema.

This PR removes the macro unrolling by changing the generated GLSL
code:

**Before**
```
layout(std140) uniform _probe_block
{
  ProbeBlock probe_block;
};
```

**After**
```
layout(std140) uniform probe_block
{
  ProbeBlock _probe_block;
};
```

Some tweaks had to be done to the Eevee-shaders to make sure that
the macro unrolling is done correctly and could be compiled using
legacy opengl drivers.

Fix: #106278
Fix: #106555
(and others)

Pull Request: blender/blender#106535
2023-04-06 08:03:25 +02:00
Jon Denning
bbf756ddf1 Text Editor: update syntax highlighting for different Python strings
Python has several different string types [0], each using a prefix to
indicate the type. Presently Blender's Text Editor / syntax highlighting
does not include the prefix as part of the string, which makes the
prefix appear as a syntax error. This patch looks for these prefixes,
and includes them with the string highlighting.

Note: prefixes can appear in either case (ex: f and F mean the same
thing), and some prefixes can be combined (ex: fr is a raw f-string).

[0]: https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals

Ref D14739
2023-04-06 14:01:54 +10:00
68092297ca Cleanup: Remove unused DerivedMesh edges/corners code
The edge hash is only needed for the corner edge array,
and the mloop_index variable is unused.
2023-04-05 22:35:26 -04:00
d727f64ad2 PyAPI DocS: Fix source code link markup
FIxes blender/blender#106212#
2023-04-05 22:27:51 -04:00
a2b259aa2c Fix: Wrong attribute name used for corner edges array
My regex to check for this didn't catch the mistake because
the repetition was split between two lines.
2023-04-05 22:18:30 -04:00
63c0e1be31 UV: paste-uvs will return OPERATOR_CANCELLED if uvs were unchanged 2023-04-06 13:48:29 +12:00
6e1c048250 Fix #106314: warn user when paste-uvs fails to find a match
Pull Request: blender/blender#106606
2023-04-06 03:36:57 +02:00
2e878690e5 WM: include the GHOST backend in bug report when non-default
It wasn't possible to know if users were running X11/Wayland.
The field is omitted for WIN32 & APPLE.
2023-04-06 10:29:44 +10:00
d34abea26a Cleanup: format 2023-04-06 11:02:47 +12:00
b626f1fd18 Cleanup: use ".cc" & ".hh" extensions for intern/ghost 2023-04-06 08:29:57 +10:00
d1bbb32cb4 Fix #106602: Cyclic link in versioning code
Fix link from capture_node to node.

Pull Request: blender/blender#106605
2023-04-06 00:11:12 +02:00
9e01c4f69e List groups in menu, some crash fixes 2023-04-05 17:07:56 -04:00
302e858273 Fix #104507: Show Splash if New Version
Show Splash screen if there are no Preferences found even if we are
launched with a filename, so that users can migrate old settings.

Pull Request: blender/blender#105863
2023-04-05 22:35:05 +02:00
7212f52457 Progress 2023-04-05 16:33:47 -04:00
8f8548e964 Fix libs harvesting for Embree as a dynamic library
libembree4.so was missing from make deps target location.
2023-04-05 22:13:02 +02:00
70edef1311 Cycles: Fix Metal use-after-free bug
`entryPoint` was being used unsafely following its release.

Pull Request: blender/blender#106572
2023-04-05 21:50:14 +02:00
92c9c1d400 Fix #106568: Overlay: Resolve motion path rendering in Metal
Resolve small indexing issue in Metal implementation
of motion path line rendering.

Authored by Apple: Michael Parkin-White

Pull Request: blender/blender#106595
2023-04-05 20:55:14 +02:00
51d48bdcdb Merge branch 'main' into node-group-operators 2023-04-05 14:14:42 -04:00
6cb5b14f16 Fix #106598: Cone primitive crash after MPoly removal
The sizes of the bottom faces weren't filled.
2023-04-05 14:11:18 -04:00
b288c4004e Cleanup: fix various Cycles compilar warnings
Mainly for the build configuration of the Hydra render delegate and
standalone repo.
2023-04-05 19:48:19 +02:00
920ffd3253 Cleanup: fix clang 10 compiler warning 2023-04-05 19:48:19 +02:00
a10ae5cf05 Progress 2023-04-05 13:34:31 -04:00
19051b863e Merge branch 'main' into node-group-operators 2023-04-05 11:55:48 -04:00
42a9c62bff Fix #106584: Active/default UV map legacy conversion with name conflict
The legacy conversion from MLoopUV to generic attributes used the
active and default layer names to copy the active/render status to the
new layers. But sometimes the names can change, and they weren't
updated in that case. Instead, store the active status with an index
into the names array (use an array instead of Vector for clarity).
2023-04-05 11:46:35 -04:00
18ad154cf9 Fix CUdeviceptr and hipDeviceptr_t build error on ppc64le architecture
Pull Request: blender/blender#106575
2023-04-05 17:42:01 +02:00
892f985227 Fix mismatch in Sequencer preview region versioning
Make the versioning for the sequencer preview region match the state of
new sequencers, the zooming range would be different.
2023-04-05 17:21:11 +02:00
56640440f0 Fix crash loading pre 2.5 test file (Cycles test failure)
fa0f295b53 exposed that there was a region missing because of some
faulty versioning.

The `fluid_motion_blur.blend` Cycles test file was crashing. Seems like
this is a pre 2.5 file that was resaved in newer versions, but the
preview region for the Sequencer was missing. Before mentioned commit,
the region would be broken when activating the preview view mode in the
Sequencer, now it would crash even on startup.

Ensure the region exists, as expected.
2023-04-05 16:57:56 +02:00
68ec019a40 Fix: Typos, grammar, writing style in UI messages
Issues reported by Joan Pujolar:

See the pull request for a full list of reasoning.

Pull Request: blender/blender#106580
2023-04-05 16:40:16 +02:00
4c66e0fe61 Fix windows tests failing due to comparison with NaN
which returns false on other platforms but true on windows with fast math
2023-04-05 16:00:03 +02:00
d17b1da572 Fix FindEmbree.cmake
When EMBREE_INCLUDE_DIR was cached, it ended up wrongly assuming it
was Embree 4.
2023-04-05 15:53:20 +02:00
8f0829f2a0 Cleanup: Remove accidentally committed TODO comment
Committed in fa0f295b53 but not necessary anymore. The regions are
creating in versioning already now.
2023-04-05 15:46:25 +02:00
ad031029cf Fix #106467: Crash when loading files with custom node groups
Loading a blend file containing custom material node groups crashed Blender.
See #106467 for more information.

Pull Request: blender/blender#106559
2023-04-05 15:36:24 +02:00
fa0f295b53 UI: Region polling support
Introduces *ARegionType.poll()* as a way to dynamically add/remove a region. The region is still there internally, but is not accessible to the user.

Previously editors would to this manually, by either removing/adding regions altogether, or hiding them, unsetting their alignment (so no AZones are added I assume) and removing their event handlers. Polling makes this much simpler.

We plan to use this in #102879.

This patch refactors multiple editors to use region polling:
- File Browser
- Sequencer
- Clip Editor
- Preferences

Notes:
- Previously, editors would lazy-create some of the regions. Versioning is added here to ensure they are always there. Could be a separate patch.
- Some editors reuse a region in different display modes, and so additional work needs to be done to reinit regions they become available or the mode changes. Typically `V2D_IS_INIT` is unset for that, which isn't great. Could be improved, but not a new issue.

Behavior change:
- When the Preferences are opened as a regular editor, the "execution" region in the preferences that displays the *Save Preferences* button would still be there, but empty with a scrollbar.
  This patch makes it disappear entirely.

## Implementation

- Introduces `ARegionType.poll()`
- Before a window is drawn, all contained regions have their poll checked, and the result is stored in a flag (`RGN_FLAG_POLL_FAILED` - runtime-only flag).
- If the result of the poll changes, the area is re-initialized and event handlers are added/removed.
- UI code checks the flag as needed.

Pull Request: blender/blender#105088
2023-04-05 15:30:32 +02:00
075d92184b Cleanup: correct comment, quiet warnings 2023-04-05 20:11:08 +10:00
a76bf65c9d Cycles: Refactored GPU denoising code
To prepare for OIDN2 with GPU support, some of the code that was exclusive to the OptiXDenoiser is being moved to the DenoiserGPU superclass.

Co-authored-by: Stefan Werner <stefan.werner@intel.com>
Pull Request: blender/blender#106496
2023-04-05 11:19:15 +02:00
9e9baa9085 Cycles: Upgrade to new Embree 4 while staying compatible with Embree 3
For more information about Embree 3->4 API changes:
https://github.com/embree/embree/blob/master/doc/src/api.md#upgrading-from-embree-3-to-embree-4

This is not yet enabling HW RT on Arc GPUs using Embree, which is worked on in blender/blender#106266

Co-authored-by: Nikita Sirgienko <nikita.sirgienko@intel.com>
Co-authored-by: Stefan Werner <stefan.werner@intel.com>
Pull Request: blender/blender#105974
2023-04-05 11:03:06 +02:00
2c446d2de3 Cleanup: use bool for render pipeline & related API's
Also add doc-string for RenderEngine::reports.
2023-04-05 17:52:28 +10:00
7e99470a85 Fix headless render silently failing when called from Python
Any errors from calling `bpy.ops.render.render(write_still=True)` would
be suppressed, making it impossible to know what went wrong.

Now the operator now reports errors when run via `exec` which mainly
occurs when the operator is called from scripts.

Interactively rendering via `invoke` is left as-is since users can see
the error in the UI and showing a popup error is disruptive.
2023-04-05 17:42:19 +10:00
a245e294a3 Fix missing assets in the source archive
The assets are required to build proper Blender release, so they can not be
skipped from packing.

The packing ignores the `working` directory as it seems to be big and sounds
that it is not needed for the release.

The assets are bundled under the `release/datafiles/assets` folder in the
blender sources. This is where they will reside after switch to the Git LFS.

Pull Request: blender/blender#106536
2023-04-05 09:27:42 +02:00
440cccecdc Cleanup: spelling in comments 2023-04-05 14:39:51 +10:00
d683665095 Cleanup: compiler warnings 2023-04-05 14:23:54 +10:00
8216623e25 Build: bump wayland to v1.22
Use the latest Wayland version, resolves inverted track-pad scroll
direction #104272 by adding support for physical scroll direction.
Updates to GHOST/Wayland have already been made.
2023-04-05 14:04:18 +10:00
1ad98ac65e Merge branch 'main' into node-group-operators 2023-04-04 18:02:37 -04:00
dec9c593cb Cleanup: Use generic index copying utility for normals 2023-04-04 17:22:14 -04:00
f594e951e0 Cleanup: Use generic mesh corner to poly map utility 2023-04-04 17:01:19 -04:00
e785d956c4 Fix: Crash loading autosave/last session file after MPoly removal
We need to check CustomData for the MPoly layer rather
than the deprecated mesh customdata pointer.
2023-04-04 16:13:39 -04:00
4b2ea18ec9 Cleanup: Deduplicate OffsetIndices utility for meshes and curves
The "reverse map" of corners to faces and points to curves is the same
for meshes and curves now. Move it to the offset indices header to
reflect this.

This unification can go further in the future, but I'd rather wait
until the design is clearer for now.

Pull Request: blender/blender#106570
2023-04-04 22:12:17 +02:00
8d0920ec6d Cycles: Optimize extraction of Blender attributes
Similar to 4bcd59d644. This probably got worse recently with
the generic attribute refactors for `Mesh`, but the final performance is
probably much better than older versions too.

Timings extracting attributes from a 16 million vertex grid (seconds):
- Corner float attribute: 0.72 -> 0.19
- Face float attribute: 0.60 -> 0.07
- UV map: 3.18 -> 0.05
2023-04-04 15:38:12 -04:00
6652d2ee9b Cleanup: Remove unused DerivedMesh vert normals calculation 2023-04-04 14:52:41 -04:00
2887557907 Cleanup: Remove unused DerivedMesh functions
Unused after 7adea7ee15.
2023-04-04 14:52:02 -04:00
6f2263bc79 Cleanup: Remove unused DerivedMesh variables
`needsFree` was always set to `true`, and same with `deformedOnly`,
but it was also never even used.
2023-04-04 14:47:39 -04:00
7966cd16d6 Mesh: Replace MPoly struct with offset indices
Implements #95967.

Currently the `MPoly` struct is 12 bytes, and stores the index of a
face's first corner and the number of corners/verts/edges. Polygons
and corners are always created in order by Blender, meaning each
face's corners will be after the previous face's corners. We can take
advantage of this fact and eliminate the redundancy in mesh face
storage by only storing a single integer corner offset for each face.
The size of the face is then encoded by the offset of the next face.
The size of a single integer is 4 bytes, so this reduces memory
usage by 3 times.

The same method is used for `CurvesGeometry`, so Blender already has
an abstraction to simplify using these offsets called `OffsetIndices`.
This class is used to easily retrieve a range of corner indices for
each face. This also gives the opportunity for sharing some logic with
curves.

Another benefit of the change is that the offsets and sizes stored in
`MPoly` can no longer disagree with each other. Storing faces in the
order of their corners can simplify some code too.

Face/polygon variables now use the `IndexRange` type, which comes with
quite a few utilities that can simplify code.

Some:
- The offset integer array has to be one longer than the face count to
  avoid a branch for every face, which means the data is no longer part
  of the mesh's `CustomData`.
- We lose the ability to "reference" an original mesh's offset array
  until more reusable CoW from #104478 is committed. That will be added
  in a separate commit.
- Since they aren't part of `CustomData`, poly offsets often have to be
  copied manually.
- To simplify using `OffsetIndices` in many places, some functions and
  structs in headers were moved to only compile in C++.
- All meshes created by Blender use the same order for faces and face
  corners, but just in case, meshes with mismatched order are fixed by
  versioning code.
- `MeshPolygon.totloop` is no longer editable in RNA. This API break is
  necessary here unfortunately. It should be worth it in 3.6, since
  that's the best way to allow loading meshes from 4.0, which is
  important for an LTS version.

Pull Request: blender/blender#105938
2023-04-04 20:39:28 +02:00
17800e0c03 CMake/Win: use manifest for PLATFORM_BUNDLED_LIBRARIES
`PLATFORM_BUNDLED_LIBRARIES` was installing right next to the blender
executable rather than the `blender.shared` folder,
`PLATFORM_BUNDLED_LIBRARIES` wasn't used very much on windows, just
by the ONEAPI code which likely wasn't aware this plumbing was
still missing.

This diff adds support for using `PLATFORM_BUNDLED_LIBRARIES` on
windows in both debug and release configurations.

You can differentiate between a .dll being installed for debug/release
or all configurations, by prefixing the library with either `DEBUG`,
`RELEASE` or `All`, if no prefix is given `ALL` is assumed.

Pull Request: blender/blender#106348
2023-04-04 20:10:06 +02:00
4b15f2158f Cleanup: Cycles: LightTree: Fix warning about unused variables 2023-04-04 20:01:55 +02:00
1ae54bb4fd Fix MSVC C1001 error after texture sampler refactor
This patch fixes the MSVC C1001 error that was introduced after
ff3b2226fb.

Pull Request: blender/blender#106554
2023-04-04 18:20:44 +02:00
412b6a8f65 Fix #106430: Index the right UVmap in BMesh
When accessing UVmaps from python in BMesh, the UVmap name/index was ignored
and the active UVmap always used. This fixes this by passing the layer index
to the underlying CustomData function.

Pull Request: blender/blender#106537
2023-04-04 18:10:11 +02:00
7adea7ee15 Cleanup: Removed DerivedMesh triangle cache
This was only used in a single place, multires baking, where it's simple
to just retrieve the looptris from the temporary `Mesh` that we already
create to simplify accessing normals. This allows removing a bunch of
complexity from `DerivedMesh`, to help progress towards its complete
removal at some point in the future.

Also use `Span` more instead of raw pointers in multires baking,
and pass around the spans instead of the low-resolution DerivedMesh.
2023-04-04 11:26:14 -04:00
85bd64ece4 Fix: Crash and broken multires baking
Caused by 16fbadde36. The first mistake was passing a pointer
to a poly to what was meant to be the pointer to the start of the array.
Use Span instead to avoid that confusion. The second was a logic error
in CCGDerivedMesh's lazy initialization of corner data. The data was
copied when the mesh is created so it wasn't initialized.
2023-04-04 11:16:04 -04:00
547f0d5dab Cleanup: Use const arguments for DerivedMesh functions 2023-04-04 11:11:54 -04:00
87cbdcbe7c Refactor: move part of light tree logic from #LightManager to #LightTree 2023-04-04 16:24:21 +02:00
e58a05ca68 Refactor: renaming a few light-tree-related variables
primitives -> emitters, `index` -> `node_index`
2023-04-04 16:24:21 +02:00
6f60b09f51 Vulkan: Enable Step-by-Step Debugging in Renderdoc.
This PR adds debug information inside the spir-v assembly to enable
step-by-step debugging of Shaders using renderdoc. The debugging
information can be fairly large so are only generated when used
with the `--debug-gpu-renderdoc` feature.

During debugging shader optimizations are turned off.

Pull Request: blender/blender#106546
2023-04-04 15:58:41 +02:00
f94599c095 Fix #106478: Missing xray check in snapping
Regression caused by 98bfa8d458

The `XRAY_ENABLED(v3d)` check was lost during a modification to
`transform_snap_context_project_view3d_mixed_impl` function.

This caused vertex snapping in solid shading to jump between visible
and occluded faces.

Pull Request: blender/blender#106495
2023-04-04 15:40:48 +02:00
ff3b2226fb GPU: Refactor texture samplers
This patch refactors the texture samples code by mainly splitting the
eGPUSamplerState enum into multiple smaller enums and packing them
inside a GPUSamplerState struct. This was done because many members of
the enum were mutually exclusive, which was worked around during setting
up the samplers in the various backends, and additionally made the API
confusing, like the GPU_texture_wrap_mode function, which had two
mutually exclusive parameters.

The new structure also improved and clarified the backend sampler cache,
reducing the cache size from 514 samplers to just 130 samplers, which
also slightly improved the initialization time. Further, the
GPU_SAMPLER_MAX signal value was naturally incorporated into the
structure using the GPU_SAMPLER_STATE_TYPE_INTERNAL type.

The only expected functional change is in the realtime compositor, which
now supports per-axis repetition control, utilizing new API functions
for that purpose.

This patch is loosely based on an older patch D14366 by Ethan Hall.

Pull Request: blender/blender#105642
2023-04-04 15:16:07 +02:00
d0604a1bb2 Fix #106530: Don't try to move unmovable node socket values
Missing checkings for unsupported cases.

Pull Request: blender/blender#106545
2023-04-04 14:23:40 +02:00
96c8fcde0f Vulkan: Reduce Macro Unrolling In GLSL.
Related to #106535 where a similar fix was done for OpenGL. A small
cleanup that might reduce the complexity during GLSL shader compilation.

Pull Request: blender/blender#106538
2023-04-04 14:04:09 +02:00
09effd579b Renderdoc: Use Main Context Workaround.
Renderdoc requires all calls/updates to originate from the same
context. It also doesn't support multithreading. For now we
enable main context workaround.
2023-04-04 13:27:41 +02:00
fc46d6408f GPU: Use --debug-gpu-renderdoc For Renderdoc Integration.
The renderdoc integration used to be behind the `--debug-gpu`
command line option. When using `--debug-gpu` outside renderdoc
error messages where displayed that aren't relevant.

This PR adds a specific command line option for the renderdoc
integration. This option will also enable `--debug-gpu`.

Pull Request: blender/blender#106541
2023-04-04 12:46:47 +02:00
d872240983 Fix #106528: light tree nodes could have a NaN axis
Caused by collinear vectors not detected due to numerical issue.
2023-04-04 12:40:28 +02:00
d030d12d7b Vulkan: Fix Compilation Error on Windows Platforms.
Automatically conversion not working. Replacing `begin` with
`data` would solve this issue.

Pull Request: blender/blender#106539
2023-04-04 12:13:01 +02:00
58c54b5859 Fix #106396: UV stitch crash with hidden faces
This was the case with hidden faces and `Sync Selection` turned ON.

Caused by 8f543a73ab.

Since 8f543a73ab, the UV element map
respects the hidden state of geometry, but stitching [which also
respected this on its own even prior to the culprit commit in its
calculation of connectivity] did this differently [it only skipped
hidden geo when UV_SYNC_SELECTION was OFF -- even though UVs would not
be visible which is probably the real error here, I believe there is
this principle that we "dont act on stuff we dont see"].

To fix this, also skip hidden geo (even with UV_SYNC_SELECTION = ON) in
the stitch calculation of connectivity, just as
`BM_uv_element_map_create` does it.

Should go into 3.3 LTS as well.

Pull Request: blender/blender#106493
2023-04-04 12:10:30 +02:00
f2f8884f95 CMake: reset WAYLAND_PROTOCOLS_DIR when it's missing the reference XML
Depending on newer API's could cause build failure for existing
builds using wayland-protocols outside of Blender's 'lib' directory.
Now the existence of the most recent XML file is checked on each CMake
execution, resetting the cache when not found so the protocols in
`../lib/linux_x86_64_glibc_228/` will be used instead.
2023-04-04 19:15:00 +10:00
cf9f3919a8 I18n: fix add-on extraction when UI code appears in __init__.py
The function which collects files to process in add-on extraction
returned only files that did not start with '_', in the case where the
add-on was a module in a directory. This excluded __init__.py, which
may very well contain UI code, so an exception is added for this case.

This change currently allows the extraction of 42 new messages.
2023-04-04 10:07:02 +02:00
648417bfff GHOST/Wayland: improve internal fractional scaling behavior
Logic for the recently included fractional scaling support [0] was
difficult to reason about as it depended on two different callbacks
one that listened to a preferred scale, another that tracked which
physical displays the window overlapped.
Checking if fractional scaling was in used depended on the order
the callbacks ran - which is undefined.

In practice - mixing non-fractional and fractional displays would
flicker when the window was moved between monitors.

Resolve this problem with the following changes:

- When the fractional-scale manager is supported,
  only respond to the scale from it's preferred_scale callback.
- When no fractional-scale manager is available,
  set the scale based on the scale of overlapping outputs.
- Add support for postponing the buffers commit call to prevent
  flickering when changing the windows scale.

Other changes:

- Use a lock before setting the pending frame state from
  wp_fractional_scale_handle_preferred_scale.
- Ensure pending actions that themselves trigger pending actions
  run in the time gwl_window_pending_actions_handle is called.
- Rename GWL_Window::scale -> GWL_WindowFrame::buffer_scale.

[0]: cde99075e8
2023-04-04 17:35:42 +10:00
95ffc4ba3a GHOST/Wayland: remove fractional-scale ifdef's
Depend on fractional-scale when searching for wayland-protocols

This will impact builders that don't use Blender's `../lib/` and
have wayland-protocols older than v1.31.
2023-04-04 17:26:37 +10:00
d2ad00d0f5 Cleanup: remove unused RenderData::stereomode 2023-04-04 17:26:37 +10:00
ececd71fb2 Cleanup: remove references to the Blender Game Engine Player 2023-04-04 17:26:37 +10:00
b5a7724262 Fix #105268: Avoid creating redundant dependencies for the lattice modifier
For some reason, lattice modifier always depend on self object transform.
This fix just move extra dependencies in to if case statement, also some
cleaning of this code area.

Pull Request: blender/blender#105293
2023-04-04 09:25:51 +02:00
b1bf1db656 Fix source_archive ignoring addons
Caused by the changes in the submodules configuration.

Can no longer rely on the `git submodule` command to
show list of external references to be packed.

Needs to be backported to 3.5.1.

Pull Request: blender/blender#106502
2023-04-04 09:14:58 +02:00
e952083652 Fix #105989: Outliner: Make Single User duplicates data
This happens even though there is only one user.

The Outliner only implements this `Make Single User` for worlds
(`singleuser_world_fn`) and actions (`singleuser_action_fn`) [it is
questionable if the whole functionality could be removed really, but
this is for another report] and it uses `id_single_user` to do so --
this function does not check if we even have more than one user though,
so data gets duplicated resulting in duplicate worlds or actions even if
they only have one user and shouldnt be touched.

Now let `id_single_user` check usercount and only act if we have more
than one real users.

Pull Request: blender/blender#105991
2023-04-04 09:12:37 +02:00
14b112ef82 Fix #106422: Mesh Data Attributes Using tip_ for iface_
pgettext_tip incorrectly imported as iface_ instead of importing
pgettext_iface. These leads to incorrectly translated attribute text
shown when the user elects to translate only tooltips.

Pull Request: blender/blender#106507
2023-04-03 20:55:22 +02:00
3e8f85c743 Fix: VSE Channels region unhides when changing font
Caused by filebrowser calling space `refresh` function. The intention of
refresh function was mainly to hide channels when view type is changed.
Unhiding channels when view is changed back seems logical, but this
causes issues when region is too thin, which results in hiding side
panel, which is more important.
2023-04-03 19:46:10 +02:00
9726e4a0ad Nodes: Move data-block default values with link drag search
When creating nodes by dragging a link, it can be convenient to
transfer values from input socket. For reference values, like images,
this may be necessary to avoid unnecessary data-block users. This
patch starts adding such a system. At this moment this only makes sense
for one node (Image Input), but this can be extended to work with other
reference types, different non-reference types and support auto-casting
(if a float is transferred to the Integer Input node).

See task: blender/blender#102854
Original patch: https://archive.blender.org/developer/D16735

Pull Request: blender/blender#105972
2023-04-03 19:33:39 +02:00
e7f395dd20 Nodes: Add dropdown to select group socket subtype
Previously the only way to control the subtype was to remove the group
input or output and create it again. This commit adds a dropdown to
change an existing socket, for supported socket types.

Based on a patch by Angus Stanton: https://developer.blender.org/D15715

It was necessary to fix the UI code slightly; the layout's context
wasn't being used in calls to an operator's enum items callback.

Pull Request: blender/blender#105614
2023-04-03 18:23:30 +02:00
4cb670e68f Fix #105148: Cycles Metal memory leak on AMD GPU
After NanoVDB support from 02c2970982, this line should not have been
removed.
2023-04-03 18:18:01 +02:00
7a1ec82af4 Cleanup: Remove poly normal writing
The potential optimization in the normal edit modifier when flipping
faces isn't worth the "API impurity" and complexity introduced by
adding poly normal editing as part of the API. This change simplifies
future changes to the ownership of poly normals with a shared cache,
which can prevent recomputing poly normals completely.
2023-04-03 12:11:21 -04:00
e76f4d9f9a Mesh: Use more efficient update tag when flipping faces
Vertex positions and faces aren't changed, so most caches shouldn't
need to be tagged. This removes unnecessary re-computation of bounds,
triangulation, loose edges, etc.

Pull Request: blender/blender#106250
2023-04-03 18:01:16 +02:00
da6dfc2b43 VSE: Clarify why frame range is drawn differently than in other editors. 2023-04-03 17:44:04 +02:00
45f7e2b6ba Fix Snap package error on startup in older Linux version
With the new glibc requirement, the core version needs to be increased.
2023-04-03 17:32:35 +02:00
dbf1049d41 Cycles: bump version to 3.6.0 2023-04-03 17:32:35 +02:00
861debcb10 Fix Cycles standalone and Hydra build issues in some configurations
Bring the build in sync with the Cycles standalone repo.
2023-04-03 17:32:35 +02:00
Alex Fuller
4f0092c1ff Refactor: add native Cycles Normalize option on lights for Hydra
Make it a native Cycles light option instead of counter-acting the inverse
area calculation in Hydra.

Differential Revision: https://developer.blender.org/D16838
2023-04-03 17:23:46 +02:00
Alex Fuller
945579c203 Fix Cycles build issue with USD 23.02
HdRenderDelegate got a change with the interface, adding gpuSupported. It
currently is just a dummy implementation without checking for anything
GPU-related.

Differential Revision: https://developer.blender.org/D17207
2023-04-03 17:23:46 +02:00
Alex Fuller
cbf3bd0efc Fix Cycles missing geometry header in object header, causing crashes
The problem is that `set_geometry()` otherwise ends up implicitly
casting `Geometry*` to bool. In Blender this worked because the
geometry header was always included before the object header.

Differential Revision: https://developer.blender.org/D16737
2023-04-03 17:23:46 +02:00
8833f5dbf9 Animation: Allow NLA strips to be horizontally shuffled
Allows NLA strips to horizontally translated over each other. If a strip is dropped when translating, it'll cause the strip to shuffle into place.

---

Abstracted large conditional branch in `recalcData_nla` into it's own `nlastrip_fix_overlapping` method for increased readability. No logical changes were made.

---
[Archived Phabricator Patch](https://archive.blender.org/developer/D10102)

Pull Request: blender/blender#105532
2023-04-03 17:10:37 +02:00
4bcd59d644 Cycles: Avoid overhead from RNA when extracting mesh data
Use raw Blender structs and mesh data rather than using the RNA API.
There isn't any benefit from using the RNA when Cycles is compiled
with Blender anyway, and a profile showed that the majority of time
was spent in Blender RNA API functions.

This gives a significant improvement in performance when ingesting
meshes. Here are some tests of the runtime of the `create_mesh`
function (in seconds):

|                           | Before | After |
| ------------------------- | ------ | ----- |
| Grid                      | 0.66   | 0.11  |
| Many realized cubes       | 2.60   | 0.48  |
| Large curve to mesh setup | 4.18   | 1.14  |

Also change to resizing the arrays and filling them by index rather
than appending. This makes the parallel aspect of the logic clearer,
and makes the loops easier to parallelize in the future, and makes
it easier to have a performance benefit when an attribute like
`sharp_face` doesn't exist.

Pull Request: blender/blender#106275
2023-04-03 17:04:58 +02:00
1380ee74ff Overlay: use edge-connected polygons to calculate wireframe factor
Use the dot product of the normal of the two polygons connected to the
edge to calculate the edge factor.

This fixes #90641 and #102545 and ensures more predictable results for
boundary and non-manifold edges.

Co-authored-by: Germano Cavalcante <mano-wii>
Pull Request: blender/blender#105352
2023-04-03 16:22:41 +02:00
d1fe11c79f DRW: remove edges hidden by Optimal Display in IBO creation
No functional changes.

Edges hidden by Optimal Display are hidden by edge factor Shader.
But there is not much advantage in doing this, as the number of edges
hidden by the Optimal Display is usually much higher than the number of
visible edges.

And the lines extractor does not include invisible edges due to other
factors.

So this change makes:
- Visibility test more consistent with what is actually seen.
- Smaller buffer for IBO sent to GPU
- consistency with GPU Subdivision that already considers Optimal Display
- Allows possible improvement in the "Edge Factor" extraction by making
it unnecessary to check the Optimal Display (except for optimization).

Co-authored-by: Germano Cavalcante <mano-wii>
Pull Request: blender/blender#106402
2023-04-03 15:59:41 +02:00
d1ec8a2ae5 I18n: translate popover descriptions
Popover menu buttons had their labels translated but not their
descriptions, although they were properly extracted.

This commit fixes that using the `TIP_()` macro.
2023-04-03 15:55:48 +02:00
da764ee357 I18n: translate viewport grid unit
This information is displayed in the top left of the 3D Viewport with
other text info. The units of the grid are already extracted, but they
were not translated in the drawing code.
2023-04-03 15:28:16 +02:00
e4cd7d2fed Updated translations from SVN trunk (r6419). 2023-04-03 12:58:50 +02:00
e05010b2f2 Cleanup: make format on new install_linux_packages py script.
Also some minor fixes to generator for version numbers of packages.
2023-04-03 12:00:13 +02:00
f692010ae1 Cleanup: remove redundant call to #free() for light tree arrays 2023-04-03 11:48:09 +02:00
b81472d20f Cleanup: remove useless comments
Remove comments from `eBConstraint_Types` that
- were used long ago during a big refactor effort, but are no longer
  necessary, or
- just repeated the name of the enum constant.

No functional changes.
2023-04-03 11:24:39 +02:00
1205111fe9 Refactor: move #object_usable_as_light() from #LightManager class to #Object
so that the function can also be used by other classes.
Also change `!bounds.valid()` to `!is_traceable()` so zero-sized objects
are skipped.
2023-04-03 11:16:00 +02:00
4aed240b02 CMake: Disable Options Depending on OpenEXR Dependecies
OpenEXR has some dependecies that other other modules in Blender
requires. When disabling OpenEXR these dependecies could not match
and building blender would fail.

This PR disables the next options when `WITH_IMAGE_OPENEXR=Off`

- `WITH_OPENVDB`
- `WITH_ALEMBIC`
- `WITH_VULKAN_BACKEND`
- `WITH_CYCLES_OSL`

Additionally windows stores the IMath libraries in `IMATH_LIBRARIES`
Linux and Mac stored the IMath libraries in `IMATH_LIBRARY`. This
change will also adds `IMATH_LIBRARIES` variable to all platforms.

Pull Request: blender/blender#106209
2023-04-03 09:50:50 +02:00
8954df63ef Fix #106431: Resolve Metal workload dependency
Splitting workload dependency chains such that they
only exist within the context of a single frame.
Dependencies are required to ensure sequential
command buffer submissions execute in order,
but the additional dependencies between frames
could incur GPU timeouts, if a signal was delayed.

This could be triggered by both CPU/GPU cycles
texture updates and Viewport Compositor operations.

Should also resolve #106401

Authored by Apple: Michael Parkin-White

Pull Request: blender/blender#106443
2023-04-03 08:53:42 +02:00
682cb6ecd3 Metal: Optimize SSR shader for Apple Silicon
Reduce register spill to global memory in raytrace_resolve
function. Results in a 20% uplift for this particular shader on
Apple Silicon GPUs. Contributing to 3-5% uplift for scenes
which have SSR enabled. This is achieved via reducing
memory pressure using a packed data type for the sampling
kernel.

Authored by Apple: Michael Parkin-White

Pull Request: blender/blender#106231
2023-04-03 08:37:24 +02:00
dc63f75837 Fix #106414: Handle mat==None case in GPencil Change Active Material operator
Some material slots could be empty, the operator could encounter a python
exception. Now fixed.

Pull Request: blender/blender#106418
2023-04-02 17:08:50 +02:00
45104ddd14 Cleanup: Remove code asserted as unreachable,
This piece of code has been assserted as unreachable for 3 years now,
time to clean it up.
2023-04-01 20:17:26 +02:00
8a364ef72c Fix (unreported) misisng handling of XR data object pointer in foreach_id.
Very sadge to see this kind of mistakes still exist in 2023 code...

While in theory this commit could be backported to (LTS) releases, would
rather only do it if/when proven it actually fixes user-facing issues.
Fixing such issues so deep in ID management code can have completely
unexpected side effects.
2023-04-01 20:10:48 +02:00
7592ec35d3 GPU: Fix compilation with option WITH_GPU_BUILDTIME_SHADER_BUILDER
Breakage caused by 84c93f3a06
2023-04-01 17:16:54 +02:00
e652d0002b GPU: FrameBuffer: Fix empty framebuffer update
The framebuffer default size was only set during the first bind. This
is because the `dirty_attachments_ tag` wasn't set and thus the
framebuffer size was never passed down to the GL.

Split to `default_size_set()` to not affect other code paths that use
`size_set()`.
2023-04-01 13:24:48 +02:00
897a735151 BLI: Rotation: Add CartesianBasis transform_point and invert 2023-04-01 13:24:35 +02:00
957ac41237 Fix #78396: Pack UVs to original bounding box
Adds the ability to pack UVs back into the original bounding box.

Choose UV Editor > Menu > UV > Pack Islands

Then change "Pack To" to "Original bounding box"
2023-04-01 21:13:58 +13:00
531f99ffbd UV: simplify uv packing api and simplify uv packing
Fix #invert_m2_m2 with repeated arguments.

Change UV Packing to use {pivot, half_diagonal} representation.
2023-04-01 11:35:07 +13:00
6778460e53 Fix #106323: Snap to Face Nearest not working
Face Nearest only works with individual projection, so always set the
`SCE_SNAP_PROJECT` flag in this case.

Also gray out the `Project Individual Elements` option in the UI if
`Face Nearest` is enabled.

And change the description to indicate that `Project Individual Elements`
is always enabled with the `Face Nearest` option.

(I feel a better design for this option needs to be considered).
2023-03-31 17:30:26 -03:00
f898c22349 Fix #106363: snap toggle affecting operators not set to 'Affect'
Regression due 88e2542398.

Although the "Non-Affect" operators continue to use incremental,
this snapping should not be enabled by default.
2023-03-31 16:32:53 -03:00
389025bee2 Cleanup: Use consistent type in function definition 2023-03-31 14:24:23 -04:00
1a956ce196 Cleanup: Mode most of MOD_nodes.cc to the blender namespace
Avoid introducing another `::modifiers` namespace for now, since it's
not clear if we'll want that long term. This just avoids a bunch of
boilerplate and makes things easier to read.
2023-03-31 13:19:37 -04:00
60cac27ccc Cleanup: Use helper function to create AttributeFieldInput 2023-03-31 13:00:51 -04:00
1113a25d1f Cleanup: Make geometry nodes execution functions more reusable
Use the node group and the properties as arguments instead of
the modifier. This may help to allow reusing the functions outside
of the modifier execution context.
2023-03-31 12:53:21 -04:00
96e8f8a002 Some progress 2023-03-31 12:32:59 -04:00
4c19994c11 Merge branch 'main' into node-group-operators 2023-03-31 11:58:07 -04:00
7d548b5735 Refactor: Cleaning up NLA Draws Non_solo boolean option
Refactor: Clean up boolean logic naming in nla_draw to be more readable.
Pull Request: blender/blender#106119
2023-03-31 17:49:26 +02:00
0187943a3d Animation: Weight Paint select more/less for faces
This adds the select more/less operators to the weight paint mode face selection.

Just like in edit mode, press `CTRL`+`Numpad Plus/Minus` to use them.
They have also been added to the `Select` menu.

Pull Request: blender/blender#105607
2023-03-31 14:53:00 +02:00
0d1a0cb453 Animation: Weight Paint select more/less for vertices
This adds the select more/less operators to the weight paint mode vertex selection.

Just like in edit mode, press CTRL+Numpad Plus/Minus to use them.
They have also been added to the Select menu.

Pull Request: blender/blender#105633
2023-03-31 14:47:57 +02:00
0face8bd22 Fix #105912: Texture paint removes evaluated mesh attributes
When retrieving the evaluated mesh to paint on, it can be reevalauted,
where a smaller set of attributes are requested than for regular
evaluated meshes. That reevaluation should be completely removed
(see #106186), but a simple fix in the meantime is to manually
request that data.
2023-03-31 08:15:58 -04:00
7775fecb14 Animation: Graph Editor - grey out area outside of normalization range
When normalization is enabled in the Graph Editor,
the area outside the -1/1 range on the y axis isn't meaningful.
To visually represent that this patch greys out that area
just as it does with anything outside the current frame range.

Pull Request: blender/blender#106302
2023-03-31 13:54:32 +02:00
324ba509b5 Fix: don't access 4th element of float3
The issue here is that `float3` implicitely casts to `float *`
which is then passed into the `float4` constructor.
2023-03-31 11:41:05 +02:00
ca0ec55d59 Update license document. 2023-03-31 11:39:39 +02:00
b73ae802fb Fix OBJ test expectations after fast_float.h update 2023-03-31 11:36:25 +03:00
e1426e6319 Externals/IO: update fast_float.h to latest version
fast_float.h currently is only used by OBJ, STL and PLY I/O importers.
Update it to the latest release from upstream (from 3.4.0 2020 Nov to
4.0.0 2023 Mar).

No behavior changes, but they have optimized the performance a bit.
Importing a 6-level subdivided Suzanne OBJ file (330MB) goes from 3.5sec
down to 3.2sec on Win10, Ryzen 5950X, VS2022 build.
2023-03-31 11:03:13 +03:00
cde99075e8 GHOST/Wayland: add fractional-scale interface support
Previously, fractional scaling was detected but set an integer buffer
scale which the compositor would down-scale causing blurry output.

Now the fractional scaling interface is used when available to set the
DPI and set the internal buffers size & viewport transformation to
ensure 1:1 pixels from Blender to the Wayland output.

Tested to work with multiple monitors with mixed
fractional/non-fractional scale.

Note that this change causes a regression for when fractional scaling
is set on a compositor without support for fractional-scale-v1.
Supporting fractional scaling in both cases is possible but overly
complicated. This case already wasn't working so well - with blurry
output due to image scaling, now the DPI wont be accurate in this case
although Blender is still usable.
2023-03-31 13:03:50 +11:00
75127f9b09 Build: upgrade wayland protocols to 1.31
Needed for fractional-scale-v1 protocol.
2023-03-31 13:02:54 +11:00
a9d15ee8a0 Cleanup: pass rect as a constant pointer 2023-03-31 13:02:53 +11:00
7c67f8c719 Progress 2023-03-30 19:17:05 -04:00
cf77874cdb Merge branch 'main' into node-group-operators 2023-03-30 18:52:25 -04:00
498287bca0 Cleanup: Geometry Nodes: Split modifier property update function
It's a bit easier to follow this way, and we can make better use of
const. It's also more reusable in case we have to use it elsewhere
too (for node group operators?).
2023-03-30 18:51:33 -04:00
3d5ba79050 Cleanup: Use const arguments for IDProperty functions 2023-03-30 18:51:33 -04:00
7e748413f9 Add no-op operator base 2023-03-30 18:38:33 -04:00
ed0e4f4043 UV: refactor uv packing, reduce usage of #BoxPack
No functional changes.
2023-03-31 10:09:48 +13:00
41c5490137 Merge branch 'main' into node-group-operators 2023-03-30 16:34:46 -04:00
cbb813886c Geometry Nodes: Simplify retrieval of node dependencies
Use checks for certain node types with better algorithmic complexity.
They should perform better in some edge case with a lot of nodes or
node group nesting. They're now a bit more similar to each other too.
2023-03-30 16:30:23 -04:00
76e0ca6b91 Build: suppress CMake warnings about newer Boost versions
This is the only package that warns about this type of thing, and gets in the
way of actual warnigns on build logs. This requires CMake 3.19+ to take effect,
older versions still show the warnings.
2023-03-30 22:29:14 +02:00
40f050aadc UV: simplify packing usage of #BoxPack
No functional changes.
2023-03-31 09:02:01 +13:00
f6e89233a3 Workbench: Optimize texture usage flags
Authored by Apple: Michael Parkin-White

Pull Request: blender/blender#106229
2023-03-30 21:49:41 +02:00
ec94b1da58 Metal: Optimize texture usage in glutil
Ensure compression is enabled by using shader_read
flag only. Also ensure that MTLTexture contents
remain in optimal layout for reading after any
data modifications.

Authored by Apple: Michael Parkin-White

Pull Request: blender/blender#106234
2023-03-30 21:45:45 +02:00
338db40df9 Merge branch 'main' into node-group-operators 2023-03-30 15:25:08 -04:00
1658b8ab46 Fix Cycles Metal failing when run in parallel, always run serial
The command buffer fails to execute, the cause is unknown. It does not
appear to be related to the binary archive cache as disabling that does
not prevent the issue.

Pull Request: blender/blender#106328
2023-03-30 19:46:49 +02:00
55d642ba2f Fix non-deterministic behavior of mask compositor node
The issue was caused by uninitialized offset used for the scale
variable.

Follow the rest of the usages of the operation which initialize
it explicitly. This makes it very safe and easy fix to backport
to any LTS or corrective release.

Ideally should probably initialize all members in the class
itself, to avoid such situations in the future.

Pull Request: blender/blender#106325
2023-03-30 18:57:22 +02:00
a145d1563a Cleanup: move flip faces code from nodes to geometry module 2023-03-30 18:44:11 +02:00
55d473ee40 Cleanup: use better default name for unknown parameter
The `<` and `>` don't work well when the name is inserted into a .dot graph.
2023-03-30 18:44:11 +02:00
bdc3f1581d Fix #106261: When geometry output is viewed the cycling operator picks wrong sockets.
The cycling method for the viewer connection starts searching from the next socket
after the last current connection. If a geometry socket is is the last connected
output this caused the method to jump to the next socket after the geometry,
potentially skipping over valid data sockets that are not viewed yet.

The solution is to ignore the geometry sockets in the cycling entirely and only
consider data sockets (i.e. non-geometry sockets).

Pull Request: blender/blender#106318
2023-03-30 16:56:56 +02:00
8785862ee4 Replace install-deps bash script by a python one, and only handle distro packages.
This tool now only supports installing packages, it won't build any
dependency anymore. This implies that on most distributions, it wont
make a complete Blender build possible, some features will likely be
misisng.

By default, it only install basic dev environment to enable building
Blender with the precompiled libraries (which is the recommended way).

Passing the `--all` option will make it try to install all known
dependencies from distro packages. This is a development option,
regular Blender build should be done with the precompiled libraries.

Tested on Debian Testing, Arch, Fedora and Suse Tumbleweed.

With the new design, it should be fairly trivial to add more
distributions if desired, and maintenance should also be way simpler.

NOTE: side effect is that a working python3 interpreter is expected on
system running this script. In practice this should not be an issue,
since Python3 is installed by default in almost all regular desktop
linux installations.
2023-03-30 16:30:45 +02:00
be733c240e Animation: Insert Keyframe only on active FCurve
The insert key operator allowed to insert a keyframe on all selected FCurves
and on the Active FCurve at cursor value.
But it didn't allow to insert a keyframe only on the active FCurve.

This patch adds that. It is available in the redo panel and under Key->Insert Keyframes (which can also be called with the I hotkey)

Pull Request: blender/blender#106307
2023-03-30 16:29:50 +02:00
12b001ebce Fix OBJ tests using release folder
This change aimed to solve the following issues:

- Possible threading issue of two tests writing to the same
  file, depending on how the ctest is invoked

- Test using the release directory, and potentially leaving
  temp file behind on test failure, breaking code sign on
  macOS.

Pull Request: blender/blender#106311
2023-03-30 15:55:01 +02:00
8f1925c2f6 Cleanup: make format 2023-03-30 15:28:21 +02:00
f9b9430982 Fix: Crash when loading 3.4 autosave file
The MVert to float3 vertex position conversion was skipped using
the wrong case, mesh->mvert wasn't always set when writing
apparently.
2023-03-30 08:37:05 -04:00
80319035e6 Fix: Debug assert extracting multiple UV maps in edit mode 2023-03-30 08:24:29 -04:00
7eda8e5367 Fix: unnecessary edge pan updates
Found together with a fix for #106043.

Edge panning (in Node Editors, Outliner and VSE) does unnecessary
updates when the view has not changed at all. This includes adding
`MOUSEMOVE` events (even if you dont move the mouse at all).

Adding `MOUSEMOVE` events results in the transform system constantly running (even if you dont move the mouse) which we certainly want to avoid.

Rectify this by only calling these updates when the view changes.

Pull Request: blender/blender#106301
2023-03-30 14:08:57 +02:00
2a6f177e8e Fix #106043: Moving frame node jittering while cursor is still
The fix for #105363 (6d3ce8273a) made the transform system respect
(Frame) nodes `offsetx`/`offsety`.

Now Node Editors run the transform system even if the mouse is still (due to edge panning -- unnecessarily, see PR #106301 for fixing this). And due to the way `frame_node_prepare_for_draw` recalculates these offsets (based on
on updated positions and `node.runtime->totr` [which in turn gets rounded in `node_update_basis` -- so subpixel precision is lost there, see [1]]), this can lead to slight imprecisions/noise/jitter during transform (if we use float offsets, see the PR for more info).

So to counter this, use rounded offsets now [which will keep the whole circle stable].

NOTE: PR #106301 would fix this already for having the cursor still, but this patch still improves slight jitter when moving, so will commit separately.

[1] comment from `node_update_basis`
> /* Round the node origin because text contents are always pixel-aligned. */

Pull Request: blender/blender#106096
2023-03-30 14:02:45 +02:00
d90795bc3c Asset System: New "weak" asset reference for storing in .blend files
No user visible changes expected.

For brush assets, we need a way to store a reference to a brush in .blend files, so that the last active brush can be restored from the file. See #101908. It seems like a generally useful thing to have.

Adds a new DNA struct to store a "weak" asset reference, that is, a reference that can break under a number of circumstances, but should work reliably enough under normal usage. There's no way to reliably reference an asset currently, so this works on a "best effort" basis. It can break when assets are moved inside the asset library, asset libraries are unregistered from the Preferences, or a file is opened on a different machine with different Preferences, for example. It can also break currently if an asset library is renamed.
It contains:
- Information to identify the asset library the asset can be found in.
- A relative "identifier" (currently a relative path) for the asset within the asset library.

There's further code to resolve a weak reference to file paths and Blender library paths.

Part of #101908.

Co-authored-by: Bastien Montagne <bastien@blender.org>

Pull Request: blender/blender#105603
2023-03-30 12:25:42 +02:00
a12a8a71bb Remove "All Rights Reserved" from Blender Foundation copyright code
The goal is to solve confusion of the "All rights reserved" for licensing
code under an open-source license.

The phrase "All rights reserved" comes from a historical convention that
required this phrase for the copyright protection to apply. This convention
is no longer relevant.

However, even though the phrase has no meaning in establishing the copyright
it has not lost meaning in terms of licensing.

This change makes it so code under the Blender Foundation copyright does
not use "all rights reserved". This is also how the GPL license itself
states how to apply it to the source code:

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) <year>  <name of author>

    This program is free software ...

This change does not change copyright notice in cases when the copyright
is dual (BF and an author), or just an author of the code. It also does
mot change copyright which is inherited from NaN Holding BV as it needs
some further investigation about what is the proper way to handle it.
2023-03-30 10:51:59 +02:00
7e940f184f Animation: Auto frame curves Y extents when hitting normalize
When hitting the "normalize" button in the graph editor, set the y extents of the view to the extents of the `FCurves`.
Previously you had to search for your curves after pressing that button.

Pull Request: blender/blender#105857
2023-03-30 10:01:12 +02:00
d9de76f5d1 Cleanup: PLY exporter headers cleanup
Move private functions out of headers, cleanup unnecessary includes,
forward declarations instead of includes where possible, avoid global
variables.
2023-03-30 09:56:23 +03:00
0fcecc5c1e Cleanup: use methods to convert to/from window scale
Simplifies adding support for the fractional-scale protocol which
requires events to be fractially scaled.
2023-03-30 17:36:31 +11:00
3cfc3eab93 UV: fix unreported, bad uv packing with convex shape_method.
Pivot wasn't set with convex shape_method when an island has only one triangle.

Regression from 86b1e5e3b6
2023-03-30 12:35:45 +13:00
9ea6771d10 Cleanup: simplify sorting during uv packing
Prevent double-sorting during uv packing with bounding-box packing.

Slight speed improvement, slight packing efficiency improvement.
2023-03-30 12:23:49 +13:00
a62f6c8290 Fix out-of-bounds array access when building with GHOST_OPENGL_ALPHA
While this is off by default, best replace hard coded sizes to avoid
out of bounds access if the enum is expanded.
2023-03-30 09:51:44 +11:00
abb879175e Fix #106283: several uv operations producing missing uvs
Uninitialized memory, regression from in p_flush_uvs [0]

[0] 8ac67a798b
2023-03-30 10:28:41 +13:00
7b94e86dd9 PLY: improve UV values merging in the exporter
Similar to recent OBJ UV values merging commit (05a63e3705) - build
mapping of (vertex, UV) by going over the face loops directly, instead
of using BKE_mesh_uv_vert_map_get_vert and then having an additional
map on top. Provide the mapping into ready to use flat arrays, instead
of building a map and then building arrays out of that in a separate
pass.

While at it, avoid the extra cost of building all this complicated
mapping when we don't have or are not exporting UVs.

Timing tests on exporting several models into binary PLY file
(Win10, Ryzen 5950X):

- Suzanne subdivided to level 6 (2.1M verts): 0.93s -> 0.68s
- Rungholt Minecraft level (9.7M verts): 3.3s -> 2.3s
- Stanford Lucy 3D scan (14.0M verts, no UVs): 5.2s -> 1.5s
2023-03-29 23:00:06 +03:00
5f61eca7af Cycles: Exploit non-uniform threadgroup sizes on Metal
This patch replaces `dispatchThreadgroups` with `dispatchThreads` which takes care of non-uniform threadgroup bounds. This allows us to remove the bounds guards in the integrator kernel entry points.

Pull Request: blender/blender#106217
2023-03-29 21:46:11 +02:00
8eb9d5342f Fix build error on Ubuntu 20.04 with Wayland after recent changes
The system wayland-protocols version is too old, and xdg-activation-v1.xml
is a more recent addition than xdg-decoration-unstable-v1.xml so check for
that.
2023-03-29 20:28:37 +02:00
944a5854c6 Cycles: Fix MetalRT shadow all hit bug
This patch fixes a MetalRT issue where viable shadow hits are discounted based on the false assumption that hits are ordered by distance. With this patch, the following unit tests now pass:

- openvdb smoke
- shadow catcher pt transparent lamp only 0.8
- shadow catcher pt transparent lamp only 1.0

Pull Request: blender/blender#106276
2023-03-29 20:20:07 +02:00
8ce3bb6e05 Fix: Curves: crash when requesting write access for attribute from multiple threads
This is preparation for #106228, the crash does not happen in `main` currently.
The issue was `positions_for_write` might make a copy of the data if it was
shared. This operation is not thread safe on a single mesh. The solution is to
get write-access to the positions only once before threading starts.
2023-03-29 18:40:13 +02:00
84c93f3a06 Cleanup: use eCustomDataType instead of int
This makes the APIs more correct and simplifies debugging, because
some debuggers can now show the enum name instead of the integer.

Pull Request: blender/blender#106268
2023-03-29 17:10:49 +02:00
431d9858c5 Cleanup: Retrieve const custom data layers 2023-03-29 11:09:14 -04:00
5efa39096c Fix #106134: Broken triangulation without cached face normals
Logic broken in 16fbadde36
2023-03-29 11:09:14 -04:00
d32d787f5f Clang-Format: Allow empty functions to be single-line
For example

```
OIIOOutputDriver::~OIIOOutputDriver()
{
}
```

becomes

```
OIIOOutputDriver::~OIIOOutputDriver() {}
```

Saves quite some vertical space, which is especially handy for
constructors.

Pull Request: blender/blender#105594
2023-03-29 16:50:54 +02:00
cc7634f2ea Cleanup: deduplicate code 2023-03-29 09:47:41 -03:00
bb2c89b20d Fix #106251: "Shift to extend" doesn't work in 3D View Collections panel
Regression in [0], use shift to initialize the extend option when unset.

[0]: d7dd7403a8
2023-03-29 20:05:44 +11:00
c0a252b833 Fix #105895: UI scaled down with 125% fractional scaling on Wayland
The DPI returned by the GHOST/Wayland didn't account the buffer being
rendered at a higher (non-fractional) resolution, then scaled down.

This caused the software cursor and UI to rendered very small.
A fractional scale of 101% would show the UI just over 50% of the size
(making the UI to be close to half the scale it should have been).

Resolve by accounting for down-scaling of the buffer to it's
fractional size.
2023-03-29 17:48:53 +11:00
68d146d57d Fix error in WM_capabilities_flag (all capabilities were set)
Mistake in [0] caused the flag not to be reset.

[0]: 4e51008a82
2023-03-29 17:33:38 +11:00
86b1e5e3b6 Cleanup: simplify uv packing api 2023-03-29 17:09:36 +13:00
2bc331981d Cleanup: function style casts, remove UNUSED(..) & use nullptr in C++ 2023-03-29 14:37:53 +11:00
1ddbe7cadd Cleanup: move doc-strings into headers, remove duplicates
In some cases move implementation details into the function body.
2023-03-29 14:37:34 +11:00
ce659dbc4e Cleanup: use doxygen sections 2023-03-29 14:17:32 +11:00
35f770a689 Cleanup: duplicate words in comments 2023-03-29 14:17:32 +11:00
43f6df853f Merge branch 'blender-v3.5-release' 2023-03-28 22:52:27 -04:00
df824e2015 Cleanup: use function style casts
Missed in 901a804f9e.
2023-03-28 23:10:11 -03:00
901a804f9e Cleanup: convert 'view3d_navigate.c' to C++
Anticipate porting this file as changes are planned to it and we are
gradually porting files to C++.
2023-03-29 04:02:16 +02:00
8d16e8f726 Merge branch 'blender-v3.5-release' 2023-03-28 16:33:34 +02:00
a58c951c98 Merge branch 'blender-v3.5-release' 2023-03-28 14:30:12 +02:00
d81d743537 BLI: support == and != for Set
This makes it more convenient to check if two sets contain the same keys.
2023-03-28 14:16:57 +02:00
fbcddfcd68 BLI: add core types for supporting implicit-sharing
The overall goal is to use implicit-sharing in many places in Blender
that currently do unnecessary copies. See #95845 for more details.

This commit only adds the base data structures in blenlib and uses those
in `GeometrySet` and `AnonymousAttributeID`, which used a more ad-hoc
version of implicit sharing already. #105994 lists some more places where
support for implicit sharing can be added (most notably: custom data layers).

Pull Request: blender/blender#105994
2023-03-28 13:57:51 +02:00
1987cbb12a Merge branch 'blender-v3.5-release' 2023-03-28 13:41:43 +02:00
0256bfd309 UI: Support minimum row count for tree views
No user visible changes expected.

With this, empty rows will be added to the tree view so that the
background box is at least a few lines high (like with UI lists). If the
view is used as a drop target, data can be dropped on these empty rows
too then.
This was requested for the Cycles light linking project.
2023-03-28 12:39:24 +02:00
3ea5a8fbb9 Fix #105590: Compositor: Masks don't consider anamorphic aspect ratio
This PR adds support for anamorphic aspect rations when using
masks. As viewport compositor doesn't support masks yet, this
has not been added yet.

Pull Request: blender/blender#106121
2023-03-28 12:36:14 +02:00
aa69ec7f80 Vulkan: Clearing Framebuffer + Scissors
This PR adds support for clearing framebuffers and scissor testing.
Tweaks had to be made to VKTexture to keep track of its layout
on the device. Based on the actual call the layout can switch
to a more optimum layout.

For example during upload of a texture the texture will be converted
to a transfer destination optimized layout. When reading from the
texture it will be converted to a transfer source optimized layout.

The order of the attachments in the framebuffer follows the next rules

- When only color attachments are there the color attachments will
  be placed in the slot they are defined. This way it will match
  the ShaderCreateInfo binding location.
- When a stencil/depth attachment is added it will be placed
  right after the color attachments. When there isn't a color
  attachment it will be the first attachment.

Pull Request: blender/blender#106044
2023-03-28 11:51:32 +02:00
eb9ab4fae4 Refactor: draw code for anim channel widget
A few small refactors of the `draw_setting_widget()` function for drawing
animation channel widgets (like 'modifier mute', etc.)

- Use `const` where appropriate.
- Move some variable declarations to their actual use, to clarify their
  scope and make it possible to use `const`.
- Return earlier where possible, which should improve performance as some
  unnecessary code gets skipped.

No functional changes.
2023-03-28 11:19:30 +02:00
a64877f045 Vulkan: Added prerequisite checks for using VK_Layer_Validation
This PR adds pre-checks when enabling validation layers.

For validation layers to work some platforms require that
the Vulkan SDK is installed. Validation layers are activated
when running blender with `--debug-gpu`.

Sometimes we expect users to run with `--debug-gpu` for
narrowing down an issue and we cannot expect them to have
the Vulkan SDK installed.

This patch will check if the `VK_LAYER_PATH` is available
and that the configuration file of the validation layer is
present. If this isn't the case we don't activate the
requested validation layer.

Pull Request: blender/blender#105922
2023-03-28 10:45:44 +02:00
f8e190aac5 Cleanup: Silence Compilation Warnings
In recent Vulkan changes.

Pull Request: blender/blender#106204
2023-03-28 08:53:56 +02:00
a88c77eaac Cleanup: use struct comments for gwl_registry_handlers declaration 2023-03-28 17:05:25 +11:00
1cf2ad8e15 Fix #106203: Memory leak with dynamics enabled in particle edit mode
particle_batch_cache_init was called with allocated memory in
ParticleBatchCache. Now particle_batch_cache_clear frees all allocated
memory.
2023-03-28 16:58:50 +11:00
3071ec486b GHOST/Wayland: support window activation
Calling render (for example) with an existing window open now activates
the window on Wayland. Tested to work on GNOME & KDE.

Use the xdg-activation protocol which typically brings the
window to the foreground.

Partially resolves #102985.
2023-03-28 16:08:10 +11:00
8132b4a927 GHOST/Wayland: GWL_Seat::data_source_serial when modifiers are set
All keyboard/cursor events should set the data_source_serial,
also update doc-string.
2023-03-28 16:05:32 +11:00
4ee705ca4f Cleanup: use a system method to access the APP_ID
Move the app-id out window initialization code.
Make it possible for other methods to access the APP_ID.
2023-03-28 16:05:31 +11:00
10b03e66b9 Cleanup: remove unreachable code 2023-03-28 15:57:48 +11:00
4bead379c6 Cleanup: remove redundant (void) in C++ function declarations 2023-03-28 15:57:48 +11:00
2ec4ce18ae Cleanup: use 'override' specifier for GHOST: X11, SDL & None with CLANG
Clang would warn about failure to use 'override' when a single
method was added that used 'override' when none of the other methods
did.

This meant a single correct use of override caused noisy compiler
warnings (for CLANG but not GCC).
Avoid this by using 'override' where appropriate.
2023-03-28 15:57:48 +11:00
47e065f165 Cleanup: quiet unused but set warnings with CLANG 2023-03-28 15:57:48 +11:00
bbcfdb844c Cleanup: quiet strict-prototypes warning with CLANG 2023-03-28 15:57:48 +11:00
1b0816929f Cleanup: quiet unreachable-code-generic-assoc warnings with CLANG
Duplicate types in type checking macros caused many warnings.
2023-03-28 15:57:48 +11:00
5379c0aa00 Fix particle system creating over-sized KD-tree
Particles were counted but the result was ignored.
2023-03-28 15:57:48 +11:00
55f6c97185 Fix redundant memcmp in BLI_array_store, correct assertion
Assert failed in BLI_array_store_test, failing to compare chunks
caused an unnecessary memcmp call in rare cases.
2023-03-28 15:57:48 +11:00
8ac67a798b Cleanup: Simplify aspect ratio usage in uv unwrapper
Replace `aspx` and `aspy` with `aspect_y`.

No functional changes.
2023-03-28 15:52:34 +13:00
ceaaf7f0ca Cleanup: format 2023-03-28 15:05:54 +13:00
16576beb22 Fix: Mistake in mesh vertex normal dirty tag in previous commit
The "clear dirty" call was removed, that shouldn't happen (yet!).
2023-03-27 19:56:21 -04:00
9bb6f92fe0 Cleanup: Use Vector for metaball tessellation vertex data
Avoid manually reallocating arrays here, and simplify future changes
to the ownership and assignment of mesh vertex normals.
2023-03-27 19:48:04 -04:00
b828641a93 UV: Add alpaca_rotate variant for improved packing efficiency
Improvements to packing efficiency and updating UV packing API.

* Add #pack_islands_alpaca_rotate, the fast alpaca-style packer with rotation.

* Update heuristic for sorting islands based on longest edge.
(Improves pack efficiency when rotation is enabled.)

* Add `aspect_y` to UV Packing API, to support non-square materials in the future.

Pull Request: blender/blender#105977
2023-03-28 00:35:27 +02:00
00bb30c0e9 Geometry Nodes: Copy cached no loose edge status in realize instances
When all of the input meshes have no loose edges, the output won't have
any either, but finding that out for the output is much more expensive.
Copy this tag to the output mesh to save processing time when drawing.
In my test creating 1 million instances of a 16 face mesh, this changed
the time for the draw cache loose geometry extraction from 220 ms to
131 ms.

For now, only do this when the loose edges of the inputs are already
cached (primitive nodes, for example). This avoids paying the cost of
calculation when we don't know it will be necessary.
2023-03-27 16:40:04 -04:00
63689e4756 Geometry Nodes: Tag no loose edges after curve to mesh node
It doesn't take much time to know whether all of the curves have more
than a single point, and if that's the case, we know for sure there are
no loose edges in the mesh. This can save time when creating the mesh
draw cache. The time for finding loose geometry goes from 180 ms to
104 ms for a large molecular nodes test file.
2023-03-27 16:39:33 -04:00
52eced3eef Geometry Nodes: Slightly improve curve to mesh performance
For the single-threaded part of the curve to mesh conversion, avoid
writing to two logically separate arrays in the same loop. Instead
run the calculation on two separate threads if the output is large.

Timing for `calculate_result_offsets` when processing 1 million curves:
Before: Average: 10.4 ms, Min: 9.4 ms
After: Average: 9.2 ms, Min: 7.7 ms
2023-03-27 15:53:34 -04:00
de5ec852f3 Merge branch 'blender-v3.5-release' 2023-03-27 14:52:51 -04:00
59c0e19db2 Geometry: Skip recomputing bounds after translation
Now that mesh primitive nodes calculate their bounds in constant time,
it's worth updating the bounds eagerly when translating a geometry
since doing so should be very cheap and might save a more significant
amount of time if they're needed later.

Also slightly unify the translation functions for the different types.

Pull Request: blender/blender#106159
2023-03-27 20:51:01 +02:00
05a63e3705 OBJ: improve UV values merging in the exporter
Previous code was using BKE_mesh_uv_vert_map_get_vert to somewhat
detect identical UV values on mesh vertices. But this was not
handling the case when separate mesh vertices still use the same UV
values (e.g. cube with all six faces mapped to whole image).

Replace usage of BKE_mesh_uv_vert_map_get_vert with a simple "unique UV
value" map, very similar to how OBJ normals are calculated for export.

Measurements on a somewhat extreme case: exporting "Rungholt" Minecraft
level from https://casual-effects.com/data time (Win10, Ryzen 5950X)
goes 2.9sec -> 2.2sec, and resulting file size 486MB -> 231MB. This
particular model has a lot of mesh faces mapping to the same places
in UV map.

On less extreme cases the timings are similar between old and new
code, with a tiny speedup in most tests I've tried.
2023-03-27 21:39:13 +03:00
8ad0935ed6 Fix #106108: Allow Arrow Increment on Sequence Values
Allow clicking the "up" and "down" arrows to increment/decrement by a
frame for Video Sequencer strip Frame Start, Strip Offset Start, and
Strip Offset End.

Pull Request: blender/blender#106117
2023-03-27 20:26:56 +02:00
2215ee9358 UI: Noto Emoji Font with Unicode 15.0 Updates
Updated version of our monochrome Noto Emoji (variable) font with 31
new emojis that were released as part of Unicode 15.0

Pull Request: blender/blender#106142
2023-03-27 20:05:44 +02:00
bb67d4c298 Transform: expose hardcoded 'Rotate Normals' key
"Rotate Normals" is a changeable operation like any other and does not
need to be hardcoded.

An advantage of exposing this modal is that the shortcut key now
appears in the header when rotating an edited mesh.
2023-03-27 14:38:47 -03:00
040ea1637d Cleanup: deduplicate code that changes transform mode
Avoid calling `restoreTransObjects`, `resetTransModal`,
`resetTransRestrictions` and `initSnapping` for each change.

Also bring `applyMouseInput` close to the rest of the code.
2023-03-27 14:05:59 -03:00
7af13f0ae9 Cleanup: remove unnecessary code
Since `t->values_final` was created, `t->values` is no longer changed
by the mode, so the solution in dfaf26412d is no longer needed.
2023-03-27 14:05:59 -03:00
195c2b77ae Transform: modify constants for improved readability
No functional changes.

The lack of organization in the values of the constants that indicate
the properties was prone to errors.

One error that can be noticed is that the values of
`P_ORIENT_AXIS_ORTHO` and `P_VIEW2D_EDGE_PAN` were the same.
(not really a problem though)
2023-03-27 14:05:59 -03:00
6cfc43fd76 Merge branch 'blender-v3.5-release' 2023-03-27 18:49:43 +02:00
2bbb483b5c Merge branch 'blender-v3.5-release' 2023-03-27 19:35:01 +03:00
fea567651b Fix building Blender with some versions of gcc.
Seems like quadriflow was missing a header, which somehow made the build
fails on Suse Tumbleweed (gcc 13).
2023-03-27 18:29:39 +02:00
1af3c16962 Cleanup: Use const pointers for evaluated meshes
Helps with the fix to #105912
2023-03-27 11:48:10 -04:00
efda95840d Cleanup: Remove unused variable 2023-03-27 11:42:23 -04:00
b27ffee8f3 Fix #105917: Correct compositing map range clamp tooltip
The tooltip of the map range node in the compositing section was displaying that the output value was between 0.0 and 1.0 whereas it is between To Min and To Max value so I just changed the string.

Pull Request: blender/blender#105924
2023-03-27 16:20:30 +02:00
39dfa015a0 Geometry Nodes: Add node editor option to edit "Operator" node groups
This functions as a way to avoid having the context affect which node
groups are displayed. This is necessary since there is no concept of an
active operator and most node groups could be used as an operator.

It was considered to make this a more general "No Context" option for
the node editor. That still might happen eventually, but we want to
encourage users to use the modifier context since it allows the
various inspection features to work properly.
2023-03-27 10:02:15 -04:00
0a4b5eb73e Fix: Compiling Shader Builder.
IMath is required for building with vulkan. This patch adds
dependencies to shader_builder for now.

Currently there is a difference between windows and other OS's in
which variable the library is stored. Might be because imath isn't
a direct dependecy. As this is a compilation error I did the quickest
solution and check with platform module what would be the best solution.

Pull Request: blender/blender#106180
2023-03-27 15:53:20 +02:00
ad7ca08e0a Merge remote-tracking branch 'origin/blender-v3.5-release' into main 2023-03-27 10:28:22 -03:00
7a1f2fd680 Timeline: draw cache in overlay so that it stays in sync with actually cached data
Before this, when the animation is playing and the set of cached frames
changes the timeline is out-of-date which can be confusing.

Now the cached frames are redrawn whenever the current-frame indicator is
redrawn. This fixes the issue but also causes redraws when they are not necessary.
Currently, that does not seem to be an issue,

Pull Request: blender/blender#105986
2023-03-27 11:00:42 +02:00
3b4725fb62 Fix #106094: Snap curves to surface operator does not update geometry
Snapping changes positions, but these were not tagged for update.

Pull Request: blender/blender#106104
2023-03-27 09:37:57 +02:00
3d06905ac4 Realtime Compositor: Use luminance coefficients in SMAA
This patch utilizes luminance coefficients in the SMAA edge detection
phase to match the existing implementation in the CPU compositor.
2023-03-27 09:10:51 +02:00
c42370d577 Fix: Glare has an offset on low quality settings
When using the Low or Medium settings on the Glare node, the generated
glare has an offset toward the lower left corner of the image. That's
because the shader erroneously has logic that assumes non-normalized
coordinates, so its offsets are in the pixel space of the original
image. To fix this, we just use a fixed 0.5 offset in the output pixel
space to evaluate at the center of pixels.

In the future, we might look into using a more advanced downsampling
scheme to avoid temporal instability, which is a new requirement due to
the viewport compositor.
2023-03-27 08:51:02 +02:00
bb2dc141f2 Cleanup: spelling in comments 2023-03-27 12:08:14 +11:00
99d7816d06 Cleanup: suppress clang-tidy warnings in GHOST_Types.h 2023-03-27 11:07:27 +11:00
4e51008a82 GHOST: replace multiple functions with a single capabilities flag
Adding checks for platform capabilities involved adding functions
to multiple classes and was too involved.

Replace this with a single GHOST_System::getCapabilities() function.
2023-03-27 11:01:20 +11:00
2f4a7d67b7 Realtime Compositor: Implement Anti-Aliasing node
This patch implements the Anti-Aliasing node by porting SMAA from
Workbench into a generic library that can be used by the realtime
compositor and potentially other users. SMAA was encapsulated in an
algorithm to prepare it for use by other nodes that require SMAA
support.

Pull Request: blender/blender#106114
2023-03-26 16:59:13 +02:00
8c1090aeb0 Merge branch 'blender-v3.5-release' 2023-03-25 14:20:43 -07:00
847bc5c2fd Cleanup: DRW: Utility defines for retopology overlay
Move some retopology overlay logic to defines which can be reused
elsewhere.

Pull Request: blender/blender#106129
2023-03-25 15:34:09 +01:00
9678e6e7e5 Fix: Variable size blur implicitly works with Fast Gaussian
If the variable size option of the Blur node was previously set to true
and the type of blur was later set to Fast Gaussian, variable size blur
will take effect, even though the option is not visible to the user.

This patch fixes the issue by disabling variable size blur when the blur
type is set to Fast Gaussian.
2023-03-25 11:41:22 +02:00
51bc44420b Cleanup: format 2023-03-25 11:22:36 +13:00
c685d1935a Fix #106041: fix uv packing performance on aligned quads
More improvements to the xatlas "witness" mechanism.
2023-03-25 11:20:27 +13:00
18232af3ee Transform: Improve workaround used in #40241
Prefer `invoke` over `modal` to initialize a value that doesn't need to
be computed again.

Also avoid repeated `source_operation` checks.
2023-03-24 17:06:33 -03:00
1d84216c09 Fix #105891: Faster Font Fallback Finding
An improved strategy for finding glyphs within our font fallback stack.

Pull Request: blender/blender#106011
2023-03-24 19:55:28 +01:00
9c8cb823a0 BLI: Fix compilation when importing BLI_math_rotation.hh
It worked until now because `<iostream>` was included by other headers
before the rotation ones. But this didn't work in all cases. This commit
make sure all rotation type headers include it.
2023-03-24 17:42:34 +01:00
4eb24a4da3 Cleanup: Graph Editor "Gauss" to "Gaussian" 2023-03-24 16:18:09 +01:00
c4832af274 Fix: paintface_mouse_select not calling finish()
Every time you selected a face in weight paint mode
it would give a warning.
2023-03-24 15:37:53 +01:00
7eefdad051 Merge branch 'blender-v3.5-release' 2023-03-24 15:14:52 +01:00
08466a93e3 Fix security warning generated by std::tmpnam
Effectively replicate the behavior of the function in the manner
which is used for autosave file.

There might be better a solution which is cross-platform and does
not suffer from the time of check, time of use (TOCTOU) vector of
attack. This seems to be a bigger project to figure out, so until
then silence the warning: it is fine since the directory is only
used to chdir to, so worst case an external attacker can introduce
is a test failure.
2023-03-24 14:52:43 +01:00
9266469117 Refactor: Use utility function from BLI for temp directory
Should be no functional changes as the utility is based on the
code from the where_is_temp().
2023-03-24 14:52:43 +01:00
8c38d29feb BLI: Add utility to access system-wide temporary directory
It provides path to a directory suitable for storing temporary files
which satisfies the following conditions:

- The directory exists.
- The return path has trailing directory separator.

It is based on the code used in the appdir.c to get the temporary
directory.

For the C++ people: this is similar to the temp_directory_path()
from the std::filesystem.

No functional changes expected as it is a new code which is planned
to be used on other places as a followup development.
2023-03-24 14:52:43 +01:00
18a15bafe8 Fix blender_test not re-linked on macOS after changes
The Linux worked due to the libraries provided as a dependency
via `EXTRA_LIBS "${TEST_LIBS}"` with extra whole archive.

While on Windows and macOS the whole-archive is not needed the
dependency from the library to the blender_test is still needed.

Solves the issue when modifying asset_catalog_test.cc on macOS
does not make blender_test to be relinked.

Pull Request: blender/blender#106051
2023-03-24 14:11:46 +01:00
cef82a1d39 Cleanup: Grammar: "it's" vs "its" 2023-03-24 08:34:21 -04:00
03cfa75bcc Merge branch 'blender-v3.5-release' 2023-03-24 22:42:33 +11:00
5d5027db03 Animation: Gaussian Smooth operator for Graph Editor
Add a Gaussian smoothing operator to supersede the current
smoothing operator in the graph editor.

Advantage over the current implementation:
* Supports modal operations
* Is independent of key density
* More options in the redo panel
* More predictable Impulse Response

Option in the redo panel to change

Filter Width: How far out on each side of a key the code checks
to average key values

Sigma: The shape of the bell curve, lower values make a sharper bell curve
reducing the smoothing effect.
Too High values will make the code behave like an average filter as the
curve in the -1/1 range will almost be flat.

On a technical note, the operator needs to store additional data when running in modal
to avoid allocating/deallocating data on every modal run.
For that reason the `tGraphSliderOp` struct has been extended with
`void *operator_data` and `void (*free_operator_data)(void *operator_data)`.
The former is the data and the latter is a function responsible for freeing that data.

Pull Request: blender/blender#105635
2023-03-24 12:11:20 +01:00
8069b01c28 Cleanup: Make drop target creation functions non const
These often want to store a non-const reference to its owner, i.e. the
object that created them. I don't really like removing const here, but
it makes sense to enable this use case.
2023-03-24 11:53:49 +01:00
64f3afb267 Fix UI view drag target not using correct boundaries with panels
Initial idea was to calculate the view boundaries when finishing the
`uiBlock`, after layout code and such ran. But the panel code applies an
offset later, which breaks this. The view boundaries would be off by
something like 100px.
2023-03-24 11:40:09 +01:00
2fba27e6d8 Fix #105325: crash calling asset_generate_preview() in backgound mode
`.asset_generate_preview()` internally calls `UI_icon_render_id` as a
job -- as opposed to `.preview_ensure()` [which internally also calls
`UI_icon_render_id`, but not as a job] leading to crashes in background
mode.

This might be due to the fact that OpenGL context is not set up
correctly (so there might be other ways to fix this), but there seems to
be other places/comments indicating that icon handling is only for main
thread (see e.g. 13beeb5892).
And while this does not fully explain why doing this with jobs works fine
from the UI, the patch certainly fixes the crashes in background mode for
now (by not using jobs).

Pull Request: blender/blender#106046
2023-03-24 09:17:00 +01:00
08a6361b3f Vulkan: Texture Data Conversions
This PR adds basic support for texture update, read back and clearing
for Vulkan. In Vulkan we need to convert each data type ourselves as
vulkan buffers are untyped. Therefore this change mostly is about data
conversions.

Considerations:
- Use a compute shader to do the conversions:
  - Leads to performance regression as compute pipeline can stall
    graphics pipeline
  - Lead to additional memory usage as two staging buffers are needed
    one to hold the CPU data, and one to hold the converted data.
- Do inline conversion when sending the data to Vulkan using `eGPUDataFormat`
  - Additional CPU cycles required and not easy to optimize as it the
    implementation requires many branches.
- Do inline conversion when sending the data to Vulkan (optimized for CPU)

For this solution it was chosen to implement the 3rd option as it is fast
and doesn't require additional memory what the other options do.

**Use Imath/half.h**
This patch uses `Imath/half.h` (dependency of OpenEXR) similar to
alembic. But this makes vulkan dependent of the availability of
OpenEXR. For now this isn't checked, but when we are closer to
a working Vulkan backend we have to make a decision how to cope with
this dependency.

**Missing Features**

*Framebuffer textures*
This doesn't include all possible data transformations. Some of those
transformation can only be tested after the VKFramebuffer has been
implemented. Some texture types are only available when created for a
framebuffer. These include the depth and stencil variations.

*Component format*
Is more relevant when implementing VKVertexBuffer.

*SRGB textures*
SRGB encoded textures aren't natively supported on all platforms, in
all usages and might require workarounds. This should be done in a
separate PR in a later stage when we are required to use SRGB textures.

**Test cases**
The added test cases gives an overview of the missing bits and pieces of
the patch. When the implementation/direction is accepted more test cases
can be enabled/implemented.

Some of these test cases will skip depending on the actual support of
platform the tests are running on. For example OpenGL/NVidia will skip
the next test as it doesn't support the texture format on OpenGL, although
it does support it on Vulkan.

```
[ RUN      ] GPUOpenGLTest.texture_roundtrip__GPU_DATA_2_10_10_10_REV__GPU_RGB10_A2UI
[  SKIPPED ] GPUOpenGLTest.texture_roundtrip__GPU_DATA_2_10_10_10_REV__GPU_RGB10_A2UI [ RUN      ] GPUVulkanTest.texture_roundtrip__GPU_DATA_2_10_10_10_REV__GPU_RGB10_A2UI
[       OK ] GPUVulkanTest.texture_roundtrip__GPU_DATA_2_10_10_10_REV__GPU_RGB10_A2UI
```

Pull Request: blender/blender#105762
2023-03-24 08:09:19 +01:00
d5df77199b Vulkan: Resource Submission Tracking
In Vulkan multiple commands can be in flight simultaneously.

These commands can share resources like descriptor sets or push
constants. When between commands these resources are updated
a new version of the resources should be created.

When a resource is updated it should check the submission id of the
command buffer. If this is different than last known by the resources,
the previous resources should be freed.
If the submission id is the same than previously it has to create a
new version of the resource to not intervene with other commands that
uses the resource before the update.
When the resource wasn't updated between multiple usages in the same
submission id it could reuse the previous resource.

This PR introduces a `ResourceTracker` and a `SubmissionTracker`.
A submission tracker can check if the command buffer is submitted.
In this case all resources of the resource tracker should be freed.
Unmodified resources in the same submission can be shared.

A resource tracker will keep track of all resources that are in
flight. After the resources are used (submission + execution) have
finished the resources can be cleared.

Pull Request: blender/blender#105183
2023-03-24 07:47:50 +01:00
1588f57602 Fix: Targa with Palette Shows Grayscale in Viewport.
Viewport assumes that when the number of planes of the image
buffer is less or equal to 8 it is a gray scale image. In that
case it will optimize the texture to be stored as a grayscale
image on the GPU.

When using a targa file with a palette, the bitplanes were not
extracted from the actual colors, but from the number of colors
that were present in the palette.

Image buffers don't support palettes so that doesn't make sense.
This PR uses the bitdepth of the actual colors inside the palette
to identify the number of planes to use in the image buffer.

Pull Request: blender/blender#106047
2023-03-24 07:46:33 +01:00
a016d142e8 Fix #106040: pasting long text fails in Gnome-Shell/Wayland
Workaround gnome-shell including uninitialized memory when pasting
from the clipboard. Where `read` woud

Reading from the pipe into a power-of-two buffer
works around the problem.

It's not clear why this only impacts gnome-shell - as there is no
significant down-side to changing the buffer size, apply a workaround.
2023-03-24 17:12:02 +11:00
3dcd4df70c UI: support the primary clipboard for console & 3D text selection
Only the text editor supported the primary clipboard & only for modal
selection. Now selecting text in the console & 3D text editing also
sets the primary clipboard under X11 & Wayland.

Notes:

- Pasting from the primary clipboard isn't yet exposed in the key-map
  so in practice it's only useful for pasting text outside of Blender.
- Use skip-save option when pasting from the primary selection
  so this is never used by the regular paste shortcut.
- This commit adds a primary-clipboard flag to WM_capabilities_flag() so
  creating the the copy-buffer is only performed when necessary.
2023-03-24 17:09:39 +11:00
c971adfeef Separate ColorRamp node name into Color Ramp
Node names should be properly separated for easy searching and reading
and for consistency with other (color) nodes.

This commit should only touch UI names which do not need versioning and does not break node setups or py scripts.
2023-03-24 05:00:02 +01:00
3fe7e1f03b Update RNA to User manual mappings 2023-03-23 21:58:53 -04:00
058a0187f8 Fix #106029: Crash sculpting with dynamic topology
The pbvh->mesh pointer isn't set when dyntopo is enabled.
2023-03-23 21:57:55 -04:00
f7946b486b Fix #106041: fix uv packing performance on aligned quads
AABB aligned quads would defeat the "witness" accelerator when
using the xatlas packing strategy.

This change reorders the search to allow use of the "witness" technique.
2023-03-24 12:11:00 +13:00
8a5c9f1f6e Fix #105058: fix UV ABF++ bounds check on large angles
Previous code had a faulty do-while-loop which only checked
bounds on one angle instead of all three.
2023-03-24 11:47:15 +13:00
1111ce3472 Fix rotate around zero vector in #OrientationBounds 2023-03-23 18:42:39 +01:00
b57b22388c BLI: Fix drawdata leak on Scene IDs
A call to `DRW_drawdata_free` must be present for all ids that can hold
draw data. The Scene ID was missing one and was leaking data on
EEVEE-Next.
2023-03-23 16:43:50 +01:00
fda65ad5ca GPU: Renderdoc Frame Capturing
This PR uses renderdoc for frame capturing when enabled.
It enabled an easier workflow for frame capturing.

- Capture GPU API calls from test cases
- Capture GPU API calls from background threads
- Capture GPU API calls from background rendering.

Renderdoc is an important GPU debugger used by the Eevee/
Viewport module. Previously we needed to change code in
order to record background rendering, that could on its own
lead to other side-effects.

The integration with renderdoc can be enabled using
`WITH_RENDERDOC=On` compiler option. `GPU_debug_capture_begin`
and `GPU_debug_capture_end` can be added to the section
of the code you want to debug. When running Blender inside
renderdoc this part will automatically be captured.

All GPU test cases are now guarded by these calls. In order
to capture the test cases you need to start the test cases
from renderdoc and the captured GPU API calls will appear
where each capture is a single test case.

Pull Request: blender/blender#105921
2023-03-23 16:37:52 +01:00
0efb7a202e Fix #105954: RIGIDBODY_REBUILD failure on rendering
Happens if a scene has a PointerProperty of type collection which
is set to a collection containing rigid bodies.

The error is printed by the builder of the render pipeline graph,
which contains very minimal subset of the view layer: it includes
custom properties (which gets recursed into), but not the rigid
body simulation.

This fix is mainly suppressing the error print, without changing
the apparent behavior of the graph.

Pull Request: blender/blender#106045
2023-03-23 15:51:29 +01:00
a2827af0aa Cleanup: NLA, remove FIXME and other unnecessary comment 2023-03-23 15:08:26 +01:00
831060a2c5 Cleanup: remove no-longer-relevant FIXME
"double check whether ANIMFILTER_LIST_VISIBLE is needed" above code that
doesn't actually use that flag.

No functional changes.
2023-03-23 13:02:16 +01:00
e84ae56621 Refactor: remove enum eAnimFilterFlags
Remove `enum eAnimFilterFlags` from `ED_keyframing.h`, the function
parameters that pass them around, and the code that uses them to filter
things.

Only one of the enum values was actually used, `ANIMFILTER_KEYS_LOCAL`.
It indicates whether to only consider keys on the datablock itself (when
set), or in the case of objects, also consider keys on its materials or
shapekeys (when cleared). However, this flag was *always* set, making it
possible to remove the code that handled it.

Finally there was only one function that received a `filters` parameter
that could be different across calls: it would either have value
`ANIMFILTER_KEYS_LOCAL` or `0`. However, the only flag it actually tested
for was `ANIMFILTER_KEYS_MUTED`, which was never actually set. So all of
that could be removed as well.

Just for grepping-through-history sake, these are the flags that were
removed:

- `ANIMFILTER_KEYS_LOCAL`
- `ANIMFILTER_KEYS_MUTED`
- `ANIMFILTER_KEYS_ACTIVE`
- `ANIMFILTER_KEYS_NOMAT`
- `ANIMFILTER_KEYS_NOSKEY`

Note: this is NOT about the flags defined in `ED_anim_api.h`, in `enum
eAnimFilter_Flags`. Note the different names, the one that's removed
doesn't have an `_`.

No functional changes.

Pull Request: blender/blender#106028
2023-03-23 13:00:56 +01:00
e77b666ae9 Fix normalize zero vector in light tree #OrientationBounds
was assuming such cases are already handled before this function is
called, but seems to be broken on windows and linux. Do
`safe_normalize()` so the tests pass, will check the problem afterwards.
2023-03-23 12:38:25 +01:00
e38ef6aca1 Refactor: Move static functions to the top
No functional changes.
A set of functions to get the bounds of a channel was created
for the `ANIM_OT_channels_view_selected` operator.
Theses functions will be used by other functions in this file,
so they need to move to the top.
2023-03-23 11:55:21 +01:00
791f35e2c0 Fix rotation axis not normalized in light tree #OrientationBounds 2023-03-23 11:11:54 +01:00
84e170c563 Animation: Add duration display to frame range settings
This patch adds an option to the Status Bar: `Scene Duration`

This shows the duration of the current scene in frames and timecode
`Duration: <timecode> (Frame <current frame>/<total frames>)`
The timecode follows the formatting defined in the user preferences.

Pull Request: blender/blender#104882
2023-03-23 10:18:38 +01:00
b77e6aaa0f Fix warnings in Cycles graph test output
Harmless, but is quite noisy and easy to avoid.

Pull Request: blender/blender#105985
2023-03-23 09:55:54 +01:00
e203e858ec Python: Limit BGL deprecation messages.
This PR change the number of displayed BGL deprecation messages
from 100 to 10.

Fix: 105997

Pull Request: blender/blender#106018
2023-03-23 07:53:16 +01:00
846ed20ad6 Cleanup: remove unused argument signified from used arguments in Python
Also simplify import for `_bpy._utils_previews`.
2023-03-23 15:31:14 +11:00
ebd7298594 Cleanup: avoid repeating defaults for pointer scroll under Wayland 2023-03-23 15:19:00 +11:00
80dfb885d7 License headers: add missing license identifiers 2023-03-23 15:12:09 +11:00
da0a832f74 Cleanup: remove confusingly named variable OperatorType::srna
This was assigned a variable named `func`, remove and follow the
convention used by other operators to access this from the operator-type.
2023-03-23 14:35:37 +11:00
684570ce57 Cleanup: use function style casts 2023-03-23 14:29:46 +11:00
d7de8bcf0d Cleanup: format 2023-03-23 14:28:50 +11:00
e39b358a2f Guarded allocator: print memory-in-use as a size_t, not uint
There is no reason to cast to a smaller value which could overflow.
2023-03-23 14:20:14 +11:00
eeb21fc8c3 CustomData: validate layer indices, assert assigned values are valid
Mesh.validate(..) now corrects invalid layer indices.
Add assertion to prevent invalid values being set #105860.
2023-03-23 13:55:51 +11:00
eaec2175ad Fix #105860: Out of bounds active layer index caused crashes elsewhere
Setting a negative active layer index was possible, causing a crash
when adding new layers (for example).

Clamp the active index when assigning from RNA.
2023-03-23 13:37:34 +11:00
2de2db0f79 Cleanup: BLI_array_store comments, use const variables 2023-03-23 10:52:40 +11:00
274c554f4c BLI_array_store: avoid unnecessary memcmp when detecting duplicates
Memory chunks that were in the same hashed bucket but had different keys
were comparing memory unnecessary.

In practice this didn't happen all that often in my tests so the
performance improvement isn't significant.

Follow up to 4f10800094.
2023-03-23 10:52:38 +11:00
a3241fc003 Merge branch 'blender-v3.5-release' 2023-03-22 23:22:13 +01:00
6addd195fa Fix: Unused variables mistake from previous commit 2023-03-22 17:58:06 -04:00
73d0531f50 Cleanup: Remove mesh poly macros, simplify loops
These `ME_POLY_LOOP_PREV` are redundant, since they're similar to
the `poly_corner_prev` inline functions. They were also confusing,
since they took an index into the poly and returned an index into
the entire corner range. Instead structure code to use the function
version, and simplify some loops in the process.
2023-03-22 17:48:07 -04:00
ce140c1b15 Cleanup: Remove unused polys variable 2023-03-22 17:15:30 -04:00
5c3f4195b6 Cleanup: Move poly topology lookup functions to C++ header
Standardize naming, use spans and references for input parameters,
and improve documentation. Now the functions expect the lookups to
succeed as well, they will fail and assert otherwise.

The functions are also simple enough that it likely makes sense to keep
them all inlined
2023-03-22 17:11:41 -04:00
59050f3fdd Cleanup: Make SculptSession a C++ only type
This allows adding spans, arrays, etc. directly to SculptSession, which
simplifies accessing mesh data, especially in #105938. A few files
aren't moved to C++ yes, so I had to add three C accessor functions.
2023-03-22 17:11:41 -04:00
a2d0f7049a UI: Generalize drop target API, support drop targets for UI views
Previously UI view items would support custom drop controllers (so they
could react to data being dragged over them and dropped). This is now
more generalized so the views themselves can do this as well.

Main changes:
- Support calculating a bounding box for the view, so this can be used
  for recognizing mouse hovering.
- Rename "drop controller" to "drop target", this is more clear, less
  abstract naming.
- Generalize drop controllers/targets. There is a new
  `ui::DropTargetInterface` now.
- Add support for drop targets in the `ui::AbstractView` base class, so
  custom views can use this.

Pull Request: blender/blender#105963
2023-03-22 18:45:35 +01:00
15c673175d Merge branch 'blender-v3.5-release' 2023-03-22 18:20:40 +01:00
b0045cc797 Fix #106002: crash when passing field into Switch node when it doesn't support it
Pull Request: blender/blender#106006
2023-03-22 17:54:27 +01:00
16b93486ca Fix Cycles CUDA compiler warnings with if constexpr 2023-03-22 15:57:06 +01:00
410ef5342e Fix Cycles build warning on Windows with unused argument 2023-03-22 15:57:06 +01:00
807e41e415 Merge branch 'blender-v3.5-release' 2023-03-22 15:54:41 +01:00
35b69c578c Merge branch 'blender-v3.5-release' 2023-03-23 01:12:18 +11:00
a36841af13 Merge branch 'blender-v3.5-release' into main 2023-03-22 14:21:28 +01:00
40bd35c9c4 BLI: Add dirty and cached checks to shared cache
While these aren't needed that often, it can be helpful to avoid
using a cache if it isn't necessary and it doesn't already exist.
2023-03-22 08:50:27 -04:00
95a4049633 Cleanup: Unused private fields
Pull Request: blender/blender#105988
2023-03-22 12:44:11 +01:00
7c952d6d15 Cleanup: Avoid unused includes in EnumerableThreadSpecific header 2023-03-22 07:43:26 -04:00
ad96939a66 Fix warning in points to volume node
Strict compiler was generating possible-uninitialized warning.

Added an explicit initialization and asserts to solve the noisy
output and catch possible errors early on.

Pull Request: blender/blender#105990
2023-03-22 12:35:19 +01:00
69ba34fa21 Merge branch 'blender-v3.5-release' 2023-03-22 10:55:46 +01:00
e4300bbf2d Cleanup: quiet warnings by using system-includes for ./extern/
extern/json & extern/fmtlib reported warnings with GCC 12.2.1.
As these libraries aren't maintained as part of Blender, treat them as
system-includes.
2023-03-22 14:18:14 +11:00
3afe88b6c7 Cleanup: cmake indentation 2023-03-22 14:14:15 +11:00
ca08de5de4 PyAPI: raise an exception when removing an AOV which is not found
This is in keeping with how other remove functions behave.
2023-03-22 14:08:09 +11:00
Alexander Revkov
a1f52a02a8 Mesh: Set bounds eagerly for spherical and cylindrical primitive nodes
Eager bounds calculation for cylindrical and spherical primitive nodes,
implemented in constant time rather than as a loop over all positions.
Takes into account the segments count of the circle from which they
are constructed. Solution of the task #105551.

Pull Request: blender/blender#105743
2023-03-21 22:38:40 -04:00
d3bab78d05 Merge branch 'blender-v3.5-release' 2023-03-22 12:25:26 +11:00
2ba1556e69 Cleanup: spelling in comments, use doxygen syntax 2023-03-22 12:22:55 +11:00
99ecd6a900 Cleanup: Skip copying data between C++ and C
No functional changes.
2023-03-22 14:11:54 +13:00
075baf895e Fix building in debug mode 2023-03-22 12:04:38 +11:00
d2b502f213 Cleanup: Following naming convention and more const
Adding "_" suffix on private member variables.
Add const qualifier where possible.

No functional changes.
2023-03-22 13:06:27 +13:00
64ef514ec9 Cleanup: format 2023-03-22 12:48:04 +13:00
dd7e1a3574 Fix: Hide corner vert and edge attributes in UI
These are meant to be like other low-level attributes--
hidden from the UI, at least by default. This was just
missing from the initial commit that added these
because seeing them was useful for debugging.
2023-03-21 18:30:51 -04:00
45379d9b59 Fix (unreported): Snap not enabled if Ctrl is pressed before operation
Regression introduced by 88e2542398.

The transform operator has a special way of detecting when the snap
modifier is pressed before the modal.
2023-03-21 19:17:25 -03:00
dab0ab673e BLI: Add a default constructor to OffsetIndices
Though it's not common, sometimes it is necessary to declare this class
without immediately assigning a value, and `Span` already supports this.
2023-03-21 16:53:57 -04:00
45a05d351d Python API: Add deprecation warning to MeshUVLoop
Add ui_text to the MeshUVLoop python struct definition containing a
deprecation warning.

Pull Request: blender/blender#105970
2023-03-21 21:05:24 +01:00
5bb4d733a6 Fix (unreported) potential invalid memory access in BKE_main_collection_sync_remap.
After remapping there is no guarantee that collections' parent pointers
are still valid, so using these to free the object cache of all the
collections' ancestors is potentially accessing invalid memory.

Further more, it is noticiably inefficient, as a same collection may be
processed many times.

So instead, introduce (and use in resync case) a new
`BKE_main_collections_object_cache_free`, which iterates over all
collections of given Main and only free their own cache.
2023-03-21 18:38:04 +01:00
e858be84fa Cleanup: move space_action folder to c++
I'm doing this because I want to work on the timeline integration for
simulation nodes caching. Also see #103343 for more info regarding moving
files to C++.

Pull Request: blender/blender#105962
2023-03-21 17:49:23 +01:00
ed7c90c13b Cycles: fix build failure due to lack of std:: specifier 2023-03-21 18:15:45 +02:00
711a830ede Fix #105949: Uninitialized array used when counting material triangles
Mistake in 5256b2ca62. Return the array by value so the
caller doesn't have to know about the need for zero initialization.
2023-03-21 12:04:51 -04:00
1d5cf734a8 Merge branch 'blender-v3.5-release' 2023-03-21 16:19:55 +01:00
45c1deac4f Bone relation lines: optionally draw between bone heads
Add control over how bone relation lines are drawn. Instead of always
drawing from the head of the child to the tail of the parent, give users
a choice for the parent side of the line. This can now be toggled
between the head and the tail of the bone, where the tail is Blender's
original behaviour and is retained as default value.

Pull request: blender/blender#105427
2023-03-21 15:16:13 +01:00
04d128f545 Fix: Realtime compositor outputs wrong EXR passes
The Image node in the realtime compositor will output wrong passes if multiple passes are used at the same time. This is because images can only store a single layer, pass, and view at a time. Furthermore, they rely on operators and RNA callbacks to invalidate the cache when a different layer, pass, or view is requested. In effect, when the image node requests multiple passes at the same time without any kind of cache invalidation, wrong passes are output.

While a proper fix is to allow caching of multiple layers, passes, and views at the same time. This patch implements a temporary workaround by explicitly ensuring an up-to-date cache through a call to BKE_image_ensure_gpu_texture() when before requesting a GPU texture.

Pull Request: blender/blender#105547
2023-03-21 14:57:12 +01:00
1d43beab84 I18n: Extract asset catalog and asset names and descriptions
The asset catalogs are used in Geometry nodes Add Node menu to
generate the hierarchy of submenus.

The assets themselves are used to generate the operator names in the
same menu, and their descriptions.

This commits enables extraction of this data by parsing the catalog
sidecar file, as well as opening each asset blend file to search for
assets.
2023-03-21 12:41:10 +01:00
2ce23b069e I18n: Translate Node Add menus generated from asset files
The Node Add menu can have special submenus containing node assets.
These submenus are generated by parsing the asset blend files from
release/datafiles/assets, and the interface drawing is specific to
these menus.

This commit enables the translation of these dynamic menus, including
their names and the description of the operators.
2023-03-21 12:41:10 +01:00
c73ae00cfc I18n: translate painting error message
An error message in paint mode is built out of several possible
components, depending on what is missing in the context for the
painting operation to work.

The main message was properly extracted, but not its individual
possible components.

Although such composite messages should generally not be used, in this
case I'm not sure it's worth it writing 15 different messages with all
possible combinations.
2023-03-21 11:40:21 +01:00
17c8e0d309 Refactor Light Tree to improve readability and efficiency
* Group bounding box, bounding cone and energy to a struct called `LightTreePrimitivesMeasure`
* Add utility functions to add primitives to nodes or buckets
* Precompute the split bucket cost to improve efficiency (about 1.4x expected)

Pull Request: blender/blender#105931
2023-03-21 11:06:41 +01:00
79a6fd57bc UV: Reduce round-off error during UV Packing in Geometry Nodes
Migrate #mul_v2_m2_add_v2v2 to `blender::geometry::`
2023-03-21 21:56:49 +13:00
31147c90c4 code_clean: restrict 'use_function_style_cast' edits to C++
Allows running multiple edits at once on C & C++ files without
C++ edits being attempted on C source.
2023-03-21 19:50:46 +11:00
db762d5508 Cleanup: various C/C++ code cleanups, use utility macros 2023-03-21 19:47:21 +11:00
e0d05da826 UV: Add option to Pack UVs using the xatlas strategy
Loosely based on the "xatlas" algorithm.
See https://github.com/jpcy/xatlas

Adds `shape_method` with ED_UVPACK_SHAPE_AABB, ED_UVPACK_SHAPE_CONVEX
and ED_UVPACK_SHAPE_CONCAVE

Ref #68889, #105680

Pull Request: blender/blender#105821
2023-03-21 09:15:06 +01:00
16275ca1de Cleanup: Remove unused const. 2023-03-21 08:43:41 +01:00
242dfbcd75 Code-style formatting. 2023-03-21 08:27:48 +01:00
8bfe34b285 Fullframe compositor: support backdrop offset for viewer node
Translating an image in fullframe compositor now also translates
the backdrop image for the viewer node.

Attached gif shows the behavior. Notice how gizmo moves with correct
values with the image but the frame stays to indicate what will get
rendered.

Note: This patch is a continuation of [D12750]
(https://archive.blender.org/developer/D12750). In a previous patch,
display offset on screen was not computed correctly. This has now
been fixed.

Pull Request: blender/blender#105677
2023-03-21 08:27:05 +01:00
439beb20c3 UI: Clicking camera icon while rendering should open render window
During rendering, clicking on the Camera icon of the jobs panel
should focus or open a Render Window.

Pull Request: blender/blender#105765
2023-03-21 07:53:31 +01:00
f54af343f1 Merge branch 'blender-v3.5-release' 2023-03-21 12:57:20 +11:00
5404841421 Merge branch 'blender-v3.5-release' 2023-03-21 11:53:44 +11:00
0323f8d1d9 Fix #105926: Sharp edge attribute removed when all edges are sharp
When converting a BMesh to a Mesh, the attribute would be removed if
all values were true, since BMesh stores the data in a reversed flag.
The check worked the same way for the sharp face attribute already.
2023-03-20 20:30:13 -04:00
88e2542398 Transform: reduce overhead when checking if snapping is active
No functional changes.

The code previously contained redundant and complex checks for
different snapping scenarios, which involved combinations of multiple
snapping flags and modes on each mouse interaction. This resulted in
unnecessary code duplication and overhead.

To address this issue, the code has been simplified and micro-optimized
by moving these checks to the initialization of the snapping parameters.

This results in a more streamlined and efficient codebase.
2023-03-20 20:13:28 -03:00
4de247eb94 Cleanup: deduplicate snapping parameters
The members `align`, `project`, `peel` and `use_backface_culling`
already have a corresponding value in `TransSnap::flag`.

Keeping values that represent the same thing is error prone.
2023-03-20 20:13:28 -03:00
5256b2ca62 Cleanup: Reorder mesh draw cache functions to avoid prototypes
This bit of code is easier to read if you can scan it vertically with
the typical "entry point at the bottom, lower level code on top" order.
2023-03-20 23:16:50 +01:00
85066f3748 Cleanup: Rename variables in BMesh loose element extraction
Use simpler wording that's more readable and avoid confusing
"ids" with the simple indices from these loops.
2023-03-20 23:16:50 +01:00
aa1fc6102f Cleanup: Avoid contractions for loose geometry variables
Saving five characters for these names doesn't have much benefit,
and using the full word avoids readers wondering what "l" is supposed
to mean.
2023-03-20 23:16:50 +01:00
638709b0ed Cleanup: Use Array and Span for mesh draw buffer cache data
Use C++ types for more automatic memory management, simpler code,
and easier potential performance improvements. Also document each
item in the cache and access a named struct by pointer for the "poly
sorted" instead of using an identical unnamed struct.
2023-03-20 23:16:50 +01:00
21e3b4483f Cleanup: Pass UV offset in UV edit code
As part of #105779, the active status of UV maps won't be stored in
CustomData anymore, so it has to be retrieved from a higher level.
The best way to do that is to retrieve it once and pass around the BMesh
custom data offset as a "key" to the data. This should also decrease
function call overhead in this code (not that it was a bottleneck).

Pull Request: blender/blender#105904
2023-03-20 21:09:53 +01:00
309553fc07 BLI: Simplify and extend OffsetIndices class
Add `index_range()` and `is_empty()` functions, rename `ranges_num()`
to `size()` (clarifying the final extra integer as an implementation
detail). Also remove the `size(index)` function which gave almost the
same assembly as `[index].size()` (https://godbolt.org/z/PYzqYs3Kr).
2023-03-20 13:34:14 -04:00
23c5e06932 Cycles: build Light Tree in parallel
Push a task to `TaskPool` when more than `MIN_PRIMS_PER_THREAD` primitives are to be processed. The nodes are rearranged in a depth-first order when copied to the device.
Tested with the scene in #105550 on an Apple M1 Ultra (20 cores), about 11x speedup.

Pull Request: blender/blender#105862
2023-03-20 18:02:11 +01:00
006bc603f8 I18n: translate error messages generated with WM_report() and family
Many error messages were translated when using `BKE_report()` or
`BKE_reportf()`, directly, but others were missing because they used
`WM_report()` or `WM_reportf()`.

This commit adds these two functions to the list of functions used in
the message extraction regex.

In addition, `WM_reportf()` is modified so that the format string is
translated before formatting actually occurs.
2023-03-20 17:17:56 +01:00
3af5d2f0a8 Merge branch 'blender-v3.5-release' 2023-03-20 17:08:15 +01:00
16fbadde36 Mesh: Replace MLoop struct with generic attributes
Implements #102359.

Split the `MLoop` struct into two separate integer arrays called
`corner_verts` and `corner_edges`, referring to the vertex each corner
is attached to and the next edge around the face at each corner. These
arrays can be sliced to give access to the edges or vertices in a face.
Then they are often referred to as "poly_verts" or "poly_edges".

The main benefits are halving the necessary memory bandwidth when only
one array is used and simplifications from using regular integer indices
instead of a special-purpose struct.

The commit also starts a renaming from "loop" to "corner" in mesh code.

Like the other mesh struct of array refactors, forward compatibility is
kept by writing files with the older format. This will be done until 4.0
to ease the transition process.

Looking at a small portion of the patch should give a good impression
for the rest of the changes. I tried to make the changes as small as
possible so it's easy to tell the correctness from the diff. Though I
found Blender developers have been very inventive over the last decade
when finding different ways to loop over the corners in a face.

For performance, nearly every piece of code that deals with `Mesh` is
slightly impacted. Any algorithm that is memory bottle-necked should
see an improvement. For example, here is a comparison of interpolating
a vertex float attribute to face corners (Ryzen 3700x):

**Before** (Average: 3.7 ms, Min: 3.4 ms)
```
threading::parallel_for(loops.index_range(), 4096, [&](IndexRange range) {
  for (const int64_t i : range) {
    dst[i] = src[loops[i].v];
  }
});
```

**After** (Average: 2.9 ms, Min: 2.6 ms)
```
array_utils::gather(src, corner_verts, dst);
```

That's an improvement of 28% to the average timings, and it's also a
simplification, since an index-based routine can be used instead.
For more examples using the new arrays, see the design task.

Pull Request: blender/blender#104424
2023-03-20 15:55:13 +01:00
a2600e0a76 Merge branch 'blender-v3.5-release' 2023-03-20 15:30:14 +01:00
4bb9006089 UI: align tab labels towards panels
Align the labels on the tabs so that when you read them, your head is tilted
towards the content, instead of away.

When tabs are drawn to the right of panels in the sidebar, the labels are read
from bottom to top, which may suggest that this tab does not belong to the area.

This change does it like this:
* Sidebar on the right: the text is read from top to bottom.
* Sidebar on the left: the text keeps reading from bottom to top.

Pull Request: blender/blender#105835
2023-03-20 15:20:39 +01:00
5316cdb26d Merge branch 'blender-v3.5-release' 2023-03-20 14:48:17 +01:00
7484a1504d Cleanup: rename function
The name #ensure_valid_reflection seems to indicate that the resulted
reflection must be valid, whereas in the reality it only ensure validity
for specular reflections. The new name matches the behavior better.
2023-03-20 14:35:02 +01:00
dfe7b839bc Cycles: only apply function #ensure_valid_reflection to glossy materials
This function checks if the shading normal would result in an invalid reflection into the lower hemisphere; if it is the case, the function raises the shading normal just enough so that the specular reflection lies above the surface. This is a trick to prevent dark regions at grazing angles caused by normal/bump maps. However, the specular direction is not a good representation for a diffuse material, applying this function sometimes brightens the result too much and causes unexpected results. This patch applies the function to only glossy materials instead.

Pull Request: #105776
2023-03-20 14:35:02 +01:00
70f3382c45 Refactor: simplify computations in function #ensure_valid_reflection
Actually both potential roots lie in the interval [0, 1], so the
function ended up checking both roots all the time.
The new implementation explains why only one of the roots is valid; it
saves two square roots and a bunch of other computations.
2023-03-20 14:35:02 +01:00
4784ee852c Merge branch 'blender-v3.5-release' 2023-03-20 14:09:52 +01:00
8f6415418e Cleanup: Refactor UI tree & grid view building API
The Cycles light linking branch is using the tree view UI but it seemed
to use the "wrong" layout. It wasn't clear that the layout has to be
reactivated before building the view.

Make it harder to use the API wrong now by requiring the layout as
argument, so the building can ensure it's active.
2023-03-20 11:35:45 +01:00
5584c1cb53 IO: add PLY export test coverage for loose edges and loose vertices
The input file contains a partial cube, with two regular faces, two
loose edges and one loose vertex. This checks whether the loose vertex
for example is included into the output when exporting with UVs
(loose verts do not have UVs in Blender, so they should get (0,0) UV
in PLY).
2023-03-20 09:31:07 +02:00
4c70d9e11a Merge branch 'blender-v3.5-release' 2023-03-19 23:25:38 -04:00
7cda559d7c Cleanup: format, spelling, struct member comment 2023-03-20 11:12:34 +11:00
bb593e5416 BLI: Math: Fix function description
No functional change.
2023-03-19 21:12:15 +01:00
0c2299e6b1 DRW: View: Allow the possibility to disable the visibility test
This is useful when we know that everything will be inside the view
frustum.
2023-03-19 21:12:15 +01:00
65b2aed14b EEVEE-Next: Spherical Harmonics Library
Implement spherical harmonics to be used for irradiance caching.
2023-03-19 21:12:15 +01:00
21b6f6f1f6 Cleanup: Use spans for mesh data in texture margin code
Avoid retrieving data from a DerivedMesh or a Mesh in the
same function.
2023-03-19 11:42:49 -04:00
63a44e29ac Mesh: Parallelize extraction of UV maps
Since UVs are now stored as 2D vectors in meshes, they can be copied
directly to the vertex buffers. Somewhat surprisingly, multithreading
the copying into the vertex buffer provides a good speedup-- on a CPU
with many cores at least.

Here is a test uploading two UV maps created in geometry
nodes with a 1 million quad mesh, with a Ryzen 7950x:
|         | Before  | After  | Speedup |
| ------- | ------- | ------ | ------- |
| Average | 24.3 ms | 7.5 ms | 3.2x    |
| Min     | 17.6 ms | 7.0 ms | 2.5x    |

I added the copying utilities to the array utils header, since the
need for them has come up in a few different places already, and the
existing function with a selection argument didn't make sense here.

Pull Request: blender/blender#105793
2023-03-19 16:18:19 +01:00
f149d7625d Cleanup: Use more specific variable names for color attributes
The "active_index" and "default_index" could easily apply to different
attribute subsets, better to make the naming specific here.
2023-03-19 10:31:14 -04:00
35bb942ae3 Cleanup: Use better check for UV map attribute
Also check the domain in addition to the type, to avoid processing
any associated layers unnecessarily. And remove an unnecessary
comment too.
2023-03-19 10:10:04 -04:00
37889015f3 Cleanup: Use C++ attribute API
When deleting UV UI attributes it isn't necessary to use the higher
level C attribute API, since we already know we aren't working with
the edit mesh here.
2023-03-19 10:07:54 -04:00
fbdeb0434c Merge branch 'blender-v3.5-release' 2023-03-19 10:03:11 -04:00
4b30b5c57f Nodes: SDF Volume nodes milestone 1
Geometry Nodes: SDF Volume nodes milestone 1

Adds initial support for SDF volume creation and manipulation.
`SDF volume` is Blender's name of an OpenVDB grid of type Level Set.
See the discussion about naming in #91668.

The new nodes are:
- Mesh to SDF Volume: Converts a mesh to an SDF Volume
- Points to SDF Volume: Converts points to an SDF Volume
- Mean Filter SDF Volume: Applies a Mean Filter to an SDF
- Offset SDF Volume: Applies an offset to an SDF
- SDF Volume Sphere: Creates an SDF Volume in the shape of a sphere

For now an experimental option `New Volume Nodes` needs to be
enabled in Blender preferences for the nodes to be visible.

See the current work plan for Volume Nodes in #103248.

Pull Request: blender/blender#105090
2023-03-19 11:21:08 +01:00
e13ae37e8b Fix #105885: toolbar items overlapping, after recent refactor
The RNA property was not mapped to the right new DNA member.
2023-03-19 10:07:39 +01:00
d8a439ebaf Merge branch 'blender-v3.5-release' 2023-03-19 07:59:54 +01:00
e2caac4c73 Merge branch 'blender-v3.5-release' 2023-03-19 07:04:17 +01:00
45c4a0b1ef Merge branch 'blender-v3.5-release' 2023-03-18 19:57:58 -04:00
3048d9e99c Mesh: Remove unnecessary mesh position copying
Change code fragments where `BKE_mesh_vert_coords_alloc` had been used
to temporarily copy vertex coordinates of a mesh (see #103789) and
providd pointers to the mesh's stored vertex positions instead.
This reduces memory usage and improves performance.

Pull Request: blender/blender#105756
2023-03-19 00:26:28 +01:00
335688dd42 EEVEE-Next: Deferred Pipeline
Implement GBuffer prepass and deferred lighting (lights only).

This decouple lighting from the material shaders making them lighter,
less expensive and faster to compile.

Trying to keep a nice data flow so we could potentially use the
subpass programable blending feature on tiled GPU arch.

Not everything is covered yet and #105880 is making the GBuffer layout
a bit awkward and not easily extendable.

Pull Request: blender/blender#105868
2023-03-18 20:54:20 +01:00
b93a66d603 IO: refactor, replace std::vector with Vector in OBJ and PLY code 2023-03-18 08:51:43 +02:00
1b2f58adff VSE: Update text of text strip after each typed character
Use `PROP_TEXTEDIT_UPDATE`
2023-03-18 05:33:38 +01:00
bb1c503bee Fix 105824: Retiming remove gizmo size is fixed
Size was hardcoded to 14 pixels. Now it also conforms to strip size.
Minimum size is 40% of strip size, Otherwise it stays at 14px.
2023-03-18 05:33:35 +01:00
cf8640e7b5 Fix: Broken mesh to curve conversion
A recent refactor replaced the use of the `totpoly`
local variable where it shouldn't have.

Pull Request: blender/blender#105838
2023-03-18 03:49:38 +01:00
740c9204cc Cleanup: Simplify mesh to legacy curve logic
Changed `edge->v2` to `endVert` to make it consistent with surrounding code.
Removed the unused `totedges` variable.
Currently `totpoly` is also unused, but is fixed in a separate PR.

Pull Request: blender/blender#105870
2023-03-18 03:49:25 +01:00
3eff28a158 Merge branch 'blender-v3.5-release' 2023-03-17 17:08:22 -04:00
74de2e23a5 Merge branch 'blender-v3.5-release' 2023-03-17 21:53:51 +01:00
ec08d03198 Merge branch 'blender-v3.5-release' 2023-03-17 20:40:26 +01:00
728694b4e4 Cleanup: use array instead of vector for LightTreeBucket with fixed size 2023-03-17 19:57:04 +01:00
a1a11b08d8 Cleanup: added a bunch of const qualifiers in Light Tree 2023-03-17 19:57:04 +01:00
74070a1c2c Merge branch 'blender-v3.5-release' 2023-03-17 18:12:20 +01:00
f4fd348d22 Fix: FCurve Bounds - return when can't be found
Originally this was added by #105179
This code was reverted by accident in #105177
2023-03-17 17:16:11 +01:00
48496f1473 PLY: optimize new exporter (2x faster)
1) There was a logic error in FileBuffer where when it was trying to
   add a new 64kb chunk to hold output, it was adding an empty chunk,
   but making sure we have space capacity to hold 64 thousand chunks.
   So that was a bit of pointless juggling to get nothing good.
2) In UV_vertex_key, instead of trying to combine three members into
   a hash value, badly, by doing some ad-hoc shifts and xors, use
   get_default_hash_3 instead, which combines them way more properly.
   Also avoid copying the whole hash map object.

On my windows box (Ryzen 5950X, VS2022), exporting Stanford Lucy 3D
scan:
- Binary: 13.4 -> 5.4 sec
- ASCII: 29.3 -> 14.6 sec

So basically 2x faster for two tiny changes.
2023-03-17 17:01:09 +02:00
d9273d8578 Fix Cycles growing BoundBox with empty BoundBox modifies the original BoundBox 2023-03-17 15:28:27 +01:00
f440b15630 Merge branch 'blender-v3.5-release' 2023-03-17 13:59:29 +01:00
8ded95c175 Vulkan: Clearing Storage Buffers
This PR adds support for `GPU_storagebuf_clear` and
`GPU_storagebuf_clear_zero` to the Vulkan backend. It also adds test
cases for all backends.

Pull Request: blender/blender#105487
2023-03-17 13:48:39 +01:00
0cb02ff3ba Merge branch 'blender-v3.5-release' 2023-03-17 12:46:16 +01:00
6c6edaf513 PLY: Improve robustness and performance of the new PLY importer
Fixes:

* General:
- Was assuming that positions/normals/UVs are always `float`, and colors
  are always `uchar`. But e.g. positions are sometimes doubles, or colors
  are floats etc.
- Was assuming that `face` element is always just a single vertex indices
  property. But some files have more arbitrary properties per-face.

* ASCII importer:
- Was assuming that file elements are always in this order: `vertex`,
  `face`, `edge`. That is not necessarily the case.
- Was only handling space character as separator, but not other
  whitespace e.g. tab.
- Was not checking for partially present properties (e.g. if just `nx` is
  present but not `ny` and `nz`, it was still assuming whole normal is there).

* Binary importer:
- Was assuming that faces are always 1-byte list size and 4-byte indices.
- Was assuming that edge vertex indices are always 4-byte.

For the assumptions above, it often lead to either crashes, garbage data
or not detecting presence of a vertex component. E.g. binary importer was
just always reading 4 bytes for vertex indices, but if a file has 2 byte
indices then that would read too much, and then later on would start reading
garbage. ASCII importer was doing out-of-bounds reads into properties array
if some assumptions were not correct, etc.

Improvements:
- Some ply files use different property type names, e.g. `float32`,
  `uint16` or `int8` instead of `float`, `ushort`, `char`; now that is
  supported too.
- Handles `tristrips` element. Some files out there do not have `face` but
  rather has a triangle strip, internally using -1 indices for strip restarts.

Performance:

While doing the above fixes/improvements, in order to fix some things it was
more convenient to also make them more performant :) Now it avoids splitting
each ASCII line into a vector of `std::string` objects, for example, or
reading a binary file in tiny chunks.

Generally this is now 2x-4x faster than the previous state of C++ importer.

The code has changed quite a bit to achieve both the fixes and performance:
- Instead of separate files for ASCII and Binary reading, they are now both
  in `ply_import_data.cc/hh`. Reason is that all of the "find correct property
  indices" logic is the same between both (and that bit was mostly missing
  previously).
- Instead of using raw C++ `fstream` object and reading line by line (which
  in turn reads one byte at a time) or reading field by field, now there's a
  `ply_import_buffer.cc/hh` that reads in 64KB chunks and does any needed
  logic for the ASCII/header part to properly split into lines. This avoids
  all the mutex locking, locale lookups, C++ abstraction layers overhead
  that C++ iostreams have when doing a ton of tiny reads.

Tests:

Extended test coverage with new files (comitted in svn revision 63274).
11 new "situations", in both ascii and binary forms. Additionally, now also
has a Big Endian binary file to test; BE codepath was completely untested
before.

Overall reworked the tests so that they don't do the whole "load dummy
blend file, import ply file on top, go over meshes, check them", but rather
do a simpler "run ply importer logic that fills in PlyData structure, check
that". The followup conversion to blender meshes is fairly trivial and the
tests were not really covering that in a useful way.

Pull Request: blender/blender#105842
2023-03-17 12:20:41 +01:00
ac2f67dda0 Merge branch 'blender-v3.5-release' 2023-03-17 12:13:10 +01:00
6e2ea0b997 Merge branch 'blender-v3.5-release' 2023-03-17 12:06:00 +01:00
b4e0e696fc Merge branch 'blender-v3.5-release' 2023-03-17 11:58:19 +01:00
8bf4aa2fdc Merge branch 'blender-v3.5-release' 2023-03-17 11:17:40 +01:00
0963ee559e Cycles: adjust resolution divider to achieve a more usable viewport
This changes the maximum viewport resolution divider for Cycles to
help users get a more responsive viewport.

This is done by changing the maximum viewport resolution divider
to a divider that aims to have the largest axis of the viewport
roughly equal to 128 pixels.

Depending on the circumstances, this change can result in a few
noticeable differences:
 - Users with slow hardware and a large pixel_size, or slow hardware
 and a low resolution screen, may observe a higher resolution viewport
 during navigation, making the scene more readable. However this comes
 at the cost of reduced responsiveness.

 - Users with slow hardware and a low pixel_size and high
 resolution screen may observe a lower resolution viewport during
 navigation, providing a more responsive viewport during navigation.

Along with that, how Cycles iterates through resolution dividers
is changed to promote quick transitions between resolution dividers.
Meaning users don't need to wait through as many iterations to get
from a low navigation resolution to a 1:1 viewport resolution.

Pull Request: blender/blender#105581
2023-03-17 11:15:58 +01:00
509a12eaac Treat -Wunguarded-availability-new as an error
This makes it so access to macOS SDK from newer versions than our
deployment target can be detected on a buildbot via failed build.

Pull Request: blender/blender#105595
2023-03-17 10:45:03 +01:00
da590428c3 Merge branch 'blender-v3.5-release' 2023-03-17 10:08:42 +01:00
e853a67efc Cleanup: use BKE_blendfile_* for functions defined in BKE_blendfile.h 2023-03-17 16:45:42 +11:00
3b8a050fc1 Cleanup: use function-style casts, ELEM & STREQ macros 2023-03-17 16:45:42 +11:00
976b17e415 Cleanup: remove redundant casts 2023-03-17 16:45:42 +11:00
b6b0bc4531 Cleanup: spelling in comments 2023-03-17 16:45:42 +11:00
01a29ebaeb Merge branch 'blender-v3.5-release' 2023-03-17 14:52:04 +11:00
f78f05c749 Refactor: U.dpi_fac -> U.scale_factor
A renaming of UI scale factors from names that imply a relationship to
monitor DPI to names that imply that they simply change "scale"

Pull Request: blender/blender#105750
2023-03-17 04:19:05 +01:00
e4eb9e04e0 Fix #105823: Crash While deleting retiming handles
Handle index operator property was exposed to user, which was
unintended. The property is validated only in invoke function.
2023-03-17 03:26:37 +01:00
025beb2cda Merge branch 'blender-v3.5-release' into main 2023-03-16 17:52:08 -06:00
aa2d8647c1 Merge branch 'blender-v3.5-release' 2023-03-16 23:19:59 +01:00
9a8bfe8dd3 Cleanup: Make format
Simply adds a single blank line.
2023-03-16 14:23:40 -07:00
339e9deb72 Merge branch 'blender-v3.5-release' 2023-03-16 21:45:16 +01:00
34f3893831 BLI: support recursive usage of Vector
This makes it possible to use `Vector` recursively if the inline buffer
has 0 size. Any other inline buffer size does not work, because then
the type would be embedded in itself which does not make sense.

Pull Request: blender/blender#105832
2023-03-16 17:52:03 +01:00
ee213f3c4d Merge branch 'blender-v3.5-release' 2023-03-16 15:58:34 +01:00
cb20f2cbf9 Fix build error after previous merge
Function was moved and renamed in 48814c25fd.
2023-03-16 15:27:27 +01:00
7317da80fe Merge branch 'blender-v3.5-release' (won't build, see followup) 2023-03-16 15:26:23 +01:00
d1b8a827a6 Refactor: Avoid unsafe strcpy in library path utility function
Make sure the expected max-length for the string is respected.

Suggested by Bastien in #105825.
2023-03-16 15:07:27 +01:00
b80f6c4017 Cleanup: Improve comment on library path utility function
Suggested by Bastien in #105825.
2023-03-16 15:07:27 +01:00
48814c25fd Cleanup: Move blend file path utilities out of blenloader module
These are not really about reading or writing .blend files, they are
general utilities for file-names/paths. Having to link to the
blendloader library just for these utilities is annoying.
Moved them to `BKE_blendfile.h` now, in agreement with Bastien.

Pull Request: #105825
2023-03-16 15:07:27 +01:00
8bb411ad1a EEVEE Next: IrradianceCache surfels debug display
Add a surfels debug pass to aid with the GI implementation development.

Pull Request: blender/blender#105802
2023-03-16 14:14:33 +01:00
bb0ee9fdb4 Fix tiny file browser highlight offset on retina screens
While this was just a single pixel off, it was a bit notable since the
highlight wasn't centered correctly. Now retina and non-retina screens match
visually.
2023-03-16 12:48:56 +01:00
5e0cc9d277 Cleanup: Silence Unused parameter warnings.
- blender::gpu::GLContext
- blender::gpu::VKContext
2023-03-16 09:44:09 +01:00
a25cc51db9 Cleanup: Spelling in previous commit. 2023-03-16 08:55:45 +01:00
3d9d67594c GPU: Add GPU frame capture support.
Adds two modes of GPU frame capture support for
enhanced debugging. GPU frame capture begin/end
allow instantaneous frame capture of all GPU commands
within the capture boundary.

GPU frame capture scopes allow several user-defined capture
regions which can wrap key parts of code. These scopes are
exposed to connected GPU tools allowing the user to manually
trigger a capture of a known scope at the desired time.

This is currently integrated with the Metal backend for
support with Xcode.

Related to #105591

Pull Request: blender/blender#105717
2023-03-16 08:54:05 +01:00
397f6250a5 Merge branch 'blender-v3.5-release' 2023-03-16 08:28:21 +01:00
ebad816057 Merge branch 'blender-v3.5-release' 2023-03-16 17:20:28 +11:00
b6caf5980e Merge branch 'blender-v3.5-release' 2023-03-16 04:47:15 +01:00
bad85fe8c7 Cleanup: Avoid keeping mesh normals references after dirty tag
Without assumptions of a mesh's direct ownership of its normals,
this was error prone, since normals could potentially be reallocated
when they are tagged dirty or retrieved with write access.
2023-03-15 21:39:50 -04:00
896360de1f Cleanup: remove GCC warning pragma
I'm no longer able to generate a warning with GCC 12.2.1.
2023-03-16 11:46:56 +11:00
42380ea996 Cleanup: use static declaration, quiet undeclared warning 2023-03-16 11:24:14 +11:00
64304b4e27 Fix invalid enum passed to BKE_id_attribute_search 2023-03-16 11:24:11 +11:00
f2a05c3e4e Cleanup: Remove unused pbvh function declarations 2023-03-15 20:13:34 -04:00
0fe006eec5 Merge branch 'blender-v3.5-release' 2023-03-15 16:12:47 -07:00
7ee0bf671e Cycles: use 8-bit type for number of ray hits when possible
INTEGRATOR_SHADOW_ISECT_SIZE is lower than 256 for GPUs, this allows
using only a 8-bit type for storing intersection counts there.
2023-03-15 22:01:48 +01:00
f9922b7074 Cycles: Use ray->tfar in Embree filter functions
This allows to tell embree to stop intersecting beyond the distance
when max number of hits is reached.
2023-03-15 22:01:48 +01:00
1a580dbfdd Cycles: Use IntegratorShadowState directly in Embree filter functions 2023-03-15 22:01:48 +01:00
b97a6daa9a Cycles: Use geometryUserPtr from Embree filter functions arguments
This saves calls to rtcGetGeometryUserData.
2023-03-15 22:01:47 +01:00
59a083e948 Cleanup: format 2023-03-16 09:34:38 +13:00
c38fe87127 UV: Improve UV Packing efficiency with non-square aspect ratio
Improve pre-conditioning of UV Islands before passing them to the UV Packing API.

Pull Request: blender/blender#105784
2023-03-15 21:29:31 +01:00
f6c70755d1 Measure Tool: reduce snap overhead
No functional changes.

This is just a micro-optimization to avoid updating `prev_point` and
calling `ED_gizmotypes_snap_3d_data_get` when snapping is not enabled.
2023-03-15 17:14:57 -03:00
b79ad1f93f Merge branch 'blender-v3.5-release' into main 2023-03-15 17:14:42 -03:00
b21537d215 Cleanup: Wrap C++ normal accessors with C functions
Implement the two cached normal accessors with C++ methods
directly. This avoids dealing with raw pointers and reduces the
amount of casting necessary.
2023-03-15 15:57:27 -04:00
4aa2a3522e Cleanup: Store cached mesh normals with Vector
Avoids manually allocating and freeing the data in some cases,
clarifies ownership, and gives extra safety with the sizes.
2023-03-15 15:57:27 -04:00
17a53d6647 Cleanup: Tweak mesh normal accessors documentation
Just reference the C++ functions in the C API, and make the wording
a bit more concise.
2023-03-15 15:57:27 -04:00
f9132e2bbf Cleanup: Remove redundant mesh normals dirty tag function
Since normals are derived data, it's always a change to something
else that will cause them to change, like the winding order of a face
or vertex positions. So it's clearer to use tags for those things
directly. It's correct to remove the tag in one place since dirty is
the default state of a new mesh.
2023-03-15 15:57:27 -04:00
2daf6c69be Merge branch 'blender-v3.5-release' 2023-03-15 14:05:29 -04:00
d7ac2a177a Cleanup: Use spans and C++ type to access mesh normals
Also rename some variables to use names consistent with elsewhere.
2023-03-15 14:03:05 -04:00
d9c2fb9ae2 Cleanup: Remove mesh validation of cached normals
This validation dates back to when vertex normals were stored in
the `MVert` type (before cfa53e0fbe). Since normals
are all calculated in the same place, and aren't saved in files, this
isn't relevant anymore-- they can just be recalculated.
2023-03-15 14:03:05 -04:00
1fc892744c GPU: Fix: Use 2 slots for each UDIMs texture instead of 4
Create GPUNodeLinks for tiled_image and tiled_image_mapping together, to ensure they are the same texture.

See blender/blender#105661 (comment) for context and a more in-depth explanation.

Pull Request: blender/blender#105772
2023-03-15 17:58:25 +01:00
f518591abc Merge branch 'blender-v3.5-release' 2023-03-15 17:42:00 +01:00
72d64c35aa Cleanup: Basic C++ style for file_draw.cc
See #103343.
2023-03-15 17:40:00 +01:00
b9af4f6748 Cleanup: Remove unused headers in file_draw.cc 2023-03-15 17:40:00 +01:00
1bbb8b679f Cleanup: Move file_draw.c to C++
See #103343.
2023-03-15 17:40:00 +01:00
f6f2f4f264 Fix #105681: Sculpt trim generates smooth shaded faces
Caused by 5876573e14. We need to use the old default here
explicitly.
2023-03-15 12:32:45 -04:00
ed4e0b559a Merge branch 'blender-v3.5-release' 2023-03-15 12:14:13 -04:00
19ca2e905e UI: Increase the size of the "Open Recent" list
Increase the default value for the maximum number of recently-opened
files from 10 to 20. Also change the user's preference on version bump
to this new value if their current value is exactly the old default.

Pull Request: blender/blender#105703
2023-03-15 17:09:36 +01:00
c0e757a713 UI: Add scroll to sidebar tabs
When the height of the editor couldn't fit the sidebar tabs, they would shrink
to a size too small to read the tab label.

This change matches the behaviour with the Properties Editor navigation bar,
by introducing the following improvements:
* Avoid truncating tab labels.
* Allow scrolling when tabs don't fit.

Behaviour is similar to how scrolling works in the Properties Editor navigation
bar, supporting mouse wheel up/down and MMB, and switching tabs with
`Ctrl+Wheel Up/Down`.

Pull Request: blender/blender#105355
2023-03-15 16:45:11 +01:00
81818b797b Merge branch 'blender-v3.5-release' 2023-03-15 11:18:02 -04:00
c3dfe1e204 File Browser: Make full file name label draggable
Previously only the icon of a file could be dragged in the list display
modes, the name label would invoke box select. This made dragging quite
finicky. I've seen this cause quite some frustration, especially when
the file browser is used as a regular editor to drag data from into
other editors.

Instead follow the Outliner (and some other file browsers like the macOS
one): Dragging on empty space invokes box select, dragging on the name
or icon invokes drag & drop of the item.

The hitbox for the dragging is the width of the string, and the full row
height. So there's no space between rows to do box-select from, it
always triggers dragging. This is based on feedback during testing.

Note that 1e9564864c and 6da512f0bc were needed to prepare this change.

Pull Request: #104830
2023-03-15 16:03:00 +01:00
2b78441c09 Merge branch 'blender-v3.5-release' 2023-03-15 13:59:10 +01:00
c31ba08f76 Fix #105661: (Regression) Materials can use fewer images than before
Skip explicit binding location for samplers in OpenGL when not needed, since drivers can usually handle more sampler declarations this way (as long as they're not actually used by the shader).

Pull Request: blender/blender#105770
2023-03-15 13:37:19 +01:00
30e517c3ca Merge branch 'blender-v3.5-release' 2023-03-15 13:07:26 +01:00
254e3e133f Cleanup: format 2023-03-15 18:24:34 +13:00
559898709f Fix issues with retiming API
Ensure retiming data when operator is used, fix math for setting
retiming handle timeline frame.
2023-03-15 03:19:30 +01:00
99506b3d73 Fix: Crash in weighted normal modifier
Mistake in 1dc57a89e9
2023-03-14 15:00:33 -04:00
7b66168bcb Merge branch 'blender-v3.5-release' into main 2023-03-14 18:19:53 +01:00
ee18b625ca Fix: Edit mesh face corner color operators always use first layer
The operator went through quite a bit of trouble to pass a color
attribute index to the operator, but then it always used the offset
from the first layer of the active color attribute's type.

Also remove the "copy domains temp" API function, which
generalized this more than necessary, and exposed the internals
of the custom data system a bit more than we would like.
2023-03-14 12:03:46 -04:00
13ae75f545 Cleanup: Use C++ array type in skin modifier
This quiets a false positive (I think) allocation size warning for me.
2023-03-14 11:33:32 -04:00
90076b543b Cleanup: Remove two redundant color attribute functions
The two removed BKE functions were at a mid-level of abstraction
that doesn't make total sense in this API. Removing them is also
helpful in the general effort to have the attribute system rely less
on `CustomData` internally.
2023-03-14 11:33:32 -04:00
6d1cd997a2 Fix #105726: Driver Editing Popover Menu Closing
Allow specifying a specific region to check for active button. This is
required in some circumstances, like Driver Popover.

Pull Request: blender/blender#105746
2023-03-14 16:27:23 +01:00
92b607d686 CustomData: add separate function to add layer from existing data
This simplifies the usage of the API and is preparation for #104478.

The `CustomData_add_layer` and `CustomData_add_layer_named` now have corresponding
`*_with_data` functions that should be used when creating the layer from existing data.

Pull Request: blender/blender#105708
2023-03-14 15:30:26 +01:00
b06d522427 Fix potentially-uninitialised local variable
Very unlikely this caused any actual issue, but in theory it was possible.
2023-03-14 14:36:05 +01:00
258678916f Geometry Nodes: use lazy-function directly for switch node
This changes the Switch node so that it is implemented directly as a lazy-function,
instead of as a normal geometry node which uses `GeoNodeExecParams`. This improves
the design of the layered execution api, where different nodes can be implemented
at a proper different abstraction level. The simplest kinds of nodes are implemented
as multi-function, then there is `GeoNodeExecParams` and more specialized nodes are
implemented as lazy-function. The switch node is special in the sense that it currently
needs extra behavior in the lazy-function graph generation anyway.

`GeoNodeExecParams` can be simplified as well, because the Switch node was the only
one that used the `lazy_` methods.

We could consider adding back lazy-input functionality to normal geometry nodes
as it becomes necessary. Ideally, that could be integrated with the node declaration.

Pull Request: blender/blender#105696
2023-03-14 14:09:29 +01:00
ce34024681 Merge branch 'blender-v3.5-release' 2023-03-14 16:09:44 +11:00
4ff3cd2476 Fix error building on Linux 2023-03-14 16:09:08 +11:00
8929ed75d4 Image: Add OIIO support APIs
This adds a new set of APIs supporting the loading and saving of image
formats through OIIO. It makes use of the recent IOProxy work in OIIO
to align with the existing Blender image loading/saving machinery.

The support code here has been prototyped to work with ~7 of our image
formats so far. It includes centralized handling of `IB_test`,
`IB_mem`, and `IB_metadata` flags, which the existing code did not
handle consistently or at all depending on the format.

The PSD format (`format_psd.cc`) is included since the prior location
of the code has been restructured away. It serves as an example of how
the loading code typically flows for all the other formats.

Pull Request: blender/blender#105519
2023-03-14 04:42:17 +01:00
19565469c8 Merge branch 'blender-v3.5-release' 2023-03-14 13:41:43 +11:00
84b66c5a9c Cleanup: format, add missing CMake header 2023-03-14 12:53:37 +11:00
bc6985a6c1 Cleanup: doxygen comments 2023-03-14 12:51:37 +11:00
2a1a9307a7 Cleanup: spelling in comments 2023-03-14 12:36:49 +11:00
548d599dda Merge branch 'blender-v3.5-release' 2023-03-14 12:20:17 +11:00
46da66f4df Fix: Uninitialized boolean arrays in mesh conversion
In practice this probably didn't cause bugs, but it would have
caused extra copies of the UV helper layers. The layers are only
needed if we find true values. Mistake in 0fe0db63d7.
2023-03-13 17:32:20 -04:00
1dba915dff Merge branch 'blender-v3.5-release' into main 2023-03-13 15:35:42 -03:00
cf2c9fe186 Vulkan: Add initial VkPixelBuffer.
VKPixelBuffer is used by external render engines to allocate buffers
using the same GPU backend that Blender runs in.

In a later stage we should test what exact binding flags are needed. I
expect that it should be able to use as a transfer buffer to copy the
pixels over to a texture using transfer commands.

Pull Request: blender/blender#105741
2023-03-13 19:25:18 +01:00
2788fa915b Refactor: CurvesGeometry read/write function
This add the`CurvesGeometry::blend_read` and `CurvesGeometry::blend_write` methods
and uses them in the `curves_blend_read_data` and `curves_blend_write` functions.

No functional changes.

Pull Request: blender/blender#105737
2023-03-13 18:42:51 +01:00
08fd5747d2 Python API: implement ViewLayer.aovs.remove
Implement ViewLayer.aovs.remove by adding a new RNA function to call
the internal BKE_view_layer_remove_aov.

Resolves #99259

Pull Request: blender/blender#105646
2023-03-13 17:29:19 +01:00
d3cfb2e20e Fix: Failing assert for meshes with no faces
It's okay if the normals span is empty when there are no faces
2023-03-13 11:40:22 -04:00
097492b326 Merge remote-tracking branch 'origin/blender-v3.5-release' 2023-03-13 15:24:19 +01:00
2ae9526cd9 Cleanup: Small changes in Mesh BMesh conversion
Tweak variable naming, remove a few unnecessary comments,
remove a timer accidentally committed previously.
2023-03-13 09:20:15 -04:00
0fe0db63d7 Mesh: Optimize BMesh to Mesh conversion with UV maps
The BMesh to Mesh conversion does some checks to the UV helper
attributes like selection to avoid copying them to the mesh if they
don't contain any meaningful data. However, it does this by looping
over all faces for every UV map, not in parallel, so it takes up a large
portion of the total time in the conversion. This commit moves that
to the existing similar checks.

On a 1 million face mesh with 3 UV maps, for me this improved the
conversion runtime by 75%, from 174ms to 99ms. Before the serial
loops took 88ms out of the total. Combining them with the existing
loop over faces only increased its runtime from 29 to 40ms.
2023-03-13 09:07:52 -04:00
ea50dbe615 Merge remote-tracking branch 'upstream/blender-v3.5-release' 2023-03-13 13:00:48 +01:00
2bd88340bd Fix compiler warning 2023-03-13 11:57:03 +01:00
c6d6a3517e I18n: extract add-on bl_info warnings
Some add-ons choose to use the `warning` field in the `bl_info`
dictionary. This is potentially useful info, which should be shown to
the user translated.

This commit extends `dump_addon_bl_info()` from the i18n utils add-on,
to add this field to the message extraction.
2023-03-13 11:19:42 +01:00
4238080568 Cleanup: Remove gpu prefix in gpu test cases.
The _gpu_ prefix is redundant as they are inside a namespace
and run as part of a test suite that already contain the name
gpu. (GPUOpenGLTest)

This patch also moved the texture test cases to its own
compile module.
2023-03-13 11:14:17 +01:00
93bb443086 Fix: failing test in debug build due to wrong span size 2023-03-13 10:55:48 +01:00
df0c2693b6 Refactor: Rename grease pencil files to legacy
This renames the `BKE_gpencil_*` as well as the `DNA_gpencil_types.h`
files to indicate that it's the legacy grease pencil.

Pull Request: blender/blender#105597
2023-03-13 10:42:51 +01:00
6567ff558c Fix: Failing test case due to resource lifetime.
When a shader is bound it should outlife the pipeline. In one
test case where only the shader data was accessed it also bound
the shader. This isn't needed as the shader data should be
retrieved without binding the shader.

This change fixes the issue by not binding the GPU shader.
2023-03-13 09:54:57 +01:00
a26203bb3e Fix: Incorrect version code.
Patch version was increased, but the file subversion should have
been increased.

Also fixes previous incorrect patch versioning code as it didn't
add all 'version code until next subversion bump goes here.' after
version bump.
2023-03-13 08:38:04 +01:00
cbc73a1e05 Cleanup: Make mesh function static 2023-03-12 17:35:50 -04:00
03fffc08b6 Cleanup: Fix unused variable warning in release builds 2023-03-12 17:34:01 -04:00
050e08e5f0 Cleanup: Remove unused UI handlers function
Unused after c402b3f52f
2023-03-12 17:33:23 -04:00
68ec41d00e Cleanup: Remove unused mesh function
The function set bits in a bitmap for all the edge indices in a face.
With future changes to mesh topology storage though, this level
of abstraction won't be as helpful anyway.
2023-03-12 17:32:26 -04:00
1dc57a89e9 Mesh: Move functions to C++ header
Refactoring mesh code, it has become clear that local cleanups and
simplifications are limited by the need to keep a C public API for
mesh functions. This change makes code more obvious and makes further
refactoring much easier.

- Add a new `BKE_mesh.hh` header for a C++ only mesh API
- Introduce a new `blender::bke::mesh` namespace, documented here:
  https://wiki.blender.org/wiki/Source/Objects/Mesh#Namespaces
- Move some functions to the new namespace, cleaning up their arguments
- Move code to `Array` and `float3` where necessary to use the new API
- Define existing inline mesh data access functions to the new header
- Keep some C API functions where necessary because of RNA
- Move all C++ files to use the new header, which includes the old one

In the future it may make sense to split up `BKE_mesh.hh` more, but for
now keeping the same name as the existing header keeps things simple.

Pull Request: blender/blender#105416
2023-03-12 22:29:15 +01:00
5669c5a61b Mesh: Parallelize BMesh to Mesh conversion
This is very similar to ebe8f8ce71, but applies the same
changes to conversions to non-evaluated meshes meant for original
data. The function also handles shape keys, UVs, selection history,
"scan the database" object vertex index remapping, and multires fixes.
Those operations are handled in parallel with the other conversions now.

Similar to before, the improvement is better the more attributes/data
contained in the BMesh. This time I observed an improvement of 50%
(182ms to 123ms) for a large grid mesh with many attributes, and 20%
for a large grid mesh with less data. Shape keys, selection, hiding, and
multires data should have less of a detriment to performance now too.

One remaining thing to improve is the recently added UV selection/pin
handling. This should be moved into the first single-threaded loop over
faces, or changed further.

Pull Request: blender/blender#105602
2023-03-12 21:50:14 +01:00
e2030fbc33 Fix: Add missing default versioning for retopology overlay color
This is something we missed in #104599.
Without it, the default color isn't always set.
Thanks to user roman-13 for pointing out the problem,
and thanks to Hans Goudey for telling me the solution.

Pull Request: blender/blender#105539
2023-03-12 09:33:52 +01:00
adfffb7d32 Fix: normalize matrix before converting to euler
Without this, Blender aborts due to an assert.
2023-03-12 05:55:06 +01:00
54c9f972df Merge branch 'blender-v3.5-release' 2023-03-11 08:33:50 +01:00
b06edc2897 Cleanup: UV: simplify uv packing API.
Rename `struct ::UVPackIsland_Params` to
`class blender::geometry::UVPackIsland_Params`

Brings us closer to an "algorithm" style API.

No functional changes.
2023-03-11 14:59:58 +13:00
e56fe42aab Cleanup: format 2023-03-11 14:25:46 +13:00
eaa5a439b5 Merge branch 'blender-v3.5-release' 2023-03-11 12:01:33 +11:00
622c911534 Merge branch 'blender-v3.5-release' 2023-03-11 12:01:31 +11:00
e7b21403d2 Merge branch 'blender-v3.5-release' 2023-03-11 12:01:28 +11:00
65d8f9e140 Merge branch 'blender-v3.5-release' 2023-03-11 12:01:26 +11:00
0ea8e59151 Merge branch 'blender-v3.5-release' 2023-03-11 12:01:24 +11:00
12e8664f96 Merge branch 'blender-v3.5-release' 2023-03-11 12:01:22 +11:00
3c8b749a38 Merge branch 'blender-v3.5-release' 2023-03-11 12:01:19 +11:00
c402b3f52f Fix #63890: Allow Eyedropper and Other Operations in Popovers
Allow some operations on contents of popovers, like resetting to
defaults and use of the eyedropper.

Pull Request: blender/blender#105387
2023-03-11 00:36:39 +01:00
4d5a3c9932 Merge branch 'blender-v3.5-release' into main 2023-03-10 16:55:04 -03:00
3f0853264f Merge branch 'blender-v3.5-release'
Conflicts:
	source/blender/geometry/intern/mesh_merge_by_distance.cc
2023-03-10 16:09:02 -03:00
e7a3a2c261 Fix custom normals not normalized in Cycles shader nodes 2023-03-10 19:29:27 +01:00
e7b0a23283 Fix (unreported) broken ID remapping code, and improve efficiency.
Commit ea97bb1641 introducing the GHash mapping between objects and
their CollectionObject items in a Collection broke ID remapping of
collections's objects. Release builds would 'work', but debug builds
would assert in several ways when opening complex production files.

The root of the issue was a bad/missing handling of the 'duplicate case'
(several CollectionObjects pointing to a same Object).

While fixing the code was possible, it turned out to require disabling
to much safety checks. Further more, there was an opportunity to improve
efficiency of the related code in ID remapping (the pos-processing
checking for NULL and duplicates in collections objects lists).

This commit introduces a new 'dirty' tag for CollectionObject lists and
their ghash mappings.

This tag is set by the `foreach_id` callback when the `ob` pointer of a
CollectionObject is changed, and it is detected as (potentially)
breaking the consistency of that data.

This tag is then used by a new `BKE_collections_object_remove_invalids`
call, to only check and fix collections tagged as dirty, instead of all
the collections in the given Main. It replaces the previous
`BKE_collections_object_remove_nulls` and
`BKE_collections_object_remove_duplicates` functions.
The speed-up is about an order of magnitude for the clean-up code
itself, which gives 2-3 percent speed-up on resynching a complex
production file e.g.

This commit also includes some cleanups and re-organization of related
code.
2023-03-10 18:52:01 +01:00
111038062a Cleanup: Remove unused node function declarations 2023-03-10 12:26:55 -05:00
4f56b02a0c Fix #95105: Unclamp draw size of the frame node's label
Fix issues with the display of frame node labels, that made them
harder to read for people with low vision or on high dpi displays:
* Unclamp the size of text that is drawn in the frame node
  so all sizes can be displayed consistently at all zoom levels
  and independet of the UI scale.
* Account for the label when calculating the frame node's
  bounds, so child nodes don't obscure the label.

Pull Request: blender/blender#104555
2023-03-10 18:24:22 +01:00
9b354e9433 Merge branch 'blender-v3.5-release' 2023-03-10 17:59:02 +01:00
9f76a21677 Merge branch 'main' of projects.blender.org:blender/blender 2023-03-10 21:16:59 +05:30
577fd9add5 Merge branch 'blender-v3.5-release' 2023-03-10 21:11:09 +05:30
3ea36e9134 Merge branch 'blender-v3.5-release' 2023-03-10 16:26:29 +01:00
4805a54525 BLI: Math: Move rotation types template out of math::detail
The reasoning is that the detail namespace is not to be used
outside the module itself. But one might want to use different
number types with these templates.

The `Base` suffix was chosen in order to be consistent with `MatBase`
and `Vector` naming convention.
2023-03-10 11:48:15 +01:00
2e03352492 Refactor: fcurve bounds functions
Refactor the following functions and cover with tests

* `BKE_fcurve_calc_bounds` - used to get the `rctf` bounding box of an fcurve
* `BKE_fcurve_calc_range` - used to get only the x-range, potentially faster when not needing y extents

`get_fcurve_end_keyframes` has been replaced with `get_bounding_bezt_indices` - dealing with indices allows to iterate over that range later

### BKE_fcurve_calc_bounds
* pass in an `rctf` instead of float pointers
* extract logic to get bounds into separate functions

### BKE_fcurve_calc_range
* removed the parameter `do_min_length` it was always false, and this function shouldn't concern itself with clamping.
Calling code can do that if the return bool is false
* use function to get x bounds separated from `BKE_fcurve_calc_bounds`

Pull Request: blender/blender#105177
2023-03-10 11:33:11 +01:00
219be2e755 BLI; Math: Remove Normalized template parameter for some conversion
Always expect normalized matrix input as per API design.
2023-03-10 10:20:22 +01:00
896ba33336 GHOST: use logging for GHOST_NDOFManagerUnix
Even for debug builds, NDOF info on startup is unnecessarily noisy.
2023-03-10 13:12:27 +11:00
d64dfc4333 Cleanup: spelling in comments 2023-03-10 12:58:10 +11:00
ecc3e8c751 Cleanup: format, sort CMake file lists 2023-03-10 12:50:17 +11:00
10f06221c1 Cleanup: UV: simplify uv packing
Remove dependency on boxpack_2d in public API.

Brings us closer to full rotation in UV Packing.

No functional changes.
2023-03-10 13:56:33 +13:00
d474732f91 Cleanup: UV: simplify types
No functional changes.
2023-03-10 12:59:26 +13:00
66b4a4427b Sculpt: Edit face set operator improvements
* Last operator panel now works
* Added a strengh property for fairing modes
* Now works when called from a menu (added OPTYPE_DEPENDS_ON_CURSOR
  to operator type flag).
2023-03-09 15:43:05 -08:00
d795c00b88 Sculpt: Fix #105557 Bugs in new sculpt menu entries
Note: the wrong hotkeys are still displayed for
move/rotate/scale, for some reason the base view3d
keymap values are being used.
2023-03-09 15:20:22 -08:00
bd3c6801da Cleanup: BLI: Rotation: Remove unneeded type forward declarations 2023-03-10 00:02:53 +01:00
3982aa922e BLI: AxisAngle: Fix wrong constructor
The constructor was using the incorrect cast to VecBase3.
Also removes a redudant cast.
2023-03-10 00:02:53 +01:00
610cb16d5d BLI: AxisAngle: Make axis normalization mandatory
This moves out the normalization as per math API design (no implicit
normalization of inputs).
2023-03-10 00:02:53 +01:00
f70171e9c6 Cleanup: format 2023-03-10 11:00:18 +13:00
caf90c6a90 Fix #105587: Triangulated shading in sculpt mode
The function to upload the normals uses an optimization to avoid
checking the smooth status or face normal of the triangle is part
of the same face. The smooth status needs to be initialized before
the loop for that to work.

Also do a bit of cleanup:
- Decrease variable scope
- Fix the reversed incorrect naming of `smooth`
- Retrieve mesh data at the start of the function
2023-03-09 14:44:25 -05:00
68a142ee7b Fix #105524: Texture paint broken after recent cleanup
eb68334b58 replaced the pointer to looptris with a span
but left the variable for the number of looptris unset at zero. Fix by
using the size of the span instead.
2023-03-09 14:25:53 -05:00
0fe1a02055 Merge branch 'blender-v3.5-release' 2023-03-09 13:50:29 -05:00
af5a115f65 GPU: Refactor API for Clearing Storage Buffers
The previous API for clearing storage buffers was following the OpenGL
api. OpenGL has many options to support for data conversions, striding
and sizzling. Metal and Vulkan don't have these features and we have to
deal it ourselves.

Blender internally only uses a tiny subset for what is possible in
OpenGL. Making the current API to difficult to implement on our future
platforms as we had to implement all cases, most even not used at all.

By changing the API we make future development easier as we only need
to implement what we are actually using.

**New API**

`GPU_storagebuf_clear(GPUStorageBuf* ssbo, uint32_t clear_value)`

Related issue: #105492

Pull Request: blender/blender#105521
2023-03-09 18:46:28 +01:00
ffcd8e6b02 Eevee-next: Use compute shader to clear clipmaps
Clearing of clipmaps is the only place in Blender that uses non
uniform data (not all components of the cleared data to be exact
the same).

Vulkan has only the possibility to clear buffers using a single
uint32_t. There were two solutions:
- Add compute shader to Vulkan backend.
- Make Eevee-next responsible to clear the clipmaps.

When fixing this in the Vulkan backend it could lead to other issues
as the backend isn't aware what is exactly required and might overwrite
active bindings. We chose to make it a responsibility of Eevee-next
as there it is clear what is needed.

Related issue: #105492

Pull Request: blender/blender#105560
2023-03-09 18:28:05 +01:00
28a581d6cb BLI: Rotation C++ API
This patch re-implement the whole C rotation API into a more type
oriented C++ API. See the #104444 design task for more details about
the goals.

The list of C to C++ equivalent syntax can be found attached.

This adds `AngleRadian`, `AngleCartesian` and `AngleFraction` as
different angle types with the same interface. Each of them have
specific benefits / cons. See inline documentation for detail.

This adds `Axis` and `AxisSigned` class wrapped enums to increase type
safety with axes selection.

This adds `CartesianBasis` to represent orthonormal orientations.

Added a weight accumulation to dual-quaternions to make normalization
error proof. Creates the overhead of summing the total weight twice
(which I think is negligible) and add an extra float.

Named the dual-quaternion `DualQuaternion` to avoid naming ambiguity
with `DualQuat` which come up quite often (even with namespace).

Pull Request: blender/blender#104941
2023-03-09 18:15:22 +01:00
f9c627b275 Mesh: Set bounds eagerly for cube and grid primitive nodes
For mesh primitives, the bounds can be calculated trivially in advance
with negligible cost. In case they are needed later on, setting them
eagerly can save the calculation later on. For large meshes, this can
save tens of milliseconds before drawing.

Pull Request: blender/blender#105266
2023-03-09 18:11:53 +01:00
a8819481cb Merge branch 'blender-v3.5-release'
Conflicts:
	source/blender/modifiers/intern/MOD_array.cc
2023-03-09 16:53:06 +01:00
e699bd780c Cleanup: silence unreferenced param warning in MSVC
This warning appears when the `WITH_BULLET` option is off.
2023-03-09 12:50:07 -03:00
b7679addd2 cmake/win32: Fix building with WITH_VULKAN_BACKEND
The shader libraries were not hooked up yet in cmake for windows since
when the shaderc libs landed there was no code yet that used it.

It's required now, so this change adds the missing bits.
2023-03-09 08:41:17 -07:00
b0037c5c6b Texture Painting: Fix Seam Bleeding of Non-Manifold Sections of Mesh
Fix seam bleeding of non-manifold sections of the mesh, by copying pixels
that are covered by the brush stroke.

As manifold parts are already handled, the pixel copying solution can be
very straight forward.

* Pixels are copied from the same tile. So we don't need a mechanism that
  copies and merges pixels from other tiles.
* Pixels are copied from the closest pixel that is being painted on. We
  don't need to consider that that pixel can be in different areas of the
  tile.

When we copy a pixel, we find the closest pixel in UV space that is being
directly influenced by a paint brush. We also look for the second closest
pixel, which is still a neighbor from the closest pixel. We can mix both
pixels together and store it in the destination. A mix factor is calculated
using the closest non manifold edge as a guidance.

The result of this step is a list of copy and mix commands that can be
executed to fix the seam bleeding for non-manifold sections of the mesh.

| Destination | Source 1 | Source 2 | Mix factor |
| ----------- | -------- | -------- | ---------- |
| 1780,1811   | 1780,1810| 1779,1810| 0.000000   |
| 1781,1811   | 1781,1810| 1782,1811| 0.168627   |
| 1828,1811   | 1828,1810| 1827,1811| 0.156863   |
| 1829,1811   | 1829,1810| 1828,1810| 0.188235   |
| 1830,1811   | 1830,1810| 1829,1810| 0.188235   |
| 1831,1811   | 1831,1810| 1830,1810| 0.188235   |
| 1832,1811   | 1832,1810| 1831,1810| 0.188235   |
| 1833,1811   | 1832,1810| 1832,1810| 0.000000   |

In the end we go over this list mix the sources and store the result at
the destination.

```
tile_buffer[destination] = mix(tile_buffer[source_1],
                               tile_buffer[source_2],
                               mix_factor);
```

**Encoding**
When using a large textures or large seam margins this table can grow
large and reduce performance as data retrieval is slower, than the
operations it has to perform. To improve the performance we encode the
table so less data retrieval needs to be done.

* first `DeltaCopyPixelCommand` is delta encoded from
  `CopyPixelGroup#start_destination` and `start_source_1`. The others
  are delta encoded from the previous `DeltaCopyPixelCommand`.
* For performance reasons PixelCopyGroup#pixels are ordered from
  destination (left to right) for each row a new group would be created
  as the delta encoding most likely doesn't fit. When pixels cannot be
  delta encoded a new group will also be created.

**Compression rate**
When using Suzanne the compression rate is around 36% when using a seam
margin of 4 pixels. The compression rate may vary depending on seam
margin and model. For Suzanne the compression rate was around 36% for
various resolutions.

| Resolution | Margin | Decoded size | Encoded size | Compression |
| ---------- | ------ | ------------ | ------------ | ----------- |
| 2048x2048  | 4 px   | 353.052      | 128.101      | 36%         |
| 4096x4096  | 4 px   | 700.140      | 255.137      | 36%         |
| 8192x8192  | 4 px   | 1.419.320    | 513.802      | 36%         |
| 2048x2048  | 8 px   | 721.084      | 193.629      | 26%         |
| 4096x4096  | 8 px   | 1.444.968    | 388.110      | 26%         |

Pull Request: blender/blender#105336
2023-03-09 16:11:01 +01:00
f27d6b9640 MSVC: lower C4100 warning level from 4 to 3
The C4100 warning is related to unused formal parameters in functions.

Enabling it better aligns with "-Wunused-parameter" option in other
compilers.

While suppressing it with `__pragma(warning(suppress:4100))` is not the
same as using `__attribute__((__unused__))` in GCC or Clang, it is
still preferable to use it over completely hiding the warning.

This ensures consistent warning behavior across compilers and improves
code quality by addressing unused function parameters.

(Note that some warnings in Windows-specific code have already been
silenced in 7fcb262dfd)

Pull Request: blender/blender#105534
2023-03-09 16:05:48 +01:00
85fb63f99c Cleanup: Move functions in BMesh Mesh conversion
These functions will be useful to speed up the edit mode to object
mode conversion too, move them above that so they can easily be
used for that case later.
2023-03-09 09:41:26 -05:00
d21b9a4bb6 Vulkan: Warn Developer When Layer Not Found.
Currently a developer that starts blender with `--debug-gpu` or
runs the GPU test cases can receive an error when not the full
VulkanSDK is installed.

The VulkanSDK isn't required for normal developement and
therefore it is better to show it as a warning.

NOTE: VulkanSDK is adviced to use when developing in the Vulkan
backend as it contains tools that helps/speed up the development
and validation during development.

Pull Request: blender/blender#105599
2023-03-09 14:55:40 +01:00
85a70e9756 Fix memory leak with button tooltip callback and decorator buttons
Decorator buttons would be skipped when setting the tooltip data for all
buttons in the layout, but the duplicated data would still be marked as
used, so not freed.
2023-03-09 14:38:51 +01:00
3b900048f1 Animation: Move Graph Editor settings to User Preferences
Move two settings that were previously in the "View" menu of the Graph Editor into User Preferences.

It has been mentioned in the meeting by Luciano Muñoz Sessarego that it would be good to move that to the preferences so you can set it once and then forget about it.

The Settings moved are:

    Only Selected Curve Keyframes
    Use High Quality Display

Pull Request: blender/blender#104532
2023-03-09 14:15:23 +01:00
0239eee1c6 Fix build error on Windows introduced in 46be42f6b1 2023-03-09 13:48:14 +01:00
7edb3ab5e0 Merge branch 'blender-v3.5-release' 2023-03-09 13:16:15 +01:00
560314b7fd Merge branch 'blender-v3.5-release' 2023-03-09 11:21:27 +01:00
c20bf8d61e GPU: Replace old shader tests with shader builder.
Both the shader_builder and existing shader tests eventually
tested the same aspects. shader_builder is more modern and
handles more cases.

The old shader test requires a full backend in order to run
This commit replaces the old tests to just use the
shader builder for validation.

Shader builder can still be run at compile time, this is
just a convenience to have as a test case as well for CI/CD.

Ref: #105482
2023-03-09 10:40:57 +01:00
0ad06cd39d Vulkan: Automap Buffers.
It is recommended to map buffers once and not each time the
mapped memory is needed. This patch will map the buffer when
created and unmap the buffer when the buffer is freed.

This patch will reduce the overhead where the Vulkan driver or
the virtual memory manager needs to be accessed.

Pull Request: blender/blender#105588
2023-03-09 09:27:42 +01:00
c77b78ad53 Fix: restore margin offset for UV packing
Regression caused by b1185da403
2023-03-09 18:15:11 +13:00
9d3edb7e9a Cleanup: clear the linked list pointers for wmWindow::event_last_handled
While this doesn't cause any bugs, these may reference freed memory
so it's best to clear them as the event is no longer in a list.
2023-03-09 15:57:08 +11:00
09ba0210d9 Docs: note wmWindow::event_last_handled is for event queue handling only 2023-03-09 15:57:08 +11:00
7dcc040118 Merge branch 'blender-v3.5-release' into main 2023-03-09 01:33:14 -03:00
434526f3fc Cleanup: use doxy sections 2023-03-09 14:53:44 +11:00
39ab104761 Cleanup: remove invalid copy-pasted comments 2023-03-09 14:53:44 +11:00
ea913d40a2 Cleanup: format 2023-03-09 16:33:05 +13:00
25d2a4f948 Merge branch 'blender-v3.5-release' 2023-03-09 13:16:39 +11:00
c10377cf08 Cleanup: rename 'ok' to 'success' in file reading, double-quote paths
- Both success & ok were used for file reading, use the clearer name.
- Paths were single/double quoted, use double quotes for print/reports.
- Rename `path` to `filepath` / `dirpath`.
2023-03-09 12:11:40 +11:00
46be42f6b1 PyAPI: extend save/load handlers, optionally take a filepath argument
Add a filepath argument to load/save pre/post.
Also add save_post_failed and load_post_failed handlers so it's always
possible to for the pre handlers to run a matching post action.

This makes it possible to know the filepath of the blend file mean
loaded/saved as well as supporting running an action when load/save
operations fail.

When loading and saving the startup-file, the path argument is set to
an empty string.

Details:

New RNA types were added to support storing primitive values in
PointerRNA. Primitive{String/Int/Float/Boolean}RNA. These will likely
only be used in some limited cases, in the case of BKE_callback_exec it
allows strings to be included as part of the PointerRNA **pointers
argument.

Ref !104769.
2023-03-09 12:05:30 +11:00
1cc072b1a7 Cleanup: remove redundant filepath access in WM_OT_save_mainfile 2023-03-09 12:04:37 +11:00
b3625e6bfd Cleanup: comment blocks 2023-03-09 10:39:49 +11:00
56d2298271 Fix #105435: Pause Win32 Auto-Focus During Text Entry
Don't allow the hover of mouse to auto-raise another window while you
are entering data into a text or number input.

Pull Request: blender/blender#105446
2023-03-08 22:20:34 +01:00
60f35207d4 Fix: Hide ".uv_seam" attribute in UI
The attribute, like the other attributes that start with `.` is not
supposed to be displayed in the spreadsheet or the attribute list
by default. This was missing from the commit that added the attribute.
2023-03-08 11:41:36 -05:00
27b9ce6ab6 Mesh: Avoid writing unnecessary attributes
When writing in the legacy mesh format, some attributes don't need to
be written since they're written as flags or legacy struct types.
2023-03-08 11:41:36 -05:00
1354e3108b const_cast no longer needed for ntreeIsRegistered. 2023-03-08 17:38:15 +01:00
7d7190de74 Merge branch 'blender-v3.5-release' 2023-03-08 17:36:59 +01:00
5876573e14 Mesh: Move face shade smooth flag to a generic attribute
Currently the shade smooth status for mesh faces is stored as part of
`MPoly::flag`. As described in #95967, this moves that information
to a separate boolean attribute. It also flips its status, so the
attribute is now called `sharp_face`, which mirrors the existing
`sharp_edge` attribute. The attribute doesn't need to be allocated
when all faces are smooth. Forward compatibility is kept until
4.0 like the other mesh refactors.

This will reduce memory bandwidth requirements for some operations,
since the array of booleans uses 12 times less memory than `MPoly`.
It also allows faces to be stored more efficiently in the future, since
the flag is now unused. It's also possible to use generic functions to
process the values. For example, finding whether there is a sharp face
is just `sharp_faces.contains(true)`.

The `shade_smooth` attribute is no longer accessible with geometry nodes.
Since there were dedicated accessor nodes for that data, that shouldn't
be a problem. That's difficult to version automatically since the named
attribute nodes could be used in arbitrary combinations.

**Implementation notes:**
- The attribute and array variables in the code use the `sharp_faces`
  term, to be consistent with the user-facing "sharp faces" wording,
  and to avoid requiring many renames when #101689 is implemented.
- Cycles now accesses smooth face status with the generic attribute,
  to avoid overhead.
- Changing the zero-value from "smooth" to "flat" takes some care to
  make sure defaults are the same.
  - Versioning for the edge mode extrude node is particularly complex.
    New nodes are added by versioning to propagate the attribute in its
    old inverted state.
- A lot of access is still done through the `CustomData` API rather
  than the attribute API because of a few functions. That can be
  cleaned up easily in the future.
- In the future we would benefit from a way to store attributes as a
  single value for when all faces are sharp.

Pull Request: blender/blender#104422
2023-03-08 15:36:18 +01:00
2f04f8882f Merge branch 'blender-v3.5-release' into main 2023-03-08 11:17:12 -03:00
b9649c2e72 Eevee: fall back to Diffuse BSDF before proper implementation of Hair BSDFs
Co-authored by @fclem
2023-03-08 15:05:58 +01:00
2282272787 Overlay: Adjustment of the max value of "Edge Width" from 5 to 32.
The first implementation based the max value on what seemed reasonable.
It was therefore limited it to 5.
I received a request from a user in the first already merged #104741
to allow a higher max value.

Thus I adjusted the max value to be the same as the max value used for
"Vertex Size", 32.

Pull Request: blender/blender#105544
2023-03-08 15:01:46 +01:00
6398c9cd7f Cleanup: Remove unused GPU subdivision function declaration 2023-03-08 08:05:36 -05:00
25016b56ef EEVEE Next: Tag shadowmap usage for transparent object volumes
Render the transparent object bounds to a low-res frame-buffer and ray-march the
bounds volume, tagging shadow tiles along the way.

The bounds volume is inflated by half a pixel as a conservative rasterization
alternative, to ensure the tiles needed by all LOD0 pixels get tagged.

The bounds are rendered with front face culling and then the fragment shader
ray-marches against the bounds volume.
Each ray-marching step size equals the world space size of the pixel at the step
depth.
The step bounding sphere radius is also sent to the shadow usage tagging library
to ensure the whole step volume is tagged.

Pull Request: blender/blender#104580
2023-03-08 13:51:24 +01:00
53bb713eda Refactor: Rename OB_GPENCIL and ID_GD
This renames the `OB_GPENCIL` object type and the `ID_GD` to `OB_GPENCIL_LEGACY` and `ID_GD_LEGACY` respectively.
There is no change for the user.

Pull Request: blender/blender#105541
2023-03-08 12:35:58 +01:00
a736f1d638 BLI: Math: Support more vector swizzling and add alignment static assert
Sergey said it was faaaaaaaaaaaaiin.
2023-03-08 11:21:12 +01:00
63a05f1e18 Vulkan: Fix Shader Compilation Issues.
Fixes recent introduced shader compilation issues.
- `sampler` is a reserved keyword in Vulkan GLSL.
2023-03-08 11:10:05 +01:00
b1185da403 Fix #102843: Add UV Packer with O(nlogn) performance
Adds a novel "Alpaca" UV packing strategy for fast packing
of UV island AABBs without rotation.

Pull Request: blender/blender#105393
2023-03-08 20:39:27 +13:00
4fb2c9a407 Cleanup: use system native slashes in PLY, OBJ tests, studiolights
Use native paths to avoid issues comparing paths, see: #103385.
2023-03-08 15:50:02 +11:00
4787384d9d Cleanup: use BKE_area_find_region_type utility function 2023-03-08 15:50:01 +11:00
3a1d5e6032 Cleanup: surround expressions in defines by parenthesis 2023-03-08 15:49:59 +11:00
7896ebec12 Cleanup: make undeclared function static 2023-03-08 15:49:57 +11:00
5c5650f0f8 Cleanup: UV: Rearrange functions in cpp files to improve type safety
No functional changes.
2023-03-08 05:43:15 +01:00
809a336a3d Merge branch 'blender-v3.5-release' 2023-03-07 20:06:05 -05:00
b228e5b118 Cleanup: run clang-format on a few files 2023-03-07 16:54:18 -08:00
e67c27e172 Merge branch 'blender-v3.5-release' 2023-03-08 01:50:08 +01:00
7fcb262dfd Cleanup: resolve some unreferenced parameter warnings in MSVC
When the warning level is set to 4, some unreferenced parameter
warnings can appear

This commit resolves some of those warnings.
2023-03-07 21:39:44 -03:00
da65b21e2e Sculpt: Add Transform, Trim, and Mesh Filter operators to Sculpt menu
Hello, this is a small PR to check that my understanding of #102427 is correct before moving on to the rest of the issue.
This PR contains the updated UI of the `Sculpt` menu only. Other menus will be submitted for review later.

Currently exposed operators:
* Move
* Rotate
* Scale
* Box Trim (Trim Mode ="Difference")
* Lasso Trim (Trim Mode ="Difference")
* Box Add (Trim Mode ="Join")
* Lasso Add (Trim Mode ="Join")
* Line Project
* Smooth
* Surface Smooth
* ~~Scale (Could be left out?)~~
* Inflate
* Random
* Relax Topology
* Relax Face Set Boundaries
* Sharpen
* Enhance Details
* Erase Displacement

The original issue specifies `Relax Face Set Boundaries` and `Erase Displacement`. I'm not quite sure if this is done in the UI code or somewhere else.

Reviewed By: Joseph Eagar & Julian Kaspar
Pull Request: blender/blender#104718
2023-03-08 01:18:21 +01:00
d46a0f5a1a Cleanup: UV: simplify #uv_parametrizer_construct_end
No functional changes.
2023-03-08 10:29:07 +13:00
d41a1e1806 Cleanup: UV: simplify types
No functional changes.
2023-03-08 10:16:07 +13:00
8faeccf6e5 Fix #105496: Incorrect solidify modifier materials after recent cleanup 2023-03-07 16:11:01 -05:00
a97cae3efc Fix: VSE retiming off by 1 error 2023-03-07 22:10:00 +01:00
cf39e077b3 Cleanup: Remove useless function
`seq_time_strip_original_content_length_get()` was created initially for
purposes of retiming, but it just returns `seq->len`.
2023-03-07 22:10:00 +01:00
894dcfbb41 Cleanup: format 2023-03-08 09:50:03 +13:00
655623ce08 Merge branch 'blender-v3.5-release' 2023-03-07 15:41:15 -05:00
314db1bcab Merge branch 'blender-v3.5-release' 2023-03-07 15:24:29 -05:00
ea80e14464 Fix: Logic error in check for curves selection
The code always assumed the selection array was on the curve domain.
Introduced in 33cbd063d3.
2023-03-07 15:24:20 -05:00
58401a85cd Merge branch 'blender-v3.5-release' 2023-03-07 15:07:01 -05:00
0b05baeaf3 Cycles: oneAPI: fix linking for when icpx compiler is used
When compiling from MSVC environment, libs such as libircmt.lib weren't
found, we need to set the path to these in LIB environment variable.
2023-03-07 21:01:59 +01:00
66eedc542b VSE: Use flag for strips with single frame of content.
Previously `SEQ_transform_single_image_check` function was used to check
if image or effect strip has only one frame of content. Now these strips
are flagged with `SEQ_SINGLE_FRAME_CONTENT`.

While previously this was implicit property of strip, benefit of having
explicit flag is that this property can be decoupled from strip length.
2023-03-07 20:34:24 +01:00
5ab49afe8d Cleanup: Fix warning in skin modifier
Pull Request: blender/blender#105542
2023-03-07 19:33:49 +01:00
78e8c6649d Fix unreliable PLY regression test
At a random the bf_io_ply_tests would fail in one of the fixtures.

The root of the issue was that the exporter parameters were used
uninitialized, causing the mesh to be triangulated in some of the
runs and not be triangulated in other runs.

This change makes it so PLYExportParams is always zero-initialized,
so that this solves this issue, and that adding fields to it in the
future will not re-introduce the issue.

Pull Request: blender/blender#105537
2023-03-07 18:59:02 +01:00
d11874bf21 Merge branch 'blender-v3.5-release' 2023-03-07 18:29:30 +01:00
cbf569523c Realtime Compositor: Implement bicubic interpolation
This patch implements the bicubic interpolation option in the transform
nodes. The path merely reuse the code in the shader image texture and
adds bicubic variants to the domain realization shader.

Pull Request: blender/blender#105533
2023-03-07 18:02:20 +01:00
393d5aac59 Ignore build files for VS and VS Code
Git: Add VS/VSCode litter to .gitignore

Neither regular VS nor VS Code can't seem to keep themselves from
littering in the source folders.

This change adds some common litter to .gitignore file to provide some
relief for developers using these editors/IDE's
2023-03-07 17:38:34 +01:00
023524765a Merge branch 'blender-v3.5-release' 2023-03-07 17:35:05 +01:00
5ff959a056 Fix BLI_assert 'attr->comp_len == 2' failed in cage 2d gizmo 2023-03-07 17:07:49 +01:00
48944e7a8e Gizmo: slightly increase cage2d corner margins 2023-03-07 16:29:09 +01:00
275d69467b Gizmo: show hovering regions of cage2d gizmo to indicate constraint axis 2023-03-07 16:29:09 +01:00
7bf20e93d6 Cleanup: silence unused local variable warning
`region` is not used in a `Release` build.
2023-03-07 11:56:42 -03:00
bc5f2c5415 GPencil: Fix compiler warning 2023-03-07 15:26:48 +01:00
a4d2ae12a5 Blenlib: Add ConstListbaseWrapper for iterating const ListBase *
This commit introduces `ConstListBaseWrapper`, to allow easy iteration over
`const ListBase *` in C++ code.

Basically `ListBaseWrapper` was renamed to `ListBaseWrapperTemplate`, and
got a new template parameter `LB`. The new `ListBaseWapper` class has `LB=ListBase`,
whereas `ConstListBaseWrapper` has `LB=const ListBase`.

Also in this commit is one use of `ConstListBaseWrapper` to make sure the
templated code is actually expanded & compiled.

Example use:

```cpp
for (const bDeformGroup *dg : ConstListBaseWrapper<bDeformGroup>(defbase)) {
  ...
}
```

Pull Request: blender/blender#105464
2023-03-07 15:23:59 +01:00
6fbc52bdca Viewport: draw light icons using the light colors
Indicating light colors by coloring the light icons.
Task: #104280
Pull Request: #105236

- Added a checkbox under overlay extra to enable/disable light coloring. Disabled by default.
- The outer ring and the sun rays are colored.
- Only the base color is shown, colors in nodes are not considered.
2023-03-07 15:17:59 +01:00
891eb4938c UI: add parenting (Keep Transform Without Inverse) to menu
Since db6287873c, we added parenting (Keep Transform Without Inverse)
to the parent_set operator and exposed this in the UI in the invoke menu
of that operator.

This however never made it to the `Object` > `Parent` menu.

Since this is quite useful (and otherwise a bit hidden in the Adjust
Last Operation panel) and parent inverse can cause confusion in many
cases (see e.g. #105276 or #103969), now add this as an explicit entry
in the `Object` > `Parent` menu as well.
2023-03-07 15:14:00 +01:00
4aea5df231 Cleanup: Use CPP Wrapper to Clear SSBO in Eevee-next.
Eevee-next motion blur called GPU module directly, but should have
used the CPP wrapper.

Pull Request: #105528
2023-03-07 15:11:38 +01:00
7f5d1fb05a Merge branch 'blender-v3.5-release' into main 2023-03-07 13:23:43 +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
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
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
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
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
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
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
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
71c366f5cc PLY: fixing tests 2023-03-05 21:50:25 +02:00
ca4486bfa1 Cleanup: format 2023-03-05 19:53:40 +01:00
9139983f94 Cycles: Implement MaterialX OSL microfacet closures
This commit implements three OSL microfacet closures that are needed to support
MaterialX: dielectric_bsdf, conductor_bsdf and generalized_schlick_bsdf.

Internally these map to existing microfacet closures, only the Fresnel term is
different.
2023-03-05 19:52:07 +01:00
014f6e4309 Cycles: Make Fresnel term independent of microfacet closure type
Currently, we use the closure type to encode the type of microfacet distribution
(GGX/Beckmann/Sharp/MultiGGX), the lobes we're interested in
(Reflection/Refraction/both) AND the Fresnel type (None or Principled v1).

This results in the mess of dozens of options that we currently have. Since
adding Principled v2 and the MaterialX OSL closures will involve adding more
Fresnel types, this clearly doesn't scale.

But, since the earlier Fresnel rework (D17101), the Fresnel type only matters
in one place now. This allows to significantly clean up the closure type
handling. To do this, MicrofacetBsdfs now separately store their Fresnel type,
and instead of a single MicrofacetExtra we have one struct per Fresnel type
(unless no extra data is needed).

Further, instead of having one _setup() function per combination, the Fresnel
setup is also split into separate functions. This decouples the implementation
of new Fresnel terms from most of the Microfacet logic, and makes it a very
simple and clean operation.
2023-03-05 19:52:07 +01:00
5f9b518a8b Cycles: Use per-microfacet Fresnel term for Glass closures
This commit replaces the current Glass approach, where Glass is a virtual closure
that gets replaced with a Glossy and a Refractive closure, with a combined
closure that handles Fresnel after sampling the microfacet. That way, the Fresnel
term is more accurate since it accounts for the microfacet normal, not the
shading normal.

Also updates the BSDF sampling to use a 3D sampler now, since we need two
dimensions to pick the microfacet normal and then a third dimension to pick
reflection/refraction. This can also be used to get rid of the LCG in the
Principled Hair BSDF, which means we can remove it altogether once MultiGGX is
gone.

Also, "sharp" is now supported as a microfacet distribution in OSL, and 2
is supported as the "refract" argument to microfacet() in order to get glass.
2023-03-05 19:52:07 +01:00
a30abe9c2e IO: minor tweaks to the new C++ PLY importer/exporter
Address some issues discussed in PR #104404:
- Vertex color options changed to None/sRGB/Linear, default is sRGB
  to match the existing Python addon.
- Change name to "Stanford PLY" from "PLY" in the menu item.
- Default "Export UVs" to on.
- After importing vertex colors, they are set as enabled for render.
2023-03-05 20:44:53 +02:00
Nathan Rozendaal
43e9c90061 IO: New C++ PLY importer/exporter
New (experimental) Stanford PLY importer and exporter written in C++.

Handles: vertices, faces, edges, vertex colors, normals, UVs. Both
binary and ASCII formats are supported.

Usually 10-20x faster than the existing Python based PLY
importer/exporter.

Additional notes compared to the previous Python addon:
- Importing point clouds with vertex colors now works
- Importing PLY files with non standard line endings
- Exporting multiple objects (previous exporter didn't take the vertex
  indices into account)
- The importer has the option to merge vertices
- The exporter supports exporting loose edges and vertices along with
  UV map data

This is squashed commit of PR #104404
Reviewed By: Hans Goudey, Aras Pranckevicius

Co-authored-by: Arjan van Diest
Co-authored-by: Lilith Houtjes
Co-authored-by: Bas Hendriks
Co-authored-by: Thomas Feijen
Co-authored-by: Yoran Huzen
2023-03-05 20:44:53 +02:00
b4d36b3efe GPU: Compute: Document and cleanup header
No fonctional changes.
2023-03-05 18:14:17 +01:00
4862d56a0e GPUFrameBuffer: Document and cleanup header
No fonctional changes.
2023-03-05 17:57:51 +01:00
d782569682 Cleanup: GPU: Improve eGPUBarrier documentation 2023-03-05 17:57:51 +01:00
0a10571501 GPU: Replace GPU_finish by correct memory barrier 2023-03-05 17:57:51 +01:00
38407b319a CMake/Win32: Install boost dlls during install phase
During install all dlls should copy to the blender.shared
folder regardless if the dependency is on or off, creators
CmakeLists.txt already did this correctly, but for boost
the BOOST_POSTFIX and BOOST_DEBUG_POSTFIX variables were
not set causing the boost dll's not to be copied.

This change takes the setting of these variables out of the
WITH_BOOST block, but still guards it with a
WITH_WINDOWS_FIND_MODULES block so we don't break the build
for people building with that on.
2023-03-04 14:07:17 -07:00
adacf5a706 Merge branch 'blender-v3.5-release' 2023-03-04 04:12:20 -08:00
4b0f5c2aad Fix build error introduced in previous commit.
Fix build error introduced in 57742c7868 due to int/float conversion.
2023-03-04 08:04:35 +01:00
f5e9a78216 GPU: Fix wrong barrier in tests
Texture and buffer reads were using the incorrect barrier.
2023-03-04 07:44:34 +01:00
fcedc97d11 GPU: Add GPU_BARRIER_BUFFER_UPDATE barrier type
This barrier types is needed for correct readback of buffers GPU memory
to CPU memory.
2023-03-04 07:44:34 +01:00
57742c7868 Fix: Wrong text clipping in the frame node
When drawing text with multiple lines inside a frame node, depending
on the zoom level some lines would wrongly get clipped despite being
inside the clipping region.

This was caused by the clipping check in `blf_glyph_draw` not accounting
for the font’s aspect.

Pull Request #105389
2023-03-04 07:12:14 +01:00
e22eb23bc2 Cleanup: match header/source arguments & quiet cppheck warnings 2023-03-04 15:19:00 +11:00
7cb3a79246 Cleanup: remove unused arguments 2023-03-04 15:10:39 +11:00
d0cfbc23db Merge branch 'blender-v3.5-release' 2023-03-03 15:37:11 -08:00
c02feb6773 Fix failing VSE test
Caused by b4100ed377. Image strips with only 1 frame of content do
expect any timeline frame to be translated into frame index of 0.

Check this case and return 0 explicitly.
2023-03-03 23:56:12 +01:00
6749593aec Fix mistake in previous commit
Fix error in b4100ed377

`seq_retiming_evaluate()` returns range from 0 to 1, to which framerate
correction was applied. this is incorrect, and correction should be
applied to function input.
2023-03-03 23:03:59 +01:00
c066035907 Cleanup: Deduplicate node parent checking functions
Unify both functions in one, with a more telling name,
to be sure of the order of the arguments. Some functional
cleanup of the using code to make it more explicit.

Pull Request #105413
2023-03-03 22:38:49 +01:00
b4100ed377 Fix VSE clamping strip content length incorrectly
When movie framerate does not match scene, content length was clamped to strip
length in scen framerate. This also caused issues with retiming which behaved in
similar way. Retiming was modified to use frame index of strip content, so even
when scene framerate is changed, retiming data is preserved in correct
proportions. This means, that handles are mapped to time in seconds rather than
to frames.
2023-03-03 22:32:37 +01:00
a95eaf0ec1 Build: Make OpenImageIO a required dependency
During the discussion for #101413 there was consensus that we could make
OIIO a mandatory dependency. This patch does just that.

The `idiff` testing tool remains optional.

Pull Request #105111
2023-03-03 21:53:34 +01:00
d0eeb3d155 Cleanup: Remove mesh normals function, deprecate in RNA
Since normals are calculated when they are accessed if necessary, this
was a no-op. Related to cfa53e0fbe and 6a3c3c77b3.
2023-03-03 15:18:29 -05:00
915ff8d152 Cleanup: Use references for mesh poly variables
Similar to the previous commit, this simplifies future refactoring
to change the way edges are stored, and further differentiates
single poly variables from array pointers.
2023-03-03 11:40:43 -05:00
45cff837bc Cleanup: Use simpler iterator for mesh polygons
Avoid incrementing a pointer, use only indices as a source of truth.
This should ease refactors to change the way polys are stored.
2023-03-03 11:40:43 -05:00
e1a0c09f06 Merge branch 'blender-v3.5-release' 2023-03-03 16:55:20 +01:00
e7ba8247de Merge branch 'blender-v3.5-releas' into main 2023-03-03 16:45:45 +01:00
05b141e67f Merge remote-tracking branch 'upstream/blender-v3.5-release' 2023-03-03 15:27:07 +01:00
e0732b640a Fix: Build with FFmpeg 6.0
Pull Request #105377
2023-03-03 13:51:45 +01:00
a2d988b5da Cleanup: function style casts for C++, use nullptr 2023-03-03 23:28:18 +11:00
a2cc7e1511 Merge branch 'blender-v3.5-release' 2023-03-03 23:16:32 +11:00
5bb3dc84c1 Merge branch 'blender-v3.5-release' 2023-03-03 12:31:25 +01:00
7ebe721557 Refactor: Move motion tracking related files to C++
A bulk change, to make things moving as quickly as possible, instead of
doing per-modified-file basis.

This is pretty much direct translation of C code to C++, is not really
"proper" C++ usage. That could happen on a more case-by-cases basis.

Pull Request #105376
2023-03-03 11:09:33 +01:00
aa82afaaf7 Cleanup: regenerate the default theme file
Re-run ./tools/utils/blender_theme_as_c.py
2023-03-03 16:32:38 +11:00
f0257aa71b Cleanup: use camel-case for struct name, wrap function arguments 2023-03-03 16:29:43 +11:00
2eaa55272d Cleanup: use function style casts, nullptr in C++ 2023-03-03 16:29:36 +11:00
b4eef99973 Cleanup: use C-style code comments, format 2023-03-03 16:29:22 +11:00
37c0b0b2b8 Cleanup: format 2023-03-03 13:42:21 +13:00
dcad51dfc3 DRW: Retopology Overlay
Add overlay option for retopology, which hides the shaded mesh akin to Hidden Wire, and offsets the edit mesh overlay towards the view.

Related Task #70267
Pull Request #104599
2023-03-03 00:35:45 +01:00
55ea58ff5b BLI_string: correct size for BLI_str_format_int_grouped, update tests
Ensure the defines match the longest strings in tests.
2023-03-03 10:25:47 +11:00
05324e2e3c Cleanup: spelling in comments 2023-03-03 10:09:20 +11:00
99e90615d7 Cleanup: compiler warnings 2023-03-03 09:53:23 +11:00
d130f81a22 Cleanup: Use const arguments in node.cc
Cleanup, try to always use const.
Many function signatures still have incorrect argument order
(constants, mutables). But this is a larger other cleanup.

Pull Request #104937
2023-03-02 23:14:59 +01:00
118ec54ec7 Cleanup: Move five mesh related files to C++
To faciliate further mesh data structure refactoring. See #103343.

Pull Request #105354
2023-03-02 23:14:33 +01:00
15375b0845 Docs: improve comments in linux_rocky8_setup.sh 2023-03-02 21:30:22 +01:00
2a9f792c9e Draw Next: Fix shader orco computation 2023-03-02 17:57:30 +01:00
8c29d84139 BLI: Prevent Overflow in Grouped Number Output
Increase the buffer sizes used for `BLI_str_format_uint64_grouped` to
prevent overflow on strings representing numbers within the uint64
range. Also creates and uses defines for all the formatted string
buffer sizes.

Pull Request #105263
2023-03-02 17:38:36 +01:00
ff6ce25926 Add a basic support to BKE library linking code to generate liboverrides.
This commit adds the ability to generate liboverrides of linked data at
the `BKE_blendfile_link_append` BKE level, and through the Python API
(the `BPY_library_load` context manager, aka `bpy.data.libraries.load`).

The python API was updated essentially to allow easy testing of the new
code. This commit also adds tests for the new 'override' behavior, and
for existing basic link one.

Current code only generates 'basic' overrides, without any handing of
hierarchies or dependencies, as for brush assets only the Brush ID needs
to be overridden.

That new feature does not aim at being exposed to user through the
link/append operations in its current state, as it is way too simplistic.

This change is a requirement for the Brush Asset project (#101908).

Pull Request #104746
2023-03-02 17:22:42 +01:00
f5c56b4cd6 Animation: Remove the 'Weight Paint: Fix Deforms' operator
The code of the 'Fix Deforms' operator was hard to read and inefficient, doing `O(num_vertices * num_vertex_groups)` evaluations of the mesh. It caused multiple issues and got in the way of improvements to Blender, and seems to be used very little (if ever).

It was decided in [last week's module meeting](https://devtalk.blender.org/t/2023-02-23-animation-rigging-meeting/27757#patch-review-decision-time-5) that this operator should be removed.

Pull Request #105237
2023-03-02 16:58:14 +01:00
1d3a2fb5bb Merge branch 'blender-v3.5-release' 2023-03-02 15:15:11 +01:00
fa044c453f Cleanup: Unused fields and API for tracks map
The map is used to, well, map localized copy of the tracks used by the
tracing thread to the original tracks in the movie clip. There seems to
be some accumulated stuff in there which is no longer used by the current
state of code.

There should be no functional changes.

Pull Request #105374
2023-03-02 15:09:50 +01:00
81b56f8bbc Cleanup: Refactor BKE_nlatrack_add to multiple methods to handle adding a new NLA track to the track list. Insert before, after, head, and tail
This PR removes the BKE_nlatrack_add, and adds new:

* BKE_nlatrack_insert_before
* BKE_nlatrack_insert_after
* BKE_nlatrack_new_before_and_set_active
* BKE_nlatrack_new_after_and_set_active
* BKE_nlatrack_new_head_and_set_active
* BKE_nlatrack_new_tail_and_set_active

methods to easily add new NLA tracks in relation to the existing track list.

Pull Request #104929
2023-03-02 15:02:30 +01:00
12854fdfd6 Fix: Frame Channels fails when no keys in range
Under the following circumstances
* keys on 1, 3 and 5
* preview range set to 10-20

The frame channel operator would zoom into nothingness.
because no keys were found in the preview range.
(Only the `ANIM_OT_channel_view_pick` operator though)
This PR fixes it and notifies the user with a warning.

Pull Request #105179
2023-03-02 13:04:57 +01:00
f97542e5a2 Merge branch 'blender-v3.5-release' 2023-03-02 11:04:17 +01:00
4de2cf4136 Merge branch 'blender-v3.5-release' 2023-03-02 09:53:58 +01:00
b02b2589e2 Merge branch 'blender-v3.5-release' 2023-03-02 16:37:59 +11:00
bb77d6934c Merge branch 'blender-v3.5-release' 2023-03-02 16:37:55 +11:00
b43f520a82 Cleanup: Move UV parameterizer to blender::geometry namespace
The current API makes more sense as part of a class, but for now, keep
consistency with the other geometry module headers and move the code
to the proper namespace, removing the `GEO_` prefix which is only meant
for C code.

Pull Request #105357
2023-03-02 06:10:26 +01:00
2d6921198a Cleanup: Remove unnecessary struct and using keywords in C++ 2023-03-02 06:10:25 +01:00
aea53c771d Cleanup: Move UV parameterizer header to C++
See #103343
2023-03-02 06:10:25 +01:00
8cae7a0dcc Cleanup: remove/comment unused defines 2023-03-02 15:05:52 +11:00
ae086deaa5 Docs: note that "Effect" and related types are deprecated
Also use comments to identify "Effect" members which must be used
by all structs.
2023-03-02 15:05:52 +11:00
93508ab2df Cleanup: Make mesh validation functions static
These functions used internal values and only really make sense in
the context of the mesh validation process where they're used to remove
invalid elements from the mesh.
2023-03-01 22:30:47 -05:00
fcaf12f07a Cleanup: format 2023-03-02 16:23:17 +13:00
52d20c6a0e Fix #105331: Assert in solidify extrude after recent cleanup
Use indices instead of pointers to avoid accessing elements beyond
the end of the result mesh arrays.
2023-03-01 22:21:08 -05:00
6b8cdd5979 Fix #103469: Update UV Sphere Projection with Seam support.
Note: Applies to both UV Sphere Projection and UV Cylinder Projection.

Adds a new boolean option "Preserve Seams" to UV Sphere Projection.

With "Preserve Seams" active, the Sphere projection will do a
greedy flood fill over the 3D topology, stopping at 3D boundaries
and also stopping at edges where "Mark Seam" has been used in the
3D Viewport.

During the flood fill, each face is mapped using the spherical
projection and then adjusted along the U axis so the UV map is
continuous across the shared edge.

With careful seam placement, this allows for the creation of a
spiral-cut-orange-peel unwrap, where a sphere can be unwrapped
into a single long continuous strip, wrapping multiple times around
the object.

Finally, if the flood fill process creates multiple UV Islands,
they are spaced along the `U` axis to prevent overlaps.

Pull Request #104847
2023-03-02 00:48:34 +01:00
7de2f21001 Fix: Debug build error after recent variable rename cleanup
Also adjust some comment formatting as penance.
2023-03-01 18:08:41 -05:00
3022a805ca Cleanup: Standardize mesh edge and poly naming
With the goal of clearly differentiating between arrays and single
elements, improving consistency across Blender, and using wording
that's easier to read and say, change variable names for Mesh edges
and polygons/faces.

Common renames are the following, with some extra prefixes, etc.
 - `mpoly` -> `polys`
 - `mpoly`/`mp`/`p` -> `poly`
 - `medge` -> `edges`
 - `med`/`ed`/`e` -> `edge`

`MLoop` variables aren't affected because they will be replaced
when they're split up into to arrays in #104424.
2023-03-01 15:58:01 -05:00
0f61497e20 Cleanup: Use spans for mesh render data
This offers overflow checking in debug builds, avoids implicit
conversion to pointers, slicing features for future convenience,
and clarifies ownership. Also switch naming to plural like most
other arrays for further clarification.
2023-03-01 15:58:01 -05:00
f1f47df56b Cleanup: Remove unused variable 2023-03-01 15:58:01 -05:00
2324eb4f8c Fix: Use of uninitialized variable after recent cleanup 2023-03-01 15:58:01 -05:00
d939ecc46f Cleanup: Access mesh data with spans
Similar to cb62ab5b28, in newly C++ files.
2023-03-01 15:58:01 -05:00
7ca63d40dc Revert #105225: WM Check for lack of active window
This check is no longer needed as Campbell has removed the need to
pass around the active window.  This check could potential be error-
hiding so best removed if not needed.

Pull Request #105351
2023-03-01 21:44:41 +01:00
59b9bb0849 Draw: Custom IDs
This pull request adds a new tipe of resource handles (thin handles).
These are intended for cases where a resource buffer with more than one
entry for each object is needed (for example, one entry per material
slot).
While it's already possible to have multiple regular handles for the
same object, they have a non-trivial overhead in terms of uploaded
data (matrix, bounds, object info) and computation (visibility
culling).
Thin handles store an indirection buffer pointing to their "parent"
regular handle, therefore multiple thin handles can share the same
per-object data and visibility culling computation.

Thin handles can only be used in their own Pass type (PassMainThin),
so passes that don't need them don't have to pay the overhead.

This pull request also includes the update of the Workbench Next
pre-pass to use PassMainThin, which is the main reason for the
implementation of this feature.

The main change from the previous PR is that the thin handles are now
stored directly in the main resource_id_buf, to avoid wasting an extra
 bind slot.

Pull Request #105261
2023-03-01 21:42:25 +01:00
03f17c42d0 Fix #100129: Status bar incorrectly shows "[G] Move" after pressing G
Add specific modal keyitem for `Vert/Edge Slide` and `TrackBall`.
So they don't need to reuse modal items from other operators.

Note that there is a workround to avoid repeated keys in the status bar.
2023-03-01 16:06:20 -03:00
515cb14056 Fix: Don't create undo step for empty box select in VSE
In `gesture_box_apply`, check if `exec` function returns
`OPERATOR_CANCELLED` and return 0 to prevent any undo items from being
created.

Pull Request #105065
2023-03-01 18:47:46 +01:00
d449539cd2 Cleanup: Move five modifier files to C++
See #103343

Pull Request #105345
2023-03-01 17:32:12 +01:00
4d58f01424 Add LSAN suppression rules config file.
This file has been tested on linux, other platforms may need some
tweaks, and/or dedicated files.

This is used to suppress errors with builds integrating ASAN sanitazing
tools, regarding memleaks detected in some third party libraries.

To use it, define the envvar option like that:

`LSAN_OPTIONS=print_suppressions=false:suppressions=/path/to/blender/source/tools/config/analysis/lsan.supp`

This is especially usefull when running ctest.

NOTE: Will also update https://wiki.blender.org/wiki/Tools/Tests/Setup
and https://wiki.blender.org/wiki/Tools/Debugging/ASAN_Address_Sanitizer
accordingly.
2023-03-01 16:24:59 +01:00
3006140718 Refactor: Replace DNA_DEPRECATED attribute with _legacy suffix
Applied for the motion tracking data data structures.

There are two advantages of doing so:

- More explicit and platform independent way of indicating that
  something is legacy and is not to be accessed outside of the
  versioning code.

- Simplifies conversion to C++ where having deprecated fields
  triggers warning in implicitly defined assign operator.

Pull Request #105340
2023-03-01 15:18:54 +01:00
1ba0494e33 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.
2023-03-01 15:17:33 +01:00
3ff2cbe708 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-01 15:17:33 +01:00
565acb639c WM: use the window associated with an area for initialization
The active window was used by the NLA and the Graph editor however
this is not always available and not necessarily the window that
contains the area being initialized. Potentially causing the graph and
NLA spaces to be initialized with the wrong scene.

Active window access caused various awkward fixes in the past
([0], [1], [2]) which worked around the active window not being set.
Use a lookup for the window instead of accessing the active window.

Note that passing the window is an option too however this is only
used for versioning older files and is not be needed in most cases.

[0]: 20788e1747
[1]: 42f6aada98
[2]: 480e467ac9
2023-03-02 00:39:29 +11:00
124b41a877 Cleanup: unused variables 2023-03-02 00:39:28 +11:00
cccf91ff83 Mesh: Move edge UV seams to a generic attribute
As part of #95966, move the `ME_SEAM` flag on mesh edges
to a generic boolean attribute, called `.uv_seam`. This is the
last bit of extra information stored in mesh edges. After this
is committed we can switch to a different type for them and
have a 1/3 improvement in memory consumption.

It is also now possible to see that a mesh has no UV seams in
constant time, and like other similar refactors, interacting with
only the UV seams can be done with less memory.

The attribute name starts with a `.` to signify that the attribute,
like face sets, isn't meant to be used in arbitrary procedural
situations (with geometry nodes for example). That gives us more
freedom to change things in the future.

Pull Request #104728
2023-03-01 14:13:05 +01:00
66c9c19466 Cleanup: add missing CMake headers & sort file lists 2023-03-01 22:46:04 +11:00
01e711749b pyproject: remove tools/pyproject.toml
Rely on ./pyproject.toml. This file was only separated because it was in
an external repository.
2023-03-01 22:18:28 +11:00
e1ab9e352c Cleanup: autopep8 2023-03-01 22:12:18 +11:00
bd0aa88909 Fix invalid path references after moving tools & scripts 2023-03-01 22:00:46 +11:00
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
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
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
e35afd8a1d Merge branch 'blender-v3.5-release' 2023-03-01 21:16:37 +11:00
e9fefcd298 Merge branch 'blender-v3.5-release' 2023-03-01 21:16:33 +11:00
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
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
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
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
09c4d6bd7b Cleanup: avoid looping over layer collections again when freeing 2023-03-01 15:14:50 +11:00
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
e65671c1ed Merge branch 'blender-v3.5-release' 2023-03-01 11:21:02 +11:00
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
6fe2fabbff Merge branch 'blender-v3.5-release' 2023-02-28 17:47:10 -05:00
71a79a7a7c Cleanup: Small cleanups to flip faces node
Decrease indentation, simplify variable names, use IndexRange more.
2023-02-28 17:30:25 -05:00
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
f2ea7ae751 Fix #105319: Crash in weighted normal modifier after recent cleanup 2023-02-28 16:44:26 -05:00
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
eb5e7b1b4e Merge branch 'blender-v3.5-release' 2023-02-28 15:39:55 -05:00
f911a9280b Merge branch 'blender-v3.5-release' 2023-02-28 14:03:22 -05:00
4ffae99d6d Cleanup: Remove unnecessary declarations in laplacian smooth modifier 2023-02-28 13:03:42 -05:00
08e20376b1 Cleanup: Use simpler for loop syntax for mesh polys in two modifiers 2023-02-28 13:03:42 -05:00
62c6eb12bf Fix #105165: Weighted normal modifier crash after recent cleanup
Mistake in cb62ab5b28
2023-02-28 13:03:42 -05:00
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
8fbc80be8f Merge branch 'blender-v3.5-release' 2023-02-28 11:36:20 -05:00
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
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
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
5edca02d08 Fix cage2d gizmo setting uniform size when uniform scaling is required 2023-02-28 13:00:20 +01:00
0786b05175 Cleanup: More clear variable name in File Browser drawing 2023-02-28 11:29:59 +01:00
09e848deec Cleanup: use term "filepath" instead of "name" / "fname" 2023-02-28 17:31:08 +11:00
707af21afd Merge branch 'blender-v3.5-release' 2023-02-28 17:14:02 +11:00
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
c2df623e86 Merge branch 'blender-v3.5-release' 2023-02-28 16:01:42 +11:00
1e6aaf5f65 Merge branch 'blender-v3.5-release' 2023-02-28 16:01:26 +11:00
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
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
cca5f18303 Fix path for check_mypy_config 2023-02-28 15:11:27 +11:00
466d160424 Cleanup: replace an integer array with booleans for RNA type validation 2023-02-28 14:53:48 +11:00
9ac0cc48b9 Cleanup: use _ separator for variable names including dummy
Names such as `dummyult` and `dummyet` didn't read very well,
underscore separate these names.

Also rename some variables that used old conventions which missed
being updated (`mpr` for manipulator instead of `gz` for gizmo).
2023-02-28 14:39:41 +11:00
6d5e834857 Merge branch 'blender-v3.5-release' 2023-02-28 14:11:25 +11:00
4675ee3c73 Merge branch 'blender-v3.5-release' 2023-02-28 10:31:07 +11:00
a58caeb4b3 Cleanup: quiet struct declaration warning 2023-02-28 10:17:17 +11:00
e4f0e29bab Merge branch 'blender-v3.5-release' 2023-02-28 10:12:51 +11:00
cb1af1fbd9 UV: Migrate UV packing from Editor to bf_geometry.
No functional changes.

Pull Request #105212
2023-02-27 22:41:10 +01:00
c3d803c2ef Cleanup: Use consistent "positions" term for mesh update tag functions
Consistent with naming from 1af62cb3bf. Keep the "coord"
naming in the "vert_coords_alloc" set of functions since they should be
removed (see #103789).
2023-02-27 16:08:48 -05:00
b37111c574 Cleanup: Use consistent "vert" term for mesh normals
Use "vert" instead of "vertex" when referring to mesh normals. This was
discussed as part of 1af62cb3bf but never completely
implemented.
2023-02-27 15:52:29 -05:00
baa27d0aef Fix: Explode modifier cycles test failure after recent cleanup
Caused by 96abaae9ac. Just keep the old argument
in the `_ex` version of the function for now. It can be removed
when the explode modifier is removed in 4.0.
2023-02-27 15:29:52 -05:00
5ea41a9942 UI: Added Edge Width option in preferences for 3DView and UV/Image Editor
Previously [D16255](https://developer.blender.org/D16255)
There is no option to adjust the edge_width like there is in the preferences for vertex_size and face_dot_size.

I only added the option for 3DView and UV/Image Editor, and limited both to a max size of 5 pixel, since the edges do not look very nice with too high values.
In the UV Editor only, there are always black outlines on the edges, I could not find a way to reduce the increasing thickness of these black outlines.

The default edge_width of 1 pixel:

![shows the marked new attribute with a value of 1 in the settings for the UV/Imageeditor](/attachments/f48fc1e5-2b49-4337-bd86-f2ad4aca42c3)

Here the edge_width with a falue of 3:

![shows the marked new attribute with a value of 3 in the settings for the UV/Imageeditor](/attachments/d0b0b1ea-5967-46b2-80a2-ccae18933638)

And here the visible increase of the dark border of the edges and their overlap (even at the maxed size of 5):

![shows the marked new attribute with a value of 5 in the settings for the UV/Imageeditor and points out the thicker border in the left side UV Editor](/attachments/1590965f-af2a-49d0-a11e-1afecaabf940)

Lastly for the 3DView the max edge_width of 5 looks like this:

![shows the marked new attribute with a value of 5 for the settings for the 3DView and it's resulting wider lines in the right side visible 3DView](/attachments/fcd35341-97a5-4db6-8bbf-c5ce5333e5aa)

Pull Request #104741
2023-02-27 20:02:37 +01:00
f37077ae5a Mesh: Clear loose edges bitmap with count of zero
When there are no loose edges, the loose edge bitmap shouldn't be used.
That was already documented in the loose edge storage struct, but the
bit vector wasn't actually cleared.
2023-02-27 13:09:45 -05:00
52104c1a0c Mesh: Avoid recalculating bounds after some operations
Share the bounds cache across the input and output meshes of some
mesh operations that don't change the min and max positions: simple
subdivision, edge/face deletion, and triangulation. If the source mesh's
bounds are computed, or if the mesh is persistent, this can save
recalculation of the bounding box, which takes a few milliseconds
for large meshes.
2023-02-27 12:31:09 -05:00
96abaae9ac Cleanup: Remove legacy argument from mesh creation functions
The legacy `tessface_len` argument was only used for the explode
modifier. Remove it and copy the legacy face data manually there.
2023-02-27 11:24:22 -05:00
494becdec9 Cleanup: Remove redundant parenthesis 2023-02-27 16:56:46 +01:00
17e92711d3 UI: Refactor path dropping so logic doesn't depend on icons
No behavior change intended.

Many file drag & drop handlers used the icon assigned for dragging to
determine what type of data is dragged. This is fragile, for example
changing an icon would break drag & drop (!). This happened a few times,
e.g. see 3788003cda. It's also causing problems with #104830, which
changes how file browser drag data is handled.

Instead use the file extension to determine the file type.
2023-02-27 16:44:47 +01:00
1d4abfb537 Merge remote-tracking branch 'upstream/blender-v3.5-release' 2023-02-27 16:28:23 +01:00
5bd63e0fa5 Merge remote-tracking branch 'upstream/blender-v3.5-release' 2023-02-27 16:20:18 +01:00
d69e2dba34 Merge branch 'blender-v3.5-release' 2023-02-27 16:14:43 +01:00
0ade3dfc14 Merge branch 'blender-v3.5-release' 2023-02-27 15:23:56 +01:00
8cc11bc5f2 Fix #105226: Transform Gizmo with tncorrect offSets
Error in Commit a85b62bbc

Offsets were incorrectly being accumulated.
2023-02-27 11:09:22 -03:00
07f5d9bf2a Merge branch 'blender-v3.5-release' 2023-02-27 14:13:29 +01:00
c79c35b4d3 Merge branch 'blender-v3.5-release' 2023-02-27 14:02:56 +01:00
b558fff5b8 Outliner: New Grease Pencil filter
Actually is impossible to filter the Grease Pencil object type in the Outliner because only Meshes, Cameras and Lights are supported. This patch adds the Grease Pencil filter that allows artists to select only this type of objects. This filter is very handy for storyboarding.

Pull Request #104473
2023-02-27 13:07:14 +01:00
8aedc03aa2 Vulkan: Calculate Correct Host and Device Memory Size.
Due to an error in GPU module we fixed the memory size in the
Vulkan backend. Last week the error has been fixed in the GPU module
so we can remove the temp fixes in the Vulkan backend.

Pull Request #105244
2023-02-27 12:56:05 +01:00
1812f5cb92 Merge branch 'blender-v3.5-release' 2023-02-27 12:03:42 +01:00
f6c9fb27d5 Cleanup: remove .orig file added by accident 2023-02-27 21:52:26 +11:00
efb86b75ee Cleanup: comment block formatting 2023-02-27 21:51:57 +11:00
f240a16037 Cleanup: format 2023-02-27 21:34:53 +11:00
9a1ab6bd14 Cleanup: function style casts for C++, use nullptr 2023-02-27 21:34:53 +11:00
347cbbff2d Fix path in check_licenses utility 2023-02-27 21:34:53 +11:00
16aab1508d Cleanup: comment out unused parameters from last commit 2023-02-27 02:04:55 -08:00
08af0f1204 Fix setting the active vertex color when assigning false
Oversight in c517e4a501.
2023-02-27 21:00:30 +11:00
30db096cc8 Cleanup: quiet compiler warnings 2023-02-27 21:00:30 +11:00
dc08ff3c2e Cleanup: spelling in comments 2023-02-27 21:00:30 +11:00
40a11c7404 Merge branch 'blender-v3.5-release' 2023-02-27 10:59:30 +01:00
b4ee936627 Sculpt: Add support for last operator panel to color filter operator
* Refactored the color filter op to have an ->exec callback.
* Added nullptr checks to the filter cache API to support
  running outside of a view3d context.
* Redo panel displays the active filter type's name in the
  header.
2023-02-27 01:51:36 -08:00
6c03339e48 Cycles: reduce mesh memory usage by unflattening
To improve mesh upload speeds and reduce the size of the scene data which allows larger scenes to be rendered.

The meshes in Cycles are currently stored as flattened meshes, where each triangle is stored as a set of 3 vertices. Unflattening writes out the vertices in a list according to the index buffer. This uses a lot of memory and for current hardware does not provide a noticeable benefit. This change unflattens the mesh by directly using the meshes vertex and index buffers directly and skips the unflattening. This change allows for larger scenes and also a reduction in the sizes of the meshes. Further it results in a decrease the amount of time it takes to upload the data to a GPU. This is especially important for when multiple GPUs are used in a single machine.

Pull Request #105173
2023-02-27 10:39:19 +01:00
79d64bfde3 Geometry Nodes: Remove unnecessary position copying in delete node
In Edges and Edges & Faces modes, the node copied the positions once
with the other generic attributes and another time specifically just as
the positions. This is now unnecessary since positions are stored as
a generic attribute (1af62cb3bf). In a simple test this saved
2ms out of a total 12 in these modes.
2023-02-26 22:16:58 -05:00
ca2c0da79e Merge branch 'blender-v3.5-release' 2023-02-26 18:09:18 -05:00
3b59163b02 Subdiv: Simplify final vertex counting
The initial subdivision context counting ended up using unnecessarily
complicated logic to count the number of final vertices. In a first pass
it added vertices for every coarse edge. Then it added the same number
of vertices for every loose edge. That adds up to the same number of
vertices for the edges, so the separation is redundant and can be
replaced with a single multiplication.

The bitmap doesn't need to be cleared then, since it isn't used now.

In a test of a mesh with 2 million faces and 3 million vertices, this
saved 2.8ms (though the whole subdivision process takes around 700ms).

Pull Request #105159
2023-02-26 23:57:49 +01:00
8b543bfa3a Merge branch 'blender-v3.5-release'
# Conflicts:
#	source/blender/gpu/metal/mtl_immediate.mm
2023-02-26 17:44:31 +01:00
bf27a239c7 Fix: segfault when setting value in empty bit span 2023-02-26 17:26:12 +01:00
9335150f8c Cleanup: move some function implementations out of header
It's not really worth having them in the header and compiling them
in every translation unit where they are used.
2023-02-26 17:26:12 +01:00
54f672cbfa #99807: USD IO: Add support for exporting to USDZ
This commit adds the default .usdz export capability.

The importer already supports usdz so no change is required other than updating the text in menu to match the updated exporter text.

On export, a .usd/a/c file has to be created first, and then converted to .usdz. A weird change of directory is required because of a quirk with the USD conversion to usdz. If an absolute filepath is passed into the `UsdUtilsCreateNewUsdzPackage` function, the usd files inside the usdz archive will have the same directory structure, i.e. if one tries to create a file at `C:\code\BlenderProjects\file.usdz`, when the usdz file is created, inside it will have the structure `\code\BlenderProjects\file.usdc`.

This is counteracted by setting the current working directory to the temporary session directory where both the usdc and usdz files are created, and just passing the file name to `UsdUtilsCreateNewUsdzPackage` without any filepath. Once the usdz file is created it is moved to the intended directory.

There is a separate `UsdUtilsCreateNewARKitUsdzPackage` capability for exporting usdz for iOS devices that will be implemented in a follow up patch as it will require some more small UI changes.

Co-authored-by: Charles Wardlaw (@CharlesWardlaw)
Co-authored-by: Sonny Campbell (@SonnyCampbell_Unity)
Co-authored-by: Bastien Montagne (@mont29)

Pull Request #105185, based on #104556.
2023-02-26 16:36:49 +01:00
ec6e7d97ca Fix OSX implementation of BLI_current_working_dir and improve tests.
While some implementations of `getcwd` may return an allocated string
instead of the given char buffer in some cases, this is not the expected
behavior of the BLI wrapper. Not to mention the danger of returning a
pointer to a static char buffer...

Improve `ChangeWorkingDirectoryTest` to be more 'full check' regarding
behavior of both `BLI_current_working_dir` and `BLI_change_working_dir`.
Also move call to `BLI_threadapi_init` into proper `SetUp` method (to
have correct symmetry with the call to `BLI_threadapi_exit` in the
`TearDown` one).

Based on investigation by Charles Wardlaw (@CharlesWardlaw).

Pull Request #105220
2023-02-26 15:52:19 +01:00
86ceb6722f Cleanup: format 2023-02-26 11:55:22 +13:00
52ded6ab56 GPUTexture: Make sure all available texture format are supported
This remove default casses from the `switch` statements to catch where
the missing cases are.

Uncomment unimplemented cases for the sake of completeness. Improving the
overall API.

This make the format conversion lists exhaustive and documented.

This replace `validate_data_format_mtl` by the common version as they
don't differ at all now.
2023-02-25 21:47:00 +01:00
5b2b114a2a Fix #105198: Ensure Frame and Reroute nodes are searchable
Set the new `gather_add_node_search_ops` member for these two special
node types.

Pull Request #105201
2023-02-25 21:32:23 +01:00
7eef746270 Merge branch 'blender-v3.5-release' 2023-02-25 23:13:05 +05:30
afb6336857 Workbench: Remove unecessary GPU_TEXTURE_USAGE_ATTACHMENT flag
The dummy 3D textures are read only and never used as framebuffer targets.
2023-02-25 13:13:21 +01:00
9fb1f32f06 Cleanup: GPUTexture: Remove _ex suffix from texture creation
It isn't relevant anymore now that usage flags are mandatory.

Pull Request #105197
2023-02-25 11:39:54 +01:00
3d6578b33e GPUTexture: Add texture usage flag to all texture creation
All usages are currently placeholder GPU_TEXTURE_USAGE_GENERAL.
2023-02-25 11:39:53 +01:00
e01b140fb2 GPUTexture: Remove data_format from 3D texture creation function
For every other texture types this is expected to be implicitly
`GPU_DATA_FLOAT`. There is only one case where this is not the case.

I believe this was previously needed because the data type was
conditionning the texture creation. This is not the case anymore.
2023-02-25 11:39:53 +01:00
75e3371aef GPUTexture: Remove obsolete GPU_texture_bind_ex argument set_number
This was previously used when the binding number wasn't always stored
inside the texture itself.
2023-02-25 11:39:53 +01:00
73da5ee90d Cleanup: GPUTexture: Rename some functions with more descriptive names
List of renames:
GPU_texture_generate_mipmap > GPU_texture_update_mipmap_chain
GPU_texture_orig_width > GPU_texture_original_width
GPU_texture_orig_height > GPU_texture_original_height
GPU_texture_orig_size_set > GPU_texture_original_size_set
GPU_texture_format_description > GPU_texture_format_name
GPU_texture_array > GPU_texture_is_array
GPU_texture_cube > GPU_texture_is_cube
GPU_texture_depth > GPU_texture_has_depth_format
GPU_texture_stencil > GPU_texture_has_stencil_format
GPU_texture_integer > GPU_texture_has_integer_format
2023-02-25 11:39:53 +01:00
584e514561 Cleanup: GPUTexture: Improve function parameters name 2023-02-25 11:39:53 +01:00
7974557f0b GPUTexture: Add header documentation and reorganize sections 2023-02-25 11:39:53 +01:00
6166dac3ee Gizmo: support scaling of light gizmos with zero size
Zero-sized gizmos were not shown because GPU does not draw filled
triangles with zero area. This problem is resolved by drawing lines or
points in these degenerated cases.
Scaling is supported via computing the original and the new size, then
treat the case with zero original size separately, instead of only
computing the scale itself.
Actually applies to all `cage2d` gizmos, but not compatible when
translate flag is set.
2023-02-24 22:54:24 +01:00
0f09678036 Merge branch 'blender-v3.5-release' 2023-02-24 11:47:39 -08:00
6cd9604a91 Merge branch 'blender-v3.5-release' 2023-02-24 11:10:56 -08:00
e3538546f2 Merge branch 'blender-v3.5-release' 2023-02-24 22:36:18 +05:30
12cc3ccd72 Merge branch 'blender-v3.5-release' 2023-02-24 17:09:29 +01:00
be94fefeb1 Merge branch 'blender-v3.5-release' 2023-02-24 16:43:17 +01:00
45bbee340e Cleanup: Draw Manager: Update outdated comment 2023-02-24 16:30:10 +01:00
30efdbfc62 Merge branch 'blender-v3.5-release' 2023-02-24 16:27:26 +01:00
3e0a1cafa7 Merge branch 'blender-v3.5-release' 2023-02-24 15:53:18 +01:00
d5e45c8b92 Merge branch 'blender-v3.5-release' 2023-02-24 13:20:39 +01:00
ac93598dd1 Fix #105011: Cannot remove user preset when its name is translated
The preset names were translated before building the UI. This meant
that the translated name was passed to the operator responsible for
deleting the preset file, instead of the original name.

Pull Request #105155
2023-02-24 03:39:08 -08:00
2491cd5e16 Cleanup: Move two subdiv headers to C++ 2023-02-23 18:30:47 -05:00
cfb112edcb UI: Widen Search Boxes When Necessary
Make floating search boxes wider when there is a linked scene or are
otherwise showing more information than a simple list.

Pull Request #104603
2023-02-24 00:07:16 +01:00
470e8ce1f4 BLF: Revert Glyph Clipping Changes
Revert #104679. We are just too used to the old behavior, especially
the incorrect vertical clipping. Some uses rely on setting the min and
max of the clipping rect the same. Will have to revisit this later
to only correct for horizontal positioning for full hinting.

Pull Request #105157

Own Code.
2023-02-23 23:44:17 +01:00
1b72712283 Fix: Global buffer overflow of enum property items on startup
RNA enum items arrays need to end with a null entry.
2023-02-23 15:53:10 -05:00
5b1f94f05a Fix: Use of uninitialized mesh size variables after recent cleanup 2023-02-23 15:52:42 -05:00
c065e8dd7f Merge branch 'blender-v3.5-release' 2023-02-23 15:31:29 -05:00
2bd097a58d Fix: Debug build failure and warnings after recent cleanup commit 2023-02-23 13:21:24 -05:00
4369627e71 Mesh: replace 'BKE_mesh_merge_verts' algorithm
Blender currently has 2 algorithms for merging vertices:
- `BKE_mesh_merge_verts`;
- `blender::geometry::create_merged_mesh`

`BKE_mesh_merge_verts` has a simplified algorithm to work with Array,
Mirror and Screw modifiers. It doesn't support merge results that would
create new faces. However it has shortcuts to be more efficient in
these modifiers.

`blender::geometry::create_merged_mesh` tries to predict all possible
outcomes. So it's a more complex. But it loses in performance to
`BKE_mesh_merge_verts` in some cases.

The performance comparison between these two depends on many factors.
`blender::geometry::create_merged_mesh` works with a context that has
only the affected geometry. Thus a smaller region of the mesh is read
for duplicate checking. Therefore, the smaller the affected geometry,
the more efficient the operation.

By my tests `blender::geometry::create_merged_mesh` beats
`BKE_mesh_merge_verts` when less than 20% of the geometry is affected
in worst case `MESH_MERGE_VERTS_DUMP_IF_EQUAL` or 17% in case of
`MESH_MERGE_VERTS_DUMP_IF_MAPPED` .

For cases where the entire geometry is affected, a 30% loss was noticed,
largely due to the creation of a context that represents the entire mesh.

Co-authored-by: Germano Cavalcante <germano.costa@ig.com.br>
Pull Request #105136
2023-02-23 19:10:01 +01:00
8e50539f1b Merge branch 'blender-v3.5-release' into main 2023-02-23 17:26:52 +01:00
b88428a301 Fix: Frame Channel when using normalized view
When using the frame channel operators from #104523
the framing would fail under the following circumstance.
* In the graph editor
* Using normalized view
* with a curve that has a y-extent of less than the focus threshold of 0.01

The issue was the the clamping code was
before the normalization multiplication.

Pull Request #105121
2023-02-23 17:23:03 +01:00
8a8c1988bd Fix: Using "Frame Channel" in Dope sheet resets view to top
When using the "Frame Channel" operator in the Dope Sheet
the view would always go back to the top.

Fix it by copying the y bounds when in the Dope Sheet.

Pull Request #105123
2023-02-23 17:17:26 +01:00
cb62ab5b28 Cleanup: Access mesh edges, faces, and loops with spans
Using spans instead of raw pointers helps to differentiate ararys from
pointers to single elements, gives bounds checking in debug builds, and
conveniently stores the number of elements in the same variable.

Also make variable naming consistent. For example, use `loops` instead
of `mloop`. The plural helps to clarify that the variable is an array.

I didn't change positions because there is a type mismatch between
C and C++ code that is ugly to manage. All remaining code can be
converted to C++, then that change will be simpler.

Pull Request #105138
2023-02-23 17:14:03 +01:00
a74fd9f2ae Cleanup: Remove unnecessary copying of mesh data outside CustomData
This code seems to be left over from before edges, polys, and loops were
stored in CustomData. They are already copied by the CustomData copy
calls directly above, which already deal with every other layer.
2023-02-23 17:14:02 +01:00
1851a69014 Merge branch 'blender-v3.5-release' 2023-02-23 15:57:34 +01:00
6403bc28cd Merge branch 'blender-v3.5-release' 2023-02-23 15:16:33 +01:00
25a5ff7670 Merge branch 'blender-v3.5-release' into main 2023-02-23 14:57:40 +01:00
afd0ab5cce Vulkan: Initial VKUniformBuffer.
Only supports uploading data to a uniform buffer.
Requirement for push constants #104880.

Pull Request #105129
2023-02-23 14:51:34 +01:00
f5c0b2433f Vulkan: Resolve Builtin Uniform(Block).
Resolving builtin uniforms and uniform blocks when creating
shader interface. This maps builtin uniforms to uniforms
defined by the shader. Works the same as the OpenGL
builtin uniforms.

Pull Request #105128
2023-02-23 14:50:49 +01:00
90f5b2f0ce Vulkan: Get access to physical device limits.
This patch will give access to the physical device limits
of the device associated with the context. In vulkan each
device has different limits and the application is
responsible to match these limits as the vulkan driver
just ignores calls that don't match these limits.

Those limits are GPUBackend specific and therefore are not
added to GPU_capabilities.

Pull Request #105125
2023-02-23 13:47:29 +01:00
78a54f23db Merge branch 'blender-v3.5-release' 2023-02-23 13:30:53 +01:00
e2ba7f902d Merge branch 'blender-v3.5-release' 2023-02-23 13:15:44 +01:00
f93f743ffc Fix #105043: Add shortcut for proportional editing 2023-02-23 12:24:23 +01:00
c8ed48d5ca Merge remote-tracking branch 'origin/blender-v3.5-release' 2023-02-23 11:28:02 +01:00
4cd00b1a71 Merge branch 'blender-v3.5-release' 2023-02-23 10:44:54 +01:00
7267682017 Animation: Paste Keys in Graph Editor with value offset
Extend the `GRAPH_OT_paste` operator with an enum to define the value offset.

Options are:

| Option              | Effect                                                                        |
| ------------------- | ----------------------------------------------------------------------------- |
| No Offset           | use the same key values as the copied keys                                    |
| Cursor Value        | align the leftmost key with the cursor value                                  |
| Current Frame Value | Evaluate the curve under the cursor align the leftmost key with it            |
| Right Key           | Align the rightmost key with the first key that is to the right of the cursor |
| Left Key            | Align the leftmost key with the first key that is to the left of the cursor   |

Pull Request #104512
2023-02-23 09:46:47 +01:00
8756671084 Animation: Add Slider operators to hotkey menu
Before that patch, the slider operators for the Graph Editor are not easily accessible since they don't have a hotkey.
This adds the "d" hotkey for the already existing slider operator menu.

Using the popup menu means that your last used operator will always be under the cursor, so it's quick to access.

Pull Request #104530
2023-02-23 09:29:18 +01:00
ddcf718640 Sculpt: Fix #104475, data transfer not respecting vgroup for float colors
This might've been a merge error, the result of color mixing
was being overwritten by a simple copy of source to destination
inside of layerCopyValue_propcol.
2023-02-22 23:31:44 -08:00
45731fd987 Refactor: Weight Paint Select Linked Faces
When implementing the operator to select linked vertices in weight paint mode, the new `AtomicDisjointSet` was used.
In order to keep the code consistent, and also prepare it to add things like Extending/Shrinking selection, the select linked faces logic was also updated.

It now also makes use of the `AtomicDisjointSet` by connecting all edges of each poly. In order to find connecting Faces you then have to check if edges of that poly share a connection.

Pull Request #104577
2023-02-23 08:26:32 +01:00
4eb90fc15c Sculpt: Fix #104618 (again).
SculptAttributeParams.stroke_only wasn't being
applied to existing attributes properly.
2023-02-22 23:04:53 -08:00
7f256e0d33 Sculpt: fix 104174, clicking over empty space always pushes undo.
This was actually caused by two problems.  The first is that the
code actually deliberately detects if nothing happened and pushed
an undo step, a bugfix for a problem that no longer exists.

The second was that SCULPT_test_location sometimes does a closest
point search instead of ray casting and didn't check the result
against the brush radius.
2023-02-22 22:37:28 -08:00
e497a50aa2 Merge branch 'blender-v3.5-release' 2023-02-22 21:03:17 +01:00
8693f1fdd2 Merge branch 'blender-v3.5-release' 2023-02-22 13:36:04 -05:00
defd95afcd Win32: Auto-Raise and -Focus Windows on Hover
On the Windows platform, raise windows and give them focus as the mouse
hovers over them. This allows keyboard shortcuts for the area under the
mouse without having to click the window caption to make them active.

Pull Request #104681
2023-02-22 10:26:43 -08:00
54fa3b124f BLF: Glyph Clipping Corrections
Improvements to how glyphs are tested against the font clipping rect.

Pull Request #104679
2023-02-22 10:00:37 -08:00
967662eda4 Merge branch 'blender-v3.5-release' 2023-02-22 18:50:54 +01:00
915e436574 Merge branch 'blender-v3.5-release' 2023-02-22 18:43:17 +01:00
775b51a847 Merge branch 'blender-v3.5-release' 2023-02-22 17:38:59 +01:00
cbb4f8a9ba UI: Add color selector to Bone Groups list
Expose the color selector on each item in the list, so it's easier to see
at a glance the Bone Groups color theme and change it.

Also avoids having color widgets grayed out when not in Custom Colors mode.

Pull Request #105036
2023-02-22 17:34:44 +01:00
Sonny Campbell
1b7076bd4f USD import: extract read_mesh params into a struct.
This is a small initial refactor to extract the
USDGeomReader::read_mesh parameters into a separate struct.
This will allow for adding extra parameters to handle importing
velocities for #104462 which was brought over from

https://archive.blender.org/developer/D15430

Original patch was being reviewed here:

https://archive.blender.org/developer/D15435

Pull Request 104459
2023-02-22 11:22:48 -05:00
d58e422ac3 UI: Properly cancel dragging on escape or right-click
This is refering to drag & drop within Blender which is using the
drop-box system.

Previously Escape would cancel the dragging, but still pass on the event
to other event handlers, which could trigger other behavior. For example
cancelling dragging a file in a file browser dialog would also cancel
the file browser operation and close the window. Right-click didn't
cancel anything even though we usually use both Escape and right-click
as a way to cancel the operation.

Now both escape and right-click both cancel the dragging and the event
is not passed on further.

Pull Request: #104838
2023-02-22 16:54:07 +01:00
d6a61bc864 Merge branch 'blender-v3.5-release' 2023-02-22 15:27:57 +01:00
8c03410ebd Vulkan: Refactor shader interface.
Descriptor set locations are now determined in the
VKShaderInterface. Issues with the previous solution:

- Due to legacy code in GPU module the locations/bindings
  must be the same. Using one for something else might
  result in undesired lookups, incorrect resource
  bindings.
- Images/Textures reuses the same namespace, that didn't
  work as expected when looking up the resources via
  its binding.

This refactoring is required for adding support for
push constants.

Pull Request #105073
2023-02-22 14:42:01 +01:00
709013dca4 Cleanup: Move rna_access.c to C++
See #103343

Pull Request #105060
2023-02-22 14:04:57 +01:00
140a663f6f Cleanup: Move area.c to C++
See #103343

Pull Request #105061
2023-02-22 14:04:23 +01:00
e1f6587f12 VSE: Add retiming tool
This tools allows to change strip playback speed by manipulating
retiming handles. More handles can be added to single strip to create
variable playback speed.

This tool replaces Speed Factor property in time panel, with exception
of sound strips. Support for sound strips is still in review.

Pull Request #104523
2023-02-22 13:16:32 +01:00
50ebe21dd3 Merge branch 'blender-v3.5-release' 2023-02-22 11:37:42 +01:00
ad124d15e2 Merge remote-tracking branch 'upstream/blender-v3.5-release' 2023-02-22 10:05:03 +01:00
612965497e Curves: Avoid unnecessary allocation when calculating offsets
Arrays for curve handle types were allocated even when there were no
Bezier curves. This saves 0.5ms of the total 0.9ms spent creating the
evaluated curve offsets, which happens every time the topology
of non-poly curves change.
2023-02-21 22:32:36 -05:00
05637254da Cleanup: Use simpler syntax to return panel open status 2023-02-21 21:45:41 -05:00
8b63966236 Revert 104438: Windows Spanning Multiple Monitors
Revert of commits that allowed non-temp Blender windows to be saved
and restored that spanned multiple monitors on the Windows platform.
This causes problems with temp windows (like Preferences & Render) that
cannot currently be fixed.

See 104956 for much more details.

This change is being redone after it was accidentally reverted.

Differential Revision: blender/blender#104956

Reviewed by Ray Molenkamp
2023-02-21 15:45:45 -08:00
b874a0ead8 msgfmt: fix runtime requirements
msgfmt has a TBB dependency though bf_blenlib, now for a release build
The MSVC linker is smart enough to realize none of the TBB code is
actually used and discards it. In debug mode the linker is a bit more
conservative and doesn't, leaving msgfmt with a runtime dependency
on TBB. The problem here is, we only copy the runtime dlls during
the install phase, and msgfmt runs long long before that.

For this reason when we run msgfmt we should make sure any runtime
needs it could have are met in the path, there already is a handy
variable for that since oslc has similar requirements.

Pull Request #105048
2023-02-21 23:00:34 +01:00
7216eb8879 UI: UIList Hover Highlighting
Add mouse hover highlighting for items in UILists, in both list mode
and preview tile mode.

See 104677 for more details

Differential Revision: blender/blender#104677

Reviewed by Brecht Van Lommel
2023-02-21 13:03:17 -08:00
ac160a270f Merge branch 'blender-v3.5-release' 2023-02-21 19:29:13 +01:00
e82d4f1f93 Merge branch 'blender-v3.5-release' 2023-02-21 18:41:43 +01:00
1b96dd535a Merge branch 'blender-v3.5-release' 2023-02-21 17:20:34 +01:00
78825783cc Merge branch 'blender-v3.5-release' 2023-02-21 17:18:47 +01:00
ade37c0212 Merge branch 'blender-v3.5-release' into main 2023-02-21 17:13:43 +01:00
996eb1bd5f Cleanup: Remove unused UV map deletion functions
The attribute API is now used instead.
2023-02-21 10:53:29 -05:00
7fe42ea566 Merge branch 'blender-v3.5-release' 2023-02-21 16:50:35 +01:00
b02778147d Merge branch 'blender-v3.5-release' 2023-02-21 10:46:45 -05:00
ecb88eff7e Merge branch 'blender-v3.5-release' 2023-02-21 16:41:47 +01:00
92dc89e28a Fix tests for macOS storage_apple.mm functions.
Pull Request #105000
2023-02-21 16:06:42 +01:00
6a5caf9d88 Vulkan: Fix mismatch in shader and resource types. 2023-02-21 15:36:11 +01:00
e9f8020f75 Cleanup: added empty line between methods. 2023-02-21 15:36:11 +01:00
a55e38e05d Fix duplicated code after merge from release branch
a280554b75 was committed to fix this in main, b5fa180d5d for the release
branch. Only one is needed though :)
2023-02-21 15:27:51 +01:00
7fb1f060ff Vulkan: Initial Compute Shaders support
This patch adds initial support for compute shaders to
the vulkan backend. As the development is oriented to the test-
cases we have the implementation is limited to what is used there.

It has been validated that with this patch that the following test
cases are running as expected
- `GPUVulkanTest.gpu_shader_compute_vbo`
- `GPUVulkanTest.gpu_shader_compute_ibo`
- `GPUVulkanTest.gpu_shader_compute_ssbo`
- `GPUVulkanTest.gpu_storage_buffer_create_update_read`
- `GPUVulkanTest.gpu_shader_compute_2d`

This patch includes:
- Allocating VkBuffer on device.
- Uploading data from CPU to VkBuffer.
- Binding VkBuffer as SSBO to a compute shader.
- Execute compute shader and altering VkBuffer.
- Download the VkBuffer to CPU ram.
- Validate that it worked.
- Use device only vertex buffer as SSBO
- Use device only index buffer as SSBO
- Use device only image buffers

GHOST API has been changed as the original design was created before
we even had support for compute shaders in blender. The function
`GHOST_getVulkanBackbuffer` has been separated to retrieve the command
buffer without a backbuffer (`GHOST_getVulkanCommandBuffer`). In order
to do correct command buffer processing we needed access to the queue
owned by GHOST. This is returned as part of the `GHOST_getVulkanHandles`
function.

Open topics (not considered part of this patch)
- Memory barriers & command buffer encoding
- Indirect compute dispatching
- Rest of the test cases
- Data conversions when requested data format is different than on device.
- GPUVulkanTest.gpu_shader_compute_1d is supported on AMD devices.
  NVIDIA doesn't seem to support 1d textures.

Pull-request: #104518
2023-02-21 15:04:52 +01:00
02c2970983 Cycles: add NanoVDB support for Metal on Apple Silicon
Contributed by Yulia Kuznetcova at Apple.

NanoVDB is patched to give add address spaces required by Metal. We hope that
in the future Metal will support the generic address space.

For AMD and Intel this is currently not available since it causes a performance
regression also on scenes without volumes.

Pull Request #104837
2023-02-21 15:03:52 +01:00
8b8d8acc84 Merge branch 'blender-v3.5-release' 2023-02-21 08:45:46 -05:00
68a8f96cca Merge branch 'blender-v3.5-release' 2023-02-21 13:21:13 +01:00
a280554b75 Fix new essentials asset library not being covered in library path query 2023-02-21 12:20:09 +01:00
a91c6e71db Brush: Add writing and reading ID preview for Brushes.
Mandatory change for the Brush Assets project, from quick test does not
seem to break anything (more) in existing 'old' brushes...

Re. #101908.

Pull Request #105016
2023-02-21 12:15:33 +01:00
fdf6252b5a Merge branch 'blender-v3.5-release' 2023-02-21 12:04:30 +01:00
6eccea7a6f Gitea: more updates for new scoped label syntax 2023-02-21 11:16:52 +01:00
5b0cb65a56 Gitea: update for new scoped label syntax 2023-02-21 11:13:22 +01:00
8a135a9a5f Curves: Add cursor snapping support
This adds support for cursor snapping for the new curves object.

It implements a function `transverts_from_curves_positions_create` (to separate the logic from the `Curves` object type). That function is then C wrapped by `ED_curves_transverts_create` and finally used in `ED_transverts_create_from_obedit`.

Pull Request #104967
2023-02-21 11:04:40 +01:00
ad7f8a1fa5 Merge branch 'blender-v3.5-release' 2023-02-21 11:02:30 +01:00
e1b58be9e2 Merge branch 'blender-v3.5-release' 2023-02-21 10:17:13 +01:00
c38cac9682 Merge branch 'blender-v3.5-release' into main 2023-02-21 10:05:50 +01:00
4ab91dc0c9 Fix: Channel clamping when markers are used
Previously when markers were used, the newly introduced clamping code (#104516) would stop the last channel from being shown.

This patch fixes that by modifying the `v2d->tot.ymin` calculation.

This is a bit counterintuitive since the `v2d->tot` height is calculated in `action_draw.c`. But the advantage of doing it there is that it also works for the channels region.

Pull Request #104892
2023-02-21 09:23:59 +01:00
2d34a09043 Tests: Address imbuf_save failures on ARM64 builds
This does 2 things to address the ARM64 failures:
- Increases the threshold to be inline with what Cycles uses
- Disables the 2 problematic WebP variations (#105006 will track)
2023-02-20 21:36:19 -08:00
ece43dd716 Cleanup: format 2023-02-21 17:07:02 +13:00
7699c7407d Tests: Add tests for image format saving and loading
This adds saving and loading tests for our supported image formats.

**Saving - bf_imbuf_save.py**
There are 2 template images which are loaded anew for each file save
attempt.  One is an 8-bit RGBA image and the other 32-bit. This is
required as many formats use a variety of factors to determine which of
`ibuf->rect` or `ibuf->rectfloat` to use for processing.  The templates
are constructed to have alpha transparency as well as values > 1 (or
clamped to 1 for the case of the 8-bit template).

Test flow:
 - Load in an appropriate template image
 - Save it to the desired format with the desired set of options
 - Compare against the reference image

Notes:
 - 98 references are used totaling ~3.6MB
 - 10-12 second test runtime
 - Templates can be reconstructed with the create-templates.blend file

**Loading - bf_imbuf_load.py**
Test flow:
 - Load in each of the reference images
 - Save them back out as .exr
 - Save additional metadata to a secondary file (alpha mode, colorspace etc)
 - Compare the saved out .exr with another set of reference .exrs
 - Compare the saved out file metadata with set of reference metadata

Notes:
 - 98 exr references are used totaling ~10MB
 - 10-12 second test runtime as well

A HTML report is not implemented. The diff output organization is very
similar to the other tests so it should be somewhat easy to do in the
future if we want.

The standard set of environment variables are implemented for both:
BLENDER_TEST_UPDATE, BLENDER_VERBOSE, and BLENDER_TEST_COLOR

Pull Request #104442
2023-02-20 19:06:38 -08:00
ff3fd5f1ce Sculpt: Implement mesh filter cancel
Added new function sculpt_mesh_filter_cancel in sculpt_filter_mesh.cc
for cancelling mesh filters. It currently is unused pending a
revamped modal map for mesh filter (see pull req 104718).
2023-02-20 18:09:05 -08:00
3e049973ee BMesh: fix invalid existence check in BM_mesh_bm_to_me
Remember that the null customdata layer index is -1,
not 0.
2023-02-20 17:46:45 -08:00
07ae1feed2 Fix test
Pull Request #104934
2023-02-20 23:04:10 +01:00
ba6c9a6f59 BLI_math: fix parameter aliasing in mul_m3_series and mul_m4_series
No functional changes.
2023-02-20 23:04:10 +01:00
7c1e26dd64 Merge branch 'blender-v3.5-release' 2023-02-20 21:24:48 +01:00
cc925b9282 Nodes: Allow adding multiple search items per type in add menu
Add a per node type callback for creating node add search operations,
similar to the way link drag search is implemented (11be151d58).

Currently the searchable strings have to be separate items in the list.
In a separate step, we can look into adding invisible searchable text
to search items if that's still necessary.

Resolves #102118

Pull Request #104794
2023-02-20 19:17:03 +01:00
DESKTOP-ON14TH5\Sonny Campbell
ceba1854f9 BLI: add function for changing working directory
Add `BLI_change_working_dir(path)` to change the current working directory.

This change is required for adding USDZ support to Blender. When exporting to that format, we are required to do a weird change of directory because of a quirk with the USD library's USDZ functionality. If an absolute filepath is passed into the `UsdUtilsCreateNewUsdzPackage` function, the USDZ archive will store that full path.

macOS uses `NSFileManager` through some new Mac-only wrapper functions.

Ref #99807

Pull Request #104525
2023-02-20 15:58:38 +01:00
8abef86217 Merge branch 'blender-v3.5-release' 2023-02-20 15:37:02 +01:00
9b7eb57cf7 Merge branch 'blender-v3.5-release' 2023-02-20 15:33:44 +01:00
5a85b62bbc Transform Gizmo: calculate matrix_offset when creating the gizmos
That way the `matrix_base` doesn't need to depend on the axis
simplifying the code.

This also fixes an issue in plane scaling gizmos with non-orthogonal
matrix.
2023-02-20 11:28:11 -03:00
82ab491ab5 Merge branch 'blender-v3.5-release' 2023-02-20 12:59:47 +01:00
e55f8b0b52 Merge branch 'blender-v3.5-release' 2023-02-20 12:47:13 +01:00
dfbbf411d9 Merge branch 'blender-v3.5-release' 2023-02-20 12:13:14 +01:00
c437a8aea8 Revert release branch only commit after merge
This is a revert of a revert, because the initial revert is only
supposed to be in the release branch.

This reverts commit 3eed00dc54.
2023-02-20 11:51:16 +01:00
74be1acc7a Merge branch 'blender-v3.5-release' 2023-02-20 11:35:11 +01:00
c25c46b77b Merge branch 'blender-v3.5-release' 2023-02-20 10:56:00 +01:00
488a757c83 Icons: Minor maintenance for the icons source SVG
No design or functional changes. Just rename the layers for the last
two icons that were added so that they follow the naming pattern.
Also, update the layer order for another icon (was not alphabetic).

Pull Request #104954
2023-02-20 10:41:31 +01:00
e1e2dae317 Revert 104438: Windows Spanning Multiple Monitors
Revert of commits that allowed non-temp Blender windows to be saved
and restored that spanned multiple monitors on the Windows platform.
This causes problems with temp windows (like Preferences & Render) that
cannot currently be fixed.

See 104956 for much more detail

Differential Revision: blender/blender#104956

Reviewed by Ray Molenkamp
2023-02-19 19:28:08 +01:00
e61566137b Merge branch 'blender-v3.5-release' 2023-02-18 16:44:25 +11:00
cc4587a9b4 Merge branch 'blender-v3.5-release' 2023-02-18 05:14:33 +01:00
be9104f7aa Cleanup: spelling, capitalize tags, use C-style comments & clarification 2023-02-18 14:33:28 +11:00
6bd058189c Cleanup: quiet mypy warnings 2023-02-18 14:22:34 +11:00
162e6c7951 Fix error in project_info when make wasn't found
The warning referenced an undeclared variable.
2023-02-18 14:21:56 +11:00
da9dff053e Build: fix error building xvidcore on Linux
The file renaming seems only to be needed on Windows,
so don't attempt it on other platforms.
2023-02-18 14:10:59 +11:00
d9398bb53f Fix #104188: Screw modifier edges invisible in edit mode wireframe view
Caused by 25237d2625, when the new "template" mesh created
in the modifier started to use the proper default value for CD_ORIGINDEX
layers rather than just zero. Zero isn't correct because it refers to
the first element, not "no element". For that we need to remove the
original index mapping arrays completely. There is some gray area
about whether that is allowed too, but it's best here to just keep the
old behavior working for now.
2023-02-17 16:24:49 -05:00
2ee5560b3f Spreadsheet: Add original indices to mesh debug information
Add the `CD_ORIGINDEX` layer to the columns potentially displayed
with the Blender debug value of 4001 from the debug menu. Also
separate the debug columns to separate functions.
2023-02-17 16:24:49 -05:00
dd2ab55507 Fix 104816: Ensure Win32 visible title bar
When creating Win32 windows, ensure that the caption bar is visible.

Differential Revision: blender/blender#104848

Reviewed by Ray Molenkamp
2023-02-17 20:11:44 +01:00
8806d7551d Merge branch 'blender-v3.5-release' 2023-02-17 13:54:16 -05:00
d6774174e9 Fix compile error due to previous changes 2023-02-17 19:14:47 +01:00
4b6ce4512c Merge remote-tracking branch 'origin/blender-v3.5-release' 2023-02-17 18:50:52 +01:00
d7dd7ee24c Animation: Add "Frame Channel" operators
When animating it is often useful to frame the Graph Editor/Dope Sheet to whatever frames are in a given channel.
This patch adds the option to frame on selected channels OR frame on whatever channel is under the cursor.

If a preview range is set it will only focus on keys in that range.

Supports FCurve and keyframe data

Frame to selected is called with
* Right click in the channel section -> Frame Selected Channels
* or in Channel → Frame Selected Channels
* or hitting . on the numpad

Frame to channel under cursor is done with

ALT + Middle Mouse Button

Co-authored-by: Christoph Lendenfeld <chris.lenden@gmail.com>
Pull Request #104523
2023-02-17 18:10:58 +01:00
e95ba8a70e Nodes: Add 'Online Manual' to context menu
Finding the documentation for nodes can be time consuming.
By adding the online manual to the right click context menu in the node
editor the user gets easier access to the documentation.

Can also be used by custom nodes add-ons by registering a manual-map.

Pull Request #104833
2023-02-17 16:59:30 +01:00
a797c0c05c Merge branch 'blender-v3.5-release' 2023-02-17 16:44:32 +01:00
0e4312ceec Merge branch 'blender-v3.5-release' 2023-02-17 16:33:59 +01:00
08f24553dc Cleanup: Remove accidentally merged TODO comment 2023-02-17 15:05:39 +01:00
7838eb12c6 Merge branch 'blender-v3.5-release' 2023-02-17 14:37:35 +01:00
69677827ff Fix #104347: Loop Cut Tool becomes impressive with GPU Subdivision
When updating a mesh, the GPU Subdivision code makes calls to
`GPU_indexbuf_bind_as_ssbo()`.

This may cause the current VAO index buffer to change due to calls from
`glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ibo_id_)` in
`GPU_indexbuf_bind_as_ssbo()`.

The solution is to unbind the VAO (by calling `glBindVertexArray(0)`)
before creating the index buffer IBO.

Co-authored-by: Germano Cavalcante <grmncv@gmail.com>
Pull Request #104873
2023-02-17 14:30:29 +01:00
42f636f7e8 Merge branch 'blender-v3.5-release' 2023-02-17 13:43:17 +01:00
cb95f8aea7 Animation: Clamp V2D so keyframes cannot go offscreen
In the Dope Sheet and the Timeline, it was possible to drag the view until the keyframes were completely out of view.
(Important to drag in the region with the keyframes, dragging in the channel box already did clamping)

This patch adds a clamping mechanism matching that of the channel box. That means the last channel will stick to the bottom of the view.

Co-authored-by: Christoph Lendenfeld <chris.lenden@gmail.com>
Pull Request #104516
2023-02-17 12:47:45 +01:00
d4480fdfa3 Merge branch 'blender-v3.5-release' 2023-02-17 11:45:49 +01:00
bf7ccd43ca Cleanup: use PI and PI/2 in compatible_eul
3.2 and 1.6 where used as rough equivalents to M_PI & M_PI_2, however
this raised questions about the significance of these values.

Running thousands of tests with generated euler inputs I wasn't able to
detect a difference so use M_PI & M_PI_2 instead.
2023-02-17 21:18:30 +11:00
773903f43c Docs: add doc-string for compatible_eul & improve code-comments 2023-02-17 21:18:30 +11:00
9b3ce950e6 Fix #95400: Crash when running Euler Filter on baked Curves
Fix a crash when using the Euler Filter from the Graph Editor on baked curves.

The crash happened because baked curves have no bezt array.
Skipping any curves where that was missing fixes the issue.

Co-authored-by: Christoph Lendenfeld <chris.lenden@gmail.com>
Pull Request #104858
2023-02-17 11:05:57 +01:00
f6c6805226 Merge branch 'blender-v3.5-release' 2023-02-17 10:56:41 +01:00
932148ec54 Merge branch 'blender-v3.5-release' 2023-02-17 10:15:28 +01:00
0250b40750 Cleanup: Silence compiler warning in VKShader. 2023-02-17 09:54:57 +01:00
c6ea00de3c BLI_math: correct the threshold for wrapping rotation in compatible_eul
Having a threshold well above PI would result in discontinuity in some
cases.

The discontinuity can be measured by generating euler values (both
random and interpolated rotations), then comparing the accumulated
difference.
Changing the threshold for wrapping rotations produces at least as good
or more compatible results.

This was reported as #17297 and fixed in [0], however the change was
only applied for the game-engine.

Ref !104856

[0]: ab44742cf3
2023-02-17 19:52:15 +11:00
1a6943d553 Merge branch 'blender-v3.5-release' 2023-02-17 09:38:18 +01:00
5de9a5dea5 Sculpt: Fix 104618: Topology automasking errors
Sculpt island tags are now invalidated whenever the PBVH
is rebuilt.
2023-02-16 22:37:20 -08:00
9808d6abd8 Cleanup: loop over axes in compatible_eul
There is no need to inline the loop.
2023-02-17 16:18:43 +11:00
6b84636ff2 Cleanup: unused warning 2023-02-17 16:18:31 +11:00
a52c0a252f Cleanup: fix warnings from last commit 2023-02-16 21:14:27 -08:00
c352eeb213 Sculpt: Add support for last operator panel to mesh filter operator
* Repeat last operator now works for mesh filters.
* Added an iteration_count property to repeat the filter.
  This is especially useful when compounded with the repeat
  last operator tool.
* The mouse event history is stored for mesh filters
  with more advanced user input (mostly Smooth and Relax
  filters).
2023-02-16 20:54:56 -08:00
ef60b13c1f Deps: Optimize meson based deps
meson defaults to debug builds [0] unless you tell it differently, this
diff changes the options for

- epoxy
- fribidi
- harfbuzz
- wayland
- wayland_protocols

to be optimized, mesa was already optimized

[0] https://mesonbuild.com/Builtin-options.html#core-options

Pull Request #104802
2023-02-17 01:43:25 +01:00
9c79875f65 Cleanup: use BitSpan instead of BitVector where possible
Passing a `BitSpan` is generally better because then the caller is not
forced to allocate the bits with a `BitVector`. Also, the `BitSpan` can
be stored in the stack, which removes one pointer indirection compared
to accessing bits through a `BitVector &`.
2023-02-17 00:47:02 +01:00
891f47b801 BLI: new bit span data structure
This adds `BitSpan` and `MutableBitSpan`. They work essentially the same as
the normal `Span` and `MutableSpan`, but work on individual bits instead
(the smallest type `Span` can handle is one byte large).

This also splits up `BLI_bit_vector.hh` and introduces two new headers:
`BLI_bit_ref.hh` and `BLI_bit_span.hh`.

The goal here is to make working with dynamically sized bit masks more
convenient. I'm mainly working on this because I might want to use this
in #104629. It can also be used to cleanup function signatures that
currently take a reference to a `BitVector`. Like with `Span` vs. `Vector`,
it is better to pass a `BitSpan` to function than a `const BitVector &`.

Unit tests for the new code are included.

Pull Request #104671
2023-02-17 00:42:44 +01:00
8094d389f7 Cleanup: format 2023-02-17 11:41:12 +13:00
09d3ebfd72 Merge branch 'blender-v3.5-release' 2023-02-16 17:00:18 -05:00
8a51d61b44 Merge branch 'blender-v3.5-release' 2023-02-16 15:20:00 -05:00
b2a536e9d7 Fix: Remove the rest of the tracks in the BKE_nlatrack_remove_and_free to free up the memory
Fix: The BKE_nlatrack_remove_and_free (#104752) unit test leaks a little memory. Cleaning up the rest of the track list to ensure everything is freed.
Co-authored-by: Nate Rupsis <nrupsis@gmail.com>
Pull Request #104839
2023-02-16 20:24:33 +01:00
77c273ee37 Fix unused variable in release builds
Assert is not needed in this case.
2023-02-16 18:57:50 +01:00
4cdf27cd96 Merge branch 'blender-v3.5-release' 2023-02-16 12:50:11 -05:00
c2a0decbf3 Cleanup: Use Span to iterate over nodes instead of ListBase
Similar to 5b8e2ebd97.
2023-02-16 12:12:38 -05:00
851de8170d Cleanup: Nodes: Avoid unnecessary const cast, use early return 2023-02-16 12:11:20 -05:00
4e7a7e613a Cleanup: Fix operator description 2023-02-16 17:47:04 +01:00
bf5a89f4e0 Cleanup: Adding in NLA Track Remove / Remove and free BKE methods
This PR adds 2 new methods:
* BKE_nlatrack_remove
* BKE_nlatrack_remove_and_free

and modifies the existing `BKE_nlatrack_free` to remove the track list parameter.

This refactor splits out the removal / freeing into it's own methods, and provides a higher order method (BKE_nlatrack_remove_and_free) to conveniently call both.

Co-authored-by: Nate Rupsis <nrupsis@gmail.com>
Pull Request #104752
2023-02-16 17:31:09 +01:00
55843cd64b Curves: Add select more/less
This adds the "Select More/Less" operators for Curves. Both operators use the `select_adjacent` function to (de)select adjacent points.

Pull Request #104626
2023-02-16 17:02:43 +01:00
1e9564864c Cleanup: Refactor File/Asset Browser button dragging code
Code to set the dragging data for a button was mostly duplicated, they
share it now. The followup commit also needs an easy way to reuse the
logic, which is possible now.
2023-02-16 16:57:10 +01:00
6da512f0bc UI: Refactor how draggable part of button is determined
No longer use the existance of an image pointer inside the button, or
the the type of a button to decide if the entire button should be
draggable, or only its icon. This was rather sneaky, undocumented
behavior. Instead make this a proper option in the public UI API, and
enable it by default in specific cases to match the previous behavior.

This at least makes the behavior known and controllable in the API, and
not something that's just "secretly" done deep down in the button
handling code. I'd argue we should just use the entire button width by
default for dragging, but that would be a bigger change.
2023-02-16 16:57:10 +01:00
2ccb820c7e Merge branch 'blender-v3.5-release' 2023-02-16 15:27:40 +01:00
be6847e773 Cleanup: Remove read-only attribute type
After the removal of the "normal" attribute providers, we no longer
use the concept of read-only attributes. Removing this status simplifies
code, clarifies the design, and removes potentially buggy corner cases.

Pull Request #104795
2023-02-16 15:08:28 +01:00
300c673a64 Geometry Nodes: Remove "normal" attribute
The "normal" was added before fields existed because we needed a
way to expose the data to geometry nodes. It isn't really an attribute,
because it's read-only and it's derived rather than original data.

No features have relied on the "normal" attribute existing, except
for the corresponding column in the spreadsheet. However, the
column in the spreadsheet is also inconsistent, since it isn't an
attribute but looks just like the other columns. The normal is
always visible in the spreadsheet.

Pull Request #104795
2023-02-16 15:08:28 +01:00
368559647f Merge branch 'blender-v3.5-release' 2023-02-16 15:01:29 +01:00
d705c8ed57 Merge branch 'blender-v3.5-release' 2023-02-16 08:30:52 -05:00
c39b81d832 UI: Improvement to screen_find_area_xy
In BKE_screen_area_map_find_area_xy (find a ScrArea by 2D location),
ignore edges by using screen verts instead of totrct

Differential Revision: blender/blender#104680

Reviewed by Brecht Van Lommel
2023-02-16 02:38:57 +01:00
6e7242f00c Merge branch 'blender-v3.5-release' 2023-02-16 00:53:04 +01:00
10c0c2a156 Windows: allow windows to span multiple monitors
On the Windows platform allow Blender windows to be created that are
spread over multiple adjacent monitors.

---

On Windows we are quite feature-complete and stable for the creation and placement of multiple (non-temp) Blender windows. We correctly do so across multiple monitors no matter their arrangement, resolution, and scale.

However, there is another way that Blender could use multiple monitors - suggested by a core dev - which is to size a window so that it comprises multiple monitors. There are some advantages to this way of working because the one window remains constantly active and in focus. It also allows a single region (like a node editor) to be as large as possible.

But this way of working is not currently possible. That is because during window creation we constrain them to fit within the confines of the nearest single monitor. This has mostly been done for simplicity and safety. We don't want to restore a saved window to a position where it cannot be seen or used.

This patch addresses that. It allows windows to span multiple monitors, and does so safely by constraining the four corners of the window to be within the working area of any active monitor.  This means it allows the creation of single windows as shown below in blue (left two), but does not allow the one in orange (right):

![image.png](/attachments/b2a9dfca-d54c-467a-ab95-717df3b25051)

Note this has been previously (before gitea) reviewed and approved by Brecht.

Co-authored-by: Harley Acheson <harley.acheson@gmail.com>
Pull Request #104438
2023-02-16 00:41:26 +01:00
ab63fe9eab Cleanup: format 2023-02-16 10:04:09 +11:00
a2551f23ad Cleanup: document & improve naming for Wayland's pending window actions 2023-02-16 10:02:23 +11:00
f178e3f849 Merge branch 'blender-v3.5-release' 2023-02-15 23:56:58 +01:00
b1abc23899 Fix: Skip anonymous CustomData layers for the python API
Now that the UV map names are read from the evaluated mesh the names of
the anonymous layers would show up in the UV Map node and be accessible
via the python interface.

This changes the collection definition to skip anonymous layers.

Pull Request #104783
2023-02-15 23:54:50 +01:00
043bff144d Merge branch 'blender-v3.5-release' 2023-02-15 17:40:15 -05:00
7ad1d3156c Cleanup: Use simpler attribute transfer API in duplicate elements node
Instead of retrieving which attributes to transfer from the geometry set
which exists at a different abstraction level, get them from accessors
directly with a newer utility function. This removes boilerplate code
and makes the logic clearer for a future even more generic attribute
propagation API.
2023-02-15 17:38:47 -05:00
2cad80b0e5 Merge branch 'blender-v3.5-release' 2023-02-15 16:13:35 -05:00
1e6ed77896 Merge branch 'blender-v3.5-release' 2023-02-15 13:27:49 -05:00
b07085fe3c Fix #104690: Evaluated positions user-after-free for copied poly curves
The evaluated positions cache can live longer than a specific
`CurvesGeometry`, but for only-poly curves, it pointed to the positions,
which are freed when the curves are. Instead, use the same pattern
as the evaluated offsets and don't store the positions span, just return
it when retrieving evaluated positions.
2023-02-15 11:38:27 -05:00
753eb9c20e Cycles: disable AMD GPU rendering binaries due to compiler bugs
There are known bugs in HIP compiler that are causing random build failures
when making changes to the Cycles kernel. This is preventing developers from
efficiently making improvements to Cycles.

For now Cycles AMD GPU rendering is disabled in Blender 3.6 until a good
solution is found, so that ongoing work like Principled v2 is not blocked.
We hope this can be resolved later on in the 3.6 release cycle.

Ref #104786
2023-02-15 17:24:37 +01:00
05b177b0b3 Revert changes to align asset library labels in menus
This reverts 1116d821dc and part of 5bac672e1a.

The solution was made specifically for the 3.5 release, to avoid
breaking other cases. The previous commit addressed the problem properly
by letting the general menu code align labels where needed.
2023-02-15 16:09:08 +01:00
58752ad93c UI: Ensure menus with icons align all menu item labels
Usually in Blender, we try to align the labels of items within a menu,
if necessary by adding a blank icon for padding. This wasn't done for
menus generated from enum properties (RNA or custom property enums). Now
we do it whenever there is at least one item with an icon.
2023-02-15 16:09:08 +01:00
0f29a65744 Merge branch 'blender-v3.5-release' 2023-02-15 15:59:34 +01:00
b9bf4700b0 Fix weird icon padding in asset library selector menu button
Since the menu doesn't automatically align the labels like other menus
and pulldowns in Blender, I manually made them align using the blank
icon. However the menu button would also include this blank icon now.

This is a specific fix for the 3.5 release. In the main branch I will
replace it with proper support for automatically aligning labels in such
menus.
2023-02-15 15:58:40 +01:00
Matti-Ranta
0b63136e63 Cleanup: delete .arcconfig
Now that https://developer.blender.org/ has been decommissioned, arcconfig is no longer needed.

Pull Request #104768
2023-02-15 15:49:22 +01:00
7ae5bc142b Merge branch 'blender-v3.5-release' 2023-02-15 15:37:47 +01:00
a6ebe0ca62 Fix possible compiler warning and linker error
Type was forward declared as class, but is a struct. GCC is quiet about this
Clang gives a warning about potential linker errors on MSVC.
2023-02-15 15:09:22 +01:00
d8112ec1ea Revert "Splash screen for Blender 3.5"
This reverts commit a0b4da2bd0.
2023-02-15 14:17:00 +01:00
6417da28a8 Revert "Blender 3.5 Beta:"
This reverts commit 904b7e4e41.
2023-02-15 14:16:43 +01:00
33193093b1 Merge branch 'blender-v3.5-release' 2023-02-15 14:16:25 +01:00
d5d48a986b Release cycle: Bump version to 3.6. 2023-02-15 13:49:56 +01:00
3590 changed files with 131831 additions and 60411 deletions

View File

@@ -1,8 +0,0 @@
{
"project_id" : "Blender",
"conduit_uri" : "https://developer.blender.org/",
"phabricator.uri" : "https://developer.blender.org/",
"git.default-relative-commit" : "origin/master",
"arc.land.update.default" : "rebase",
"arc.land.onto.default" : "master"
}

View File

@@ -130,7 +130,7 @@ PenaltyReturnTypeOnItsOwnLine: 10000
#
PenaltyBreakAssignment: 100
AllowShortFunctionsOnASingleLine: None
AllowShortFunctionsOnASingleLine: Empty
SortIncludes: true

View File

@@ -1,9 +1,9 @@
name: Bug Report
about: File a bug report
labels:
- "type::Report"
- "status::Needs Triage"
- "priority::Normal"
- "Type/Report"
- "Status/Needs Triage"
- "Priority/Normal"
body:
- type: markdown
attributes:
@@ -15,6 +15,7 @@ body:
* Test [daily builds](https://builder.blender.org/) to verify if the issue is already fixed.
* Test [previous versions](https://download.blender.org/release/) to find an older working version.
* For feature requests, feedback, questions or build issues, see [communication channels](https://wiki.blender.org/wiki/Communication/Contact#User_Feedback_and_Requests).
* Security vulnerabilities should be [reported privately](https://wiki.blender.org/wiki/Process/Vulnerability_Reports).
* If there are multiple bugs, make multiple bug reports.
- type: textarea

View File

@@ -1,7 +1,7 @@
name: Design
about: Create a design task (for developers only)
labels:
- "type::Design"
- "Type/Design"
body:
- type: textarea
id: body

View File

@@ -1,7 +1,7 @@
name: To Do
about: Create a to do task (for developers only)
labels:
- "type::To Do"
- "Type/To Do"
body:
- type: textarea
id: body

7
.gitignore vendored
View File

@@ -65,3 +65,10 @@ waveletNoiseTile.bin
/release/datafiles/locale/
/release/scripts/addons_contrib/
/source/tools/
# Build files for VS and VS Code.
/build/
/out/
CMakeSettings.json
CMakePresets.json
CMakeUserPresets.json

View File

@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2006 Blender Foundation. All rights reserved.
# Copyright 2006 Blender Foundation
# -----------------------------------------------------------------------------
# Early Initialization
@@ -164,7 +164,7 @@ get_blender_version()
# Declare Options
# Blender internal features
option(WITH_BLENDER "Build blender (disable to build only the blender player)" ON)
option(WITH_BLENDER "Build blender (disable to build only Cycles stand-alone)." ON)
mark_as_advanced(WITH_BLENDER)
if(WIN32)
@@ -331,13 +331,9 @@ option(WITH_MOD_REMESH "Enable Remesh Modifier" ON)
option(WITH_MOD_OCEANSIM "Enable Ocean Modifier" ON)
# Image format support
option(WITH_OPENIMAGEIO "Enable OpenImageIO Support (http://www.openimageio.org)" ON)
option(WITH_IMAGE_OPENEXR "Enable OpenEXR Support (http://www.openexr.com)" ON)
option(WITH_IMAGE_OPENJPEG "Enable OpenJpeg Support (http://www.openjpeg.org)" ON)
option(WITH_IMAGE_TIFF "Enable LibTIFF Support" ON)
option(WITH_IMAGE_DDS "Enable DDS Image Support" ON)
option(WITH_IMAGE_CINEON "Enable CINEON and DPX Image Support" ON)
option(WITH_IMAGE_HDR "Enable HDR Image Support" ON)
option(WITH_IMAGE_WEBP "Enable WebP Image Support" ON)
# Audio/Video format support
@@ -358,6 +354,7 @@ option(WITH_MATERIALX "Enable MaterialX Support" OFF)
# Disable opencollada when we don't have precompiled libs
option(WITH_OPENCOLLADA "Enable OpenCollada Support (http://www.opencollada.org)" ON)
option(WITH_IO_WAVEFRONT_OBJ "Enable Wavefront-OBJ 3D file format support (*.obj)" ON)
option(WITH_IO_PLY "Enable PLY 3D file format support (*.ply)" ON)
option(WITH_IO_STL "Enable STL 3D file format support (*.stl)" ON)
option(WITH_IO_GPENCIL "Enable grease-pencil file format IO (*.svg, *.pdf)" ON)
@@ -617,10 +614,12 @@ endif()
option(WITH_OPENGL "When off limits visibility of the opengl headers to just bf_gpu and gawain (temporary option for development purposes)" ON)
option(WITH_GPU_BUILDTIME_SHADER_BUILDER "Shader builder is a developer option enabling linting on GLSL during compilation" OFF)
option(WITH_RENDERDOC "Use Renderdoc API to capture frames" OFF)
mark_as_advanced(
WITH_OPENGL
WITH_GPU_BUILDTIME_SHADER_BUILDER
WITH_RENDERDOC
)
# Vulkan
@@ -646,15 +645,15 @@ if(WIN32)
endif()
# Compiler tool-chain.
if(UNIX AND NOT APPLE)
if(UNIX)
if(CMAKE_COMPILER_IS_GNUCC)
option(WITH_LINKER_GOLD "Use ld.gold linker which is usually faster than ld.bfd" ON)
mark_as_advanced(WITH_LINKER_GOLD)
option(WITH_LINKER_LLD "Use ld.lld linker which is usually faster than ld.gold" OFF)
mark_as_advanced(WITH_LINKER_LLD)
endif()
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
option(WITH_LINKER_MOLD "Use ld.mold linker which is usually faster than ld.gold & ld.lld." OFF)
option(WITH_LINKER_LLD "Use ld.lld linker which is usually faster than ld.gold" OFF)
mark_as_advanced(WITH_LINKER_LLD)
option(WITH_LINKER_MOLD "Use ld.mold linker which is usually faster than ld.gold & ld.lld. Needs \"sold\" subscription on macOS." OFF)
mark_as_advanced(WITH_LINKER_MOLD)
endif()
endif()
@@ -691,8 +690,10 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
else()
string(APPEND _asan_defaults " -fsanitize=object-size")
endif()
else()
elseif(CMAKE_COMPILER_IS_GNUCC)
string(APPEND _asan_defaults " -fsanitize=leak -fsanitize=object-size")
else()
string(APPEND _asan_defaults " -fsanitize=leak")
endif()
set(COMPILER_ASAN_CFLAGS "${_asan_defaults}" CACHE STRING "C flags for address sanitizer")
@@ -709,6 +710,7 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\LLVM\\LLVM;]/lib/clang/7.0.0/lib/windows
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\LLVM\\LLVM;]/lib/clang/6.0.0/lib/windows
)
mark_as_advanced(COMPILER_ASAN_LIBRARY)
elseif(APPLE)
execute_process(COMMAND ${CMAKE_CXX_COMPILER}
-print-file-name=lib
@@ -723,13 +725,14 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
"${CLANG_LIB_DIR}/darwin/"
)
unset(CLANG_LIB_DIR)
else()
mark_as_advanced(COMPILER_ASAN_LIBRARY)
elseif(CMAKE_COMPILER_IS_GNUCC)
find_library(
COMPILER_ASAN_LIBRARY asan ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}
)
mark_as_advanced(COMPILER_ASAN_LIBRARY)
endif()
mark_as_advanced(COMPILER_ASAN_LIBRARY)
endif()
endif()
@@ -884,16 +887,14 @@ set_and_warn_dependency(WITH_TBB WITH_MOD_FLUID OFF)
# NanoVDB requires OpenVDB to convert the data structure
set_and_warn_dependency(WITH_OPENVDB WITH_NANOVDB OFF)
# OpenVDB and OpenColorIO uses 'half' type from OpenEXR
# OpenVDB, Alembic and Vulkan, OSL uses 'half' or 'imath' from OpenEXR
set_and_warn_dependency(WITH_IMAGE_OPENEXR WITH_OPENVDB OFF)
# Haru needs `TIFFFaxBlackCodes` & `TIFFFaxWhiteCodes` symbols from TIFF.
set_and_warn_dependency(WITH_IMAGE_TIFF WITH_HARU OFF)
set_and_warn_dependency(WITH_IMAGE_OPENEXR WITH_ALEMBIC OFF)
set_and_warn_dependency(WITH_IMAGE_OPENEXR WITH_VULKAN_BACKEND OFF)
set_and_warn_dependency(WITH_IMAGE_OPENEXR WITH_CYCLES_OSL OFF)
# auto enable openimageio for cycles
if(WITH_CYCLES)
set(WITH_OPENIMAGEIO ON)
# auto enable llvm for cycles_osl
if(WITH_CYCLES_OSL)
set(WITH_LLVM ON CACHE BOOL "" FORCE)
@@ -1085,13 +1086,6 @@ if(NOT WITH_FFTW3 AND WITH_MOD_OCEANSIM)
endif()
if(WITH_CYCLES)
if(NOT WITH_OPENIMAGEIO)
message(
FATAL_ERROR
"Cycles requires WITH_OPENIMAGEIO, the library may not have been found. "
"Configure OIIO or disable WITH_CYCLES"
)
endif()
if(WITH_CYCLES_OSL)
if(NOT WITH_LLVM)
message(
@@ -1564,6 +1558,9 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
# add_check_c_compiler_flag(C_WARNINGS C_WARN_UNUSED_MACROS -Wunused-macros)
# add_check_cxx_compiler_flag(CXX_WARNINGS CXX_WARN_UNUSED_MACROS -Wunused-macros)
add_check_c_compiler_flag(C_WARNINGS C_WARN_ERROR_UNGUARDED_AVAILABILITY_NEW -Werror=unguarded-availability-new)
add_check_c_compiler_flag(CXX_WARNINGS CXX_WARN_ERROR_UNGUARDED_AVAILABILITY_NEW -Werror=unguarded-availability-new)
# ---------------------
# Suppress Strict Flags
@@ -1616,6 +1613,7 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC")
# warning level:
"/W3"
"/w34062" # switch statement contains 'default' but no 'case' labels
"/w34100" # 'identifier' : unreferenced formal parameter
"/w34115" # 'type' : named type definition in parentheses
"/w34189" # local variable is initialized but not referenced
# see https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/c5038?view=vs-2017
@@ -1937,12 +1935,8 @@ if(FIRST_RUN)
info_cfg_text("Image Formats:")
info_cfg_option(WITH_IMAGE_CINEON)
info_cfg_option(WITH_IMAGE_DDS)
info_cfg_option(WITH_IMAGE_HDR)
info_cfg_option(WITH_IMAGE_OPENEXR)
info_cfg_option(WITH_IMAGE_OPENJPEG)
info_cfg_option(WITH_IMAGE_TIFF)
info_cfg_option(WITH_OPENIMAGEIO)
info_cfg_text("Audio:")
info_cfg_option(WITH_CODEC_AVI)

View File

@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0-or-later
## Update and uncomment this in the release branch
set(BLENDER_VERSION 3.5)
# set(BLENDER_VERSION 3.1)
function(download_source dep)
set(TARGET_FILE ${${dep}_FILE})

View File

@@ -6,15 +6,24 @@
set(EMBREE_EXTRA_ARGS
-DEMBREE_ISPC_SUPPORT=OFF
-DEMBREE_TUTORIALS=OFF
-DEMBREE_STATIC_LIB=ON
-DEMBREE_STATIC_LIB=OFF
-DEMBREE_RAY_MASK=ON
-DEMBREE_FILTER_FUNCTION=ON
-DEMBREE_BACKFACE_CULLING=OFF
-DEMBREE_BACKFACE_CULLING_CURVES=ON
-DEMBREE_BACKFACE_CULLING_SPHERES=ON
-DEMBREE_TASKING_SYSTEM=TBB
-DEMBREE_TBB_ROOT=${LIBDIR}/tbb
-DTBB_ROOT=${LIBDIR}/tbb
)
if(WIN32)
set(EMBREE_EXTRA_ARGS
${EMBREE_EXTRA_ARGS}
-DCMAKE_DEBUG_POSTFIX=_d
)
endif()
if(NOT BLENDER_PLATFORM_ARM)
set(EMBREE_EXTRA_ARGS
${EMBREE_EXTRA_ARGS}
@@ -45,25 +54,19 @@ add_dependencies(
)
if(WIN32)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_embree after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/embree ${HARVEST_TARGET}/embree
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/embree/include ${HARVEST_TARGET}/embree/include
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/embree/lib ${HARVEST_TARGET}/embree/lib
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/embree/share ${HARVEST_TARGET}/embree/share
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/bin/embree4.dll ${HARVEST_TARGET}/embree/bin/embree4.dll
DEPENDEES install
)
else()
ExternalProject_Add_Step(external_embree after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/embree3.lib ${HARVEST_TARGET}/embree/lib/embree3_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/embree_avx.lib ${HARVEST_TARGET}/embree/lib/embree_avx_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/embree_avx2.lib ${HARVEST_TARGET}/embree/lib/embree_avx2_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/embree_sse42.lib ${HARVEST_TARGET}/embree/lib/embree_sse42_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/lexers.lib ${HARVEST_TARGET}/embree/lib/lexers_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/math.lib ${HARVEST_TARGET}/embree/lib/math_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/simd.lib ${HARVEST_TARGET}/embree/lib/simd_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/sys.lib ${HARVEST_TARGET}/embree/lib/sys_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/tasking.lib ${HARVEST_TARGET}/embree/lib/tasking_d.lib
DEPENDEES install
)
endif()
ExternalProject_Add_Step(external_embree after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/bin/embree4_d.dll ${HARVEST_TARGET}/embree/bin/embree4_d.dll
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/embree4_d.lib ${HARVEST_TARGET}/embree/lib/embree4_d.lib
DEPENDEES install
)
endif()
endif()

View File

@@ -10,7 +10,7 @@ ExternalProject_Add(external_epoxy
URL_HASH ${EPOXY_HASH_TYPE}=${EPOXY_HASH}
PREFIX ${BUILD_DIR}/epoxy
PATCH_COMMAND ${PATCH_CMD} -p 1 -N -d ${BUILD_DIR}/epoxy/src/external_epoxy/ < ${PATCH_DIR}/epoxy.diff
CONFIGURE_COMMAND ${CONFIGURE_ENV} && ${MESON} setup --prefix ${LIBDIR}/epoxy --default-library ${EPOXY_LIB_TYPE} --libdir lib ${BUILD_DIR}/epoxy/src/external_epoxy-build ${BUILD_DIR}/epoxy/src/external_epoxy -Dtests=false
CONFIGURE_COMMAND ${CONFIGURE_ENV} && ${MESON} setup --prefix ${LIBDIR}/epoxy --default-library ${EPOXY_LIB_TYPE} --libdir lib ${BUILD_DIR}/epoxy/src/external_epoxy-build ${BUILD_DIR}/epoxy/src/external_epoxy -Dtests=false ${MESON_BUILD_TYPE}
BUILD_COMMAND ninja
INSTALL_COMMAND ninja install
)

View File

@@ -9,7 +9,7 @@ ExternalProject_Add(external_fribidi
URL_HASH ${FRIBIDI_HASH_TYPE}=${FRIBIDI_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/fribidi
CONFIGURE_COMMAND ${MESON} setup --prefix ${LIBDIR}/fribidi -Ddocs=false --default-library static --libdir lib ${BUILD_DIR}/fribidi/src/external_fribidi-build ${BUILD_DIR}/fribidi/src/external_fribidi
CONFIGURE_COMMAND ${MESON} setup --prefix ${LIBDIR}/fribidi ${MESON_BUILD_TYPE} -Ddocs=false --default-library static --libdir lib ${BUILD_DIR}/fribidi/src/external_fribidi-build ${BUILD_DIR}/fribidi/src/external_fribidi
BUILD_COMMAND ninja
INSTALL_COMMAND ninja install
INSTALL_DIR ${LIBDIR}/fribidi

View File

@@ -21,6 +21,7 @@ set(HARFBUZZ_EXTRA_OPTIONS
# Only used for command line utilities,
# disable as this would add an addition & unnecessary build-dependency.
-Dcairo=disabled
${MESON_BUILD_TYPE}
)
ExternalProject_Add(external_harfbuzz
@@ -59,3 +60,10 @@ if(BUILD_MODE STREQUAL Release AND WIN32)
DEPENDEES install
)
endif()
if(BUILD_MODE STREQUAL Debug AND WIN32)
ExternalProject_Add_Step(external_harfbuzz after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/harfbuzz/lib/libharfbuzz.a ${HARVEST_TARGET}/harfbuzz/lib/libharfbuzz_d.lib
DEPENDEES install
)
endif()

View File

@@ -218,6 +218,7 @@ else()
harvest(openimagedenoise/lib openimagedenoise/lib "*.a")
harvest(embree/include embree/include "*.h")
harvest(embree/lib embree/lib "*.a")
harvest(embree/lib embree/lib "*${SHAREDLIBEXT}*")
harvest(openpgl/include openpgl/include "*.h")
harvest(openpgl/lib openpgl/lib "*.a")
harvest(openpgl/lib/cmake/openpgl-${OPENPGL_SHORT_VERSION} openpgl/lib/cmake/openpgl "*.cmake")

View File

@@ -15,7 +15,7 @@ llvm-config = '${LIBDIR}/llvm/bin/llvm-config'"
)
set(MESA_EXTRA_FLAGS
-Dbuildtype=release
${MESON_BUILD_TYPE}
-Dc_args=${MESA_CFLAGS}
-Dcpp_args=${MESA_CXXFLAGS}
-Dc_link_args=${MESA_LDFLAGS}

View File

@@ -44,13 +44,21 @@ set(OPENVDB_EXTRA_ARGS
# -DLLVM_DIR=${LIBDIR}/llvm/lib/cmake/llvm
)
set(OPENVDB_PATCH ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/openvdb/src/openvdb < ${PATCH_DIR}/openvdb.diff)
if(APPLE)
set(OPENVDB_PATCH
${OPENVDB_PATCH} &&
${PATCH_CMD} -p 0 -d ${BUILD_DIR}/openvdb/src/openvdb < ${PATCH_DIR}/openvdb_metal.diff
)
endif()
ExternalProject_Add(openvdb
URL file://${PACKAGE_DIR}/${OPENVDB_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${OPENVDB_HASH_TYPE}=${OPENVDB_HASH}
CMAKE_GENERATOR ${PLATFORM_ALT_GENERATOR}
PREFIX ${BUILD_DIR}/openvdb
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/openvdb/src/openvdb < ${PATCH_DIR}/openvdb.diff
PATCH_COMMAND ${OPENVDB_PATCH}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openvdb ${DEFAULT_CMAKE_FLAGS} ${OPENVDB_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/openvdb
)

View File

@@ -16,8 +16,10 @@ message("BuildMode = ${BUILD_MODE}")
if(BUILD_MODE STREQUAL "Debug")
set(LIBDIR ${CMAKE_CURRENT_BINARY_DIR}/Debug)
set(MESON_BUILD_TYPE -Dbuildtype=debug)
else()
set(LIBDIR ${CMAKE_CURRENT_BINARY_DIR}/Release)
set(MESON_BUILD_TYPE -Dbuildtype=release)
endif()
set(DOWNLOAD_DIR "${CMAKE_CURRENT_BINARY_DIR}/downloads" CACHE STRING "Path for downloaded files")

View File

@@ -478,9 +478,9 @@ set(SQLITE_HASH_TYPE SHA1)
set(SQLITE_FILE sqlite-autoconf-${SQLLITE_LONG_VERSION}.tar.gz)
set(SQLITE_CPE "cpe:2.3:a:sqlite:sqlite:${SQLITE_VERSION}:*:*:*:*:*:*:*")
set(EMBREE_VERSION 3.13.4)
set(EMBREE_VERSION 4.0.1)
set(EMBREE_URI https://github.com/embree/embree/archive/v${EMBREE_VERSION}.zip)
set(EMBREE_HASH 52d0be294d6c88ba7a6c9e046796e7be)
set(EMBREE_HASH dd26617719a587e126b341d1b32f7fd0)
set(EMBREE_HASH_TYPE MD5)
set(EMBREE_FILE embree-v${EMBREE_VERSION}.zip)
@@ -528,16 +528,16 @@ set(XR_OPENXR_SDK_HASH a2623ebab3d0b340bc16311b14f02075)
set(XR_OPENXR_SDK_HASH_TYPE MD5)
set(XR_OPENXR_SDK_FILE OpenXR-SDK-${XR_OPENXR_SDK_VERSION}.tar.gz)
set(WL_PROTOCOLS_VERSION 1.21)
set(WL_PROTOCOLS_VERSION 1.31)
set(WL_PROTOCOLS_FILE wayland-protocols-${WL_PROTOCOLS_VERSION}.tar.gz)
set(WL_PROTOCOLS_URI https://gitlab.freedesktop.org/wayland/wayland-protocols/-/archive/${WL_PROTOCOLS_VERSION}/${WL_PROTOCOLS_FILE})
set(WL_PROTOCOLS_HASH af5ca07e13517cdbab33504492cef54a)
set(WL_PROTOCOLS_HASH a28ff59a56e2ebb746048b6ef8d931d6)
set(WL_PROTOCOLS_HASH_TYPE MD5)
set(WAYLAND_VERSION 1.21.0)
set(WAYLAND_VERSION 1.22.0)
set(WAYLAND_FILE wayland-${WAYLAND_VERSION}.tar.xz)
set(WAYLAND_URI https://gitlab.freedesktop.org/wayland/wayland/-/releases/1.21.0/downloads/wayland-${WAYLAND_VERSION}.tar.xz)
set(WAYLAND_HASH f2653a2293bcd882d756c6a83d278903)
set(WAYLAND_URI https://gitlab.freedesktop.org/wayland/wayland/-/releases/${WAYLAND_VERSION}/downloads/wayland-${WAYLAND_VERSION}.tar.xz)
set(WAYLAND_HASH 7410ab549e3928fce9381455b17b0803)
set(WAYLAND_HASH_TYPE MD5)
set(WAYLAND_LIBDECOR_VERSION 0.1.0)

View File

@@ -13,7 +13,7 @@ ExternalProject_Add(external_wayland
# NOTE: `-lm` is needed for `libxml2` which is a static library that uses `libm.so`,
# without this, math symbols such as `floor` aren't found.
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env PKG_CONFIG_PATH=${LIBDIR}/expat/lib/pkgconfig:${LIBDIR}/xml2/lib/pkgconfig:${LIBDIR}/ffi/lib/pkgconfig:$PKG_CONFIG_PATH
${MESON} --prefix ${LIBDIR}/wayland -Ddocumentation=false -Dtests=false -D "c_link_args=-L${LIBDIR}/ffi/lib -lm" . ../external_wayland
${MESON} --prefix ${LIBDIR}/wayland ${MESON_BUILD_TYPE} -Ddocumentation=false -Dtests=false -D "c_link_args=-L${LIBDIR}/ffi/lib -lm" . ../external_wayland
BUILD_COMMAND ninja
INSTALL_COMMAND ninja install
)

View File

@@ -7,7 +7,7 @@ ExternalProject_Add(external_wayland_protocols
PREFIX ${BUILD_DIR}/wayland-protocols
# Use `-E` so the `PKG_CONFIG_PATH` can be defined to link against our own WAYLAND.
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env PKG_CONFIG_PATH=${LIBDIR}/wayland/lib64/pkgconfig:$PKG_CONFIG_PATH
${MESON} --prefix ${LIBDIR}/wayland-protocols . ../external_wayland_protocols -Dtests=false
${MESON} --prefix ${LIBDIR}/wayland-protocols ${MESON_BUILD_TYPE} . ../external_wayland_protocols -Dtests=false
BUILD_COMMAND ninja
INSTALL_COMMAND ninja install
)

View File

@@ -17,11 +17,13 @@ ExternalProject_Add(external_xvidcore
INSTALL_DIR ${LIBDIR}/xvidcore
)
ExternalProject_Add_Step(external_xvidcore after_install
COMMAND ${CMAKE_COMMAND} -E rename ${LIBDIR}/xvidcore/lib/xvidcore.a ${LIBDIR}/xvidcore/lib/libxvidcore.a || true
COMMAND ${CMAKE_COMMAND} -E remove ${LIBDIR}/xvidcore/lib/xvidcore.dll.a
DEPENDEES install
)
if(WIN32)
ExternalProject_Add_Step(external_xvidcore after_install
COMMAND ${CMAKE_COMMAND} -E rename ${LIBDIR}/xvidcore/lib/xvidcore.a ${LIBDIR}/xvidcore/lib/libxvidcore.a || true
COMMAND ${CMAKE_COMMAND} -E remove ${LIBDIR}/xvidcore/lib/xvidcore.dll.a
DEPENDEES install
)
endif()
if(MSVC)
set_target_properties(external_xvidcore PROPERTIES FOLDER Mingw)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,8 +1,8 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-2.0-or-later
# This script is part of the official build environment, see WIKI page for details.
# https://wiki.blender.org/wiki/Building_Blender/Other/CentOS7ReleaseEnvironment
# This script is part of the official build environment, see wiki page for details.
# https://wiki.blender.org/wiki/Building_Blender/Other/Rocky8ReleaseEnvironment
set -e
@@ -59,7 +59,7 @@ PACKAGES_FOR_LIBS=(
automake
libtool
# TODO: why is this needed?
# Used to set rpath on shared libraries
patchelf
# Builds generated by meson use Ninja for the actual build.

View File

@@ -1,19 +1,8 @@
diff -Naur org/kernels/rtcore_config.h.in embree-3.13.4/kernels/rtcore_config.h.in
--- org/kernels/rtcore_config.h.in 2022-06-14 22:13:52 -0600
+++ embree-3.13.4/kernels/rtcore_config.h.in 2022-06-24 15:20:12 -0600
@@ -14,6 +14,7 @@
#cmakedefine01 EMBREE_MIN_WIDTH
#define RTC_MIN_WIDTH EMBREE_MIN_WIDTH
+#cmakedefine EMBREE_STATIC_LIB
#cmakedefine EMBREE_API_NAMESPACE
#if defined(EMBREE_API_NAMESPACE)
diff --git a/kernels/CMakeLists.txt b/kernels/CMakeLists.txt
index 7c2f43d..106b1d5 100644
--- a/kernels/CMakeLists.txt
+++ b/kernels/CMakeLists.txt
@@ -201,6 +201,12 @@ embree_files(EMBREE_LIBRARY_FILES_AVX512 ${AVX512})
@@ -208,6 +208,12 @@ embree_files(EMBREE_LIBRARY_FILES_AVX512 ${AVX512})
#message("AVX2: ${EMBREE_LIBRARY_FILES_AVX2}")
#message("AVX512: ${EMBREE_LIBRARY_FILES_AVX512}")
@@ -26,7 +15,7 @@ index 7c2f43d..106b1d5 100644
# replaces all .cpp files with a dummy file that includes that .cpp file
# this is to work around an ICC name mangling issue related to lambda functions under windows
MACRO (CreateISADummyFiles list isa)
@@ -277,7 +283,7 @@ IF (EMBREE_ISA_AVX AND EMBREE_LIBRARY_FILES_AVX)
@@ -311,7 +317,7 @@ IF (EMBREE_ISA_AVX AND EMBREE_LIBRARY_FILES_AVX)
ENDIF()
ENDIF()
@@ -35,3 +24,128 @@ index 7c2f43d..106b1d5 100644
DISABLE_STACK_PROTECTOR_FOR_INTERSECTORS(${EMBREE_LIBRARY_FILES_AVX2})
ADD_LIBRARY(embree_avx2 STATIC ${EMBREE_LIBRARY_FILES_AVX2})
TARGET_LINK_LIBRARIES(embree_avx2 PRIVATE tasking)
diff --git a/include/embree4/rtcore_device.h b/include/embree4/rtcore_device.h
index 45bf95583..62ee7787d 100644
--- a/include/embree4/rtcore_device.h
+++ b/include/embree4/rtcore_device.h
@@ -55,6 +55,7 @@ enum RTCDeviceProperty
RTC_DEVICE_PROPERTY_FILTER_FUNCTION_SUPPORTED = 66,
RTC_DEVICE_PROPERTY_IGNORE_INVALID_RAYS_ENABLED = 67,
RTC_DEVICE_PROPERTY_COMPACT_POLYS_ENABLED = 68,
+ RTC_DEVICE_PROPERTY_BACKFACE_CULLING_SPHERES_ENABLED = 69,
RTC_DEVICE_PROPERTY_TRIANGLE_GEOMETRY_SUPPORTED = 96,
RTC_DEVICE_PROPERTY_QUAD_GEOMETRY_SUPPORTED = 97,
diff --git a/kernels/common/device.cpp b/kernels/common/device.cpp
index 3ffac7e37..215ccc961 100644
--- a/kernels/common/device.cpp
+++ b/kernels/common/device.cpp
@@ -170,6 +170,9 @@ namespace embree
#if defined (EMBREE_BACKFACE_CULLING_CURVES)
v += "backfacecullingcurves ";
#endif
+#if defined (EMBREE_BACKFACE_CULLING_SPHERES)
+ v += "backfacecullingspheres ";
+#endif
#if defined(EMBREE_FILTER_FUNCTION)
v += "intersection_filter ";
#endif
@@ -477,6 +480,12 @@ namespace embree
case RTC_DEVICE_PROPERTY_BACKFACE_CULLING_CURVES_ENABLED: return 0;
#endif
+#if defined(EMBREE_BACKFACE_CULLING_SPHERES)
+ case RTC_DEVICE_PROPERTY_BACKFACE_CULLING_SPHERES_ENABLED: return 1;
+#else
+ case RTC_DEVICE_PROPERTY_BACKFACE_CULLING_SPHERES_ENABLED: return 0;
+#endif
+
#if defined(EMBREE_COMPACT_POLYS)
case RTC_DEVICE_PROPERTY_COMPACT_POLYS_ENABLED: return 1;
#else
diff --git a/kernels/config.h.in b/kernels/config.h.in
index f02c90360..ba9acde56 100644
--- a/kernels/config.h.in
+++ b/kernels/config.h.in
@@ -5,6 +5,7 @@
#cmakedefine EMBREE_STAT_COUNTERS
#cmakedefine EMBREE_BACKFACE_CULLING
#cmakedefine EMBREE_BACKFACE_CULLING_CURVES
+#cmakedefine EMBREE_BACKFACE_CULLING_SPHERES
#cmakedefine EMBREE_FILTER_FUNCTION
#cmakedefine EMBREE_IGNORE_INVALID_RAYS
#cmakedefine EMBREE_GEOMETRY_TRIANGLE
diff --git a/kernels/geometry/sphere_intersector.h b/kernels/geometry/sphere_intersector.h
index 074f910a2..30f490818 100644
--- a/kernels/geometry/sphere_intersector.h
+++ b/kernels/geometry/sphere_intersector.h
@@ -106,8 +106,13 @@ namespace embree
const vbool<M> valid_front = valid & (ray.tnear() <= t_front) & (t_front <= ray.tfar);
const vbool<M> valid_back = valid & (ray.tnear() <= t_back ) & (t_back <= ray.tfar);
+#if defined (EMBREE_BACKFACE_CULLING_SPHERES)
+ /* check if there is a first hit */
+ const vbool<M> valid_first = valid_front;
+#else
/* check if there is a first hit */
const vbool<M> valid_first = valid_front | valid_back;
+#endif
if (unlikely(none(valid_first)))
return false;
@@ -120,7 +125,8 @@ namespace embree
/* invoke intersection filter for first hit */
const bool is_hit_first = epilog(valid_first, hit);
-
+
+#if !defined (EMBREE_BACKFACE_CULLING_SPHERES)
/* check for possible second hits before potentially accepted hit */
const vfloat<M> t_second = t_back;
const vbool<M> valid_second = valid_front & valid_back & (t_second <= ray.tfar);
@@ -131,7 +137,9 @@ namespace embree
const Vec3vf<M> Ng_second = td_back * ray_dir - perp;
hit = SphereIntersectorHitM<M> (t_second, Ng_second);
const bool is_hit_second = epilog(valid_second, hit);
-
+#else
+ constexpr bool is_hit_second = false;
+#endif
return is_hit_first | is_hit_second;
}
@@ -186,8 +194,13 @@ namespace embree
const vbool<M> valid_front = valid & (ray.tnear()[k] <= t_front) & (t_front <= ray.tfar[k]);
const vbool<M> valid_back = valid & (ray.tnear()[k] <= t_back ) & (t_back <= ray.tfar[k]);
+#if defined (EMBREE_BACKFACE_CULLING_SPHERES)
+ /* check if there is a first hit */
+ const vbool<M> valid_first = valid_front;
+#else
/* check if there is a first hit */
const vbool<M> valid_first = valid_front | valid_back;
+#endif
if (unlikely(none(valid_first)))
return false;
@@ -200,7 +213,8 @@ namespace embree
/* invoke intersection filter for first hit */
const bool is_hit_first = epilog(valid_first, hit);
-
+
+#if !defined (EMBREE_BACKFACE_CULLING_SPHERES)
/* check for possible second hits before potentially accepted hit */
const vfloat<M> t_second = t_back;
const vbool<M> valid_second = valid_front & valid_back & (t_second <= ray.tfar[k]);
@@ -211,7 +225,9 @@ namespace embree
const Vec3vf<M> Ng_second = td_back * ray_dir - perp;
hit = SphereIntersectorHitM<M> (t_second, Ng_second);
const bool is_hit_second = epilog(valid_second, hit);
-
+#else
+ constexpr bool is_hit_second = false;
+#endif
return is_hit_first | is_hit_second;
}
};

File diff suppressed because it is too large Load Diff

View File

@@ -23,6 +23,7 @@ SET(_embree_SEARCH_DIRS
FIND_PATH(EMBREE_INCLUDE_DIR
NAMES
embree4/rtcore.h
embree3/rtcore.h
HINTS
${_embree_SEARCH_DIRS}
@@ -30,28 +31,67 @@ FIND_PATH(EMBREE_INCLUDE_DIR
include
)
IF(NOT (("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64") OR (APPLE AND ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64"))))
SET(_embree_SIMD_COMPONENTS
embree_sse42
embree_avx
embree_avx2
)
IF(EXISTS ${EMBREE_INCLUDE_DIR}/embree4/rtcore_config.h)
SET(EMBREE_MAJOR_VERSION 4)
ELSE()
SET(EMBREE_MAJOR_VERSION 3)
ENDIF()
SET(_embree_FIND_COMPONENTS
embree3
${_embree_SIMD_COMPONENTS}
lexers
math
simd
sys
tasking
)
IF(EMBREE_INCLUDE_DIR)
FILE(READ ${EMBREE_INCLUDE_DIR}/embree${EMBREE_MAJOR_VERSION}/rtcore_config.h _embree_config_header)
IF(_embree_config_header MATCHES "#define EMBREE_STATIC_LIB")
SET(EMBREE_STATIC_LIB TRUE)
ELSE()
SET(EMBREE_STATIC_LIB FALSE)
ENDIF()
IF(_embree_config_header MATCHES "#define EMBREE_SYCL_SUPPORT")
SET(EMBREE_SYCL_SUPPORT TRUE)
ELSE()
SET(EMBREE_SYCL_SUPPORT FALSE)
ENDIF()
UNSET(_embree_config_header)
ENDIF()
IF(EMBREE_STATIC_LIB)
IF(NOT (("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64") OR (APPLE AND ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64"))))
SET(_embree_SIMD_COMPONENTS
embree_sse42
embree_avx
embree_avx2
)
ENDIF()
IF(EMBREE_SYCL_SUPPORT)
SET(_embree_GPU_COMPONENTS
embree4_sycl
embree_rthwif
)
ENDIF()
SET(_embree_FIND_COMPONENTS
embree${EMBREE_MAJOR_VERSION}
${_embree_SIMD_COMPONENTS}
${_embree_GPU_COMPONENTS}
lexers
math
simd
sys
tasking
)
ELSE()
SET(_embree_FIND_COMPONENTS
embree${EMBREE_MAJOR_VERSION}
)
IF(EMBREE_SYCL_SUPPORT)
LIST(APPEND _embree_FIND_COMPONENTS
embree4_sycl
)
ENDIF()
ENDIF()
SET(_embree_LIBRARIES)
FOREACH(COMPONENT ${_embree_FIND_COMPONENTS})
STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)
FIND_LIBRARY(EMBREE_${UPPERCOMPONENT}_LIBRARY
NAMES
${COMPONENT}
@@ -60,18 +100,9 @@ FOREACH(COMPONENT ${_embree_FIND_COMPONENTS})
PATH_SUFFIXES
lib64 lib
)
IF(NOT EMBREE_${UPPERCOMPONENT}_LIBRARY)
IF(EMBREE_EMBREE3_LIBRARY)
# If we can't find all the static libraries, try to fall back to the shared library if found.
# This allows building with a shared embree library
SET(_embree_LIBRARIES ${EMBREE_EMBREE3_LIBRARY})
BREAK()
ENDIF()
ENDIF()
LIST(APPEND _embree_LIBRARIES "${EMBREE_${UPPERCOMPONENT}_LIBRARY}")
ENDFOREACH()
# handle the QUIETLY and REQUIRED arguments and set EMBREE_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
@@ -85,6 +116,9 @@ ENDIF()
MARK_AS_ADVANCED(
EMBREE_INCLUDE_DIR
EMBREE_MAJOR_VERSION
EMBREE_SYCL_SUPPORT
EMBREE_STATIC_LIB
)
FOREACH(COMPONENT ${_embree_FIND_COMPONENTS})

View File

@@ -120,9 +120,8 @@ UNSET(_openexr_libs_ver)
IF(OPENEXR_VERSION VERSION_GREATER_EQUAL "3.0.0")
# For OpenEXR 3.x, we also need to find the now separate Imath library.
# For simplicity we add it to the OpenEXR includes and libraries, as we
# have no direct dependency on Imath and it's simpler to support both
# 2.x and 3.x this way.
# For simplicity we also add it to the OpenEXR includes and libraries,
# as it's simpler to support both 2.x and 3.x this way.
# Find include directory
FIND_PATH(IMATH_INCLUDE_DIR
@@ -169,6 +168,12 @@ IF(OPENEXR_VERSION VERSION_GREATER_EQUAL "3.0.0")
UNSET(_imath_build_specification)
ENDIF()
IF(OPENEXR_VERSION VERSION_GREATER_EQUAL "3.0.0")
SET(IMATH_LIBRARIES ${IMATH_LIBRARY})
ELSE()
SET(IMATH_LIBRARIES ${OPENEXR_IMATH_LIBRARY})
ENDIF()
# handle the QUIETLY and REQUIRED arguments and set OPENEXR_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
@@ -196,6 +201,7 @@ MARK_AS_ADVANCED(
OPENEXR_VERSION
IMATH_INCLUDE_DIR
IMATH_LIBRARY
IMATH_LIBRARIES
)
FOREACH(COMPONENT ${_openexr_FIND_COMPONENTS})
STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)

View File

@@ -108,6 +108,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(SYCL
IF(SYCL_FOUND)
SET(SYCL_INCLUDE_DIR ${SYCL_INCLUDE_DIR} ${SYCL_INCLUDE_DIR}/sycl)
SET(SYCL_LIBRARIES ${SYCL_LIBRARY})
ELSE()
SET(SYCL_SYCL_FOUND FALSE)
ENDIF()

View File

@@ -26,11 +26,8 @@ set(WITH_HARU ON CACHE BOOL "" FORCE)
set(WITH_IK_ITASC ON CACHE BOOL "" FORCE)
set(WITH_IK_SOLVER ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_CINEON ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_DDS ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_HDR ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_OPENEXR ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_OPENJPEG ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_TIFF ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_WEBP ON CACHE BOOL "" FORCE)
set(WITH_INPUT_NDOF ON CACHE BOOL "" FORCE)
set(WITH_INPUT_IME ON CACHE BOOL "" FORCE)

View File

@@ -27,15 +27,13 @@ set(WITH_HARU OFF CACHE BOOL "" FORCE)
set(WITH_IK_ITASC OFF CACHE BOOL "" FORCE)
set(WITH_IK_SOLVER OFF CACHE BOOL "" FORCE)
set(WITH_IMAGE_CINEON OFF CACHE BOOL "" FORCE)
set(WITH_IMAGE_DDS OFF CACHE BOOL "" FORCE)
set(WITH_IMAGE_HDR OFF CACHE BOOL "" FORCE)
set(WITH_IMAGE_OPENEXR OFF CACHE BOOL "" FORCE)
set(WITH_IMAGE_OPENJPEG OFF CACHE BOOL "" FORCE)
set(WITH_IMAGE_TIFF OFF CACHE BOOL "" FORCE)
set(WITH_IMAGE_WEBP OFF CACHE BOOL "" FORCE)
set(WITH_INPUT_IME OFF CACHE BOOL "" FORCE)
set(WITH_INPUT_NDOF OFF CACHE BOOL "" FORCE)
set(WITH_INTERNATIONAL OFF CACHE BOOL "" FORCE)
set(WITH_IO_PLY OFF CACHE BOOL "" FORCE)
set(WITH_IO_STL OFF CACHE BOOL "" FORCE)
set(WITH_IO_WAVEFRONT_OBJ OFF CACHE BOOL "" FORCE)
set(WITH_IO_GPENCIL OFF CACHE BOOL "" FORCE)
@@ -52,7 +50,6 @@ set(WITH_OPENAL OFF CACHE BOOL "" FORCE)
set(WITH_OPENCOLLADA OFF CACHE BOOL "" FORCE)
set(WITH_OPENCOLORIO OFF CACHE BOOL "" FORCE)
set(WITH_OPENIMAGEDENOISE OFF CACHE BOOL "" FORCE)
set(WITH_OPENIMAGEIO OFF CACHE BOOL "" FORCE)
set(WITH_OPENMP OFF CACHE BOOL "" FORCE)
set(WITH_OPENSUBDIV OFF CACHE BOOL "" FORCE)
set(WITH_OPENVDB OFF CACHE BOOL "" FORCE)

View File

@@ -27,11 +27,8 @@ set(WITH_HARU ON CACHE BOOL "" FORCE)
set(WITH_IK_ITASC ON CACHE BOOL "" FORCE)
set(WITH_IK_SOLVER ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_CINEON ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_DDS ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_HDR ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_OPENEXR ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_OPENJPEG ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_TIFF ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_WEBP ON CACHE BOOL "" FORCE)
set(WITH_INPUT_NDOF ON CACHE BOOL "" FORCE)
set(WITH_INPUT_IME ON CACHE BOOL "" FORCE)
@@ -85,7 +82,7 @@ if(NOT APPLE)
set(WITH_CYCLES_DEVICE_OPTIX ON CACHE BOOL "" FORCE)
set(WITH_CYCLES_CUDA_BINARIES ON CACHE BOOL "" FORCE)
set(WITH_CYCLES_CUBIN_COMPILER OFF CACHE BOOL "" FORCE)
set(WITH_CYCLES_HIP_BINARIES ON CACHE BOOL "" FORCE)
set(WITH_CYCLES_HIP_BINARIES OFF CACHE BOOL "" FORCE)
set(WITH_CYCLES_DEVICE_ONEAPI ON CACHE BOOL "" FORCE)
set(WITH_CYCLES_ONEAPI_BINARIES ON CACHE BOOL "" FORCE)
endif()

View File

@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2022 Blender Foundation. All rights reserved.
# Copyright 2022 Blender Foundation
# This file is used to test the system for headers & symbols.
# Variables should use the `HAVE_` prefix.

View File

@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2006 Blender Foundation. All rights reserved.
# Copyright 2006 Blender Foundation
macro(list_insert_after
list_id item_check item_add
@@ -702,6 +702,7 @@ macro(remove_strict_flags)
endif()
if(MSVC)
remove_cc_flag(/w34100) # Restore warn C4100 (unreferenced formal parameter) back to w4
remove_cc_flag(/w34189) # Restore warn C4189 (unused variable) back to w4
endif()
@@ -721,7 +722,7 @@ macro(remove_extra_strict_flags)
endif()
if(MSVC)
# TODO
remove_cc_flag(/w34100) # Restore warn C4100 (unreferenced formal parameter) back to w4
endif()
endmacro()
@@ -1363,3 +1364,24 @@ macro(windows_generate_shared_manifest)
)
endif()
endmacro()
macro(windows_process_platform_bundled_libraries library_deps)
if(NOT "${library_deps}" STREQUAL "")
set(next_library_mode "ALL")
foreach(library ${library_deps})
string(TOUPPER "${library}" library_upper)
if(("${library_upper}" STREQUAL "RELEASE") OR
("${library_upper}" STREQUAL "DEBUG") OR
("${library_upper}" STREQUAL "ALL"))
set(next_library_mode "${library_upper}")
else()
windows_install_shared_manifest(
FILES ${library}
${next_library_mode}
)
set(next_library_mode "ALL")
endif()
endforeach()
endif()
endmacro()

View File

@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2016 Blender Foundation. All rights reserved.
# Copyright 2016 Blender Foundation
# Libraries configuration for Apple.
@@ -221,10 +221,8 @@ find_package(PNG REQUIRED)
set(JPEG_ROOT ${LIBDIR}/jpeg)
find_package(JPEG REQUIRED)
if(WITH_IMAGE_TIFF)
set(TIFF_ROOT ${LIBDIR}/tiff)
find_package(TIFF REQUIRED)
endif()
set(TIFF_ROOT ${LIBDIR}/tiff)
find_package(TIFF REQUIRED)
if(WITH_IMAGE_WEBP)
set(WEBP_ROOT_DIR ${LIBDIR}/webp)
@@ -245,6 +243,7 @@ if(WITH_BOOST)
if(WITH_USD AND USD_PYTHON_SUPPORT)
list(APPEND _boost_FIND_COMPONENTS python${PYTHON_VERSION_NO_DOTS})
endif()
set(Boost_NO_WARN_NEW_VERSIONS ON)
find_package(Boost COMPONENTS ${_boost_FIND_COMPONENTS})
# Boost Python is separate to avoid linking Python into tests that don't need it.
@@ -270,19 +269,7 @@ if(WITH_PUGIXML)
find_package(PugiXML REQUIRED)
endif()
if(WITH_OPENIMAGEIO)
find_package(OpenImageIO)
list(APPEND OPENIMAGEIO_LIBRARIES
${PNG_LIBRARIES}
${JPEG_LIBRARIES}
${TIFF_LIBRARY}
${OPENEXR_LIBRARIES}
${OPENJPEG_LIBRARIES}
${ZLIB_LIBRARIES}
)
set(OPENIMAGEIO_DEFINITIONS "-DOIIO_STATIC_BUILD")
set(OPENIMAGEIO_IDIFF "${LIBDIR}/openimageio/bin/idiff")
endif()
find_package(OpenImageIO REQUIRED)
add_bundled_libraries(openimageio/lib)
if(WITH_OPENCOLORIO)
@@ -341,6 +328,7 @@ if(WITH_CYCLES AND WITH_CYCLES_EMBREE)
endforeach()
set(EMBREE_LIBRARIES ${_embree_libraries_force_load})
endif()
add_bundled_libraries(embree/lib)
if(WITH_OPENIMAGEDENOISE)
find_package(OpenImageDenoise REQUIRED)
@@ -463,6 +451,31 @@ if(WITH_COMPILER_CCACHE)
endif()
endif()
unset(_custom_LINKER_FUSE_FLAG)
if(WITH_LINKER_LLD)
find_program(LLD_PROGRAM ld.lld)
if(LLD_PROGRAM)
set(_custom_LINKER_FUSE_FLAG "-fuse-ld=lld")
else()
message(WARNING "LLD linker NOT found, disabling WITH_LINKER_LLD")
set(WITH_LINKER_LLD OFF)
endif()
endif()
if(WITH_LINKER_MOLD)
find_program(MOLD_PROGRAM mold)
if(MOLD_PROGRAM)
set(_custom_LINKER_FUSE_FLAG "-fuse-ld=mold")
else()
message(WARNING "Mold linker NOT found, disabling WITH_LINKER_MOLD")
set(WITH_LINKER_MOLD OFF)
endif()
endif()
if(_custom_LINKER_FUSE_FLAG)
add_link_options(${_custom_LINKER_FUSE_FLAG})
endif()
if(WITH_COMPILER_ASAN)
list(APPEND PLATFORM_BUNDLED_LIBRARIES ${COMPILER_ASAN_LIBRARY})
endif()

View File

@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2016 Blender Foundation. All rights reserved.
# Copyright 2016 Blender Foundation
# Xcode and system configuration for Apple.

View File

@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2022 Blender Foundation. All rights reserved.
# Copyright 2022 Blender Foundation
# Auto update existing CMake caches for new libraries.

View File

@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2016 Blender Foundation. All rights reserved.
# Copyright 2016 Blender Foundation
# Libraries configuration for any *nix system including Linux and Unix (excluding APPLE).
@@ -109,6 +109,10 @@ find_package_wrapper(ZLIB REQUIRED)
find_package_wrapper(Zstd REQUIRED)
find_package_wrapper(Epoxy REQUIRED)
# XXX Linking errors with debian static tiff :/
# find_package_wrapper(TIFF REQUIRED)
find_package(TIFF)
if(WITH_VULKAN_BACKEND)
find_package_wrapper(Vulkan REQUIRED)
find_package_wrapper(ShaderC REQUIRED)
@@ -190,13 +194,6 @@ if(WITH_IMAGE_OPENJPEG)
set_and_warn_library_found("OpenJPEG" OPENJPEG_FOUND WITH_IMAGE_OPENJPEG)
endif()
if(WITH_IMAGE_TIFF)
# XXX Linking errors with debian static tiff :/
# find_package_wrapper(TIFF)
find_package(TIFF)
set_and_warn_library_found("TIFF" TIFF_FOUND WITH_IMAGE_TIFF)
endif()
if(WITH_OPENAL)
find_package_wrapper(OpenAL)
set_and_warn_library_found("OpenAL" OPENAL_FOUND WITH_OPENAL)
@@ -317,7 +314,7 @@ if(WITH_CYCLES AND WITH_CYCLES_OSL)
endif()
endif()
if(WITH_CYCLES AND WITH_CYCLES_DEVICE_ONEAPI)
if(WITH_CYCLES AND (WITH_CYCLES_DEVICE_ONEAPI OR (WITH_CYCLES_EMBREE AND EMBREE_SYCL_SUPPORT)))
set(CYCLES_LEVEL_ZERO ${LIBDIR}/level-zero CACHE PATH "Path to Level Zero installation")
if(EXISTS ${CYCLES_LEVEL_ZERO} AND NOT LEVEL_ZERO_ROOT_DIR)
set(LEVEL_ZERO_ROOT_DIR ${CYCLES_LEVEL_ZERO})
@@ -394,6 +391,7 @@ if(WITH_BOOST)
list(APPEND __boost_packages python${PYTHON_VERSION_NO_DOTS})
endif()
list(APPEND __boost_packages system)
set(Boost_NO_WARN_NEW_VERSIONS ON)
find_package(Boost 1.48 COMPONENTS ${__boost_packages})
if(NOT Boost_FOUND)
# try to find non-multithreaded if -mt not found, this flag
@@ -438,32 +436,7 @@ if(WITH_IMAGE_WEBP)
set_and_warn_library_found("WebP" WEBP_FOUND WITH_IMAGE_WEBP)
endif()
if(WITH_OPENIMAGEIO)
find_package_wrapper(OpenImageIO)
set(OPENIMAGEIO_LIBRARIES
${OPENIMAGEIO_LIBRARIES}
${PNG_LIBRARIES}
${JPEG_LIBRARIES}
${ZLIB_LIBRARIES}
)
set(OPENIMAGEIO_DEFINITIONS "")
if(WITH_BOOST)
list(APPEND OPENIMAGEIO_LIBRARIES "${BOOST_LIBRARIES}")
endif()
if(WITH_IMAGE_TIFF)
list(APPEND OPENIMAGEIO_LIBRARIES "${TIFF_LIBRARY}")
endif()
if(WITH_IMAGE_OPENEXR)
list(APPEND OPENIMAGEIO_LIBRARIES "${OPENEXR_LIBRARIES}")
endif()
if(WITH_IMAGE_WEBP)
list(APPEND OPENIMAGEIO_LIBRARIES "${WEBP_LIBRARIES}")
endif()
set_and_warn_library_found("OPENIMAGEIO" OPENIMAGEIO_FOUND WITH_OPENIMAGEIO)
endif()
find_package_wrapper(OpenImageIO REQUIRED)
add_bundled_libraries(openimageio/lib)
if(WITH_OPENCOLORIO)
@@ -477,6 +450,7 @@ add_bundled_libraries(opencolorio/lib)
if(WITH_CYCLES AND WITH_CYCLES_EMBREE)
find_package(Embree 3.8.0 REQUIRED)
endif()
add_bundled_libraries(embree/lib)
if(WITH_OPENIMAGEDENOISE)
find_package_wrapper(OpenImageDenoise)
@@ -665,15 +639,29 @@ if(WITH_GHOST_WAYLAND)
pkg_check_modules(wayland-egl wayland-egl)
pkg_check_modules(wayland-scanner wayland-scanner)
pkg_check_modules(wayland-cursor wayland-cursor)
pkg_check_modules(wayland-protocols wayland-protocols>=1.15)
pkg_check_modules(wayland-protocols wayland-protocols>=1.31)
pkg_get_variable(WAYLAND_PROTOCOLS_DIR wayland-protocols pkgdatadir)
else()
# NOTE: this file must always refer to the newest API which is used, so older
# `wayland-protocols` are never found and used which then fail to locate required protocols.
set(_wayland_protocols_reference_file "staging/fractional-scale/fractional-scale-v1.xml")
# Reset the protocols directory the reference file from `wayland-protocols` is not found.
# This avoids developers having build failures when a cached directory is used that no
# longer contains the required file.
if(DEFINED WAYLAND_PROTOCOLS_DIR)
if(NOT EXISTS "${WAYLAND_PROTOCOLS_DIR}/${_wayland_protocols_reference_file}")
unset(WAYLAND_PROTOCOLS_DIR CACHE)
endif()
endif()
# Rocky8 packages have too old a version, a newer version exist in the pre-compiled libraries.
find_path(WAYLAND_PROTOCOLS_DIR
NAMES unstable/xdg-decoration/xdg-decoration-unstable-v1.xml
NAMES ${_wayland_protocols_reference_file}
PATH_SUFFIXES share/wayland-protocols
PATHS ${LIBDIR}/wayland-protocols
)
unset(_wayland_protocols_reference_file)
if(EXISTS ${WAYLAND_PROTOCOLS_DIR})
set(wayland-protocols_FOUND ON)

View File

@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2016 Blender Foundation. All rights reserved.
# Copyright 2016 Blender Foundation
# Libraries configuration for Windows.
@@ -181,8 +181,8 @@ if(NOT MSVC_CLANG)
endif()
if(WITH_WINDOWS_SCCACHE AND CMAKE_VS_MSBUILD_COMMAND)
message(WARNING "Disabling sccache, sccache is not supported with msbuild")
set(WITH_WINDOWS_SCCACHE OFF)
message(WARNING "Disabling sccache, sccache is not supported with msbuild")
set(WITH_WINDOWS_SCCACHE OFF)
endif()
# Debug Symbol format
@@ -487,14 +487,12 @@ if(WITH_IMAGE_OPENEXR)
endif()
endif()
if(WITH_IMAGE_TIFF)
# Try to find tiff first then complain and set static and maybe wrong paths
windows_find_package(TIFF)
if(NOT TIFF_FOUND)
warn_hardcoded_paths(libtiff)
set(TIFF_LIBRARY ${LIBDIR}/tiff/lib/libtiff.lib)
set(TIFF_INCLUDE_DIR ${LIBDIR}/tiff/include)
endif()
# Try to find tiff first then complain and set static and maybe wrong paths
windows_find_package(TIFF)
if(NOT TIFF_FOUND)
warn_hardcoded_paths(libtiff)
set(TIFF_LIBRARY ${LIBDIR}/tiff/lib/libtiff.lib)
set(TIFF_INCLUDE_DIR ${LIBDIR}/tiff/include)
endif()
if(WITH_JACK)
@@ -525,6 +523,28 @@ if(WITH_PYTHON)
set(PYTHON_LIBRARIES debug "${PYTHON_LIBRARY_DEBUG}" optimized "${PYTHON_LIBRARY}" )
endif()
if(NOT WITH_WINDOWS_FIND_MODULES)
# even if boost is off, we still need to install the dlls when we use our lib folder since
# some of the other dependencies may need them. For this to work, BOOST_VERSION,
# BOOST_POSTFIX, and BOOST_DEBUG_POSTFIX need to be set.
set(BOOST ${LIBDIR}/boost)
set(BOOST_INCLUDE_DIR ${BOOST}/include)
set(BOOST_LIBPATH ${BOOST}/lib)
set(BOOST_VERSION_HEADER ${BOOST_INCLUDE_DIR}/boost/version.hpp)
if(EXISTS ${BOOST_VERSION_HEADER})
file(STRINGS "${BOOST_VERSION_HEADER}" BOOST_LIB_VERSION REGEX "#define BOOST_LIB_VERSION ")
if(BOOST_LIB_VERSION MATCHES "#define BOOST_LIB_VERSION \"([0-9_]+)\"")
set(BOOST_VERSION "${CMAKE_MATCH_1}")
endif()
endif()
if(NOT BOOST_VERSION)
message(FATAL_ERROR "Unable to determine Boost version")
endif()
set(BOOST_POSTFIX "vc142-mt-x64-${BOOST_VERSION}")
set(BOOST_DEBUG_POSTFIX "vc142-mt-gyd-x64-${BOOST_VERSION}")
set(BOOST_PREFIX "")
endif()
if(WITH_BOOST)
if(WITH_CYCLES AND WITH_CYCLES_OSL)
set(boost_extra_libs wave)
@@ -540,22 +560,6 @@ if(WITH_BOOST)
endif()
if(NOT Boost_FOUND)
warn_hardcoded_paths(BOOST)
set(BOOST ${LIBDIR}/boost)
set(BOOST_INCLUDE_DIR ${BOOST}/include)
set(BOOST_LIBPATH ${BOOST}/lib)
set(BOOST_VERSION_HEADER ${BOOST_INCLUDE_DIR}/boost/version.hpp)
if(EXISTS ${BOOST_VERSION_HEADER})
file(STRINGS "${BOOST_VERSION_HEADER}" BOOST_LIB_VERSION REGEX "#define BOOST_LIB_VERSION ")
if(BOOST_LIB_VERSION MATCHES "#define BOOST_LIB_VERSION \"([0-9_]+)\"")
set(BOOST_VERSION "${CMAKE_MATCH_1}")
endif()
endif()
if(NOT BOOST_VERSION)
message(FATAL_ERROR "Unable to determine Boost version")
endif()
set(BOOST_POSTFIX "vc142-mt-x64-${BOOST_VERSION}")
set(BOOST_DEBUG_POSTFIX "vc142-mt-gyd-x64-${BOOST_VERSION}")
set(BOOST_PREFIX "")
# This is file new in 3.4 if it does not exist, assume we are building against 3.3 libs
set(BOOST_34_TRIGGER_FILE ${BOOST_LIBPATH}/${BOOST_PREFIX}boost_python310-${BOOST_DEBUG_POSTFIX}.lib)
if(NOT EXISTS ${BOOST_34_TRIGGER_FILE})
@@ -605,25 +609,18 @@ if(WITH_BOOST)
set(BOOST_DEFINITIONS "-DBOOST_ALL_NO_LIB")
endif()
if(WITH_OPENIMAGEIO)
windows_find_package(OpenImageIO)
if(NOT OpenImageIO_FOUND)
set(OPENIMAGEIO ${LIBDIR}/OpenImageIO)
set(OPENIMAGEIO_LIBPATH ${OPENIMAGEIO}/lib)
set(OPENIMAGEIO_INCLUDE_DIR ${OPENIMAGEIO}/include)
set(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO_INCLUDE_DIR})
set(OIIO_OPTIMIZED optimized ${OPENIMAGEIO_LIBPATH}/OpenImageIO.lib optimized ${OPENIMAGEIO_LIBPATH}/OpenImageIO_Util.lib)
set(OIIO_DEBUG debug ${OPENIMAGEIO_LIBPATH}/OpenImageIO_d.lib debug ${OPENIMAGEIO_LIBPATH}/OpenImageIO_Util_d.lib)
set(OPENIMAGEIO_LIBRARIES ${OIIO_OPTIMIZED} ${OIIO_DEBUG})
endif()
set(OPENIMAGEIO_DEFINITIONS "-DUSE_TBB=0")
windows_find_package(OpenImageIO)
if(NOT OpenImageIO_FOUND)
set(OPENIMAGEIO ${LIBDIR}/OpenImageIO)
set(OPENIMAGEIO_LIBPATH ${OPENIMAGEIO}/lib)
set(OPENIMAGEIO_INCLUDE_DIR ${OPENIMAGEIO}/include)
set(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO_INCLUDE_DIR})
set(OIIO_OPTIMIZED optimized ${OPENIMAGEIO_LIBPATH}/OpenImageIO.lib optimized ${OPENIMAGEIO_LIBPATH}/OpenImageIO_Util.lib)
set(OIIO_DEBUG debug ${OPENIMAGEIO_LIBPATH}/OpenImageIO_d.lib debug ${OPENIMAGEIO_LIBPATH}/OpenImageIO_Util_d.lib)
set(OPENIMAGEIO_LIBRARIES ${OIIO_OPTIMIZED} ${OIIO_DEBUG})
set(OPENIMAGEIO_IDIFF "${OPENIMAGEIO}/bin/idiff.exe")
# If the .dll does not exist, assume it is a static OIIO
if(NOT EXISTS ${OPENIMAGEIO}/bin/OpenImageIO.dll)
add_definitions(-DOIIO_STATIC_DEFINE)
endif()
add_definitions(-DOIIO_NO_SSE=1)
endif()
add_definitions(-DOIIO_NO_SSE=1)
if(WITH_LLVM)
set(LLVM_ROOT_DIR ${LIBDIR}/llvm CACHE PATH "Path to the LLVM installation")
@@ -851,27 +848,75 @@ endif()
if(WITH_CYCLES AND WITH_CYCLES_EMBREE)
windows_find_package(Embree)
if(NOT Embree_FOUND)
set(EMBREE_ROOT_DIR ${LIBDIR}/embree)
set(EMBREE_INCLUDE_DIRS ${LIBDIR}/embree/include)
set(EMBREE_LIBRARIES
optimized ${LIBDIR}/embree/lib/embree3.lib
optimized ${LIBDIR}/embree/lib/embree_avx2.lib
optimized ${LIBDIR}/embree/lib/embree_avx.lib
optimized ${LIBDIR}/embree/lib/embree_sse42.lib
optimized ${LIBDIR}/embree/lib/lexers.lib
optimized ${LIBDIR}/embree/lib/math.lib
optimized ${LIBDIR}/embree/lib/simd.lib
optimized ${LIBDIR}/embree/lib/sys.lib
optimized ${LIBDIR}/embree/lib/tasking.lib
debug ${LIBDIR}/embree/lib/embree3_d.lib
debug ${LIBDIR}/embree/lib/embree_avx2_d.lib
debug ${LIBDIR}/embree/lib/embree_avx_d.lib
debug ${LIBDIR}/embree/lib/embree_sse42_d.lib
debug ${LIBDIR}/embree/lib/lexers_d.lib
debug ${LIBDIR}/embree/lib/math_d.lib
debug ${LIBDIR}/embree/lib/simd_d.lib
debug ${LIBDIR}/embree/lib/sys_d.lib
debug ${LIBDIR}/embree/lib/tasking_d.lib
if(EXISTS ${LIBDIR}/embree/include/embree4/rtcore_config.h)
set(EMBREE_MAJOR_VERSION 4)
else()
set(EMBREE_MAJOR_VERSION 3)
endif()
file(READ ${LIBDIR}/embree/include/embree${EMBREE_MAJOR_VERSION}/rtcore_config.h _embree_config_header)
if(_embree_config_header MATCHES "#define EMBREE_STATIC_LIB")
set(EMBREE_STATIC_LIB TRUE)
else()
set(EMBREE_STATIC_LIB FALSE)
endif()
if(_embree_config_header MATCHES "#define EMBREE_SYCL_SUPPORT")
set(EMBREE_SYCL_SUPPORT TRUE)
else()
set(EMBREE_SYCL_SUPPORT FALSE)
endif()
set(EMBREE_LIBRARIES
optimized ${LIBDIR}/embree/lib/embree${EMBREE_MAJOR_VERSION}.lib
debug ${LIBDIR}/embree/lib/embree${EMBREE_MAJOR_VERSION}_d.lib
)
if(EMBREE_SYCL_SUPPORT)
set(EMBREE_LIBRARIES
${EMBREE_LIBRARIES}
optimized ${LIBDIR}/embree/lib/embree4_sycl.lib
debug ${LIBDIR}/embree/lib/embree4_sycl_d.lib
)
endif()
if(EMBREE_STATIC_LIB)
set(EMBREE_LIBRARIES
${EMBREE_LIBRARIES}
optimized ${LIBDIR}/embree/lib/embree_avx2.lib
optimized ${LIBDIR}/embree/lib/embree_avx.lib
optimized ${LIBDIR}/embree/lib/embree_sse42.lib
optimized ${LIBDIR}/embree/lib/lexers.lib
optimized ${LIBDIR}/embree/lib/math.lib
optimized ${LIBDIR}/embree/lib/simd.lib
optimized ${LIBDIR}/embree/lib/sys.lib
optimized ${LIBDIR}/embree/lib/tasking.lib
debug ${LIBDIR}/embree/lib/embree_avx2_d.lib
debug ${LIBDIR}/embree/lib/embree_avx_d.lib
debug ${LIBDIR}/embree/lib/embree_sse42_d.lib
debug ${LIBDIR}/embree/lib/lexers_d.lib
debug ${LIBDIR}/embree/lib/math_d.lib
debug ${LIBDIR}/embree/lib/simd_d.lib
debug ${LIBDIR}/embree/lib/sys_d.lib
debug ${LIBDIR}/embree/lib/tasking_d.lib
)
if(EMBREE_SYCL_SUPPORT)
set(EMBREE_LIBRARIES
${EMBREE_LIBRARIES}
optimized ${LIBDIR}/embree/lib/embree_rthwif.lib
debug ${LIBDIR}/embree/lib/embree_rthwif_d.lib
)
endif()
endif()
endif()
if(NOT EMBREE_STATIC_LIB)
list(APPEND PLATFORM_BUNDLED_LIBRARIES
RELEASE ${EMBREE_ROOT_DIR}/bin/embree${EMBREE_MAJOR_VERSION}.dll
DEBUG ${EMBREE_ROOT_DIR}/bin/embree${EMBREE_MAJOR_VERSION}_d.dll
)
endif()
endif()
@@ -997,6 +1042,23 @@ if(WITH_VULKAN_BACKEND)
endif()
endif()
if(WITH_VULKAN_BACKEND)
if(EXISTS ${LIBDIR}/shaderc)
set(SHADERC_FOUND On)
set(SHADERC_ROOT_DIR ${LIBDIR}/shaderc)
set(SHADERC_INCLUDE_DIR ${SHADERC_ROOT_DIR}/include)
set(SHADERC_INCLUDE_DIRS ${SHADERC_INCLUDE_DIR})
set(SHADERC_LIBRARY
DEBUG ${SHADERC_ROOT_DIR}/lib/shaderc_shared_d.lib
OPTIMIZED ${SHADERC_ROOT_DIR}/lib/shaderc_shared.lib
)
set(SHADERC_LIBRARIES ${SHADERC_LIBRARY})
else()
message(WARNING "Shaderc was not found, disabling WITH_VULKAN_BACKEND")
set(WITH_VULKAN_BACKEND OFF)
endif()
endif()
if(WITH_CYCLES AND WITH_CYCLES_PATH_GUIDING)
find_package(openpgl QUIET)
if(openpgl_FOUND)
@@ -1013,7 +1075,7 @@ endif()
set(ZSTD_INCLUDE_DIRS ${LIBDIR}/zstd/include)
set(ZSTD_LIBRARIES ${LIBDIR}/zstd/lib/zstd_static.lib)
if(WITH_CYCLES AND WITH_CYCLES_DEVICE_ONEAPI)
if(WITH_CYCLES AND (WITH_CYCLES_DEVICE_ONEAPI OR (WITH_CYCLES_EMBREE AND EMBREE_SYCL_SUPPORT)))
set(LEVEL_ZERO_ROOT_DIR ${LIBDIR}/level_zero)
set(CYCLES_SYCL ${LIBDIR}/dpcpp CACHE PATH "Path to oneAPI DPC++ compiler")
if(EXISTS ${CYCLES_SYCL} AND NOT SYCL_ROOT_DIR)
@@ -1024,8 +1086,9 @@ if(WITH_CYCLES AND WITH_CYCLES_DEVICE_ONEAPI)
${SYCL_ROOT_DIR}/bin/sycl[0-9].dll
)
foreach(sycl_runtime_library IN LISTS _sycl_runtime_libraries_glob)
string(REPLACE ".dll" "$<$<CONFIG:Debug>:d>.dll" sycl_runtime_library ${sycl_runtime_library})
list(APPEND _sycl_runtime_libraries ${sycl_runtime_library})
string(REPLACE ".dll" "d.dll" sycl_runtime_library_debug ${sycl_runtime_library})
list(APPEND _sycl_runtime_libraries RELEASE ${sycl_runtime_library})
list(APPEND _sycl_runtime_libraries DEBUG ${sycl_runtime_library_debug})
endforeach()
unset(_sycl_runtime_libraries_glob)
@@ -1038,6 +1101,8 @@ if(WITH_CYCLES AND WITH_CYCLES_DEVICE_ONEAPI)
list(APPEND PLATFORM_BUNDLED_LIBRARIES ${_sycl_runtime_libraries})
unset(_sycl_runtime_libraries)
set(SYCL_LIBRARIES optimized ${SYCL_LIBRARY} debug ${SYCL_LIBRARY_DEBUG})
endif()

View File

@@ -142,7 +142,7 @@ def cmake_advanced_info() -> Union[Tuple[List[str], List[Tuple[str, str]]], Tupl
make_exe = cmake_cache_var("CMAKE_MAKE_PROGRAM")
if make_exe is None:
print("Make command not found in: %r not found" % project_path)
print("Make command not found: CMAKE_MAKE_PROGRAM")
return None, None
make_exe_basename = os.path.basename(make_exe)

View File

@@ -112,6 +112,7 @@ def create_manifest(
print(f'Building manifest of files: "{outpath}"...', end="", flush=True)
with outpath.open("w", encoding="utf-8") as outfile:
main_files_to_manifest(blender_srcdir, outfile)
assets_to_manifest(blender_srcdir, outfile)
submodules_to_manifest(blender_srcdir, version, outfile)
if packages_dir:
@@ -131,9 +132,7 @@ def submodules_to_manifest(
skip_addon_contrib = version.is_release()
assert not blender_srcdir.is_absolute()
for line in git_command("-C", blender_srcdir, "submodule"):
submodule = line.split()[1]
for submodule in ("scripts/addons", "scripts/addons_contrib"):
# Don't use native slashes as GIT for MS-Windows outputs forward slashes.
if skip_addon_contrib and submodule == "scripts/addons_contrib":
continue
@@ -142,6 +141,18 @@ def submodules_to_manifest(
print(path, file=outfile)
def assets_to_manifest(blender_srcdir: Path, outfile: TextIO) -> None:
assert not blender_srcdir.is_absolute()
assets_dir = blender_srcdir.parent / "lib" / "assets"
for path in assets_dir.glob("*"):
if path.name == "working":
continue
if path.name in SKIP_NAMES:
continue
print(path, file=outfile)
def packages_to_manifest(outfile: TextIO, packages_dir: Path) -> None:
for path in packages_dir.glob("*"):
if not path.is_file():
@@ -172,7 +183,9 @@ def create_tarball(
command += [
"--transform",
f"s,^{blender_srcdir.name}/,blender-{version}/,g",
"--use-compress-program=xz -9",
"--transform",
f"s,^lib/assets/,blender-{version}/release/datafiles/assets/,g",
"--use-compress-program=xz -1",
"--create",
f"--file={tarball}",
f"--files-from={manifest}",

View File

@@ -66,9 +66,11 @@ def get_blender_git_root() -> str:
# Setup for precompiled libraries and tests from svn.
def get_effective_architecture(args: argparse.Namespace):
if args.architecture:
return args.architecture
def get_effective_architecture(args: argparse.Namespace) -> str:
architecture = args.architecture
if architecture:
assert isinstance(architecture, str)
return architecture
# Check platform.version to detect arm64 with x86_64 python binary.
if "ARM64" in platform.version():
@@ -214,7 +216,7 @@ def use_upstream_workflow(args: argparse.Namespace) -> bool:
return make_utils.git_remote_exist(args.git_command, "upstream")
def work_tree_update_upstream_workflow(args: argparse.Namespace, use_fetch=True) -> str:
def work_tree_update_upstream_workflow(args: argparse.Namespace, use_fetch: bool = True) -> str:
"""
Update the Blender repository using the Github style of fork organization
@@ -238,7 +240,7 @@ def work_tree_update_upstream_workflow(args: argparse.Namespace, use_fetch=True)
return ""
def work_tree_update(args: argparse.Namespace, use_fetch=True) -> str:
def work_tree_update(args: argparse.Namespace, use_fetch: bool = True) -> str:
"""
Update the Git working tree using the best strategy
@@ -293,7 +295,7 @@ def external_script_copy_old_submodule_over(args: argparse.Namespace, directory_
shutil.copytree(bare_repo_dir, external_dir / ".git")
git_config = external_dir / ".git" / "config"
call((args.git_command, "config", "--file", git_config, "--unset", "core.worktree"))
call((args.git_command, "config", "--file", str(git_config), "--unset", "core.worktree"))
def external_script_initialize_if_needed(args: argparse.Namespace,
@@ -325,12 +327,12 @@ def external_script_initialize_if_needed(args: argparse.Namespace,
if origin_name == "origin" and not make_utils.git_is_remote_repository(args.git_command, external_url):
external_url = resolve_external_url("https://projects.blender.org/blender/blender", repo_name)
call((args.git_command, "clone", "--origin", origin_name, external_url, external_dir))
call((args.git_command, "clone", "--origin", origin_name, external_url, str(external_dir)))
def external_script_add_origin_if_needed(args: argparse.Namespace,
repo_name: str,
directory_name: str) -> str:
directory_name: str) -> None:
"""
Add remote called 'origin' if there is a fork of the external repository available
@@ -338,7 +340,7 @@ def external_script_add_origin_if_needed(args: argparse.Namespace,
"""
if not use_upstream_workflow(args):
return ""
return
cwd = os.getcwd()
@@ -385,7 +387,7 @@ def external_script_add_origin_if_needed(args: argparse.Namespace,
finally:
os.chdir(cwd)
return ""
return
def external_scripts_update(args: argparse.Namespace,
@@ -485,7 +487,7 @@ if __name__ == "__main__":
major = blender_version.version // 100
minor = blender_version.version % 100
branch = f"blender-v{major}.{minor}-release"
release_version = f"{major}.{minor}"
release_version: Optional[str] = f"{major}.{minor}"
else:
branch = 'main'
release_version = None

View File

@@ -68,7 +68,7 @@ def git_branch_exists(git_command: str, branch: str) -> bool:
)
def git_get_remote_url(git_command: str, remote_name: str) -> bool:
def git_get_remote_url(git_command: str, remote_name: str) -> str:
return check_output((git_command, "ls-remote", "--get-url", remote_name))

View File

@@ -231,7 +231,7 @@ class FileBlockHeader:
self.SDNAIndex = 0
self.Count = 0
self.FileOffset = handle.tell()
#self.Code += ' ' * (4 - len(self.Code))
# self.Code += ' ' * (4 - len(self.Code))
log.debug("found blend-file-block-fileheader {0} {1}".format(self.Code, self.FileOffset))
def skip(self, handle):

View File

@@ -38,7 +38,7 @@ PROJECT_NAME = Blender
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = V3.5
PROJECT_NUMBER = V3.6
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a

View File

@@ -1853,8 +1853,6 @@ def pyrna2sphinx(basepath):
fw(" %s\n\n" % operator_description)
for prop in op.args:
write_param(" ", fw, prop)
if op.args:
fw("\n")
location = op.get_location()
if location != (None, None):
@@ -1865,9 +1863,12 @@ def pyrna2sphinx(basepath):
else:
url_base = API_BASEURL
fw(" :file:`%s\\:%d <%s/%s#L%d>`_\n\n" %
fw(" :File: `%s\\:%d <%s/%s#L%d>`__\n\n" %
(location[0], location[1], url_base, location[0], location[1]))
if op.args:
fw("\n")
file.close()
if "bpy.ops" not in EXCLUDE_MODULES:

View File

@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2006 Blender Foundation. All rights reserved.
# Copyright 2006 Blender Foundation
# Libs that adhere to strict flags
add_subdirectory(curve_fit_nd)

View File

@@ -14,3 +14,13 @@ The first three of them were employed by the Blender Foundation during that time
Some features (random sounds, dynamic music, playback manager, convolution and HRTFs support) were added as part of the VALS (Virtual Alliances for Learning Society) project by
- Juan Francisco Crespo Galán <dethon_5@outlook.com>
The Equalizer sound effect has been added by
- Marcos Perez
Several people provided fixes:
- Aaron Carlisle
- Sebastian Parborg
- Leon Zandman

View File

@@ -1,3 +1,104 @@
Audaspace 1.4
- Support for OS specific/native audio devices/backends has been added, that is PulseAudio (Linux), WASAPI (Windows) and CoreAudio (MacOS).
- New sound effects have been added, namely Modulator and Equalizer. Thanks to Marcos Perez for contributing the Equalizer.
- File stream info: if an audio file contains multiple streams you can choose which one to process instead of taking the first one (this feature is only supported by ffmpeg, not libsndfile).
- API Change: double instead of float for time values for more precise timing control.
- There have been lots of bugfixes, which are basically the majority of all changes.
- And some other minor improvements were implemented as well.
Detailed list of changes:
d4042d9 Port changes in Blender to upstream.
b60fb45 Equalizer
ab04e84 Fixes
8f0c305 Fix build error with MSVC 17.4+ ported from Blender.
ce44342 Minor documentation update.
cdcb3f4 Migrate from distuils to setuptools for python module.
21eccef Fix FindFFTW to find the float version fftw3f.
ab15e2f Bugfix: API change in new ffmpeg version.
a097be8 Clang format file added, valid from now on.
2fc9fb7 Porting bugfix from Blender upstream.
bb655b7 Bugfix: wrong sample size computation for PulseAudio.
a150495 Bugfix: Buffer did not support buffers > 2 GB.
034645c Update for ffmpeg 5.
932739c Bugfix: WASAPI hangs.
4fcd47c WASAPI: fix bug when switching the default device while there is no playback.
a16fbd2 Python API: fix to get convolution in the python API.
27ac5c1 WASAPI: always switch to default audio device.
1b03e6c Bugfix: catch exception if file cannot be read.
369ff6e PulseAudio: remove unused underflow callback.
2d8bf3a PulseAudio: improve synchronization accuracy.
4868e14 Revert PulseAudioDevice back from ThreadedDevice to threaded mainloop.
6a04446 Adding a jack style mixing thread with a ring buffer for pulseaudio.
5d4b57b Implement RingBuffer class.
e02d3aa FFMPEG: fix seeking and duration calculation.
07b9fa0 Adding file stream functionality.
5a8ad27 Porting changes from Blender.
fa47258 Bugfix: PulseAudio writing to little data on request.
ca3edb5 PulseAudio: increase buffersize.
6d36f3e Pulseaudio: may fix crackling playback start bug.
dbeac4b WASAPI: reinitialize device when lost.
0cba4d3 Bugfix Pulseaudio: might hang.
b73dc6d Bugfix: ffmpeg 4.4 requires channels to be set.
f1ecbe0 Fixed typo.
09e4f27 Rewrite PulseAudioDevice to use ThreadedDevice.
9516924 WASAPI: refactor to simplify and use ThreadedDevice.
749c974 Add ThreadedDevice.
e68b355 Fix some locks in SoftwareDevice.
44b57af Bugfix for deadlock in WASAPIDevice.
8c4b266 CMake: fix ERROR to FATAL_ERROR in MESSAGE.
5a17338 Rename NullDevice's reported name to None.
cd138d7 PulseAudio: add dynamic loading and threading fixes.
6e0250f CoreAudio: add CoreAudioClock as synchronizer.
43aff35 Fix leakage in CoreAudioDevice.cpp
7f6f059 Remove unnecessary cmake code.
a5c1a02 Add CoreAudio device for Apple.
af96f67 Indentation fix.
eec8fd5 WASAPI: use padding also for first buffer submission.
c63bd9b WASAPI: deal with IsFormatSupported case.
079cccb Hide WITH_PULSEAUDIO when not on Linux.
67b5013 Add mingw64 cross compilation toolchain on Linux.
a7bfa58 Add WASAPI backend for Windows.
be1cb25 Allow AUD_init with nullptr to use default device.
fc68868 Compilation fix for mingw.
bb79d25 Add a PulseAudio output device.
a11f593 Bugfix for unwanted volume fading at the beginning of sounds.
8510acf Bugfix: more accurate positioning of sequences.
cb816c1 Fix API docs for python playback manager play function
d125fa2 Add callback for mixing down audio.
789832e Fix numpy import.
9a6a802 Bugfix: JOS resampling type bugfix caused integer underflow.
ece0842 Fix corrupted document in python bindings
28b2ea2 SDL 2: support more audio formats.
a39b7e3 Trying to fix Travis CI build for OS X.
c924007 Some more changes of times from flaot to double.
659afd4 Porting fixes from blender.
8e5e2e6 Fix documentation warnings.
7a6054f API: All times are now double instead of float.
452a724 Mixer sample buffer added channels twice
8ddb6c1 Docs: Cleanup Line Wrapping for python examples
a0c37b2 Docs: Use class methods for api docs
2f8b2e3 Bugfix for invalid offsets provided by ffmpeg's seeking code.
20a7a28 Bug fixes for files with more than 8 channels.
94dc527 Bugfix: Fading from full volume.
2fb9862 Fix: Missing include in FileManager.h.
afadb94 Minor CMakeLists.txt formatting fixes.
734ef03 Add sample rate parameter to silence generation.
ed50f3b Bugfix: Return correct length for modulator and superpose.
cb7a314 Adding a modulator sound effect.
101c714 Bugfix: don't add non-existing devices to the device manager.
7ad99df OpenAL: recreate device if disconnected.
a2ff4e8 Bugfix: memory leak in python API.
5fb21bb Silence some warnings.
9b38605 Some fixes backported from Blender.
40a0a34 Udpate for travis.ci.
212b4b6 Support newer ffmpeg versions.
d27746c Build option: configure whether to build versioned plugins.
19c8d9f Make fftw3 optional.
aa11968 Bugfix for building with gcc7.
10413c5 Fix for seeking with modified pitch.
Audaspace 1.3
=============
@@ -10,6 +111,8 @@ Audaspace 1.3
- filter python API parameter check
- finding ffmpeg with pkgconfig
Detailed list of changes:
64884a7 Windows fixes.
53ba3e6 Implemented JACK dynamic loading.
5ee0ee1 Continues last commit.
@@ -46,6 +149,8 @@ Audaspace 1.2
- assuring numpy is installed
- building the Python module on Mac OS X with CMake
Detailed list of changes:
a6b6e70 Changing default sample rate from 44.1 to 48 kHz.
20f0164 Bugfix: CMake custom command for python module on OS X.
98679a2 Bugfix: using standard library (s)rand.

View File

@@ -23,7 +23,7 @@ endif()
project(audaspace)
set(AUDASPACE_VERSION 1.3)
set(AUDASPACE_VERSION 1.4)
set(AUDASPACE_LONG_VERSION ${AUDASPACE_VERSION}.0)
if(DEFINED AUDASPACE_CMAKE_CFG)

View File

@@ -15,7 +15,7 @@ Audaspace is written in C++ 11 so a fairly recent compiler (g++ 4.8.2, clang 3.3
- Jack (output device)
- libsndfile (file access)
- ffmpeg (file access)
- Python (language binding)
- Python (language binding, needs NumPy as well)
Getting the Code
----------------

View File

@@ -32,7 +32,7 @@ The following (probably incomplete) features are supported by audaspace:
License
-------
> Copyright © 2009-2015 Jörg Müller. All rights reserved.
> Copyright © 2009-2023 Jörg Müller. All rights reserved.
>
> Licensed under the Apache License, Version 2.0 (the "License");
> you may not use this file except in compliance with the License.

View File

@@ -165,6 +165,12 @@ AUD_API void AUD_SequenceEntry_move(AUD_SequenceEntry* entry, double begin, doub
(*entry)->move(begin, end, skip);
}
AUD_API void AUD_SequenceEntry_setConstantRangeAnimationData(AUD_SequenceEntry* entry, AUD_AnimateablePropertyType type, int frame_start, int frame_end, float* data)
{
AnimateableProperty* prop = (*entry)->getAnimProperty(static_cast<AnimateablePropertyType>(type));
prop->writeConstantRange(data, frame_start, frame_end);
}
AUD_API void AUD_SequenceEntry_setAnimationData(AUD_SequenceEntry* entry, AUD_AnimateablePropertyType type, int frame, float* data, char animated)
{
AnimateableProperty* prop = (*entry)->getAnimProperty(static_cast<AnimateablePropertyType>(type));

View File

@@ -68,6 +68,16 @@ extern AUD_API void AUD_Sequence_remove(AUD_Sound* sequence, AUD_SequenceEntry*
* Writes animation data to a sequence.
* \param sequence The sound scene.
* \param type The type of animation data.
* \param frame_start Start of the frame range.
* \param frame_end End of the frame range.
* \param data The data to write.
*/
AUD_API void AUD_SequenceEntry_setConstantRangeAnimationData(AUD_SequenceEntry* entry, AUD_AnimateablePropertyType type, int frame_start, int frame_end, float* data);
/**
* Writes animation data to a sequenced entry.
* \param entry The sequenced entry.
* \param type The type of animation data.
* \param frame The frame this data is for.
* \param data The data to write.
* \param animated Whether the attribute is animated.

View File

@@ -112,6 +112,14 @@ public:
*/
void write(const float* data, int position, int count);
/**
* Fills the properties frame range with constant value and marks it animated.
* \param data The new value.
* \param position_start The start position in the animation in frames.
* \param position_end The end position in the animation in frames.
*/
void writeConstantRange(const float* data, int position_start, int position_end);
/**
* Reads the properties value.
* \param position The position in the animation in frames.

View File

@@ -198,12 +198,13 @@ public:
/**
* Adds a new entry to the scene.
* \param sound The sound this entry should play.
* \param sequence_data Reference to sequence_data. Mainly needed to get the FPS of the scene.
* \param begin The start time.
* \param end The end time or a negative value if determined by the sound.
* \param skip How much seconds should be skipped at the beginning.
* \return The entry added.
*/
std::shared_ptr<SequenceEntry> add(std::shared_ptr<ISound> sound, double begin, double end, double skip);
std::shared_ptr<SequenceEntry> add(std::shared_ptr<ISound> sound, std::shared_ptr<SequenceData> sequence_data, double begin, double end, double skip);
/**
* Removes an entry from the scene.

View File

@@ -23,6 +23,7 @@
*/
#include "sequence/AnimateableProperty.h"
#include "sequence/SequenceData.h"
#include "util/ILockable.h"
#include <mutex>
@@ -63,6 +64,9 @@ private:
/// How many seconds are skipped at the beginning.
double m_skip;
/// reference to sequence_data. Mainly needed to get the FPS of the scene.
std::shared_ptr<SequenceData> m_sequence_data;
/// Whether the entry is muted.
bool m_muted;
@@ -122,9 +126,10 @@ public:
* \param begin The start time.
* \param end The end time or a negative value if determined by the sound.
* \param skip How much seconds should be skipped at the beginning.
* \param sequence_data Reference to sequence_data. Mainly needed to get the FPS of the scene.
* \param id The ID of the entry.
*/
SequenceEntry(std::shared_ptr<ISound> sound, double begin, double end, double skip, int id);
SequenceEntry(std::shared_ptr<ISound> sound, double begin, double end, double skip, std::shared_ptr<SequenceData> sequence_data, int id);
virtual ~SequenceEntry();
/**

View File

@@ -65,6 +65,19 @@ void AnimateableProperty::write(const float* data)
std::memcpy(getBuffer(), data, m_count * sizeof(float));
}
void AnimateableProperty::writeConstantRange(const float* data, int position_start, int position_end)
{
assureSize(position_end * m_count * sizeof(float), true);
float* buffer = getBuffer();
for(int i = position_start; i < position_end; i++)
{
std::memcpy(buffer + i * m_count, data, m_count * sizeof(float));
}
m_isAnimated = true;
}
void AnimateableProperty::write(const float* data, int position, int count)
{
std::lock_guard<std::recursive_mutex> lock(m_mutex);

View File

@@ -92,7 +92,7 @@ AnimateableProperty* Sequence::getAnimProperty(AnimateablePropertyType type)
std::shared_ptr<SequenceEntry> Sequence::add(std::shared_ptr<ISound> sound, double begin, double end, double skip)
{
return m_sequence->add(sound, begin, end, skip);
return m_sequence->add(sound, m_sequence, begin, end, skip);
}
void Sequence::remove(std::shared_ptr<SequenceEntry> entry)

View File

@@ -149,11 +149,11 @@ AnimateableProperty* SequenceData::getAnimProperty(AnimateablePropertyType type)
}
}
std::shared_ptr<SequenceEntry> SequenceData::add(std::shared_ptr<ISound> sound, double begin, double end, double skip)
std::shared_ptr<SequenceEntry> SequenceData::add(std::shared_ptr<ISound> sound, std::shared_ptr<SequenceData> sequence_data, double begin, double end, double skip)
{
std::lock_guard<std::recursive_mutex> lock(m_mutex);
std::shared_ptr<SequenceEntry> entry = std::shared_ptr<SequenceEntry>(new SequenceEntry(sound, begin, end, skip, m_id++));
std::shared_ptr<SequenceEntry> entry = std::shared_ptr<SequenceEntry>(new SequenceEntry(sound, begin, end, skip, sequence_data, m_id++));
m_entries.push_back(entry);
m_entry_status++;

View File

@@ -22,7 +22,7 @@
AUD_NAMESPACE_BEGIN
SequenceEntry::SequenceEntry(std::shared_ptr<ISound> sound, double begin, double end, double skip, int id) :
SequenceEntry::SequenceEntry(std::shared_ptr<ISound> sound, double begin, double end, double skip, std::shared_ptr<SequenceData> sequence_data, int id) :
m_status(0),
m_pos_status(1),
m_sound_status(0),
@@ -31,6 +31,7 @@ SequenceEntry::SequenceEntry(std::shared_ptr<ISound> sound, double begin, double
m_begin(begin),
m_end(end),
m_skip(skip),
m_sequence_data(sequence_data),
m_muted(false),
m_relative(true),
m_volume_max(1.0f),

View File

@@ -241,10 +241,38 @@ bool SequenceHandle::seek(double position)
return false;
std::lock_guard<ILockable> lock(*m_entry);
double seekpos = position - m_entry->m_begin;
if(seekpos < 0)
seekpos = 0;
seekpos += m_entry->m_skip;
double seek_frame = (position - m_entry->m_begin) * m_entry->m_sequence_data->getFPS();
if(seek_frame < 0)
seek_frame = 0;
seek_frame += m_entry->m_skip * m_entry->m_sequence_data->getFPS();
AnimateableProperty* pitch_property = m_entry->getAnimProperty(AP_PITCH);
double target_frame = 0;
if(pitch_property != nullptr)
{
int frame_start = (m_entry->m_begin - m_entry->m_skip) * m_entry->m_sequence_data->getFPS();
for(int i = 0; seek_frame > 0; i++)
{
float pitch;
pitch_property->read(frame_start + i, &pitch);
const double factor = seek_frame > 1.0 ? 1.0 : seek_frame;
target_frame += pitch * factor;
seek_frame--;
}
}
else
{
target_frame = seek_frame;
}
double seekpos = target_frame / m_entry->m_sequence_data->getFPS();
m_handle->setPitch(1.0f);
m_handle->seek(seekpos);

View File

@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2008 Blender Foundation. All rights reserved.
# Copyright 2008 Blender Foundation
set(INC
include

View File

@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2006 Blender Foundation. All rights reserved.
# Copyright 2006 Blender Foundation
# avoid noisy warnings
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")

View File

@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2012 Blender Foundation. All rights reserved.
# Copyright 2012 Blender Foundation
set(INC
.

View File

@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2006 Blender Foundation. All rights reserved.
# Copyright 2006 Blender Foundation
set(INC
.

View File

@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2006 Blender Foundation. All rights reserved.
# Copyright 2006 Blender Foundation
set(INC
.

View File

@@ -127,7 +127,7 @@ typedef uint32_t cuuint32_t;
typedef uint64_t cuuint64_t;
#endif
#if defined(__x86_64) || defined(AMD64) || defined(_M_AMD64) || defined (__aarch64__)
#if defined(__x86_64) || defined(AMD64) || defined(_M_AMD64) || defined (__aarch64__) || defined(__ppc64__) || defined(__PPC64__)
typedef unsigned long long CUdeviceptr;
#else
typedef unsigned int CUdeviceptr;

View File

@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2019 Blender Foundation. All rights reserved.
# Copyright 2019 Blender Foundation
# Build Draco library.
add_subdirectory(draco)

View File

@@ -1,7 +1,7 @@
Project: fast_float
URL: https://github.com/fastfloat/fast_float
License: MIT
Upstream version: 3.4.0 (b7f9d6c)
Upstream version: 4.0.0 (fbd5bd7, 2023 Mar 31)
Local modifications:
- Took only the fast_float.h header and the license/readme files

View File

@@ -1,12 +1,5 @@
## fast_float number parsing library: 4x faster than strtod
![Ubuntu 20.04 CI (GCC 9)](https://github.com/lemire/fast_float/workflows/Ubuntu%2020.04%20CI%20(GCC%209)/badge.svg)
![Ubuntu 18.04 CI (GCC 7)](https://github.com/lemire/fast_float/workflows/Ubuntu%2018.04%20CI%20(GCC%207)/badge.svg)
![Alpine Linux](https://github.com/lemire/fast_float/workflows/Alpine%20Linux/badge.svg)
![MSYS2-CI](https://github.com/lemire/fast_float/workflows/MSYS2-CI/badge.svg)
![VS16-CLANG-CI](https://github.com/lemire/fast_float/workflows/VS16-CLANG-CI/badge.svg)
[![VS16-CI](https://github.com/fastfloat/fast_float/actions/workflows/vs16-ci.yml/badge.svg)](https://github.com/fastfloat/fast_float/actions/workflows/vs16-ci.yml)
The fast_float library provides fast header-only implementations for the C++ from_chars
functions for `float` and `double` types. These functions convert ASCII strings representing
decimal values (e.g., `1.3e10`) into binary types. We provide exact rounding (including
@@ -28,8 +21,8 @@ struct from_chars_result {
```
It parses the character sequence [first,last) for a number. It parses floating-point numbers expecting
a locale-independent format equivalent to the C++17 from_chars function.
The resulting floating-point value is the closest floating-point values (using either float or double),
a locale-independent format equivalent to the C++17 from_chars function.
The resulting floating-point value is the closest floating-point values (using either float or double),
using the "round to even" convention for values that would otherwise fall right in-between two values.
That is, we provide exact parsing according to the IEEE standard.
@@ -47,7 +40,7 @@ Example:
``` C++
#include "fast_float/fast_float.h"
#include <iostream>
int main() {
const std::string input = "3.1416 xyz ";
double result;
@@ -60,39 +53,60 @@ int main() {
Like the C++17 standard, the `fast_float::from_chars` functions take an optional last argument of
the type `fast_float::chars_format`. It is a bitset value: we check whether
the type `fast_float::chars_format`. It is a bitset value: we check whether
`fmt & fast_float::chars_format::fixed` and `fmt & fast_float::chars_format::scientific` are set
to determine whether we allow the fixed point and scientific notation respectively.
The default is `fast_float::chars_format::general` which allows both `fixed` and `scientific`.
The library seeks to follow the C++17 (see [20.19.3](http://eel.is/c++draft/charconv.from.chars).(7.1)) specification.
The library seeks to follow the C++17 (see [20.19.3](http://eel.is/c++draft/charconv.from.chars).(7.1)) specification.
* The `from_chars` function does not skip leading white-space characters.
* [A leading `+` sign](https://en.cppreference.com/w/cpp/utility/from_chars) is forbidden.
* It is generally impossible to represent a decimal value exactly as binary floating-point number (`float` and `double` types). We seek the nearest value. We round to an even mantissa when we are in-between two binary floating-point numbers.
* It is generally impossible to represent a decimal value exactly as binary floating-point number (`float` and `double` types). We seek the nearest value. We round to an even mantissa when we are in-between two binary floating-point numbers.
Furthermore, we have the following restrictions:
* We only support `float` and `double` types at this time.
* We only support the decimal format: we do not support hexadecimal strings.
* For values that are either very large or very small (e.g., `1e9999`), we represent it using the infinity or negative infinity value.
* For values that are either very large or very small (e.g., `1e9999`), we represent it using the infinity or negative infinity value and the returned `ec` is set to `std::errc::result_out_of_range`.
We support Visual Studio, macOS, Linux, freeBSD. We support big and little endian. We support 32-bit and 64-bit systems.
We assume that the rounding mode is set to nearest (`std::fegetround() == FE_TONEAREST`).
## C++20: compile-time evaluation (constexpr)
In C++20, you may use `fast_float::from_chars` to parse strings
at compile-time, as in the following example:
```C++
// consteval forces compile-time evaluation of the function in C++20.
consteval double parse(std::string_view input) {
double result;
auto answer = fast_float::from_chars(input.data(), input.data()+input.size(), result);
if(answer.ec != std::errc()) { return -1.0; }
return result;
}
// This function should compile to a function which
// merely returns 3.1415.
constexpr double constexptest() {
return parse("3.1415 input");
}
```
## Using commas as decimal separator
The C++ standard stipulate that `from_chars` has to be locale-independent. In
particular, the decimal separator has to be the period (`.`). However,
some users still want to use the `fast_float` library with in a locale-dependent
particular, the decimal separator has to be the period (`.`). However,
some users still want to use the `fast_float` library with in a locale-dependent
manner. Using a separate function called `from_chars_advanced`, we allow the users
to pass a `parse_options` instance which contains a custom decimal separator (e.g.,
to pass a `parse_options` instance which contains a custom decimal separator (e.g.,
the comma). You may use it as follows.
```C++
#include "fast_float/fast_float.h"
#include <iostream>
int main() {
const std::string input = "3,1416 xyz ";
double result;
@@ -104,25 +118,62 @@ int main() {
}
```
You can parse delimited numbers:
```C++
const std::string input = "234532.3426362,7869234.9823,324562.645";
double result;
auto answer = fast_float::from_chars(input.data(), input.data()+input.size(), result);
if(answer.ec != std::errc()) {
// check error
}
// we have result == 234532.3426362.
if(answer.ptr[0] != ',') {
// unexpected delimiter
}
answer = fast_float::from_chars(answer.ptr + 1, input.data()+input.size(), result);
if(answer.ec != std::errc()) {
// check error
}
// we have result == 7869234.9823.
if(answer.ptr[0] != ',') {
// unexpected delimiter
}
answer = fast_float::from_chars(answer.ptr + 1, input.data()+input.size(), result);
if(answer.ec != std::errc()) {
// check error
}
// we have result == 324562.645.
```
## Reference
- Daniel Lemire, [Number Parsing at a Gigabyte per Second](https://arxiv.org/abs/2101.11408), Software: Pratice and Experience 51 (8), 2021.
## Relation With Other Work
The fast_float library is part of:
- GCC (as of version 12): the `from_chars` function in GCC relies on fast_float.
- [WebKit](https://github.com/WebKit/WebKit), the engine behind Safari (Apple's web browser)
The fastfloat algorithm is part of the [LLVM standard libraries](https://github.com/llvm/llvm-project/commit/87c016078ad72c46505461e4ff8bfa04819fe7ba).
There is a [derived implementation part of AdaCore](https://github.com/AdaCore/VSS).
The fast_float library provides a performance similar to that of the [fast_double_parser](https://github.com/lemire/fast_double_parser) library but using an updated algorithm reworked from the ground up, and while offering an API more in line with the expectations of C++ programmers. The fast_double_parser library is part of the [Microsoft LightGBM machine-learning framework](https://github.com/microsoft/LightGBM).
## References
- Daniel Lemire, [Number Parsing at a Gigabyte per Second](https://arxiv.org/abs/2101.11408), Software: Practice and Experience 51 (8), 2021.
- Noble Mushtak, Daniel Lemire, [Fast Number Parsing Without Fallback](https://arxiv.org/abs/2212.06644), Software: Practice and Experience (to appear)
## Other programming languages
- [There is an R binding](https://github.com/eddelbuettel/rcppfastfloat) called `rcppfastfloat`.
- [There is a Rust port of the fast_float library](https://github.com/aldanor/fast-float-rust/) called `fast-float-rust`.
- [There is a Java port of the fast_float library](https://github.com/wrandelshofer/FastDoubleParser) called `FastDoubleParser`.
- [There is a Java port of the fast_float library](https://github.com/wrandelshofer/FastDoubleParser) called `FastDoubleParser`. It used for important systems such as [Jackson](https://github.com/FasterXML/jackson-core).
- [There is a C# port of the fast_float library](https://github.com/CarlVerret/csFastFloat) called `csFastFloat`.
## Relation With Other Work
The fastfloat algorithm is part of the [LLVM standard libraries](https://github.com/llvm/llvm-project/commit/87c016078ad72c46505461e4ff8bfa04819fe7ba).
The fast_float library provides a performance similar to that of the [fast_double_parser](https://github.com/lemire/fast_double_parser) library but using an updated algorithm reworked from the ground up, and while offering an API more in line with the expectations of C++ programmers. The fast_double_parser library is part of the [Microsoft LightGBM machine-learning framework](https://github.com/microsoft/LightGBM).
## Users
The fast_float library is used by [Apache Arrow](https://github.com/apache/arrow/pull/8494) where it multiplied the number parsing speed by two or three times. It is also used by [Yandex ClickHouse](https://github.com/ClickHouse/ClickHouse) and by [Google Jsonnet](https://github.com/google/jsonnet).
@@ -135,14 +186,14 @@ It can parse random floating-point numbers at a speed of 1 GB/s on some systems.
<img src="http://lemire.me/blog/wp-content/uploads/2020/11/fastfloat_speed.png" width="400">
```
$ ./build/benchmarks/benchmark
$ ./build/benchmarks/benchmark
# parsing random integers in the range [0,1)
volume = 2.09808 MB
netlib : 271.18 MB/s (+/- 1.2 %) 12.93 Mfloat/s
doubleconversion : 225.35 MB/s (+/- 1.2 %) 10.74 Mfloat/s
strtod : 190.94 MB/s (+/- 1.6 %) 9.10 Mfloat/s
abseil : 430.45 MB/s (+/- 2.2 %) 20.52 Mfloat/s
fastfloat : 1042.38 MB/s (+/- 9.9 %) 49.68 Mfloat/s
volume = 2.09808 MB
netlib : 271.18 MB/s (+/- 1.2 %) 12.93 Mfloat/s
doubleconversion : 225.35 MB/s (+/- 1.2 %) 10.74 Mfloat/s
strtod : 190.94 MB/s (+/- 1.6 %) 9.10 Mfloat/s
abseil : 430.45 MB/s (+/- 2.2 %) 20.52 Mfloat/s
fastfloat : 1042.38 MB/s (+/- 9.9 %) 49.68 Mfloat/s
```
See https://github.com/lemire/simple_fastfloat_benchmark for our benchmarking code.
@@ -183,23 +234,23 @@ You should change the `GIT_TAG` line so that you recover the version you wish to
## Using as single header
The script `script/amalgamate.py` may be used to generate a single header
The script `script/amalgamate.py` may be used to generate a single header
version of the library if so desired.
Just run the script from the root directory of this repository.
Just run the script from the root directory of this repository.
You can customize the license type and output file if desired as described in
the command line help.
You may directly download automatically generated single-header files:
https://github.com/fastfloat/fast_float/releases/download/v1.1.2/fast_float.h
https://github.com/fastfloat/fast_float/releases/download/v3.4.0/fast_float.h
## Credit
Though this work is inspired by many different people, this work benefited especially from exchanges with
Michael Eisel, who motivated the original research with his key insights, and with Nigel Tao who provided
Though this work is inspired by many different people, this work benefited especially from exchanges with
Michael Eisel, who motivated the original research with his key insights, and with Nigel Tao who provided
invaluable feedback. Rémy Oudompheng first implemented a fast path we use in the case of long digits.
The library includes code adapted from Google Wuffs (written by Nigel Tao) which was originally published
The library includes code adapted from Google Wuffs (written by Nigel Tao) which was originally published
under the Apache 2.0 license.
## License

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2016 Blender Foundation. All rights reserved.
# Copyright 2016 Blender Foundation
# Too noisy for code we don't maintain.
if(CMAKE_COMPILER_IS_GNUCC)

View File

@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2016 Blender Foundation. All rights reserved.
# Copyright 2016 Blender Foundation
set(INC
src

View File

@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2014 Blender Foundation. All rights reserved.
# Copyright 2014 Blender Foundation
set(INC
.

View File

@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2014 Blender Foundation. All rights reserved.
# Copyright 2014 Blender Foundation
# avoid noisy warnings
if(CMAKE_COMPILER_IS_GNUCC)

View File

@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2021 Blender Foundation. All rights reserved.
# Copyright 2021 Blender Foundation
set(INC
.

View File

@@ -84,7 +84,7 @@ typedef uint32_t hipuint32_t;
typedef uint64_t hipuint64_t;
#endif
#if defined(__x86_64) || defined(AMD64) || defined(_M_AMD64) || defined (__aarch64__)
#if defined(__x86_64) || defined(AMD64) || defined(_M_AMD64) || defined (__aarch64__) || defined(__ppc64__) || defined(__PPC64__)
typedef unsigned long long hipDeviceptr_t;
#else
typedef unsigned int hipDeviceptr_t;

View File

@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2006 Blender Foundation. All rights reserved.
# Copyright 2006 Blender Foundation
# avoid noisy warnings
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")

View File

@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2006 Blender Foundation. All rights reserved.
# Copyright 2006 Blender Foundation
remove_strict_flags()

View File

@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2016 Blender Foundation. All rights reserved.
# Copyright 2016 Blender Foundation
# The Original Code is: all of this file.
# Contributor(s): Sebastian Barschkis (sebbas).

View File

@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2019 Blender Foundation. All rights reserved.
# Copyright 2019 Blender Foundation
# avoid noisy warnings
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")

View File

@@ -8,6 +8,7 @@
#include "loader.hpp"
#include <cstdint>
#include <fstream>
#include <unordered_map>

5
extern/renderdoc/README.blender vendored Normal file
View File

@@ -0,0 +1,5 @@
Project: Renderdoc APP
URL: https://github.com/baldurk/renderdoc/
License: MIT
Upstream version: d47e79ae079783935b8857d6a1730440eafb0b38
Local modifications: None

723
extern/renderdoc/include/renderdoc_app.h vendored Normal file
View File

@@ -0,0 +1,723 @@
/******************************************************************************
* The MIT License (MIT)
*
* Copyright (c) 2019-2023 Baldur Karlsson
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
******************************************************************************/
#pragma once
//////////////////////////////////////////////////////////////////////////////////////////////////
//
// Documentation for the API is available at https://renderdoc.org/docs/in_application_api.html
//
#if !defined(RENDERDOC_NO_STDINT)
#include <stdint.h>
#endif
#if defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER)
#define RENDERDOC_CC __cdecl
#elif defined(__linux__)
#define RENDERDOC_CC
#elif defined(__APPLE__)
#define RENDERDOC_CC
#else
#error "Unknown platform"
#endif
#ifdef __cplusplus
extern "C" {
#endif
//////////////////////////////////////////////////////////////////////////////////////////////////
// Constants not used directly in below API
// This is a GUID/magic value used for when applications pass a path where shader debug
// information can be found to match up with a stripped shader.
// the define can be used like so: const GUID RENDERDOC_ShaderDebugMagicValue =
// RENDERDOC_ShaderDebugMagicValue_value
#define RENDERDOC_ShaderDebugMagicValue_struct \
{ \
0xeab25520, 0x6670, 0x4865, 0x84, 0x29, 0x6c, 0x8, 0x51, 0x54, 0x00, 0xff \
}
// as an alternative when you want a byte array (assuming x86 endianness):
#define RENDERDOC_ShaderDebugMagicValue_bytearray \
{ \
0x20, 0x55, 0xb2, 0xea, 0x70, 0x66, 0x65, 0x48, 0x84, 0x29, 0x6c, 0x8, 0x51, 0x54, 0x00, 0xff \
}
// truncated version when only a uint64_t is available (e.g. Vulkan tags):
#define RENDERDOC_ShaderDebugMagicValue_truncated 0x48656670eab25520ULL
//////////////////////////////////////////////////////////////////////////////////////////////////
// RenderDoc capture options
//
typedef enum RENDERDOC_CaptureOption {
// Allow the application to enable vsync
//
// Default - enabled
//
// 1 - The application can enable or disable vsync at will
// 0 - vsync is force disabled
eRENDERDOC_Option_AllowVSync = 0,
// Allow the application to enable fullscreen
//
// Default - enabled
//
// 1 - The application can enable or disable fullscreen at will
// 0 - fullscreen is force disabled
eRENDERDOC_Option_AllowFullscreen = 1,
// Record API debugging events and messages
//
// Default - disabled
//
// 1 - Enable built-in API debugging features and records the results into
// the capture, which is matched up with events on replay
// 0 - no API debugging is forcibly enabled
eRENDERDOC_Option_APIValidation = 2,
eRENDERDOC_Option_DebugDeviceMode = 2, // deprecated name of this enum
// Capture CPU callstacks for API events
//
// Default - disabled
//
// 1 - Enables capturing of callstacks
// 0 - no callstacks are captured
eRENDERDOC_Option_CaptureCallstacks = 3,
// When capturing CPU callstacks, only capture them from actions.
// This option does nothing without the above option being enabled
//
// Default - disabled
//
// 1 - Only captures callstacks for actions.
// Ignored if CaptureCallstacks is disabled
// 0 - Callstacks, if enabled, are captured for every event.
eRENDERDOC_Option_CaptureCallstacksOnlyDraws = 4,
eRENDERDOC_Option_CaptureCallstacksOnlyActions = 4,
// Specify a delay in seconds to wait for a debugger to attach, after
// creating or injecting into a process, before continuing to allow it to run.
//
// 0 indicates no delay, and the process will run immediately after injection
//
// Default - 0 seconds
//
eRENDERDOC_Option_DelayForDebugger = 5,
// Verify buffer access. This includes checking the memory returned by a Map() call to
// detect any out-of-bounds modification, as well as initialising buffers with undefined contents
// to a marker value to catch use of uninitialised memory.
//
// NOTE: This option is only valid for OpenGL and D3D11. Explicit APIs such as D3D12 and Vulkan do
// not do the same kind of interception & checking and undefined contents are really undefined.
//
// Default - disabled
//
// 1 - Verify buffer access
// 0 - No verification is performed, and overwriting bounds may cause crashes or corruption in
// RenderDoc.
eRENDERDOC_Option_VerifyBufferAccess = 6,
// The old name for eRENDERDOC_Option_VerifyBufferAccess was eRENDERDOC_Option_VerifyMapWrites.
// This option now controls the filling of uninitialised buffers with 0xdddddddd which was
// previously always enabled
eRENDERDOC_Option_VerifyMapWrites = eRENDERDOC_Option_VerifyBufferAccess,
// Hooks any system API calls that create child processes, and injects
// RenderDoc into them recursively with the same options.
//
// Default - disabled
//
// 1 - Hooks into spawned child processes
// 0 - Child processes are not hooked by RenderDoc
eRENDERDOC_Option_HookIntoChildren = 7,
// By default RenderDoc only includes resources in the final capture necessary
// for that frame, this allows you to override that behaviour.
//
// Default - disabled
//
// 1 - all live resources at the time of capture are included in the capture
// and available for inspection
// 0 - only the resources referenced by the captured frame are included
eRENDERDOC_Option_RefAllResources = 8,
// **NOTE**: As of RenderDoc v1.1 this option has been deprecated. Setting or
// getting it will be ignored, to allow compatibility with older versions.
// In v1.1 the option acts as if it's always enabled.
//
// By default RenderDoc skips saving initial states for resources where the
// previous contents don't appear to be used, assuming that writes before
// reads indicate previous contents aren't used.
//
// Default - disabled
//
// 1 - initial contents at the start of each captured frame are saved, even if
// they are later overwritten or cleared before being used.
// 0 - unless a read is detected, initial contents will not be saved and will
// appear as black or empty data.
eRENDERDOC_Option_SaveAllInitials = 9,
// In APIs that allow for the recording of command lists to be replayed later,
// RenderDoc may choose to not capture command lists before a frame capture is
// triggered, to reduce overheads. This means any command lists recorded once
// and replayed many times will not be available and may cause a failure to
// capture.
//
// NOTE: This is only true for APIs where multithreading is difficult or
// discouraged. Newer APIs like Vulkan and D3D12 will ignore this option
// and always capture all command lists since the API is heavily oriented
// around it and the overheads have been reduced by API design.
//
// 1 - All command lists are captured from the start of the application
// 0 - Command lists are only captured if their recording begins during
// the period when a frame capture is in progress.
eRENDERDOC_Option_CaptureAllCmdLists = 10,
// Mute API debugging output when the API validation mode option is enabled
//
// Default - enabled
//
// 1 - Mute any API debug messages from being displayed or passed through
// 0 - API debugging is displayed as normal
eRENDERDOC_Option_DebugOutputMute = 11,
// Option to allow vendor extensions to be used even when they may be
// incompatible with RenderDoc and cause corrupted replays or crashes.
//
// Default - inactive
//
// No values are documented, this option should only be used when absolutely
// necessary as directed by a RenderDoc developer.
eRENDERDOC_Option_AllowUnsupportedVendorExtensions = 12,
} RENDERDOC_CaptureOption;
// Sets an option that controls how RenderDoc behaves on capture.
//
// Returns 1 if the option and value are valid
// Returns 0 if either is invalid and the option is unchanged
typedef int(RENDERDOC_CC *pRENDERDOC_SetCaptureOptionU32)(RENDERDOC_CaptureOption opt, uint32_t val);
typedef int(RENDERDOC_CC *pRENDERDOC_SetCaptureOptionF32)(RENDERDOC_CaptureOption opt, float val);
// Gets the current value of an option as a uint32_t
//
// If the option is invalid, 0xffffffff is returned
typedef uint32_t(RENDERDOC_CC *pRENDERDOC_GetCaptureOptionU32)(RENDERDOC_CaptureOption opt);
// Gets the current value of an option as a float
//
// If the option is invalid, -FLT_MAX is returned
typedef float(RENDERDOC_CC *pRENDERDOC_GetCaptureOptionF32)(RENDERDOC_CaptureOption opt);
typedef enum RENDERDOC_InputButton {
// '0' - '9' matches ASCII values
eRENDERDOC_Key_0 = 0x30,
eRENDERDOC_Key_1 = 0x31,
eRENDERDOC_Key_2 = 0x32,
eRENDERDOC_Key_3 = 0x33,
eRENDERDOC_Key_4 = 0x34,
eRENDERDOC_Key_5 = 0x35,
eRENDERDOC_Key_6 = 0x36,
eRENDERDOC_Key_7 = 0x37,
eRENDERDOC_Key_8 = 0x38,
eRENDERDOC_Key_9 = 0x39,
// 'A' - 'Z' matches ASCII values
eRENDERDOC_Key_A = 0x41,
eRENDERDOC_Key_B = 0x42,
eRENDERDOC_Key_C = 0x43,
eRENDERDOC_Key_D = 0x44,
eRENDERDOC_Key_E = 0x45,
eRENDERDOC_Key_F = 0x46,
eRENDERDOC_Key_G = 0x47,
eRENDERDOC_Key_H = 0x48,
eRENDERDOC_Key_I = 0x49,
eRENDERDOC_Key_J = 0x4A,
eRENDERDOC_Key_K = 0x4B,
eRENDERDOC_Key_L = 0x4C,
eRENDERDOC_Key_M = 0x4D,
eRENDERDOC_Key_N = 0x4E,
eRENDERDOC_Key_O = 0x4F,
eRENDERDOC_Key_P = 0x50,
eRENDERDOC_Key_Q = 0x51,
eRENDERDOC_Key_R = 0x52,
eRENDERDOC_Key_S = 0x53,
eRENDERDOC_Key_T = 0x54,
eRENDERDOC_Key_U = 0x55,
eRENDERDOC_Key_V = 0x56,
eRENDERDOC_Key_W = 0x57,
eRENDERDOC_Key_X = 0x58,
eRENDERDOC_Key_Y = 0x59,
eRENDERDOC_Key_Z = 0x5A,
// leave the rest of the ASCII range free
// in case we want to use it later
eRENDERDOC_Key_NonPrintable = 0x100,
eRENDERDOC_Key_Divide,
eRENDERDOC_Key_Multiply,
eRENDERDOC_Key_Subtract,
eRENDERDOC_Key_Plus,
eRENDERDOC_Key_F1,
eRENDERDOC_Key_F2,
eRENDERDOC_Key_F3,
eRENDERDOC_Key_F4,
eRENDERDOC_Key_F5,
eRENDERDOC_Key_F6,
eRENDERDOC_Key_F7,
eRENDERDOC_Key_F8,
eRENDERDOC_Key_F9,
eRENDERDOC_Key_F10,
eRENDERDOC_Key_F11,
eRENDERDOC_Key_F12,
eRENDERDOC_Key_Home,
eRENDERDOC_Key_End,
eRENDERDOC_Key_Insert,
eRENDERDOC_Key_Delete,
eRENDERDOC_Key_PageUp,
eRENDERDOC_Key_PageDn,
eRENDERDOC_Key_Backspace,
eRENDERDOC_Key_Tab,
eRENDERDOC_Key_PrtScrn,
eRENDERDOC_Key_Pause,
eRENDERDOC_Key_Max,
} RENDERDOC_InputButton;
// Sets which key or keys can be used to toggle focus between multiple windows
//
// If keys is NULL or num is 0, toggle keys will be disabled
typedef void(RENDERDOC_CC *pRENDERDOC_SetFocusToggleKeys)(RENDERDOC_InputButton *keys, int num);
// Sets which key or keys can be used to capture the next frame
//
// If keys is NULL or num is 0, captures keys will be disabled
typedef void(RENDERDOC_CC *pRENDERDOC_SetCaptureKeys)(RENDERDOC_InputButton *keys, int num);
typedef enum RENDERDOC_OverlayBits {
// This single bit controls whether the overlay is enabled or disabled globally
eRENDERDOC_Overlay_Enabled = 0x1,
// Show the average framerate over several seconds as well as min/max
eRENDERDOC_Overlay_FrameRate = 0x2,
// Show the current frame number
eRENDERDOC_Overlay_FrameNumber = 0x4,
// Show a list of recent captures, and how many captures have been made
eRENDERDOC_Overlay_CaptureList = 0x8,
// Default values for the overlay mask
eRENDERDOC_Overlay_Default = (eRENDERDOC_Overlay_Enabled | eRENDERDOC_Overlay_FrameRate |
eRENDERDOC_Overlay_FrameNumber | eRENDERDOC_Overlay_CaptureList),
// Enable all bits
eRENDERDOC_Overlay_All = ~0U,
// Disable all bits
eRENDERDOC_Overlay_None = 0,
} RENDERDOC_OverlayBits;
// returns the overlay bits that have been set
typedef uint32_t(RENDERDOC_CC *pRENDERDOC_GetOverlayBits)();
// sets the overlay bits with an and & or mask
typedef void(RENDERDOC_CC *pRENDERDOC_MaskOverlayBits)(uint32_t And, uint32_t Or);
// this function will attempt to remove RenderDoc's hooks in the application.
//
// Note: that this can only work correctly if done immediately after
// the module is loaded, before any API work happens. RenderDoc will remove its
// injected hooks and shut down. Behaviour is undefined if this is called
// after any API functions have been called, and there is still no guarantee of
// success.
typedef void(RENDERDOC_CC *pRENDERDOC_RemoveHooks)();
// DEPRECATED: compatibility for code compiled against pre-1.4.1 headers.
typedef pRENDERDOC_RemoveHooks pRENDERDOC_Shutdown;
// This function will unload RenderDoc's crash handler.
//
// If you use your own crash handler and don't want RenderDoc's handler to
// intercede, you can call this function to unload it and any unhandled
// exceptions will pass to the next handler.
typedef void(RENDERDOC_CC *pRENDERDOC_UnloadCrashHandler)();
// Sets the capture file path template
//
// pathtemplate is a UTF-8 string that gives a template for how captures will be named
// and where they will be saved.
//
// Any extension is stripped off the path, and captures are saved in the directory
// specified, and named with the filename and the frame number appended. If the
// directory does not exist it will be created, including any parent directories.
//
// If pathtemplate is NULL, the template will remain unchanged
//
// Example:
//
// SetCaptureFilePathTemplate("my_captures/example");
//
// Capture #1 -> my_captures/example_frame123.rdc
// Capture #2 -> my_captures/example_frame456.rdc
typedef void(RENDERDOC_CC *pRENDERDOC_SetCaptureFilePathTemplate)(const char *pathtemplate);
// returns the current capture path template, see SetCaptureFileTemplate above, as a UTF-8 string
typedef const char *(RENDERDOC_CC *pRENDERDOC_GetCaptureFilePathTemplate)();
// DEPRECATED: compatibility for code compiled against pre-1.1.2 headers.
typedef pRENDERDOC_SetCaptureFilePathTemplate pRENDERDOC_SetLogFilePathTemplate;
typedef pRENDERDOC_GetCaptureFilePathTemplate pRENDERDOC_GetLogFilePathTemplate;
// returns the number of captures that have been made
typedef uint32_t(RENDERDOC_CC *pRENDERDOC_GetNumCaptures)();
// This function returns the details of a capture, by index. New captures are added
// to the end of the list.
//
// filename will be filled with the absolute path to the capture file, as a UTF-8 string
// pathlength will be written with the length in bytes of the filename string
// timestamp will be written with the time of the capture, in seconds since the Unix epoch
//
// Any of the parameters can be NULL and they'll be skipped.
//
// The function will return 1 if the capture index is valid, or 0 if the index is invalid
// If the index is invalid, the values will be unchanged
//
// Note: when captures are deleted in the UI they will remain in this list, so the
// capture path may not exist anymore.
typedef uint32_t(RENDERDOC_CC *pRENDERDOC_GetCapture)(uint32_t idx, char *filename,
uint32_t *pathlength, uint64_t *timestamp);
// Sets the comments associated with a capture file. These comments are displayed in the
// UI program when opening.
//
// filePath should be a path to the capture file to add comments to. If set to NULL or ""
// the most recent capture file created made will be used instead.
// comments should be a NULL-terminated UTF-8 string to add as comments.
//
// Any existing comments will be overwritten.
typedef void(RENDERDOC_CC *pRENDERDOC_SetCaptureFileComments)(const char *filePath,
const char *comments);
// returns 1 if the RenderDoc UI is connected to this application, 0 otherwise
typedef uint32_t(RENDERDOC_CC *pRENDERDOC_IsTargetControlConnected)();
// DEPRECATED: compatibility for code compiled against pre-1.1.1 headers.
// This was renamed to IsTargetControlConnected in API 1.1.1, the old typedef is kept here for
// backwards compatibility with old code, it is castable either way since it's ABI compatible
// as the same function pointer type.
typedef pRENDERDOC_IsTargetControlConnected pRENDERDOC_IsRemoteAccessConnected;
// This function will launch the Replay UI associated with the RenderDoc library injected
// into the running application.
//
// if connectTargetControl is 1, the Replay UI will be launched with a command line parameter
// to connect to this application
// cmdline is the rest of the command line, as a UTF-8 string. E.g. a captures to open
// if cmdline is NULL, the command line will be empty.
//
// returns the PID of the replay UI if successful, 0 if not successful.
typedef uint32_t(RENDERDOC_CC *pRENDERDOC_LaunchReplayUI)(uint32_t connectTargetControl,
const char *cmdline);
// RenderDoc can return a higher version than requested if it's backwards compatible,
// this function returns the actual version returned. If a parameter is NULL, it will be
// ignored and the others will be filled out.
typedef void(RENDERDOC_CC *pRENDERDOC_GetAPIVersion)(int *major, int *minor, int *patch);
// Requests that the replay UI show itself (if hidden or not the current top window). This can be
// used in conjunction with IsTargetControlConnected and LaunchReplayUI to intelligently handle
// showing the UI after making a capture.
//
// This will return 1 if the request was successfully passed on, though it's not guaranteed that
// the UI will be on top in all cases depending on OS rules. It will return 0 if there is no current
// target control connection to make such a request, or if there was another error
typedef uint32_t(RENDERDOC_CC *pRENDERDOC_ShowReplayUI)();
//////////////////////////////////////////////////////////////////////////
// Capturing functions
//
// A device pointer is a pointer to the API's root handle.
//
// This would be an ID3D11Device, HGLRC/GLXContext, ID3D12Device, etc
typedef void *RENDERDOC_DevicePointer;
// A window handle is the OS's native window handle
//
// This would be an HWND, GLXDrawable, etc
typedef void *RENDERDOC_WindowHandle;
// A helper macro for Vulkan, where the device handle cannot be used directly.
//
// Passing the VkInstance to this macro will return the RENDERDOC_DevicePointer to use.
//
// Specifically, the value needed is the dispatch table pointer, which sits as the first
// pointer-sized object in the memory pointed to by the VkInstance. Thus we cast to a void** and
// indirect once.
#define RENDERDOC_DEVICEPOINTER_FROM_VKINSTANCE(inst) (*((void **)(inst)))
// This sets the RenderDoc in-app overlay in the API/window pair as 'active' and it will
// respond to keypresses. Neither parameter can be NULL
typedef void(RENDERDOC_CC *pRENDERDOC_SetActiveWindow)(RENDERDOC_DevicePointer device,
RENDERDOC_WindowHandle wndHandle);
// capture the next frame on whichever window and API is currently considered active
typedef void(RENDERDOC_CC *pRENDERDOC_TriggerCapture)();
// capture the next N frames on whichever window and API is currently considered active
typedef void(RENDERDOC_CC *pRENDERDOC_TriggerMultiFrameCapture)(uint32_t numFrames);
// When choosing either a device pointer or a window handle to capture, you can pass NULL.
// Passing NULL specifies a 'wildcard' match against anything. This allows you to specify
// any API rendering to a specific window, or a specific API instance rendering to any window,
// or in the simplest case of one window and one API, you can just pass NULL for both.
//
// In either case, if there are two or more possible matching (device,window) pairs it
// is undefined which one will be captured.
//
// Note: for headless rendering you can pass NULL for the window handle and either specify
// a device pointer or leave it NULL as above.
// Immediately starts capturing API calls on the specified device pointer and window handle.
//
// If there is no matching thing to capture (e.g. no supported API has been initialised),
// this will do nothing.
//
// The results are undefined (including crashes) if two captures are started overlapping,
// even on separate devices and/oror windows.
typedef void(RENDERDOC_CC *pRENDERDOC_StartFrameCapture)(RENDERDOC_DevicePointer device,
RENDERDOC_WindowHandle wndHandle);
// Returns whether or not a frame capture is currently ongoing anywhere.
//
// This will return 1 if a capture is ongoing, and 0 if there is no capture running
typedef uint32_t(RENDERDOC_CC *pRENDERDOC_IsFrameCapturing)();
// Ends capturing immediately.
//
// This will return 1 if the capture succeeded, and 0 if there was an error capturing.
typedef uint32_t(RENDERDOC_CC *pRENDERDOC_EndFrameCapture)(RENDERDOC_DevicePointer device,
RENDERDOC_WindowHandle wndHandle);
// Ends capturing immediately and discard any data stored without saving to disk.
//
// This will return 1 if the capture was discarded, and 0 if there was an error or no capture
// was in progress
typedef uint32_t(RENDERDOC_CC *pRENDERDOC_DiscardFrameCapture)(RENDERDOC_DevicePointer device,
RENDERDOC_WindowHandle wndHandle);
// Only valid to be called between a call to StartFrameCapture and EndFrameCapture. Gives a custom
// title to the capture produced which will be displayed in the UI.
//
// If multiple captures are ongoing, this title will be applied to the first capture to end after
// this call. The second capture to end will have no title, unless this function is called again.
//
// Calling this function has no effect if no capture is currently running
typedef void(RENDERDOC_CC *pRENDERDOC_SetCaptureTitle)(const char *title);
//////////////////////////////////////////////////////////////////////////////////////////////////
// RenderDoc API versions
//
// RenderDoc uses semantic versioning (http://semver.org/).
//
// MAJOR version is incremented when incompatible API changes happen.
// MINOR version is incremented when functionality is added in a backwards-compatible manner.
// PATCH version is incremented when backwards-compatible bug fixes happen.
//
// Note that this means the API returned can be higher than the one you might have requested.
// e.g. if you are running against a newer RenderDoc that supports 1.0.1, it will be returned
// instead of 1.0.0. You can check this with the GetAPIVersion entry point
typedef enum RENDERDOC_Version {
eRENDERDOC_API_Version_1_0_0 = 10000, // RENDERDOC_API_1_0_0 = 1 00 00
eRENDERDOC_API_Version_1_0_1 = 10001, // RENDERDOC_API_1_0_1 = 1 00 01
eRENDERDOC_API_Version_1_0_2 = 10002, // RENDERDOC_API_1_0_2 = 1 00 02
eRENDERDOC_API_Version_1_1_0 = 10100, // RENDERDOC_API_1_1_0 = 1 01 00
eRENDERDOC_API_Version_1_1_1 = 10101, // RENDERDOC_API_1_1_1 = 1 01 01
eRENDERDOC_API_Version_1_1_2 = 10102, // RENDERDOC_API_1_1_2 = 1 01 02
eRENDERDOC_API_Version_1_2_0 = 10200, // RENDERDOC_API_1_2_0 = 1 02 00
eRENDERDOC_API_Version_1_3_0 = 10300, // RENDERDOC_API_1_3_0 = 1 03 00
eRENDERDOC_API_Version_1_4_0 = 10400, // RENDERDOC_API_1_4_0 = 1 04 00
eRENDERDOC_API_Version_1_4_1 = 10401, // RENDERDOC_API_1_4_1 = 1 04 01
eRENDERDOC_API_Version_1_4_2 = 10402, // RENDERDOC_API_1_4_2 = 1 04 02
eRENDERDOC_API_Version_1_5_0 = 10500, // RENDERDOC_API_1_5_0 = 1 05 00
eRENDERDOC_API_Version_1_6_0 = 10600, // RENDERDOC_API_1_6_0 = 1 06 00
} RENDERDOC_Version;
// API version changelog:
//
// 1.0.0 - initial release
// 1.0.1 - Bugfix: IsFrameCapturing() was returning false for captures that were triggered
// by keypress or TriggerCapture, instead of Start/EndFrameCapture.
// 1.0.2 - Refactor: Renamed eRENDERDOC_Option_DebugDeviceMode to eRENDERDOC_Option_APIValidation
// 1.1.0 - Add feature: TriggerMultiFrameCapture(). Backwards compatible with 1.0.x since the new
// function pointer is added to the end of the struct, the original layout is identical
// 1.1.1 - Refactor: Renamed remote access to target control (to better disambiguate from remote
// replay/remote server concept in replay UI)
// 1.1.2 - Refactor: Renamed "log file" in function names to just capture, to clarify that these
// are captures and not debug logging files. This is the first API version in the v1.0
// branch.
// 1.2.0 - Added feature: SetCaptureFileComments() to add comments to a capture file that will be
// displayed in the UI program on load.
// 1.3.0 - Added feature: New capture option eRENDERDOC_Option_AllowUnsupportedVendorExtensions
// which allows users to opt-in to allowing unsupported vendor extensions to function.
// Should be used at the user's own risk.
// Refactor: Renamed eRENDERDOC_Option_VerifyMapWrites to
// eRENDERDOC_Option_VerifyBufferAccess, which now also controls initialisation to
// 0xdddddddd of uninitialised buffer contents.
// 1.4.0 - Added feature: DiscardFrameCapture() to discard a frame capture in progress and stop
// capturing without saving anything to disk.
// 1.4.1 - Refactor: Renamed Shutdown to RemoveHooks to better clarify what is happening
// 1.4.2 - Refactor: Renamed 'draws' to 'actions' in callstack capture option.
// 1.5.0 - Added feature: ShowReplayUI() to request that the replay UI show itself if connected
// 1.6.0 - Added feature: SetCaptureTitle() which can be used to set a title for a
// capture made with StartFrameCapture() or EndFrameCapture()
typedef struct RENDERDOC_API_1_6_0
{
pRENDERDOC_GetAPIVersion GetAPIVersion;
pRENDERDOC_SetCaptureOptionU32 SetCaptureOptionU32;
pRENDERDOC_SetCaptureOptionF32 SetCaptureOptionF32;
pRENDERDOC_GetCaptureOptionU32 GetCaptureOptionU32;
pRENDERDOC_GetCaptureOptionF32 GetCaptureOptionF32;
pRENDERDOC_SetFocusToggleKeys SetFocusToggleKeys;
pRENDERDOC_SetCaptureKeys SetCaptureKeys;
pRENDERDOC_GetOverlayBits GetOverlayBits;
pRENDERDOC_MaskOverlayBits MaskOverlayBits;
// Shutdown was renamed to RemoveHooks in 1.4.1.
// These unions allow old code to continue compiling without changes
union
{
pRENDERDOC_Shutdown Shutdown;
pRENDERDOC_RemoveHooks RemoveHooks;
};
pRENDERDOC_UnloadCrashHandler UnloadCrashHandler;
// Get/SetLogFilePathTemplate was renamed to Get/SetCaptureFilePathTemplate in 1.1.2.
// These unions allow old code to continue compiling without changes
union
{
// deprecated name
pRENDERDOC_SetLogFilePathTemplate SetLogFilePathTemplate;
// current name
pRENDERDOC_SetCaptureFilePathTemplate SetCaptureFilePathTemplate;
};
union
{
// deprecated name
pRENDERDOC_GetLogFilePathTemplate GetLogFilePathTemplate;
// current name
pRENDERDOC_GetCaptureFilePathTemplate GetCaptureFilePathTemplate;
};
pRENDERDOC_GetNumCaptures GetNumCaptures;
pRENDERDOC_GetCapture GetCapture;
pRENDERDOC_TriggerCapture TriggerCapture;
// IsRemoteAccessConnected was renamed to IsTargetControlConnected in 1.1.1.
// This union allows old code to continue compiling without changes
union
{
// deprecated name
pRENDERDOC_IsRemoteAccessConnected IsRemoteAccessConnected;
// current name
pRENDERDOC_IsTargetControlConnected IsTargetControlConnected;
};
pRENDERDOC_LaunchReplayUI LaunchReplayUI;
pRENDERDOC_SetActiveWindow SetActiveWindow;
pRENDERDOC_StartFrameCapture StartFrameCapture;
pRENDERDOC_IsFrameCapturing IsFrameCapturing;
pRENDERDOC_EndFrameCapture EndFrameCapture;
// new function in 1.1.0
pRENDERDOC_TriggerMultiFrameCapture TriggerMultiFrameCapture;
// new function in 1.2.0
pRENDERDOC_SetCaptureFileComments SetCaptureFileComments;
// new function in 1.4.0
pRENDERDOC_DiscardFrameCapture DiscardFrameCapture;
// new function in 1.5.0
pRENDERDOC_ShowReplayUI ShowReplayUI;
// new function in 1.6.0
pRENDERDOC_SetCaptureTitle SetCaptureTitle;
} RENDERDOC_API_1_6_0;
typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_0_0;
typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_0_1;
typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_0_2;
typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_1_0;
typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_1_1;
typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_1_2;
typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_2_0;
typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_3_0;
typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_4_0;
typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_4_1;
typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_4_2;
typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_5_0;
//////////////////////////////////////////////////////////////////////////////////////////////////
// RenderDoc API entry point
//
// This entry point can be obtained via GetProcAddress/dlsym if RenderDoc is available.
//
// The name is the same as the typedef - "RENDERDOC_GetAPI"
//
// This function is not thread safe, and should not be called on multiple threads at once.
// Ideally, call this once as early as possible in your application's startup, before doing
// any API work, since some configuration functionality etc has to be done also before
// initialising any APIs.
//
// Parameters:
// version is a single value from the RENDERDOC_Version above.
//
// outAPIPointers will be filled out with a pointer to the corresponding struct of function
// pointers.
//
// Returns:
// 1 - if the outAPIPointers has been filled with a pointer to the API struct requested
// 0 - if the requested version is not supported or the arguments are invalid.
//
typedef int(RENDERDOC_CC *pRENDERDOC_GetAPI)(RENDERDOC_Version version, void **outAPIPointers);
#ifdef __cplusplus
} // extern "C"
#endif

View File

@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2006 Blender Foundation. All rights reserved.
# Copyright 2006 Blender Foundation
set(INC
.

View File

@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2017 Blender Foundation. All rights reserved.
# Copyright 2017 Blender Foundation
# The Original Code is: all of this file.
# Contributor(s): IRIE Shinsuke.

View File

@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2022 Blender Foundation. All rights reserved.
# Copyright 2022 Blender Foundation
set(INC
.

View File

@@ -1,5 +1,5 @@
/* SPDX-License-Identifier: GPL-2.0-or-later
* Copyright 2022 Blender Foundation. All rights reserved. */
* Copyright 2022 Blender Foundation */
#ifdef __APPLE__
# include <MoltenVK/vk_mvk_moltenvk.h>

View File

@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2013 Blender Foundation. All rights reserved.
# Copyright 2013 Blender Foundation
set(INC
.

View File

@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2012 Blender Foundation. All rights reserved.
# Copyright 2012 Blender Foundation
set(INC
.

View File

@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2006 Blender Foundation. All rights reserved.
# Copyright 2006 Blender Foundation
# add_subdirectory(atomic) # header only
add_subdirectory(atomic)
@@ -67,6 +67,10 @@ if(UNIX AND NOT APPLE)
add_subdirectory(libc_compat)
endif()
if (WITH_RENDERDOC)
add_subdirectory(renderdoc_dynload)
endif()
if(UNIX AND NOT APPLE)
# Important this comes after "ghost" as it uses includes defined by GHOST's CMake.
if(WITH_GHOST_WAYLAND AND WITH_GHOST_WAYLAND_DYNLOAD)

View File

@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2020 Blender Foundation. All rights reserved.
# Copyright 2020 Blender Foundation
set(INC
.

View File

@@ -38,10 +38,8 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* The Original Code is Copyright (C) 2016 Blender Foundation.
* All rights reserved.
*
* The Original Code is: adapted from jemalloc.
* The Original Code is adapted from jemalloc.
* Modifications Copyright (C) 2016 Blender Foundation.
*/
/** \file

View File

@@ -38,10 +38,8 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* The Original Code is Copyright (C) 2016 Blender Foundation.
* All rights reserved.
*
* The Original Code is: adapted from jemalloc.
* The Original Code is adapted from jemalloc.
* Modifications Copyright (C) 2016 Blender Foundation.
*/
/** \file

View File

@@ -38,10 +38,8 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* The Original Code is Copyright (C) 2016 Blender Foundation.
* All rights reserved.
*
* The Original Code is: adapted from jemalloc.
* The Original Code is adapted from jemalloc.
* Modifications Copyright (C) 2016 Blender Foundation.
*/
/** \file

View File

@@ -38,10 +38,8 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* The Original Code is Copyright (C) 2016 Blender Foundation.
* All rights reserved.
*
* The Original Code is: adapted from jemalloc.
* The Original Code is adapted from jemalloc.
* Modifications Copyright (C) 2016 Blender Foundation.
*/
/** \file

View File

@@ -281,6 +281,7 @@ endif()
if(WITH_CYCLES_EMBREE)
add_definitions(-DWITH_EMBREE)
add_definitions(-DEMBREE_MAJOR_VERSION=${EMBREE_MAJOR_VERSION})
include_directories(
SYSTEM
${EMBREE_INCLUDE_DIRS}
@@ -393,6 +394,10 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_C_COMPILER_ID MATCHES "Clang")
unset(_has_no_error_unused_macros)
endif()
if(WITH_USD)
add_definitions(-DWITH_USD)
endif()
if(WITH_CYCLES_HYDRA_RENDER_DELEGATE AND (NOT WITH_USD))
set_and_warn_library_found("USD" WITH_USD WITH_CYCLES_HYDRA_RENDER_DELEGATE)
endif()

View File

@@ -50,6 +50,22 @@ if(WITH_CYCLES_STANDALONE AND WITH_CYCLES_STANDALONE_GUI)
list(APPEND LIB ${Epoxy_LIBRARIES} ${SDL2_LIBRARIES})
endif()
if(WITH_USD)
# Silence warning from USD headers using deprecated TBB header.
add_definitions(
-D__TBB_show_deprecation_message_atomic_H
-D__TBB_show_deprecation_message_task_H
)
list(APPEND INC_SYS
${USD_INCLUDE_DIRS}
)
list(APPEND LIB
cycles_hydra
${USD_LIBRARIES}
)
endif()
cycles_external_libraries_append(LIB)
# Common configuration.

View File

@@ -17,9 +17,7 @@ OIIOOutputDriver::OIIOOutputDriver(const string_view filepath,
{
}
OIIOOutputDriver::~OIIOOutputDriver()
{
}
OIIOOutputDriver::~OIIOOutputDriver() {}
void OIIOOutputDriver::write_render_tile(const Tile &tile)
{

View File

@@ -22,9 +22,7 @@ OpenGLDisplayDriver::OpenGLDisplayDriver(const function<bool()> &gl_context_enab
{
}
OpenGLDisplayDriver::~OpenGLDisplayDriver()
{
}
OpenGLDisplayDriver::~OpenGLDisplayDriver() {}
/* --------------------------------------------------------------------
* Update procedure.

Some files were not shown because too many files have changed in this diff Show More