Commit Graph

114404 Commits

Author SHA1 Message Date
Brecht Van Lommel
060a50a5f7 Cycles: refactor Hydra render delegate building
* Leave code for building the render delegate against other applications and
  their USD libraries to the Cycles repository, since this is not a great fit.
  In the Blender repository, always use Blender's USD libraries now that they
  include Hydra support.
* Hide non-USD symbols from the hdCycles shared library, to avoid library
  version conflicts.
* Share Apple framework linking between the standalone app and plugin.
* Add cycles_hydra module, to be shared between the standalone app and plugin.
* Bring external libs code in sync with standalone repo, adding various missing
  libraries.
* Move some cmake include directories to the top level cycles source folder
  because we need to control their global order, to ensure we link against the
  correct headers with mixed Blender libraries and external USD libraries.
2022-04-29 19:03:06 +02:00
Sebastian Parborg
074a8558b7 Fix rendering of wire curves when used as custom bone objects
In the current code we do not render any curves if they have not been
converted to meshes. This change makes the custom bone drawing try to
render mesh objects first and then falls back to curve objects if there
is no mesh data available.

Reviewed By: Clement

Differential Revision: http://developer.blender.org/D14804
2022-04-29 18:22:32 +02:00
Ray Molenkamp
3eb9b4dfbc Windows: make.bat change python detection order
Given we are officially on 3.10 now, look
for that version first, followed by any future
version before falling back to 3.9
2022-04-29 10:13:01 -06:00
Brecht Van Lommel
a6f951b464 Cycles: make Hydra display driver optional, for USD without OpenGL
OpenGL support was removed from Blender's USD precompiled libraries. This
is currently only useful when building against other applications anyway.
2022-04-29 18:08:41 +02:00
Brecht Van Lommel
e0315a5ef0 Cycles: add profiling command line argument to standalone
Like --cycles-print-stats for Blender.
2022-04-29 18:08:41 +02:00
Bastien Montagne
1a8a69d318 Cleanup: Fix harmless runtime error about null pointer in Outliner tree code.
While the reference would never be used in case of NULL pointer, this
bit of code was not really clear and nice, so make it less ambiguous
now. Also add early return in case a NULL idv pointeris actually passed.
2022-04-29 17:57:46 +02:00
Bastien Montagne
3c7a6718dd Fix T95480: Crash when relocating libraries in some cases.
While code deleting old (relocated to new ones) IDs would work fine in
typical cases, it would fail badly in others, when e.g. drivers would
create 'reversed' dependency from the obdata ID to the object ID.

This commit uses a less efficient, but much safer method. It also
ensures no relocated old IDs is left over in the file (previous version
could easily leave some old IDs from the old library until a full
save/reload cycle happened).
2022-04-29 17:57:46 +02:00
Bastien Montagne
4d464a946a Fix (unreported) library relocating code making indirectly linked IDs direct.
While relatively minor issue, it could become fairly annoying in a big
project, since once an ID is tagged as directly linked it tend to remain
as such.

Now also force indirect tagging when loading new IDs as part of a lib
relocation process, since the ones actually directly linked will be
tagged as such later on.
2022-04-29 17:57:46 +02:00
Bastien Montagne
d779b15485 Fix (unreported) bad handling of ID usercount increment in remapping code.
While this only had minor potential effect, both code incrementing
usercount of newly remapped IDs were wrong.

Original one would by-pass any 'ensured user' handling, newer one would
systematically make the ID directly linked...

`id_us_plus_no_lib` is to be used here.
2022-04-29 17:57:46 +02:00
Bastien Montagne
f44a34fc55 BKE_lib_remap: add comment note about some remapping options.
Fact that those options are only used in a specific case, and that the
same behavior is ensured in a different part of the code in other cases,
is fairly confusing and unfortunate... At least document it.
2022-04-29 17:57:46 +02:00
Clément Foucault
3b7bce45d2 Fix T97686 DRW: Freeze when switching to material preview or render view
This was caused by the compilation job being created suspended (to avoid
UI slowdown because of the material Preview Icons). The suspended job
wasn't passing the `WM_jobs_test` in `DRW_deferred_shader_remove` and
the material would still be in the compile queue with its status equal to
`GPU_MAT_QUEUED`. This would block the main thread in the waiting loop.
But since the job manager timer needs to execute in the main thread, the
compilation job was never being pushed out of its suspended state.
This lead to a complete lock situation.

The solution is to use `WM_jobs_customdata_from_type` which does exactly
what we need.

Also fixed a nullptr free.
2022-04-29 17:57:38 +02:00
Brecht Van Lommel
9ef727d3d4 Cycles: make internal integrator defaults match Blender more closely
This does not affect Blender integration, but gives better defaults for
Cycles standalone.
2022-04-29 17:39:04 +02:00
Brecht Van Lommel
0634bb24ee Cleanup: remove unused server app after network render was removed 2022-04-29 17:39:04 +02:00
Brecht Van Lommel
0c317e23bf Cleanup: fix various Cycles build warnings with non-default options
* Float/double promotion warnings were mainly meant for avoiding slow
  operatiosn in the kernel. Limit it to that to avoid hard to fix warnings
  in Hydra.
* Const warnings in Hydra iterators.
* Unused variable warnings when building without glog.
* Wrong camera enum comparisons in assert.
* PASS_UNUSED is not a pass type, only for pass offsets.
2022-04-29 17:39:04 +02:00
Sergey Sharybin
5d84d9b0d6 Cleanup: Simplify job custom data query API
There were two calls to access job's custom data. One of them
ignored job type, the other one ignored job owner.

Now there is a single function to access job's custom data.
If the job type or owner is not relevant NULL or WM_JOB_TYPE_ANY
can be passes explicitly.

Differential Revision: https://developer.blender.org/D14803
2022-04-29 16:49:52 +02:00
2f49908a5e NLA: Key influence when pushing down to NLA
When pushing down an Action onto an NLA track, set the new Strip's
influence to the Action's influence. This is done by setting a key due
to the way the NLA Strip influence works (it's either animated, or
ignored).

Reviewed By: sybren, RiggingDojo

Differential Revision: https://developer.blender.org/D14719
2022-04-29 16:28:02 +02:00
Hans Goudey
baae87ce86 Fix: Incorrect custom data maxlayers in rare files
For a single day in 2015 between rBff3d535bc2a6309 and rB945f32e66d6ada,
custom data structs could be written with an incorrect maxlayer field.
This means that custom data structs read from those files would think
they have more space to add new layers than they actually did, causing
a crash if more layers were added. This was found while investigating
a crash from D14365 which adds new face corner layers in versioning.

The fix is to reset all maxlayer integers to totlayer, which is
done when writing files in current Blender anyway.

The file tests/render/motion_blur/camera_zoom_blur_perspective.blend
has this problem as it was added on 2015-07-21, right between the two
commits. Adding three custom data layers in versioning code would crash.

The problem was originally found and investigated by Martijn Versteegh
(@Baardaap), thanks!

Differential Revision: https://developer.blender.org/D14786
2022-04-29 09:20:10 -05:00
473a2c83ea Cleanup: fix unused parameter warning
Fix 'unused parameter' warning when building without OpenColorIO.

No functional changes.
2022-04-29 16:13:23 +02:00
Brecht Van Lommel
a7db7f88b0 Fix CMake error in new builds after previous NanoVDB fix 2022-04-29 15:38:21 +02:00
Germano Cavalcante
1d9c050188 Fix wrong cast from uint to int (2)
Error in rB3d877c8a0d06
2022-04-29 10:22:49 -03:00
Germano Cavalcante
a323ada701 Fix wrong cast from uint to int
Error in rB3d877c8a0d06
2022-04-29 10:19:58 -03:00
Demeter Dzadik
7fd11d9c7f T95386: Add Discontinuity (Euler) filter to Dope Sheet.
Add the Discontinuity (Euler) Filter operator to the Dope Sheet->Key
menu, so it's not only available from the Graph Editor->Key menu. On
request of @pablico, see T95386.

This required changing a poll function which is used by a bunch of other
operators, which seemed scary at first, but my thinking is that if an
operator can execute in the Graph Editor, then it should also be able to
execute in the Dope Sheet. I think the only reason this wouldn't be true
is if we were storing animation data in the UI itself, which of course
we don't. So I hope this is okay.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D14015
2022-04-29 15:17:27 +02:00
Germano Cavalcante
3d877c8a0d Select Engine: port shader to use 'GPUShaderCreateInfo'
Simple port with a few cosmetic changes:
- Attribute named "color" for indices VBO is now called "index"
- The indices VBO is now composed of `int`s instead of `uint`s (this simplifies the source)

Differential Revision: https://developer.blender.org/D14800
2022-04-29 10:15:04 -03:00
Brecht Van Lommel
a111a0f1e1 Fix missing NanoVDB patch for HIP support, after unifying with OpenVDB
This patch has also been contributed upstream, so will not be needed anymore
soon. Also automatically clear cached variables for new nanovdb location in
libs.
2022-04-29 15:12:46 +02:00
a1b21a3503 CMake: harvest nanovdb from its new location
NanoVDB is now bundled with OpenVDB (since rBb9c37608a9e) instead of a
separate package.

This still doesn't include our patch to support AMD HIP; that'll be
committed separately soon.
2022-04-29 14:34:25 +02:00
Sergey Sharybin
d442782dbe Fix Cycles versioning code after recent change
Need to use get() instead of is_property_set() for properties
which are not defined as Property.
2022-04-29 11:49:53 +02:00
Thomas Dinges
62eb190d4e Cleanup: Remove old filter property.
It was kept for forward compatibility during 2.7x.

Reference rB5a45ccaf3e5102ee571599fa9f26a78ac1f6d0f4
2022-04-29 10:36:19 +02:00
Clément Foucault
fcb0090842 GLState: Avoid possible undefined behavior in state comparison
The bitwise XOR used to compute the delta (`changed`) might produce NaN and
thus produce undefined behavior when comparing to another float (because of
float promotion).
2022-04-29 09:10:07 +02:00
Joseph Eagar
65e7219706 Fix T97097: Color filter saturate affects non-colors
Saturation is now tested for > 0.001 instead of != 0.
We may wish to turn the limit into an operator property
in the future.
2022-04-28 23:24:10 -07:00
Campbell Barton
cc8fe1a1cb Fix T97120: Gizmo fails to select in orthographic view
Regression in exposed by 49fc4449e734842cc3ccd797e6ece73ea64f34e4.
2022-04-29 16:21:23 +10:00
Joseph Eagar
7f0163118b Fix T97608: Sculpt sample color op is missing pmap
Add missing call to BKE_sculpt_update_object_for_edit.
2022-04-28 23:19:06 -07:00
Joseph Eagar
720e19a833 Fix T62945: Hotkeys not showing up in brush tooltips 2022-04-28 23:13:53 -07:00
Campbell Barton
9dadd8bdb1 Fix T97124: Area light size gizmo unselectable
Workaround for MS-Windows NVidia/LLVMPipe combination failing to select
the gizmo unless depth-test was used.
2022-04-29 13:13:30 +10:00
Campbell Barton
0b5cf91b89 Cleanup: use 'use_' prefix for RNA boolean 2022-04-29 09:43:03 +10:00
Campbell Barton
1e23304fbc Cleanup: missing declaration warnings & spelling in comments 2022-04-29 09:27:46 +10:00
Ray Molenkamp
9a25a34e42 shader_builder: fix build issue on windows
shader_builder had no manifest set, leading
to the classic common control version being
loaded which in turn caused an import error
and made the executable fail to initialize.
2022-04-28 16:57:46 -06:00
Brecht Van Lommel
4b96517e20 Build: disable Metal for USD libraries also, it fails to build without OpenGL
This only affects macOS.

Ref D14792
2022-04-28 23:49:56 +02:00
Germano Cavalcante
f38f12cbbc Cleanup: silence unused variable warnings 2022-04-28 18:41:44 -03:00
Hans Goudey
810f33d434 Fix: Missing translation in node socket inspection 2022-04-28 15:11:26 -05:00
Ethan-Hall
708fabe3d7 Fix: Socket inspection error for data-block sockets
After rB47276b847017, for certain socket types such as object or
material, the name of the item is not obtained correctly leading
the tooltip to display random non-character memory values as text.

Differential Revision: https://developer.blender.org/D14762
2022-04-28 15:06:24 -05:00
Hans Goudey
8095875dff Fix T97151: Curve vertex parenting crash with dependency cycle
When the object's position depends on the geometry and the geometry
depends on the object's position, we can't count on the object's
evaluated geometry to be available. Lattices and mesh objects have
equivalent checks in this vertex parenting function.

Differential Revision: https://developer.blender.org/D14781
2022-04-28 14:58:52 -05:00
Clément Foucault
4b7ed584a8 Cleanup: Overlay: Avoid local variable shadowing 2022-04-28 21:44:15 +02:00
Clément Foucault
d5f3351f55 Overlay: Port UDIM Grid shader to shaderCreateInfo
Simple Straight forward port.
2022-04-28 21:43:54 +02:00
Clément Foucault
308a12ac64 Overlay: Port Grid shader to shaderCreateInfo and other code cleanup
Along with the port to createInfo this also:
- Packs constant uniforms in a UBO.
- Share enum declaration and unify names
- Makes codeflow easier to undestand.
- Split grid data to its own struct.

# Conflicts:
#	source/blender/draw/engines/overlay/overlay_grid.c
2022-04-28 21:13:04 +02:00
Hans Goudey
3d9f0280ff Fix T93899: Incorrect decorator buttons for geometry nodes vector/colors
For properties exposed to the geometry nodes modifier, decorators didn't
work at all for colors and it only worked on the X component of vectors.
The fix is to use -1 for the RNA index of the decorator button instead
of 1, which lets the UI code figure out what to do with arrays.
2022-04-28 13:46:42 -05:00
Ethan-Hall
1425b356b8 UI: Fix consistency issues with attribute tooltips and icons
This patch modifies tooltips of attributes and UV maps to resolve
inconsistencies. It also restores the vertex color icon that went
missing from the UI lists when color attributes replaced vertex colors.

Fixes T97614

Differential Revision: https://developer.blender.org/D14768
2022-04-28 13:08:52 -05:00
Brecht Van Lommel
c722993ef1 Fix T94467: Cycles baking of normal pass slower than before cycles-x 2022-04-28 19:55:12 +02:00
Hans Goudey
5b1ec08f04 Fix T93546: Fill curve node ignores last point of non-cylic curves
The node is meant to consider all curves cyclic, which means that it
shouldn't account for one fewer segment on non-cyclic curves.
2022-04-28 11:50:55 -05:00
Hans Goudey
2d7957727c Fix: Incorrect conversion from C bitfield syntax
Recent cleanups 9a8669ac81b99b2 and 1c790555a02bfc3
incorrectly interpereted the bitfield width syntax as a default
value. Also resolve two other compilation warnings.
2022-04-28 11:19:12 -05:00
Sebastian Herholz
fbc884d2a8 Ensure BSDF evals and pdfs are zero on invalid samples
Currently, the `eval` and `pdf` are not explicitly set to zero when a BSDF sample is invalid (e.g., below the upper hemisphere), when calling
`bsdf_sample` or `bsdf_eval`. It is assumed that `eval` and `pdf` are set to zero before these functions are called, which can cause problems if not.

This patch fixes this potential problem by explicitly setting `eval` and `pdf` to zero when the sampled direction is invalid.

I also added a sanity check if `eval` and `pdf` are valid (i.e., >= 0.f).
The check is activated when build in debug mode and with the `WITH_CYCLES_DEBUG` set to `ON`.

Reviewed By: brecht, sergey

Differential Revision: https://developer.blender.org/D14776
2022-04-28 18:14:06 +02:00