Commit Graph

118014 Commits

Author SHA1 Message Date
Campbell Barton 260b75a952 PyDoc: add an "Advanced" section to document WITH_PYTHON_MODULE
Document the use cases, usage and limitations
of using Blender as a Python module.
2022-09-14 15:17:51 +10:00
Campbell Barton d26220d97a Fix reports printing twice when called from Python in background-mode
Calling operators in background-mode always printed with the
assumption that output should never be hidden.
However operators called from `bpy.ops` were also printing reports to
the `stdout` (needed for the Python console and generally useful).

Resolve by adding a flag to signal that the owner of the ReportList
is responsible for printing to the `stdout`.
2022-09-14 14:06:44 +10:00
Campbell Barton 7bd60d40ef CMake: warn when "bpy" installs into the site-packages from LIBDIR
Using "../lib" as a target is unlikely to be useful,
add a warning & suggest alternatives.
2022-09-14 14:06:41 +10:00
Campbell Barton f74fa63b5a Cleanup: skip argument freeing when built as a Python module 2022-09-14 14:06:39 +10:00
Charlie Jolly e1a9c16176 UI: Add Mix Node to color section of add node menu
This adds back the new mix node to the Color sections
of the add node menu.

The add menu now contains two entries for the mix node.

One under Utilites/Converter which defaults for float.

One under Color which defaults to color with `Mix Color` label.

This was moved as part of D13749.

The issue was reported on BlenderArtists.

Differential Revision: https://developer.blender.org/D15887
2022-09-13 23:06:40 +01:00
Richard Antalik 7518d30f2a Fix T100771: Incorrect strip length when timecodes are used
Some files have 2 different framerates stored in metadata. Use function
`av_guess_frame_rate` to get media FPS, because it provides more
consistent / correct values across multiple files.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D15839
2022-09-13 20:29:12 +02:00
Richard Antalik 3302b7e6a3 Fix T100998: Speed effect not rendering scene strip subframes
After change in 19bff8eb51, subframe must be calculated for function
`RE_RenderFrame` in order to render subframes.
2022-09-13 20:25:50 +02:00
Hans Goudey 08a8de739d Fix: Resolve deprecation warning when copying polygon struct
`MPoly` is used and copied in many places. To avoid the need to use a
special function for copying MPoly, or the need to add a copy
constructor, just rename the `mat_nr` field to include "legacy" in the
name. This keeps the original purpose of notifying developers that
the field shouldn't be used without any further complexity.
Apply the same fix to `bweight`.

Differential Revision: https://developer.blender.org/D15841
2022-09-13 11:43:34 -05:00
Mattias Fredriksson eaf416693d Geometry Nodes: Port the trim curve node to the new data-block
The trim functionality is implemented in the geometry module, and
generalized a bit to be potentially useful for bisecting in the future.
The implementation is based on a helper type called `IndexRangeCyclic`
which allows iteration over all control points between two points on a
curve.

Catmull Rom curves are now supported-- trimmed without resampling first.
However, maintaining the exact shape is not possible. NURBS splines are
still converted to polylines using the evaluated curve concept.

Performance is equivalent or faster then a 3.1 build with regards to
node timings. Compared to 3.3 and 3.2, it's easy to observe test cases
where the node is at least 3 or 4 times faster.

Differential Revision: https://developer.blender.org/D14481
2022-09-13 11:36:14 -05:00
Bastien Montagne d88811aed3 Fix T100980: Missing deg update when duplicating a geometry nodetree in node editor.
Tagging depsgraph for relation rebuild does not replace tagging IDs for update.
2022-09-13 16:42:34 +02:00
Sergey Sharybin 109cc14dba Revert hidden object optimization in depsgraph
The internal state tracking is not fully suited for such kind
of optimization yet.

It is probably not that much work to make them work, but the
issue caused by the changes is serious enough for the studio
so it feels better to revert changes for now and have a closer
look into remaining issues without pressure.
2022-09-13 16:05:16 +02:00
Hans Goudey 8442b0ffc1 Fix T101027: Sculpt tools don't respect visibility after recent commit
Caused by b5f7af31d6, which exposed the fact that the PBVH wasn't
retrieving the updated hide status attributes if they were allocated in
sculpt mode. Previously the attributes were always allocated when
entering sculpt mode.
2022-09-13 08:35:58 -05:00
Nate Rupsis b6ebd5591c NLA: Remove Edited Action tab from NLA panel
Removes the "Edited Action" tab for selected Action strips in the NLA
editor. It is still available in the Action editor, where it is actually
suitable/usable. Having it in the NLA got in the way of the actual NLA
strip properties.

Reviewed By: sybren, RiggingDojo

Differential Revision: https://developer.blender.org/D14964
2022-09-13 15:09:06 +02:00
Jeroen Bakker 34051fcc12 EEVEE: Fix volumetric resolve in large scenes.
On NVIDIA volumetric resolve failed for large production scenes.
The result would remove most color from the final render. The cause
seems to be a faulty driver.

This change ported the fragment shader to a compute shader which
would select a different compiler branch and didn't show the error.
2022-09-13 15:05:17 +02:00
Wayde Moss b404548972 Fix: set ipo/easing in dope ignores hidden channels
Animators were not able to set channel interpolation or easing type for
channels visible in the dopesheet but hidden in the graph editor.

Bug seemed to be due to typo.
No official report, but there was a RCS on this
https://blender.community/c/rightclickselect/yWgbbc/

Reviewed By: sybren, RiggingDojo

Differential Revision: https://developer.blender.org/D10228
2022-09-13 15:03:24 +02:00
Hans Goudey 92a92fdca5 Fix T101031: Crash with Initialize Face Sets operator 2022-09-13 07:48:41 -05:00
Aras Pranckevicius a99a62231e obj: implement support for PBR .mtl extensions
Implement import & export support for "PBR extensions" in .mtl files
(T101029, also fixes T86736).

Newly supported parameters:
- Roughness (Pr, map_Pr)
- Metallic (Pm, map_Pm)
- Sheen (Ps, map_Ps)
- Clearcoat thickness (Pc) and roughness (Pcr)
- Anisotropy (aniso) and rotation (anisor)
- Transmittance (Tf / Kt)

Exporter has an option to enable these additional PBR parameters
export; defaults to off since not all software understands that.

Exporter UI tweaked and all material-related options were put into
their own separate box.

Added/extended test files in Subversion repository for test coverage.
2022-09-13 15:01:29 +03:00
Brecht Van Lommel 3839a4dd84 Fix broken Cycles Metal build after recent changes
It was unable to find the Metal framework, thanks to Alaska for tracking
this down.
2022-09-13 13:52:14 +02:00
Jacques Lucke 62cee24003 Fix: crash when changing to viewer context in spreadsheet 2022-09-13 13:14:29 +02:00
Sergey Sharybin 3c2c296130 Fix compilation error on Windows after recent change 2022-09-13 11:52:11 +02:00
Jeroen Bakker 8068b89a68 EEVEE-Next: Cryptomatte render passes.
This change adds cryptomatte render passes to EEVEE-Next. Due to the upcoming viewport
compositor we also improved cryptomatte so it will be real-time. This also allows viewing
the cryptomatte passes in the viewport directly.

{F13482749}

A surface shader would store any active cryptomatte layer to a texture. Object hash is stored
as R, Asset hash as G and Material hash as B. Hashes are only calculated when the cryptomatte
layer is active to reduce any unneeded work.

During film accumulation the hashes are separated and stored in a texture array that matches
the cryptomatte standard. For the real-time use case sorting is skipped. For final rendering
the samples are sorted and normalized.

NOTE: Eventually we should also do sample normalization in the viewport in order to extract the correct
mask when using the viewport compositor.

Reviewed By: fclem

Maniphest Tasks: T99390

Differential Revision: https://developer.blender.org/D15753
2022-09-13 11:07:38 +02:00
Sergey Sharybin bb3a021427 Fix T101004: Crash when invisible object becomes visible
A regression since ac20970bc2

The issue was caused by depsgraph clearing all id->recalc flags
wrongly assuming that all IDs are fully evaluated.

This change makes it so the depsgraph becomes aware of possibly
incompletely evaluated IDs.

Differential Revision: https://developer.blender.org/D15946
2022-09-13 11:00:37 +02:00
Patrick Mours a45c36efae Cycles: Make OSL implementation independent from SVM
Cleans up the file structure to be more similar to that of the SVM
and also makes it possible to build kernels with OSL support, but
without having to include SVM support.

This patch was split from D15902.

Differential Revision: https://developer.blender.org/D15949
2022-09-13 10:59:28 +02:00
Sergey Sharybin 8e03df9bbc Fix oneAPI compilation on modern Linux and CentOS 7 libraries 2022-09-13 10:55:36 +02:00
Sergey Sharybin 602cca671e Cycles: Include reason the oneAPI library could not be loaded
Additionally, just stick to a pure error stating. Such messages
are aimed for developers and it is rather implied that oneAPI
rendering will be disabled.
2022-09-13 10:52:18 +02:00
Sergey Sharybin cca416cfe6 Fix compilation on Linux, glibc 2.34, and CentOS libraries
A continuation of previous fix for malloc hooks which got removed
from the new glibc library.

The pre-compiled jemalloc has definitions which interpose hooks
in glibc leading to linking errors with multiple hook definitions.

A simple fix is to skip doing the workaround when using jemalloc
from pre-compiled libraries.

This will likely be revisited in the future, but for now it is
important to fix compilation errors for developers.
2022-09-13 10:38:42 +02:00
Campbell Barton 146e67b2bd CMake: exclude BLI_args when building as a Python module 2022-09-13 18:03:29 +10:00
Campbell Barton d92e14af1f Cleanup: typo in variable name 2022-09-13 18:03:09 +10:00
Campbell Barton f78219c9a8 Cleanup: spelling in comments 2022-09-13 18:03:09 +10:00
Jacques Lucke 4130f1e674 Geometry Nodes: new evaluation system
This refactors the geometry nodes evaluation system. No changes for the
user are expected. At a high level the goals are:
* Support using geometry nodes outside of the geometry nodes modifier.
* Support using the evaluator infrastructure for other purposes like field evaluation.
* Support more nodes, especially when many of them are disabled behind switch nodes.
* Support doing preprocessing on node groups.

For more details see T98492.

There are fairly detailed comments in the code, but here is a high level overview
for how it works now:
* There is a new "lazy-function" system. It is similar in spirit to the multi-function
  system but with different goals. Instead of optimizing throughput for highly
  parallelizable work, this system is designed to compute only the data that is actually
  necessary. What data is necessary can be determined dynamically during evaluation.
  Many lazy-functions can be composed in a graph to form a new lazy-function, which can
  again be used in a graph etc.
* Each geometry node group is converted into a lazy-function graph prior to evaluation.
  To evaluate geometry nodes, one then just has to evaluate that graph. Node groups are
  no longer inlined into their parents.

Next steps for the evaluation system is to reduce the use of threads in some situations
to avoid overhead. Many small node groups don't benefit from multi-threading at all.
This is much easier to do now because not everything has to be inlined in one huge
node tree anymore.

Differential Revision: https://developer.blender.org/D15914
2022-09-13 08:44:32 +02:00
Campbell Barton 4d69b6f525 Cleanup: use u-prefixed integer types (for brevity) 2022-09-13 16:29:06 +10:00
Campbell Barton 75f9b691e2 Docs: improve explanation for why CLG_exit shouldn't be called early 2022-09-13 16:01:39 +10:00
Campbell Barton 5ffa829a0e Cleanup: improve titles for CMake sections, line length
Also use same convention for comments as (space after #).
2022-09-13 13:50:21 +10:00
Campbell Barton 060da0858b CMake: omit WITH_INSTALL_PORTABLE from bpy_module.cmake
Since this was added, Linux libraries have been included in `../lib/`.
This made `make bpy` on Linux install the `bpy` module into the bundled
SVN libraries which isn't very useful.

Now leave WITH_INSTALL_PORTABLE unset (defaulting to ON).
Python developers may reference their systems Python and disable the
option if they wish for a system-wide module installation.
2022-09-13 13:30:06 +10:00
Campbell Barton 41212c1d44 CMake: omit WITH_INSTALL_PORTABLE from the 'lite' configuration
As portable is already the default, setting it meant using the lite
configuration would always reset the value if was intentionally changed.

This was also inconsistent as other configurations left this unset.
2022-09-13 13:30:06 +10:00
Campbell Barton 9189260880 Python: update defaults for "make bpy"
This was a kind of "lite" target, disabling options such as FFMPEG and
ALEMBIC which may be useful to read/write data from the Python module.

Now fewer options have been changed.
The following options are now disabled:

- Audio support (to prevent audio devices being initialized on startup).
- Input device support such as NDOF and IME as there is no GUI.
- Blender thumbnail extraction as it's not installed as part of
  the Python module.

Instead of attempting to predict what is useful to enable when building
as a Python module, developers can mix combine options e.g.
"make bpy release" or "make bpy lite".
2022-09-13 13:28:22 +10:00
Campbell Barton 03885fe120 Makefile: support 'make bpy lite' / 'make bpy release'
Re-order configuration loading so 'bpy' is loaded after others.
Needed as `bpy` disables options other configurations enable.
2022-09-13 13:28:22 +10:00
Campbell Barton 90fb212a93 Docs: improve BKE_object_defgroup_flip_map doc-string 2022-09-13 13:24:45 +10:00
Campbell Barton 1a08a26388 Cleanup: spelling in comments 2022-09-13 13:24:44 +10:00
Campbell Barton c05ff54795 Cleanup: remove unused function 2022-09-13 13:24:42 +10:00
Hans Goudey 400151833d Nodes: Avoid unnecessary sorting when selecting or moving nodes
Previously the nodes were sorted wven when there was no change.
This is a fixed version of e3ef6a6660, which was reverted by
dc937c5aee.
2022-09-12 21:47:01 -05:00
Hans Goudey 50913d719c Cleanup: Use attribute API for curves functions 2022-09-12 21:47:01 -05:00
Colin Basnett ddfce277e0 NLA: actionclip_add now fails on invoke if no NLA track is selected
This makes the NLA_OT_actionclip_add operation (Shift+A while mousing
over the NLA strips area) fail on invocation if no tracks are active.

This stops the annoyance of using the Shift+A menu to select an action
to add, but only getting the error after you select an action.

Differential Revision: https://developer.blender.org/D15737
2022-09-12 18:11:00 -07:00
Campbell Barton b3e9ef1924 Fix building WITH_GHOST_WAYLAND, WITH_OPENXR (without X11)
The pre-processor blocks contained un-balanced braces, causing a syntax
error when building with WAYLAND but not X11.

Use the same number of opening & closing braces in each pre-processor
block so changes aren't as likely to break other platforms.

Also assert when unexpected states are reached.
2022-09-13 10:41:36 +10:00
Campbell Barton ebcf004ecf Cleanup: quiet missing-variable-declarations warning 2022-09-13 10:41:36 +10:00
Campbell Barton 2c73175100 Cleanup: missing declaration warning 2022-09-13 10:41:36 +10:00
Harley Acheson 28c9b33870 IMBUF: Fix WebP Build Error and Warnings
Fix error and warnings introduced in commit 8851790dd7. Include
unistd.h for close() on Non-Windows OSs. Calm warnings about unused
argument. Return full size of image file to caller.

Own Code.
2022-09-12 17:28:19 -07:00
Aaron Carlisle c8b6062d6c Update RNA to User manual mappings 2022-09-12 19:09:32 -04:00
Harley Acheson 8851790dd7 IMBUF: Improved Thumbnailing of WebP Images
Thumbnail WebP images quicker while using much less RAM.

See D15908 for more details.

Differential Revision: https://developer.blender.org/D15908

Reviewed by Brecht Van Lommel
2022-09-12 15:42:51 -07:00
Hans Goudey ad245f1970 Fix T101013: Reordering materials broken with only one assigned
When there was only a single material assigned to the mesh, the material
index attribute didn't necessarily exist. Changing the oder of the slots
wouldn't change the first material index as necessary.
2022-09-12 17:17:11 -05:00