Commit Graph

109373 Commits

Author SHA1 Message Date
Brecht Van Lommel
53f25df5bc Fix T92128: Cycles CUDA wrong hair attributes, after recent changes 2021-10-15 15:42:44 +02:00
Jacques Lucke
f834939ceb Geometry Nodes: fix getting mutable geometry component
The previous code did not take into account that they geometry
component may not be mutable because it is shared between
multiple geometry sets.
2021-10-15 13:39:26 +02:00
Julian Eisel
da3946b710 Fix wrong DNA struct element lookup in versioning
The type of the element is `short`, not `int`. Harmless since this was checking
for a specific version anyway.
2021-10-15 12:38:10 +02:00
Jacques Lucke
aca38148ad Fix T92131: handle node declaration in material properties
The issue was that this menu was only looking at socket templates,
but not at the new node declarations. This fix is to just check those
as well. The fix comes with a small refactor that makes the memory
management a bit simpler.

Differential Revision: https://developer.blender.org/D12866
2021-10-15 12:12:56 +02:00
Pablo Vazquez
e46055ae9d UI: Fix offset of vertical scale indicators
`BLF_height_max()` uses the tallest character in the font, and many characters
in our font are taller than numbers. Use `BLF_height` with `0` as reference instead.

Fix by @harley, thanks!
2021-10-15 11:54:07 +02:00
Jesse Yurkovich
93a8fd1249 Cleanup: Commonize code for checking scene lights/world settings
There were several places attempting to check to see if scene lights
and world were enabled for display. This tries to find a common place
for both of these to reduce duplication.

Honestly, I couldn't find a really good spot for these and settled on
DRW_engine. It's not the best spot since they're not strictly drawing
related, but let's start here.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D12658
2021-10-15 11:42:44 +02:00
Clément Foucault
30bed8761d Fix T92226 EEVEE: AO misaligned on first sample
Caused by tricky state tracking. `GPU_framebuffer_bind()` is updating
the framebuffer on first time and will reset the viewport state of it.
2021-10-15 11:24:10 +02:00
Campbell Barton
3022e190a2 Fix is_repeat being set for in between mouse-move events 2021-10-15 20:17:51 +11:00
Campbell Barton
d649b4b066 Fix crash using menu search without an active area 2021-10-15 17:52:01 +11:00
Campbell Barton
9a76dd2454 Fix some property shortcuts not showing in tooltip
Shortcut lookups for property buttons were only supported for a subset
of RNA types.

Replace inline data-path calculation with
WM_context_path_resolve_property_full.

Now the shortcut for the 3D View's overlay toggle (for e.g.) is shown.
2021-10-15 16:34:15 +11:00
Campbell Barton
beecd24fc6 Cleanup: use const for context argument 2021-10-15 16:32:06 +11:00
Campbell Barton
3ca2697001 Cleanup: clang-tidy 2021-10-15 16:32:06 +11:00
Pablo Vazquez
3ccdee7532 UI: View2D: Align vertical indicators to view
In editors with vertical scale indicators, such as Graph Editor,
Drivers, or VSE, display the values aligned to the view.

Also add a shadow (similar to the 3D View info) to improve readability when the text is on top of curves, strips, or other content.

{F10987240, size=full}

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D12809
2021-10-15 02:54:10 +02:00
Hans Goudey
2055ef107a Geometry Nodes: Order selection inputs after geometry inputs
While there may be arguments for different positions of the selection
inputs, it's important to be consistent, and putting them right after
the corresponding geometry works well when there are multiple
geometry inputs. Addresses T91646.
2021-10-14 15:36:24 -05:00
Hans Goudey
89c7c115ce Geometry Nodes: Create empty components less often
Avoiding creating empty components can be a hassle for code that
interacts with a geometry set. One easy way to do that was calling
the functions that retrieved mutable access to geometry data directly,
like get_mesh_for_write. This commit makes it so that sort of direct
function does not create an empty component if there is no data.

Another way to create an empty component was calling the replace_*
methods with a null pointer. It's more convenient to have a nice API
that handles those cases without creating an empty component.

It's still convenient that the regular get_component_for_write adds
the component if it doesn't exist, because that's often a nice way to
add data to the geometry set.

Differential Revision: https://developer.blender.org/D12862
2021-10-14 12:43:36 -05:00
Johnny Matthews
cddda70618 Geometry Nodes: Merge Conflict Cleanup
Removing a line that remained from a merge.
2021-10-14 12:22:33 -05:00
Johnny Matthews
42a05ff6ea Geometry Nodes: Rename Nodes ID Names + Menu Org
Re-alphabetize the main add menu.

Rename Node ID Names:
FloatCompare => CompareFloats
AttributeCapture => CaptureAttribute
Boolean => MeshBoolean
CurveFill => FillCurve
CurveFillet => FilletCurve
CurveReverse => ReverseCurve
CurveSample => SampleCurve
CurveResmaple => ResampleCurve
CurveSubdivide => SubdivideCurve
CurveTrim => TrimCurve
MaterialReplace => ReplaceMaterial
MeshSubdivide => SubdivideMesh
EdgeSplit => SplitEdges

Differential Revision: https://developer.blender.org/D12865
2021-10-14 12:10:52 -05:00
Hans Goudey
17b8da7196 Geometry Nodes: Field version of mesh to curve node
This commit adds a fields version of the mesh to curve node, with a
field for the input selection. In order to reduce code duplication,
it adds the mesh to curve conversion to the new geometry module
and calls that implementation from both places.

More details on the geometry module can be found here: T86869

Differential Revision: https://developer.blender.org/D12579
2021-10-14 12:06:48 -05:00
Alexander Gavrilov
1996efe7aa Python API: implement PoseBone.children via Bone.children.
Currently `PoseBone.children` is implemented by a linear scan of
the list of armature bones. This is doubly inefficient, since
not only is it scanning all bones, the `obj.data.bones` list
is actually synthetic and generated from Bone children lists.

Instead, use the `Bone.children` native RNA property.

Differential Revision: https://developer.blender.org/D12727
2021-10-14 19:44:37 +03:00
Germano Cavalcante
497d0400bd Fix another error in rB5e12e62a6a4e
The code was ignoring the icremental with small distances.
2021-10-14 13:31:17 -03:00
Germano Cavalcante
328b6f672b Fix error in rB5e12e62a6a4e 2021-10-14 13:27:23 -03:00
Clément Foucault
2289295555 GPUTexture: Fix assert when using stereo viewport with EEVEE
Stereo viewport means the depth buffer is use twice as often as a
framebuffer attachment.
2021-10-14 18:20:49 +02:00
Germano Cavalcante
5e12e62a6a Fix regression with incremental snap in Graph Editor
Regression introduced in {rBb0d9e6797fb8}.

Previously the Graphics Editor had a conflict with two different snap
types. Auto-Snap and Snap with Ctrl.

It is now clearer which snap should prevail.
2021-10-14 13:10:19 -03:00
Hans Goudey
b42ce0c54c Functions: Generic array data structure
Sometimes it's useful to pass around a set of values with a generic
type. The virtual array data structures allow this, but they don't
have logical ownership. My initial use case for this is as a return
type for the functions that interpolate curve attributes to evaluated
points, but a need for this data structure has come up in a few other
places as well. It also reduced the need for templates.

Differential Revision: https://developer.blender.org/D11103
2021-10-14 11:06:18 -05:00
Jacques Lucke
5e8775a8da Fix T92030: crash when hovering over socket
This is the same fix as in rB24a965bb16c22e33752dfb6c22105b96a8649aeb.
2021-10-14 18:02:22 +02:00
Michael Jones
a0f269f682 Cycles: Kernel address space changes for MSL
This is the first of a sequence of changes to support compiling Cycles kernels as MSL (Metal Shading Language) in preparation for a Metal GPU device implementation.

MSL requires that all pointer types be declared with explicit address space attributes (device, thread, etc...). There is already precedent for this with Cycles' address space macros (ccl_global, ccl_private, etc...), therefore the first step of MSL-enablement is to apply these consistently. Line-for-line this represents the largest change required to enable MSL. Applying this change first will simplify future patches as well as offering the emergent benefit of enhanced descriptiveness.

The vast majority of deltas in this patch fall into one of two cases:

- Ensuring ccl_private is specified for thread-local pointer types
- Ensuring ccl_global is specified for device-wide pointer types

Additionally, the ccl_addr_space qualifier can be removed. Prior to Cycles X, ccl_addr_space was used as a context-dependent address space qualifier, but now it is either redundant (e.g. in struct typedefs), or can be replaced by ccl_global in the case of pointer types. Associated function variants (e.g. lcg_step_float_addrspace) are also redundant.

In cases where address space qualifiers are chained with "const", this patch places the address space qualifier first. The rationale for this is that the choice of address space is likely to have the greater impact on runtime performance and overall architecture.

The final part of this patch is the addition of a metal/compat.h header. This is partially complete and will be extended in future patches, paving the way for the full Metal implementation.

Ref T92212

Reviewed By: brecht

Maniphest Tasks: T92212

Differential Revision: https://developer.blender.org/D12864
2021-10-14 16:14:43 +01:00
Philipp Oeser
47caeb8c26 Fix T91743: Unify behavior of 'Auto Set Preview Range'
This is available in the DopeSheet, GraphEditor, and NLA Editor.

Currently:
- Dopesheet advertises to take selection into account...
-- ...but doesnt - which might be a mistake in rBe3842d1ca4dd
- Graph Editor does not mention selection...
-- ...and also does not take it into account
- NLA does not mention selection...
-- ...but takes it into account

Now:
- make them **all** take selection into account (you can still do a
quick 'Select All' prior to get the full range -- better than not being
able to set this based on selection)
- mention this for all in the tooltip
- also reword to 'Set Preview Range to Selected' since using the term
'Auto' impilies this would change on selection change.

Maniphest Tasks: T91743

Differential Revision: https://developer.blender.org/D12651
2021-10-14 16:29:04 +02:00
Charlie Jolly
2341ca990c Geometry Nodes: Add White Noise texture
Port White Noise shader to geometry nodes.

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D12719
2021-10-14 14:56:48 +01:00
55cf9bb5e6 Cleanup: fix const discard warning
No functional changes.
2021-10-14 15:34:29 +02:00
Charlie Jolly
25a255c32a Nodes: add boilerplate for image sockets
The sockets are not exposed in any nodes yet.
They work similar to the Object/Collection/Texture sockets,
which also just reference a data block.

Based on rB207472930834

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D12861
2021-10-14 14:19:32 +01:00
138aa20959 Cleanup: asset browser, remove invalid assertion
Remove `BLI_assert_unreachable()` in a spot that is actually easily
reachable. To reach, follow these steps:
- Configure three asset libraries (say A, B, and C) in preferences
- Set the asset browser to library C and save the file
- Remove asset library C from the preferences
- Reopen the file.
2021-10-14 15:16:16 +02:00
Paul Golter
240345842d Filebrowser: Expose file select functions for File Browser to Python API.
This patch adds activate_file_by_relative_path(relative_path="") and
deselect_all() function to the space api of the File Browser. While the
first sets the active file and adds it to the selection based on a
relative path to the current File Browser directory the second one
deselects all files but does not change the active file.

Differential Revision: https://developer.blender.org/D12826
Reviewed by: Julian Eisel
2021-10-14 14:42:43 +02:00
Johnny Matthews
9ca567bc4e Geometry Nodes: Reorganize Add Menu
- Move Converters to 'From' menus
  - Create Instances Menu
  - Realphabetize the Curve Menu

  Differential Revision: https://developer.blender.org/D12860
2021-10-14 06:41:52 -05:00
56b35991bc Alembic: avoid crash when Cycles is not enabled
The Alembic/CacheFile modifier supports Cycles procedurals when Cycles
is configured to use experimental features; the check for this would
segfault on builds with `WITH_CYCLES=OFF`. This is now fixed by adding
an extra NULL check.
2021-10-14 12:55:33 +02:00
Clément Foucault
42d79a6041 Fix T91398 Overlay: Camera BG jitter offset (regression)
This was caused by camera background being rendered in world space, causing
floating point imprecision issues when camera was far from origin.

Adding a uniform to change vertex shader to process everything in viewspace
to fix the problem.
2021-10-14 11:49:34 +02:00
Philipp Oeser
583939c54d Fix T92200: VSE: 2D Cursor position missing viewport update
Was using notifier from wrong space (copy-paste error in rBd04d27b406b8).
2021-10-14 11:03:44 +02:00
Sergey Sharybin
aa46459543 Fix shadow catcher behind transparent object on GPU
The assumption about absent shadow path was wrong.

The rest of the changes are to ensure shadow paths are finished prior
to the split, so that they write to the proper passes.

The issue was caught by running regression tests on OptiX.

Differential Revision: https://developer.blender.org/D12857
2021-10-14 09:39:38 +02:00
Campbell Barton
4f5ef3b018 WM: quiet output of delete object operator
Object deletion was reporting the number of objects deleted,
causing tests to print noisy output.

Now this is information is only included when invoked.
2021-10-14 16:41:40 +11:00
Campbell Barton
3be2d6078f Cleanup: remove historic reference from makesdna.c
We have mostly removed information about original authors,
as this information isn't so useful.
2021-10-14 16:41:38 +11:00
Campbell Barton
a620ce7e54 Cleanup: use dot-points for appdir platform specific paths 2021-10-14 16:41:37 +11:00
Campbell Barton
f12ea3d52e Cleanup: reserve C++ comments for disabled code 2021-10-14 16:41:35 +11:00
Ankit Meel
5fec6eda55 Cleanup: silence Clang missing-braces warning. 2021-10-14 10:06:16 +05:30
Johnny Matthews
a059d16f65 Geometry Nodes: Add Offset Option to Set Postion
Add a boolean field to the Set Position Node. This value allows
for each point to either have its position set to the input position
value or have the input value added to the current position.

Differential Revision: https://developer.blender.org/D12773
2021-10-13 23:33:46 -05:00
Campbell Barton
5401fda412 Cleanup: avoid using size for array length in naming
Confusing when array allocation takes two kinds of size arguments.
2021-10-14 14:06:49 +11:00
Campbell Barton
576142dc85 Cleanup: pass the sizeof(..) as the second arg for array allocation
By argument naming and convention this is the intended argument order.
2021-10-14 13:00:24 +11:00
Germano Cavalcante
c6e956bbb1 Fix compile error with 'WITH_CXX_GUARDEDALLOC' 2021-10-13 22:00:21 -03:00
Campbell Barton
9dff3de6ac Cleanup: clang-tidy, clang-format & spelling 2021-10-14 08:57:50 +11:00
Campbell Barton
685ceaa2f7 Fix reference counting error for world drag & drop
Error in 986d60490c0694941e27c070780c55f07b7b4842
2021-10-14 08:57:14 +11:00
Campbell Barton
8434aa1b78 Fix invalid arguments to ED_gizmotypes_snap_3d_context_ensure 2021-10-14 08:57:13 +11:00
Manuel Castilla
8278ad3dfb Fix T90799: Box/Ellipse Mask node masking is off-centered
This is especially noticeable when using the default center with full
width and height as some borders are masked by 1 pixel.

The relative coordinates are now calculated respect the last ones
instead of the dimensions for centering, and the limits
are inclusive to mask more accurately.
2021-10-13 23:41:14 +02:00