1
1

Compare commits

..

2858 Commits

Author SHA1 Message Date
439f86ac89 Fix T97272: Lag when resizing viewports.
Viewports where cleared explicitly due to compatibility reasons with Intel iGPUs.
This slowed down other platforms as well, this wasn't noticeable on all platforms.

This patch will be more selective when to enable the workaround.
Currently only for iGPUs on Mac + Linux.
2022-05-10 08:48:51 +02:00
11aa237858 Eevee: Fix GLSL compilation error.
Introduced by {35594f4b92fa4cbb5b848f447b7a3323e572b676}.
Some platforms do not support temp variables to be used as inout parameter.

Detected on Mac with Intel iGPU.
2022-05-10 08:30:21 +02:00
Ramil Roosileht
4bb90b8f4c D14887: Fix artifacts in hue filter
The hue color filter now wraps correctly.  Fixes T97768.

Reviewed By: Julien Kaspar & Joseph Eagar
Differential Revision: https://developer.blender.org/D14887
Ref D14887
2022-05-09 19:46:22 -07:00
1c1e842879 Fix T86358: Use per face aspect correction for primitive UV projections
During UV unwrapping, Cube Projection, Sphere Projection, Cylinder
Projection and Project From View (in the 3D Viewport), when "Correct
Aspect" toggle is active, it now uses a query cache to perform a
per-face aspect ratio ("per_face_aspect") correction for the active
image of each face.

Reviewed By: campbellbarton

Ref D14852
2022-05-10 11:14:59 +10:00
a4c2060b91 Fix T97545 GPU: Crash caused by uncommented quote char in source string
Some drivers completely forbid quote characters even in unused
preprocessor directives.

This patch adds a debug build check for all `.glsl` files that need to
be manually handled. For shared headers with `#include` directives, we
need to do runtime patching of the source to remove the quote.

Also fix an instance of the quotes check failing in `eevee_next`.
2022-05-10 00:47:44 +02:00
7301547ca7 EEVEE: Fix missing CLOSURE_DEFAULT 2022-05-09 23:52:31 +02:00
35594f4b92 Fix T97985 EEVEE: Shader mixing not working correctly when reusing shader nodes
This was caused by the `Closure` members being added to the final contribution
more than once. The workaround is to clear the members once a closure has
been added to the final contribution. I used `inout` on `Closure` inputs
so that the render engine implementation of mix and add closure nodes
can do its own thing. The nodegraph handling of inout was changed for this
to work.
2022-05-09 23:52:31 +02:00
10865c8f34 Deps/CMake: Add missing dependencies for OCIO
OCIO could build before pystring and imath due to
OCIO missing the dependencies on these two projects

No rebuild required as the build would have failed
during the libs build if you ran into this issue.
2022-05-09 13:34:33 -06:00
6e2b0a38f0 Fix T97984: GPUCodegen: crash when loading demo file
This was caused by the name buffer not being ensured in all cases.

Change the behavior and always create the `NameBuffer`.
2022-05-09 20:06:27 +02:00
bfa1c077cb Fix T97983 EEVEE: Tangent Normal of Curves info behaves differently in Eevee
Curve tangent was correctly mistaken with curve normal.

This patch fixes the name of the output in the glsl function and make curve
attributes more explicit (with `curve_` prefix).

This also improve the normal computation by making it per pixel to match
cycles.

Also ports the changes to eevee-next.
2022-05-09 20:06:27 +02:00
Brecht Van Lommel
f4827d08bc Build: disable usage of GLEW, CLEW, CUDA, GLFW in OpenSubdiv
The previous 3.1 libraries (accidentally) used glApi instead of GLEW and were
working for GPU subdivision, so revert to that. There's a suspected conflict
with Blender's own bundled GLEW or other issue with GLEW, causing the crash in
T97737.

The current GPU subdivision implementation does not need OpenCL, CUDA or GLFW.
So also remove libraries needed for that. It's simpler to stick to compute
shaders in OpenGL/Vulkan/Metal and not involve additional APIs.

Ref T95206

Differential Revision: https://developer.blender.org/D14898
2022-05-09 18:30:04 +02:00
78f61bf8c1 Fix T97906: OpenEXR files with lower case xyz channel names not read correctly
Adds some utility functions to avoid using toupper() which depends on the
locale and should not be used for this type of parsing.
2022-05-09 18:28:24 +02:00
686abf1850 Fix T97853: Crash with edit mode X-ray and subdivision
The mesh drawing code used a different mesh to check whether or not to
draw face dots and to actually retrieve them. The fix is moving the
responsibility of determining whether to use subsurf face dots to the
creation of `MeshRenderData` where the mesh used for drawing is
known, rather than doing it at a higher level.

Differential Revision: https://developer.blender.org/D14855
2022-05-09 17:36:54 +02:00
43e31d26a9 Fix T97927: bpy.utils.units.to_string uses wrong units for velocity, acceleration, lens length, and power
`TEMPERATURE` type was also missing, not only the new-ish
`TIME_ABSOLUTE` one...

Added a static assert on the size of the `bpyunits_ucategories_items`
array, and a comment on anonymous enum of `B_UNIT_`, in the hope this
won't happen again in the future.
2022-05-09 16:34:11 +02:00
6f773b1a4f Cleanup: typo in variable name. 2022-05-09 16:34:11 +02:00
0f7da9a72f GPU: Unable to compile material shaders.
This fixes a threading issues when material shaders with textures are used.
It localizes the names of the samplers.
2022-05-09 13:32:13 +02:00
b1b6994129 Minor typo fixes in UI messages. 2022-05-09 12:44:21 +02:00
b8432c2c8e Tweak i18n messages extraction script to avoid unwanted messages.
Code would add a bit too often the identifier of an RNA class to
translated messages, this is only needed if there is no valid label
available for it.
2022-05-09 12:40:26 +02:00
025959da23 Fix T97915: Regression: Blender doesn't translate viewpoint menu items.
Another mistake in rBdb3f5ae48aca.
2022-05-09 12:36:56 +02:00
cc3c15fbdd GPU: Fix crash deferred shader compilation.
On certain systems when eevee is used in a 3d viewport could crash. It
happened more often on slower systems or systems with slower glsl compilers.

For example an Intel Mac Mini. The cause was that even if a GPUMaterial
was in used it could be freed.
2022-05-09 09:54:26 +02:00
78e7b20c0f Fix T96683: Mipmaps are inaccurate for UDIM textures
For some reasons the mipmap count was not set to max during creation.
Probably it was mistaken with the UDIM tilemap texture which is only
1D and has only one mipmap.
2022-05-07 19:11:34 +02:00
90663acfd5 EEVEE: Fix missing function implementation for volumetric materials
This was leading to linking errors.

Fixes T97779 Regression: World volume noise stopped working
2022-05-07 18:47:48 +02:00
014cdd3441 Fix T97600 Regression: rendering in new window displays flickers
This is because some drivers / GPU actually still do double buffer swapping
but others don't. Adding this do ensure the background color of the first
redraw.

Note that this fix was not tested on the problematic hardware and might not
solve the issue.
2022-05-07 17:38:05 +02:00
9f2e995c3e Fix T97796 EEVEE: Regression: Alpha clipped materials rendered as alpha hashed
This was because the alpha clip thresholding was previously done in the
material nodes codegen. Now it is the responsibility of the engine to
implement it.

This adds a loose uniform that is set by EEVEE itself to control the clip
behavior.
2022-05-07 15:00:37 +02:00
3a035a4417 Fix T97881 EEVEE: First Specular and SSS closure not contributing on alpha blended material
This was because the evaluation was still being deferred just like for the
opaque case.
2022-05-07 13:18:16 +02:00
b28e261753 GPUShader: Add static compilation to clipped shader variations
This allows testing them for errors.
2022-05-07 12:25:40 +02:00
aee8e49031 Fix T97751: New OBJ IO - File Browser doesn't filter by .obj/.mtl
Makes the File Browser filter by .obj and .mtl files by default again. Note
that this commit focuses on fixing this specific bug, further
refactors/tweaks/fixes are planned (see D14863).

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

Reviewed by: Aras Pranckevicius
2022-05-06 23:05:38 +02:00
Jeroen Bakker
a7417ba845 DrawManager: Make instance data persistent.
When resizing a viewport all engine instance data was cleared.
This wasn't the intended design and lead to performance regressions
in the image engine.

This patch makes sure that the instance data isn't cleared when
the viewport size changes. When using instance data, draw engines
are responsible to update the textures accordingly.

This could also reduce flickering/stalling when resizing the viewport
in eevee-next.

Fixes T95428.

Reviewed By: fclem

Maniphest Tasks: T95428

Differential Revision: https://developer.blender.org/D14874
2022-05-06 16:17:39 +02:00
acafc7327e Fix T97466: Assert when pack sound in blender DEBUG.
This was very old code from 2008, totaly invalid with new depgraph &
evaluation system, now we just need to tag the Sound ID for update.
2022-05-06 15:05:26 +02:00
Ramil Roosileht
90042b7d79 Switch viewport shading for color tools in solid mode
This patch implements T97613, switching viewport shading when using Color Filter and Mask By Color

ALSO, this patch makes it so viewport shading color switches only when SOLID mode is chosen, to prevent color switching when using other shading modes, without user noticing it.
{F13049889}

Reviewed By: JulienKaspar, joeedh, jbakker

Maniphest Tasks: T97613

Differential Revision: https://developer.blender.org/D14765
2022-05-06 12:30:09 +02:00
84756b68e6 Add documentation about Image/ImBuf to python/RNA API.
Related to T95616, the relationship between Image ID and ImBuf 'cached'
buffers can be fairly confusing when using the RNA API.

Reviewed By: campbellbarton, jbakker

Differential Revision: https://developer.blender.org/D14833
2022-05-06 11:11:33 +02:00
62450e8485 WM: suppress assertion when switching tools
Changing the object mode outside the 3D view would trigger this
assertion. This was harmless, only assert for space types that
define the tools mode.
2022-05-06 17:44:32 +10:00
693aa573db Fix T96585: Intersect(Knife) tool is selecting wrong edges
Regression caused by [0] which flushed selection from vertices -> edges,
causing additional edges to be selected. Now selected is flushed based
on the mode, instead of all elements. Note that these function names
could be improved to make it clearer how these flushing functions are
different.

Also skip flushing unless selection is performed.

[0]: 55c82d8380
2022-05-06 16:18:04 +10:00
929a210608 Fix T97758: Applying modifiers bakes shape-keys
Regression in [0] which is useful when applying modifiers as a shape-key
but not when applying modifiers which keeps the existing shape-keys.

[0]: 65c5ebf577
2022-05-06 13:40:54 +10:00
1b566b70c1 Fix T95308, T93913: Cycles mist pass wrong with SSS shader
It was wrongly writing passes twice, for both the surface entry and exit points.
We can skip code for filtering closures, emission and holdout also, as these do
nothing with only a subsurface diffuse closure present.
2022-05-05 22:01:45 +02:00
e4931ab86d Cleanup: clang format 2022-05-05 21:57:08 +02:00
75a051a6ab Fix T93246: Cycles wrong volume shading after transparent surface
The Russian roulette probability was not taken into account for volumes in all
cases. It should not be left out from the SD_HAS_ONLY_VOLUME case.
2022-05-05 20:51:01 +02:00
b891c72d2d Fix T97575: Toggling fullscreen causes compositor recalc
The root of the issue is that compositor is using refresh mechanism
to handle recalc.

The safest fix which does not require deep refactor is to check to
whether node space was tagged for refresh from listener (currently
it is listeners which are responsible for tackling compositor tree
recalc).

Differential Revision: https://developer.blender.org/D14856
2022-05-05 15:35:59 +02:00
1830a3dfb5 Fix T97863: new OBJ importer issues with extra whitespace after "f" keywords
While possible extra whitespace after all OBJ/MTL keywords was properly
skipped, it was not done for the "f" (face definition) keyword.

While at it, also support indented keywords, i.e. extra whitespace at
the beginning of the line.

There's a tiny bit of performance drop while importing (e.g. importing
blender 3.0 splash scene: 53.38sec -> 54.21sec on my machine). But
correctness is more important.

Reviewed By: Howard Trickey
Differential Revision: https://developer.blender.org/D14854
2022-05-05 14:59:46 +03:00
756710800c File missing from 78fc5ea1c3 2022-05-05 20:40:56 +10:00
78fc5ea1c3 Workaround T81065: Merge UV's when applying modifiers
Support merging UV's that share the same vertex and are very close when
applying modifiers.

This is needed to prevent UV's becoming "detached" which can happen when
applying the subdivision surface modifier.

This regression was caused by [0] which removed selection threshold for
nearby coordinates. While restoring the UV selection threshold could be
done - some selection operations that walk around connected UV fans
wouldn't behave in a deterministic way (such as select shortest path).
There are also other cases where UV's may be compared without a
threshold such as tangent calculation and exporters which have their own
logic to handling UV's.

Also resolves T86896, T89903.

[0]: b88dd3b8e7

Reviewed By: sergey

Ref D14841
2022-05-05 20:36:15 +10:00
598917f49b Fix T97874: Python exception after undo with image space visible
Ensure tools are initialized with the correct area type set.
2022-05-05 20:13:10 +10:00
7e02c90103 Fix WM_toolsystem_refresh_screen_all failing to refresh tools
Error in 3e1baa7d53.
2022-05-05 20:13:10 +10:00
94533ca4b8 Cleanup: EEVEE: Fix clang-tidy warnings and unused var warning 2022-05-05 11:55:13 +02:00
3505d948c6 DRW: Hair: Fix shader compilation of transform feedback shader
Introduced by rBadbe71c3faba.
2022-05-05 11:44:31 +02:00
adbe71c3fa Fix T97835: crash when creating hair particle system on Mac
Recently `gpu_shader_3D_smooth_color_frag.glsl` had the uniform declarations removed.

For shaders without `ShaderCreateInfo` that require this source this results in the error:
```
ERROR (gpu.shader): hair_refine_shader_transform_feedback_workaround_create FragShader:
      |
   54 |   fragColor = finalColor;
      |
      | gpu_shader_3D_smooth_color_frag.glsl:5:0: Error: Use of undeclared identifier 'fragColor'
      | gpu_shader_3D_smooth_color_frag.glsl:5:0: Error: Use of undeclared identifier 'finalColor'
      |
   55 |   fragColor = blender_srgb_to_framebuffer_space(fragColor);
      |
      | gpu_shader_3D_smooth_color_frag.glsl:6:0: Error: Use of undeclared identifier 'fragColor'
      | gpu_shader_3D_smooth_color_frag.glsl:6:0: Error: Use of undeclared identifier 'fragColor'
```

So port that shader to use `ShaderCreateInfo`.
2022-05-04 21:42:38 -03:00
f11dba8892 Fix Cycles world light group confusing UI
Move to a subpanel of the Settings panel. Otherwise it seems like it's a
setting of one of the shader nodes.
2022-05-04 21:23:18 +02:00
0fa1c65ee3 Fix T95644: Cycles doesn't update modified object attributes on GPU
evice_update_preprocess is supposed to detect modified attributes and flag the
device_vector for a copy through device_update_flags. However, since object
attributes are only created in device_update_attributes afterwards, they can't
be included in that check.

Change the function that actually updates the device_vector to tag it as
modified as soon as its content gets updated.

Differential Revision: https://developer.blender.org/D14815
2022-05-04 20:07:19 +02:00
54f447ecde Fix T96718: Cycles invalid pixels when using bump normal for light emission
A shader node setup accidentally used the bump normal as emission. Bump
mapping nodes are excluded from light shader evaluation to reduce kernel size
and register pressure, but in that case should write zero instead of leaving
memory uninitialized.

Thanks to Lukas for helping identify the cause.
2022-05-04 20:01:04 +02:00
ac9ebc9de3 Fix Cycles division by zero in material preview render
If the render gets cancelled before the first sample finishes.
2022-05-04 20:01:04 +02:00
fc0f6d19ad Fix T96845: artifacts with GPU subdivision and mirror modifier
The coarse polygon count was set to the one of the BMesh instead of
the the one of the mesh used for subdivision, which caused the
compute shaders to output wrong data.
2022-05-04 19:31:53 +02:00
5d7ee44406 Fix T95527: wrong motion blur with rigid bodies
This index is not meant for the point cache data array, it's already offset.
2022-05-04 19:28:17 +02:00
60772baebf Fix T97709: Compositor: Scenes are being set to no users after doing a full copy.
Similar issue/solution as in rB5188c14718c5 from this Monday actually,
there may be more of those still lurking around... Quite surprising they
all get reported now, this behavior has been in Blender since years.
2022-05-04 17:29:50 +02:00
b5c3885bf0 Fix T97851: GPencil Bake object transform operator wrong transformation
The problem was the layer transformation was already applied in the layer and if we apply in the bake, we are doing double transformation.

Differential Revision: https://developer.blender.org/D14844
2022-05-04 17:18:58 +02:00
5559ea59a1 Cycles: mark all CUDA 11.x versions as supported
All released versions appear to work fine. Also slightly change wording.
2022-05-04 17:07:39 +02:00
b5b6ae06f9 Build: update outdated description of WITH_TBB option 2022-05-04 17:07:39 +02:00
54b293237e Fix T97375: changing node tree from Python is very slow
The issue was that the `NodeTreeRef` acceleration data structure was
rebuild much more often than necessary. That happened because the
Map Range node accidentally tagged the node tree for change even
though it did not actually change.

Differential Revision: https://developer.blender.org/D14842
2022-05-04 15:02:19 +02:00
d86d7c935e Fix T97827: material preview not displaying textures
Caused by rB281bcc1c1dd6 which did not properly made use
of `vec4` for UVs which are now loaded as attributes.
2022-05-04 14:30:52 +02:00
cbeb8770cc Fix T97794: new OBJ importer does not handle quoted MTL paths
Fixes T97794 (which is a reintroduction of an older issue T67266 that
has been fixed in the python importer, but the fix was not in the C++
one). Some software produces OBJ files with mtllib statements like
mtllib "file name in quotes.mtl", and the new importer was not stripping
the quotes away.

While at it, I noticed that MTLParser constructor was taking a StringRef
and treating it as a zero-terminated string, which is not necessarily
the case. Fixed that by explicitly using a StringRefNull type.

Reviewed By: Howard Trickey
Differential Revision: https://developer.blender.org/D14838
2022-05-04 15:10:54 +03:00
Yann Lanthony
b31f5b8ce7 GPencil: Apply layer transforms to visible frames
Fix regression described in T97799.

Apply layer transform and layer parenting to all visible frames, i.e. active frame + onion skinning frames.

Reviewed By: #grease_pencil, antoniov

Maniphest Tasks: T97799

Differential Revision: https://developer.blender.org/D14829
2022-05-04 12:58:57 +02:00
302584bd6e Fix T97831: Curve to mesh node can create invalid wire mesh
When the profile only has one control point, its segment count was
determined incorrectly. There needs to be a special case for a single
control point, when there are no segments even if the curve is cyclic.
2022-05-04 12:26:59 +02:00
79e94caa6b Fix error pasting text containing tabs
Regression in [0] which missed updating the string length
when converting tabs to spaces - the pasted string would be shorter.

[0]: e2f4c4db8d
2022-05-04 19:28:11 +10:00
0375720e28 Fix T95165: Custom Normals tools dont update immediately.
Recalc selection count at the end of the circle selection.
This was removed from circle selection as it became a performance
bottleneck, helas some operators rely on it.
2022-05-04 09:22:17 +02:00
0383047257 Cleanup: quiet strict-prototypes warning 2022-05-04 14:01:18 +10:00
2a89509e45 License headers: add missing license headers
Add missing license headers based on files in the same directory.
2022-05-04 13:58:53 +10:00
e86b62f195 Fix wrong task priority for particle distribution and tanget computation
These kinds of depsgraph evaluations should not be marked as low priority as
this could negatively affect playback performance. Low priority should mainly
be used for background tasks.
2022-05-03 23:08:29 +02:00
5b2a6b6ebb Fix T96880: viewport render animation hangs Blender
Isolate frame writing task so that multithreaded image operations don't cause
the thread to start writing another frame. If that happens we may reach the
MAX_SCHEDULED_FRAMES limit, and cause the render thread and writing threads to
deadlock waiting for each other.

Additionally, don't set task priority to low because this may cause the task
scheduler to be slow in scheduling the write and color management tasks.
2022-05-03 23:08:29 +02:00
281bcc1c1d Fix T93179: geonodes UVs and Vertex colors do not work in EEVEE
Overwriting UV map or vertex color data in Geometry nodes will move the
layers to another CustomData channel, and as such, will make attribute
lookup fail from the UVMap and Vertex Color nodes in EEVEE as the
CustomDataType will also be modified (i.e. no longer `CD_MTFACE` or
`CD_MCOL`).

As discussed in T93179, the solution is to use `CD_PROP_AUTO_FROM_NAME`
so that the render engine is able to find the attributes. This also makes
EEVEE emulate Cycles behaviour in this regard. `attr_load_uv` and
`attr_load_color` are also removed in favor of the generic attribute
API in the various GLSL shaders.

Although `CD_PROP_AUTO_FROM_NAME` is now used even for UV maps, the
active UV map is still used in case the attribute name is empty, to
preserve the old behavior.

Differential Revision: https://developer.blender.org/D13730
2022-05-03 22:50:04 +02:00
94205e1d02 Fix T96822: Cycles motion blur + persistent data not updating properly
At the frame before/after an object starts moving, it's transform may not be
modified but its motion would be and requires an update.
2022-05-03 22:16:08 +02:00
947f8ba300 Fix T96338: GPU subdiv crash switching to UV editing
The crash is caused as the data for the UV editor is requested before
the data for the mesh as a separate draw update. Since building the UV
stretch angle buffer requires the position buffer, the latter is not
created yet in this case.

To fix this, create a local position buffer from the subdivision data. An
alternate fix was considered to remove the dependency on the position
buffer by interpolating on the GPU the coarse stretch angle buffer but
this did work. Maybe this will be revisited.
2022-05-03 18:02:10 +02:00
5962db093f Fix T97793, Fix T97795: Use correct defaults for missing values in new OBJ importer
- Fix T97793: when a UV coordinate after vt is missing, use zero. While
  at it, also use zeroes for positions & normals, since "maximum
  possible float" is very likely to cause issues in imported meshes.
- Fix T97795: use 1.0 default if -bm value is missing, instead of zero.

Reviewed By: Howard Trickey
Differential Revision: https://developer.blender.org/D14826
2022-05-03 14:45:44 +03:00
5f5e7ac317 Fix T97757: Some MTL import correctness issues in the new OBJ importer
Fix several correctness issues where the new OBJ/MTL importer was not
producing the same results as the old one, mostly because the code for
some reason had slightly different logic. Fixes T97757:

- When .obj file tries to use a material that does not exist, the code
  was continuing to use the previous material, instead of creating new
  default one, as the previous importer did.
- Previous importer was always searching/parsing "foo.mtl" for a
  "foo.obj" file, even if the file itself does not contain
  "mtllib foo.mtl" statement. One file from T97757 repros happens to
  depend on that, so resurrect that behavior.
- When IOR (Ni) or Alpha (d) are not specified in .mtl file, do not
  wrongly set -1 values to the blender material.
- When base (Kd) or emissive (Ke) colors are not specified in the .mtl
  file, do not set them on the blender material.
- Roughness and metallic values used by viewport shading were not set
  onto blender material.
- The logic for when metallic was set to zero was incorrect; it should
  be set to zero when "not using reflection", not when "mtl file does
  not contain metallic".
- Do not produce a warning when illum value is not spelled out in .mtl
  file, treat as default (1).
- Parse illum as a float just like python importer does, as to not
  reintroduce part of T60135.

Reviewed By: Howard Trickey
Differential Revision: https://developer.blender.org/D14822
2022-05-03 14:44:49 +03:00
a2e3005b42 Fix VSE view clamping not working
Clamping was set up, but `v2d->cur` was never actually modified.
2022-05-03 10:55:05 +02:00
2ea9d1fccf Fix T97720: Fix meta strip shows incorrect mute state.
Caused by only checking mute state for meta strip itself and not the
children.
2022-05-03 10:55:05 +02:00
20f819d708 Fix T95541: Broken vertex weight with mirror modifier.
Regression from rB1a7757b0bc69/rBa0acb9bd0cc0. Special handling
(averaging) of weights on merged center vertices also requires to be
'reversed' when new correct merge order is used, compared to previous
behavior.
2022-05-03 10:33:38 +02:00
cfdec85cd9 Cleanup: auto-format 2022-05-03 18:32:12 +10:00
4824cad580 GNUmakefile: include autopep8 in the "make format" target
Run autopep8 as well as clang-format when calling "make format",
the PATHS argument is passed to both utilities which will only operate
on files they support.

For example: `make format PATHS=release/scripts` formats Python scripts,
`make format PATHS=source/blender/blenlib` would format C/C++.
If users really want they can format C/C++ & Python files at the same
time since both formatting utilities filter on file extension.

`make format PATHS="release/scripts/startup/nodeitems_builtins.py source/creator/creator.c"`

A LIBDIR variable has been added to the GNUmakefile to simplify
references to this directory which can be one of 3 possible values.

Reviewed By: sybren, brecht

Ref D14789
2022-05-03 18:32:00 +10:00
74dfb7ca23 Fix T97731: Python traceback no longer includes line-numbers
Regression caused by [0] that caused the error message to be
created based on a normalized exception (which hid line numbers).

PyC_ExceptionBuffer{_Simple} & BPy_errors_to_report
no longer clears the exception.

This could have been resolved by changing python_script_error_jump
however that would involve changes to reference counting that are more
risky (noted in code-comment).

[0]: 2d2baeaf04
2022-05-03 18:22:54 +10:00
a821a2db3d Cleanup: remove redundant PyErr_Clear calls after PyErr_Fetch 2022-05-03 18:22:54 +10:00
1fc95d829f CMake: fix error building when CUDA_NVCC_EXECUTABLE is missing 2022-05-03 18:22:54 +10:00
daa9edc9be Fix T97744: Speed effect causes memory leak
Leak was caused because output image buffer was initialized twice. Once
in speed effect strip and then by cross effect strip used for
interpolation feature.
2022-05-03 10:20:41 +02:00
fd98403211 Fix T97733: Crash when adding new scene
Caused by NULL dereference if sequencer data does not exist.
2022-05-03 10:20:41 +02:00
cc0c4c17f0 Fix T95752: crash 'Select Linked' after loopcut in multiobject editmode
This was reported explicitly for originally being in face selectmode,
but could also crash when in vertex selectmode (when doing multiple
cuts).

The reason here is that `MESH_OT_loopcut` switches to edge select mode
(needed for `TRANSFORM_OT_edge_slide`, done in `ringsel_finish`), but was
only doing this on the active object's editmesh, all other participating
meshes would keep their selectmode which would now be out of sync with
both the active object's editmesh and scene settings for these.

This causes problems later in 'Select Linked'. Here, a mixture of
objects are used. First the viewcontext is set up with the active
object, then all participating objects are iterated (changing the
viewcontext to another object), then `unified_findnearest` would use that
changed viewcontext which would now contain the last object iterated. To
repeat: this could now have a different selectmode than the active
object which is later **again** used to get the nearest `BMElem` from in
`EDBM_elem_from_selectmode`. So in the failing case, we could get an
edge (but no face because of edge selectmode) from `unified_findnearest`,
`EDBM_elem_from_selectmode` would return NULL though (edge provided, but
in face selectmode), leading to the crash.

To solve this I assume it is best to change selectmode on all
participating meshes in multi-object editmode loopcut if necessary so
these are always in sync for following operations.
Alternatively, `Select Linked` (and probably lots more operators) would
have to be tweaked to pay closer attention which object is really used
to get selectmode from.

Note the selectmode is actually set back from edge selectmode in certain
cases (see `USE_LOOPSLIDE_HACK`), this patch changes that as well to act
on all participating meshes.

Maniphest Tasks: T95752

Differential Revision: https://developer.blender.org/D14791
2022-05-03 09:46:18 +02:00
1a6d0ec71c Fix T93272: Material index mapping missing for mesh boolean node
This commit implements copying of materials and material indices from
all of the boolean node's input meshes. The materials are added to the
final mesh in the order that they appear when looking through the
materials of the input meshes in the same order of the multi-socket
input node.

All material remapping is done with mesh-level materials. Object-level
materials are not considered, since the meshes don't come from objects.

Merging all materials rather than just the materials on the first mesh
requires a change to the boolean-mesh conversion. This subtly changes
the behavior for object linked materials, but in a good way I think;
now the material remap arrays are respected no matter the number
of materials on the first mesh input.

Differential Revision: https://developer.blender.org/D14788
2022-05-03 09:28:35 +02:00
c09c3246eb Fix T97718: Crash using "Text on Curve"
8e4c3c6a24 mistakenly used the `vec` argument
of `BKE_where_on_path` like it was optional. Fix by
making that argument optional too.
2022-05-03 09:25:28 +02:00
3d96fd6fd6 Fix T97543: Changing multipass images doesn't update the image.
Code was partial migrated from the previous image engine. Missing multilayered
images.
2022-05-03 09:12:00 +02:00
38a4d96a90 Fix T97507: Crash when deleting adjustment layer
Issue was not properly fixed in 3cef9ebaf8 due to oversight.
`SEQ_get_channels_by_seq` returned pointer to `seqbase` instead of `channels`.
2022-05-03 08:47:27 +02:00
e4e5d7781e Fix T97547: Stereo rendering crash.
Viewports weren't drawn as they couldn't get a lock. Resulted in compositing
uninitialized viewports. Fixed by checking that both views were drawn.
2022-05-03 08:21:08 +02:00
4ee8dfa8b3 Fix use after free error when exiting a temp screen
Regression in [0] caused by checking the screen after event handling.

[0]: d4bdf21929
2022-05-03 14:50:40 +10:00
8810d0cecd Fix T85379: Cube projection size parameter is wrong
The input size was doubled & inverted.
2022-05-03 13:26:46 +10:00
79d4740eda Cleanup: use context.temp_override
Remove use of deprecated operator context passing.

Also minor clarification in the context.temp_override docs.
2022-05-03 09:32:28 +10:00
309b6319a0 Cleanup: quiet unused variable warning 2022-05-03 09:32:27 +10:00
Henrik Dick
62ef1c08af GPencil: Fix envelope modifier deform mode thickness
The thickness in the deform mode was just correct if the radius when
drawing a stroke was set to 20. Now all factors that influence the
stroke thickness are considered in deform mode.

Differential Revision: https://developer.blender.org/D14691
2022-05-02 22:13:38 +02:00
5188c14718 Fix T97688: Deleting a scene with a scene strip causes the referenced scene to have zero users
Relinking code would weirdly enough allow clearing of extra/fake user
status on IDs used by affected ID, which would be utterly wrong.

Fairly unclear why this was working OK in reported case before rBa71a513def20,
could not spot any obvious reason just from reading code...

Also, in `libblock_remap_data_update_tags`, only transfer fake user
status if `new_id` is not NULL (otherwise that would have removed that
falg from `old_id`, without actually transferring it to anything).
2022-05-02 15:58:53 +02:00
263f56ba49 Add RNA accessor for 'extra user' ID tag,
Not expected to be used directly by users, but very handy to have around
for investigations and debugging.
2022-05-02 15:58:53 +02:00
Ethan-Hall
3d5f5c2d9a Color Attributes: Add initial fill color option
This patch adds allows the user to select the initial fill color when
adding a new color attribute layer.

---
{F13035372}

Reviewed By: JulienKaspar, joeedh

Differential Revision: https://developer.blender.org/D14743
2022-05-02 12:18:23 +02:00
38394e1a32 GPU: Remove OCIO workaround for Apple.
OCIO shader was ported to use GPUShaderCreateInfo a while ago. That
made this workaround not needed anymore.

Best to remove it before the release.
2022-05-02 12:15:21 +02:00
1b0da28038 EEVEE: Fix compiler warning 2022-05-02 11:22:57 +02:00
d1cbfc81bb Blender 3.2 splashscreen
Credits: Oksana Dobrovolska
2022-05-02 10:38:59 +02:00
da46ed9116 Blender 3.2 - Beta
* BLENDER_VERSION_CYCLE set to beta
* Update pipeline_config.yaml to point to 3.2 branches and svn tags
* Update and uncomment BLENDER_VERSION in download.cmake
2022-05-02 10:35:39 +02:00
12baea1b8e EEVEE: Fix compilation on MSVC 2022-05-02 10:09:46 +02:00
8ece0816d9 EEVEE: Rewrite: Implement nodetree support with every geometry types
This commit introduce back support for all geometry types and all nodetree support.
Only the forward shading pipeline is implemented for now.

Vertex Displacement is automatically enabled for now.

Lighting & Shading is placeholder.

Related Task: T93220

# Conflicts:
#	source/blender/draw/engines/eevee_next/eevee_engine.cc
#	source/blender/gpu/CMakeLists.txt
2022-05-02 09:35:45 +02:00
f0f44fd92f Curves: support spherical delete brush
Differential Revision: https://developer.blender.org/D14797
2022-05-02 09:18:57 +02:00
a5644f9a28 Cleanup: GPUBuiltinShader: Remove old shader interfaces
This leaves some of the unresolved case where we still need both
implementation.
2022-05-02 01:31:24 +02:00
aaab3c8ad4 Cleanup: GPUShader: Make style consistent in builtin_shader_stages 2022-05-02 01:05:35 +02:00
f0118e9aca GPUShader: Remove GPU_SHADER_INSTANCE_VARIYING_COLOR_VARIYING_SIZE
This had only one use and it was for debugging. Remove the shader for now.
This also simplifies the debug drawing even if slower.
2022-05-02 00:57:32 +02:00
5e5e198bbe GPUShader: Port 3D uniform color clipped shaders to use shaderCreateInfo
This should have no functional changes.
2022-05-02 00:44:58 +02:00
0676963809 GPUShader: Port dashed line shaders to use shaderCreateInfo
This should have no functional changes.

This reduce the complexity of the shader by only supporting 2 colors.
We never use more than 2 color in practice and this makes usage not require
a UBO.
2022-05-02 00:35:49 +02:00
2a7a01b339 GPUShader: Port polyline shaders to use shaderCreateInfo
This should have no functional changes.
2022-05-01 23:54:41 +02:00
aa34706aac Fix T97545 DRW: Crash cause by invalid " char in glsl source
Some old compiler do not like this character even if inside an `#error`
directive.
2022-05-01 22:42:07 +02:00
3f0c09f6dd GPUShaderCreateInfo: Add validation for overlapping vertex attribute
Those are usually not supported but some driver silently fix them and most
just silently fail (rendering error).
2022-05-01 22:28:38 +02:00
fc872d738e GPUShader: Port 2D widget shaders to use shaderCreateInfo
This should have no functional changes.
2022-05-01 21:12:59 +02:00
a330b9b0ea GL: Add attribute-less shader workaround for MacOS to the backend
This workaround and the issue was described in D4490. This makes sure
any shader using `shaderCreateInfo` will benefit from the same workaround.
2022-05-01 20:54:33 +02:00
631506d9c3 External Engine: Reuse depth only shader from Basic engine
This removes the usage of `GPU_shader_create_from_info_name()`.
2022-05-01 19:35:37 +02:00
eba06fee49 Basic Engine: Port depth shader (object selection) to shaderCreateInfo
This should have no functional changes.
2022-05-01 19:35:37 +02:00
c87f6242b9 Fix T97644: new 3.2 obj importer does not set blend mode for eevee
The old python importer had a "if do_transparency, set blend_method to
BLEND" type of logic. This bit was missing in the new importer; it was
only setting the eevee blend method when a transparency texture was
present, but not in other cases of transparency (as driven by MTL
"illum" mode).

Reviewd By: Howard Trickey
Differential Revision: https://developer.blender.org/D14783
2022-05-01 20:10:21 +03:00
33518f9da1 Fix T97417: OBJ: support tab and other whitespace characters after obj/mtl keywords
Even if available OBJ/MTL format documentations don't explicitly specify
which characters can possibly separate keywords & arguments, turns out
some files out there in the wild use TAB character after the line
keywords. Which is something the new 3.2 importer was not quite
expecting (T97417).

Fix this by factoring out a utility function that checks if line starts
with a keyword followed by any whitespace, and using that across the
importer. Also fix some other "possible whitespace around name-like
parts" of obj/mtl parser as pointed out by the repro files in T97417.

Reviewed By: Howard Trickey
Differential Revision: https://developer.blender.org/D14782
2022-05-01 20:07:03 +03:00
30d1d4579e Cleanup: Overlay: Remove unused extern datatoc and shader library
These are not needed anymore.
2022-05-01 18:47:51 +02:00
6cad9c7964 Overlay: Port particle display shader to use shaderCreateInfo
This should have no functional changes.
2022-05-01 18:40:48 +02:00
d02d1129f7 Overlay: Port particle edit shader to use shaderCreateInfo
This should have no functional changes.
2022-05-01 18:17:37 +02:00
6861ef62a6 Overlay: Port sculpt mask shader to use shaderCreateInfo
This should have no functional changes.
2022-05-01 18:07:16 +02:00
cc268238ea Overlay: Port wireframe shader to use shaderCreateInfo
This should have no functional changes.
2022-05-01 17:39:32 +02:00
ba22aa8797 Overlay: Port facing shader to use shaderCreateInfo
This should have no functional changes.
2022-05-01 17:14:30 +02:00
e59cc3a814 Overlay: Port gpencil canvas shader to use shaderCreateInfo
This should have no functional changes.
2022-05-01 17:07:20 +02:00
d33801e2bf Overlay: Port image empty shader to use shaderCreateInfo
This should have no functional changes.
2022-05-01 16:30:51 +02:00
1c992cc647 Overlay: Fix non functional outline on wireframe
This was caused by rB6e5877c189df5d6c2dfcaa44ba4c3c9a8b387998.
2022-05-01 15:37:37 +02:00
0dfb6eddc0 Overlay: Port motion path shaders to use shaderCreateInfo
This should have no functional changes.
2022-05-01 15:37:37 +02:00
0c44b03b09 Overlay: Port 2D image overlay shaders to use shaderCreateInfo
This should have no functional changes.
2022-05-01 15:37:37 +02:00
df0616bcd0 Nodes: Fix T90233
- Fix default_value initialization of custom node tree interface:

  This was crashing when adding a custom interface socket to a tree.
  The node_socket_set_typeinfo function was called too early, creating a
  default float socket, which then doesn't match the socket type after
  changing to the custom type.

  The node_socket_set_typeinfo only allocates and initializes
  default_value when it isn't already set. That is because the function is
  used either when creating new sockets or to initialize typeinfo after
  loading files. So default_value has to be either null or has to be
  matching the current type already.

- Fix RNA flag for string return value of the valid_socket_type callback:

  String return values of registerable RNA functions need a
  PROP_THICK_WRAP flag since they don't have a fixed buffer to write into.
2022-05-01 09:27:22 +01:00
171851a6c8 Material: Hide material output socket Thickness as it is not used for now
This is a EEVEE-Next feature that is not yet implemented. Ideally the
socket should only be displayed when EEVEE is in the selected target
engine.
2022-05-01 10:09:23 +02:00
Nate Rupsis
5ff931149b Updating Graph editor channels pin tool tip
Reviewed By: Blendify

Maniphest Tasks: T97631

Differential Revision: https://developer.blender.org/D14766
2022-04-30 23:12:44 -04:00
12217714c7 Overlay: Port depth only & uniform_color shaders to use shaderCreateInfo
This should have no functional changes.
2022-04-30 23:56:31 +02:00
86b37748a7 Overlay: Port background shaders to use shaderCreateInfo
This should have no functional changes.
2022-04-30 23:54:52 +02:00
6e5877c189 Overlay: Port outline shaders to use shaderCreateInfo
This should have no functional changes.
2022-04-30 23:13:27 +02:00
69a43069e8 Overlay: Port edit gpencil shaders to use shaderCreateInfo
This should have (mostly) no functional changes.

Support for clipping was added to the shaders but it is not enabled for now
as we wait for the Gpencil engine to support clipping.
2022-04-30 21:11:55 +02:00
Germano Cavalcante
57b4efc250 Overlay: port paint shaders to use 'GPUShaderCreateInfo'
Simple port.

Also a description of how each shader is used has been added.

NOTE: The shader created using `OVERLAY_shader_paint_vertcol` cannot be tested.
Apparently it is created but not used.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D14812
2022-04-30 14:50:57 -03:00
fc40356ed8 Overlay: Port edit lattice shaders to use shaderCreateInfo
This should have no functional changes.
2022-04-30 19:35:51 +02:00
a8e6ee17cc Overlay: Port edit curves shaders to use shaderCreateInfo
This should have no functional changes.
2022-04-30 19:20:37 +02:00
669349bfe4 Overlay: Port edit uv shaders to use shaderCreateInfo
This should have no functional changes.

Removed `antialiasing_vert.glsl` becaus it was actually a duplicate of
`common_fullscreen_vert.glsl`.
2022-04-30 18:25:05 +02:00
b95601fa1a Overlay: Port edit uv shaders to use shaderCreateInfo
This should have no functional changes.
2022-04-30 17:37:19 +02:00
237857cc26 Overlay: Port volume shaders to use shaderCreateInfo
This should have no functional changes.
2022-04-30 16:30:09 +02:00
ac88123e29 Fix T96576: Light leaking when using normal maps with Multiscatter GGX
The Multiscatter GGX code was missing the same-side checks for incoming and
outgoing directions w.r.t. to shading and geometry normal.

Should not be needed for the Glass variant since it intentionally has both
reflection and transmission.
2022-04-30 13:49:45 +02:00
5c92c04518 XR: Add object extras, object types visibility session options
This allows object extras such as image-empties to be shown in the VR
viewport/headset display. Being able to see reference images in VR can
be useful for architectural walkthroughs and 3D modeling applications.

Since users may not want to see all object extras (lights, cameras,
etc.), per-object-type visibility settings are also added as session
options.

By slightly refactoring the definition of the 3D View object types
visibility panel (note: no functional changes), the VR Scene Inspection
add-on can show a similar panel without duplicating code. When VR
selection is possible in the future, the object type select options can
also be enabled.

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D14220
2022-04-30 16:23:43 +09:00
Ramil Roosileht
2fc6563a59 D14808: Use saturation as multiplier for saturation filter
A change proposed in T97697, using existing saturation as a multiplier for the filter operation
{F13038602}

Review By: Joseph Eagar, Julian Kaspar
Differential Revision: https://developer.blender.org/D14808
Ref D14808
2022-04-29 20:12:45 -07:00
eaa63c7d68 Overlay: Port extra shaders to use shaderCreateInfo
This should have no functional changes.
2022-04-29 20:38:42 +02:00
fc2c22e90c Cycles: Hydra fixes for stageMetersPerUnit and OpenGL context on Windows
Add "stageMetersPerUnit" render setting for USD files that have that set to
something other than the default (e.g. exported by Blender).

And fix a crash when an application creates a Hydra render pass on a thread
that does not have an OpenGL context current.
2022-04-29 19:19:39 +02:00
9b92ce9dc0 Cycles: add USD as a file format for Cycles standalone rendering
Long term, this should replace the XML format. This reuses the Hydra render
delegate implementation, and so supports the same features. The same command
line options and GUI work for both XML and USD also.

The implementation of this is still disabled, waiting for some refactoring of
USD library linking. However we want the Cycles code to be in sync between
repositories for the 3.2 release.

Ref T96731
2022-04-29 19:19:19 +02:00
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
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
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
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
e0315a5ef0 Cycles: add profiling command line argument to standalone
Like --cycles-print-stats for Blender.
2022-04-29 18:08:41 +02:00
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
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
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
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
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
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
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
0634bb24ee Cleanup: remove unused server app after network render was removed 2022-04-29 17:39:04 +02:00
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
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
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
a7db7f88b0 Fix CMake error in new builds after previous NanoVDB fix 2022-04-29 15:38:21 +02:00
1d9c050188 Fix wrong cast from uint to int (2)
Error in rB3d877c8a0d06
2022-04-29 10:22:49 -03:00
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
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
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
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
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
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
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
cc8fe1a1cb Fix T97120: Gizmo fails to select in orthographic view
Regression in exposed by 49fc4449e7.
2022-04-29 16:21:23 +10:00
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
720e19a833 Fix T62945: Hotkeys not showing up in brush tooltips 2022-04-28 23:13:53 -07:00
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
0b5cf91b89 Cleanup: use 'use_' prefix for RNA boolean 2022-04-29 09:43:03 +10:00
1e23304fbc Cleanup: missing declaration warnings & spelling in comments 2022-04-29 09:27:46 +10:00
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
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
f38f12cbbc Cleanup: silence unused variable warnings 2022-04-28 18:41:44 -03:00
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
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
4b7ed584a8 Cleanup: Overlay: Avoid local variable shadowing 2022-04-28 21:44:15 +02:00
d5f3351f55 Overlay: Port UDIM Grid shader to shaderCreateInfo
Simple Straight forward port.
2022-04-28 21:43:54 +02:00
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
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
c722993ef1 Fix T94467: Cycles baking of normal pass slower than before cycles-x 2022-04-28 19:55:12 +02:00
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
2d7957727c Fix: Incorrect conversion from C bitfield syntax
Recent cleanups 9a8669ac81 and 1c790555a0
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
Sebastian Herholz
bd327e3bf3 Fix: Sky models can return negative values
When converting from XYZ to RGB it can happen, in some sky models, that the resulting RGB values are negative.
Atm, this is not considered and the returned values for the sky model can be negative.

This patch clamps the returned RGB values to be `= 0.f`

Reviewed By: brecht, sergey

Differential Revision: https://developer.blender.org/D14777
2022-04-28 18:14:06 +02:00
Christophe Hery
110eb23005 Fix T97056: Cycles MNEE caustics treated as direct instead of indirect light
This fixes wrong render passs and bounce limits.

Differential Revision: https://developer.blender.org/D14737
2022-04-28 18:00:11 +02:00
4296c1fe25 Fix T97142: When Exporting GPencil, File Dialog Shows No Subfolders
The export had missing the `FILE_TYPE_FOLDER` flag.
2022-04-28 17:58:24 +02:00
099120e54a Cleanup: Fix compiler warnings 2022-04-28 10:53:50 -05:00
Ethan-Hall
024386bb89 UI: Improvements to "Add Color Attribute" menu
Allow the session to save the choice for domain and data type since
it is highly likely that the user intends to use the same settings
for subsequent color attributes.

Use expanded button selectors for domain and data type since there
are only two options for each.

Differential Revision: https://developer.blender.org/D14785
2022-04-28 10:47:23 -05:00
f4718d52f3 Snap Gizmo: update props using gizmo's snap_state
A snap state can be replaced by another snap state of a gizmo or cursor.

The snap gizmo should only change its state, not the current state.

It's not really a problem currently.
2022-04-28 12:41:50 -03:00
16b6d4aeb3 Deps:Specify versions for implicit python modules
D14686 added autopep8 which implicitly dragged in
toml and pycodestyle which were not versioned, this
diff adds explicit versions of these deps so there
won't be any version changes if we rebuild in the
future.

Reviewed By: brecht, sybren

Differential Revision: https://developer.blender.org/D14793
2022-04-28 09:37:22 -06:00
44b318bd22 Fix T97527: multiview camera suffix not working with more than 4 characters
Thanks to Germano Cavalcante for finding the solution.
2022-04-28 17:36:07 +02:00
853713336f Fix non-face oriented snap cursor in dragdrop
If the measure gizmo is enabled, its snap state is used in the snap update.

As it does not require a plane, the orientation of the plane is not
calculated.

However, the calculation of the plane's orientation must prevail over
the states.
2022-04-28 12:33:16 -03:00
91bd63a196 CMake: Reduce dependencies of USD
`PXR_ENABLE_OSL_SUPPORT=OFF`: OpenShadingLanguage is an optional
dependency of the Imaging module. However, since that module was
included for its support for converting primitive shapes (sphere, cube,
etc.) to geometry, OSL is not necessary. Disabling it will make it
simpler to build Blender; currently only Cycles uses OSL.

`PXR_ENABLE_GL_SUPPORT=OFF`: GL support on Linux also links to X11
libraries. Enabling it would break headless or Wayland-only builds.
OpenGL support would be useful if someone wants to work on a Hydra
viewport in Blender; when that's actually being worked on, we could
patch in a new PXR_ENABLE_X11_SUPPORT option (to separate OpenGL from
X11) and contribute it upstream.

`PXR_BUILD_OPENIMAGEIO_PLUGIN=OFF`: It's used for loading image textures
in Hydra Storm / Embree renderers which we don't use.

Reviewed By: LazyDodo, brecht, makowalski

Differential Revision: https://developer.blender.org/D14792
2022-04-28 17:16:04 +02:00
22f5c05cb3 Snap Cursor: split 'ED_view3d_cursor_snap_data_get'
Split 'ED_view3d_cursor_snap_data_get' into 'update' and 'get' functions

Sometimes we just want to update and sometimes we just get the result.

Make it clear.
2022-04-28 11:28:37 -03:00
17769489d9 VSE: Add option to limit timeline view height
When height is limited, it is defined by space occupied by strips,
but at least channels 1 to 7 will be always visible. This allows it to
easily overview timeline content by zooming out to maximum extent in Y
axis and panning in X axis.

More channels can be "created" on demand by moving strip to higher
channel. When strip is removed and highest channel becomes empty, view
will stay as is until it is moved down. Then new highest point is
remembered and it is not possible to pan upwards until strip is moved to
higher channel.

Limiting takes into account height of scrubbing and markers area as
well as scrollers. This means that when zoomed out to maximum extent,
no strips are obstructed by fixed UI element.

Fixes T57976

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D14263
2022-04-28 16:14:51 +02:00
b1b153b88c Cleanup: Improve const correctness of shape key functions 2022-04-28 09:10:50 -05:00
4412cbc6d1 Cleanup: Make RNA function comment more readable
This complex comment was hard to parse visually.
There was some odd line breaking going on, and together with no
indentation for the continued lines, it was just a blob of text with no
visual structure. You wouldn't see easily where the description of an
argument started or ended.
2022-04-28 16:06:09 +02:00
c9c95201d0 Fix T97679: Retrieving shape key normals modifies vertices
Caused by not using the proper duplicated `MVert` array.
Error in b0aaf6ff4a.
2022-04-28 08:45:31 -05:00
0ad73bb965 Geometry Nodes: Add default attribute name to field inputs/outputs
Geometry node group inputs and outputs get a new property that controls
the attribute name used for that field input/output when assigning the
node group to a modifier for the first time. If the default name is assigned
to an input, the default "Use attribute name" is true .

In order to properly detect when a node group is first assigned,
the modifier now clears its properties when clearing the node group.

Ref T96707

Differential Revision: https://developer.blender.org/D14761
2022-04-28 08:39:30 -05:00
b0e47ffdcf UI: Sort VSE modifiers alphabetically 2022-04-28 14:40:31 +02:00
77794b1a7b VSE: Add precise drag and drop and strip previews
This patch adds the drag and drop strip previews in the VSE.
It also adds two new functions to the drag and drop API.

1. "draw_in_view" for callbacks that wants to draw elements in local viewport coordinates
2. "on_drag_start" that can be used for prefetching data only once at the start of the drag.

Reviewed By: Julian, Campbell

Differential Revision: http://developer.blender.org/D14560
2022-04-28 12:55:51 +02:00
Falk David
16fe767d00 GPencil: Fix offset modifier performance regression
When using an offset modifier on a grease pencil object, the performance
could be impacted due to the randomize option introduced by rB6a2bc40e0131.
Even if the option was not used (offset, rotation, scale set to zero), the modifier
would still compute the random transformation matrix.

The patch checks if the randomization is used and only then caluclates the matrix.

Reviewed By: #grease_pencil, antoniov

Differential Revision: https://developer.blender.org/D14553
2022-04-28 12:38:28 +02:00
e8102aea13 Cleanup: fix warning due to unused variable
This warning exists in gcc 9.4.0, apparently because the variable
is not used in some `constexpr` code paths.
2022-04-28 12:21:39 +02:00
37ede15e63 Blender 3.2 Beta - Subversion bump 2022-04-28 11:40:42 +02:00
Kevin C. Burke
eed8c2e655 Fix T96476: Equalize Handles not working on all keyframes
As the default handle type in Blender is 'Auto Clamped' the Equalize
Handles operator will often appear to have no affect on the selected
keyframes on which it is run. If either of the keyframes' handle types
are 'Auto', 'Auto Clamped', or 'Vector', this patch will convert the
handles to 'Aligned'.

Reviewed By: sybren

Maniphest Tasks: T96476

Differential Revision: https://developer.blender.org/D14345
2022-04-28 11:15:50 +02:00
198a763944 Cleanup: spelling in comments
Also use back-slashes for doxy commands.
2022-04-28 14:03:49 +10:00
eb4b79c556 Cleanup: unbalanced doxy sections, add some sections 2022-04-28 14:03:47 +10:00
9e2d80c49e Cleanup: format 2022-04-28 14:03:46 +10:00
74a44e816c Fix error holding stack memory in a uniform
Caused by db622b5a0b
2022-04-28 13:59:20 +10:00
8399375098 Cleanup: Reword comment, rename variables
Use "transform" instead of "obmat", because the meshes
don't necessarily come from objects.
2022-04-27 18:53:56 -05:00
52a5f68562 Revert "Cycles: Enable inlining on Apple Silicon for 1.1x speedup"
This reverts commit b82de02e7c. It is causing
crashes in various regression tests.

Ref D14763
2022-04-28 00:46:43 +02:00
3558f565f1 Fix T97498, T97651: crash in Cycles with TBB 2021 after recent changes 2022-04-28 00:24:13 +02:00
0539208f97 Fix T97666: Blender not starting on macOS 10.14 after library upgrade 2022-04-28 00:24:10 +02:00
e2cd5c6748 EEVEE: Add shader compilation progress in the viewport
Since rBfa43c47c7cb8446b632a4c0f712162ba615fe51f the progress bar do not
show the compilation progress. This was misleading as users could think
it could be canceled or prevent rendering.

Now we just show how many shaders are still in the compilation queue inside
each viewport. This number is more accurate than the percentage that was
previously displayed in the progress bar.
2022-04-28 00:16:18 +02:00
9c82c00b32 GPUMaterial: Rework the deferred compilation to not use double locks
This uses refcounter instead of double thread mutexes. This should be
more robust and avoir use after free situation.

Also remove redundant structures and the use of scene as the job owner.
2022-04-28 00:16:18 +02:00
676198f57f GPUMaterial: Use GPU_MAT_CREATED as a default 2022-04-28 00:16:18 +02:00
c6ce2be496 Fix T97627: Revert Window Redraw When Saving
Removal of the `WM_redraw_windows` call in `wm_file_write` introduced
in rB7a9cfd08a8d7415ff004809cf62570be9152273e as that can cause
crashing while saving from a script.

See D14780 for more details.

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

Reviewed by Campbell Barton
2022-04-27 15:07:34 -07:00
b60f3fe6ad Cleanup: Remove disabled optimization code
Addressing the TODO from the comment isn't a priority at the moment,
and should be solved a bit more generally anyway.
2022-04-27 16:40:30 -05:00
bfb4dcaa1a Fix T97235: PBVH draw cache invalidation bug
The PBVH draw cache wasn't being invalidated in
all cases.  It is now invalidated whenever a PBVH
node's draw buffers are freed.
2022-04-27 13:05:06 -07:00
f3d5114c41 Fix T93285: Wrong instance order when instancing a collection
At least on the Mac, `std::sort` sometimes passes the same value in the
`a` and `b` parameters.

The `true` return is only for cases where `a` is less than `b`.
2022-04-27 11:18:37 -03:00
ce115a2786 GPUCodegen: Fix broken materials after rB478eb3a0e6ed 2022-04-27 16:13:45 +02:00
69a720abb0 Fix broken obj tests from earlier commit
rB08731d70bf66 was not properly checking if subdivision needs to be
evaluated on the CPU.

Thanks Ray Molenkamp for noticing.
2022-04-27 16:02:34 +02:00
478eb3a0e6 GPUCodegen: Keep copy of attribute name in the GPUCodegenCreateInfo
This is to avoid use after free when the `GPUPass` gets compiled after the
original `GPUMaterial` used to create it was freed.

The issue was introduced by rBfa3bd17ae873
2022-04-27 16:01:41 +02:00
c01e33d6ca GPUCodegen: Use spin lock to protect the pass refcounter.
This is not performance critical so using the same global lock should not
pose any issue.
2022-04-27 16:01:41 +02:00
163f6a17e4 Fix T96434: bad performance with viewport statistics and GPU subdivision
The subdivision is always recomputed on the CPU when displaying stats
if the mesh is animated which leads to bad performance.

This caches the subdivision topology counters from the draw code in the
mesh runtime and uses them for the viewport statistics.

Differential Revision: https://developer.blender.org/D14774
2022-04-27 15:30:17 +02:00
08731d70bf Fix T96327: data transfer crash with GPU subdivision
The crash is caused as the subdivision wrapper does not have loop
normals, which are generally computed at the end of the modifier stack
evaluation via `mesh_calc_modifier_final_normals`. (Note that they are
initially computed, but deleted by the subdivision wrapper creation.)

This records in the mesh runtime whether loop normals should have been
computed and computes them alongside the subdivision wrapper.

Differential Revision: https://developer.blender.org/D14489
2022-04-27 14:03:03 +02:00
c5a4159bee Cleanup: format 2022-04-27 14:01:45 +02:00
Jason Fielder
db622b5a0b Metal: GLSL Compatibility - Hosting default uniform values.
There are a number of shaders, most notably grid_frag.glsl, which rely on default assignments to uniform values within shaders. This is not currently supported by the shader uniform push model implemented for the Metal backend, wherein uniform updates are pushed as a singular block of data. Any default assignment would become over-written.

As such, adding assignments of these default values in the high-level, to ensure the correct value is written for all APIs. This likely impacts Vulkan push-constants as well.

Authored by Apple: Michael Parkin-White

Ref T96261

Reviewed By: fclem

Maniphest Tasks: T96261

Differential Revision: https://developer.blender.org/D14555
2022-04-27 13:00:51 +02:00
cdd4354c81 Metal: MTLTexture core implementation for Metal backend, with minimal surrounding functionality.
This covers implementation of the GPUTexture abstraction for the Metal backend, with additional utility functionality as required.

Some components have been temporarily disabled pending dependencies on upcoming Metal backend components, and these will be addressed as the backend is fleshed out.

One core challenge addressed in the Metal backend is the requirement for read/update routines for textures. MTLBlitCommandEncoders offer a limited range of the full functionality provided by OpenGLs texture update and read functions such that a series of compute kernels have been implemented to provide advanced functionality such as data format conversion and partial/swizzled component updates.

This diff is provided in full, but if further division is required for purposes of code review, this can be done.

Authored by Apple: Michael Parkin-White

Ref T96261

Reviewed By: fclem

Maniphest Tasks: T96261

Differential Revision: https://developer.blender.org/D14543
2022-04-27 12:36:56 +02:00
68ca12a7fc Fix T96283: last disabled subsurf is used for GPU subdivision
When more than one, consecutive, subdivision modifier is used on a Mesh,
the last subsurf modifier is used for GPU subdivision even though it
might be disabled. This is because retrieving the last subsurf modifier
in the draw code did not check whether the modifier was disabled or not.

To fix this, the session UUID of the modifier which delegated evaluation
to the GPU code is cached and used in the draw to select the right subsurf
modifier.

Differential Revision: https://developer.blender.org/D14488
2022-04-27 10:22:07 +02:00
9a8669ac81 Cleanup: Use bool, remove unnecessary struct keywords 2022-04-26 18:45:40 -05:00
1f270cf99b Snap: Use Map and unique_ptr for snap cache
Use C++ types instead of GHash to make code easier to read and simpler.

Differential Revision: https://developer.blender.org/D14758
2022-04-26 18:33:05 -05:00
b82de02e7c Cycles: Enable inlining on Apple Silicon for 1.1x speedup
This is a stripped down version of D14645 without the scene specialisation optimisations.

The two major changes in this patch are:

- Enables more aggressive inlining on Apple Silicon resulting in a 1.1x speedup and 10% reduction in spill, at the cost of longer pipeline build times
- Revival of shader binary archives through a new ShaderCache which is shared between MetalDevice instances using the same physical MTLDevice. This mitigates the extra compile times via explicit caching (rather than, as before, relying on the implicit system shader cache which can be purged without notice)

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D14763
2022-04-26 22:17:16 +01:00
994da7077d Outliner: Add icon column to toggle if library overrides are editable
Adds a column to the right in the Library Overrides Hierarchies view
mode to toggle editability of library overrides.

Note that making a library override non-editable currently involves
clearing all overridden properties. This is an arguable design choice,
we should probably at least warn the user before doing this.

Part of T95802.

Reviewed by: Bastien Montagne

Differential Revision: https://developer.blender.org/D14653
2022-04-26 22:30:33 +02:00
83c8f996f1 UI: Add callback for comparing button identity
The code to compare buttons from the previous to the current frame, to
see if they match (an thus should keep the same state) was quite
generic, and didn't allow much flexibility/customization. For some
cases this isn't enough, and a more specific comparison is needed. Say
if some buttons don't actually store comparable data themselves, only
via the button context. This was the case in D14653.
2022-04-26 22:26:15 +02:00
5fe1624b0e UI: Support setting context for buttons without layout
It was possible to set context pointers for buttons via the layout, but
not for buttons in places where the layout system wasn't used (where
buttons are placed manually). This is needed for buttons in the
Outliner, see D14653.
2022-04-26 22:23:52 +02:00
8016d8a4bd deps_builder/robinmap: remove file copy on windows
- It's not needed, since it's a build time dependency only.
- It was setup to copy to the wrong folder.
2022-04-26 11:02:16 -06:00
296b261299 build_deps.cmd: prevent over-subscription of the cpu.
/maxcpucount:1 and /m are the same option with the latter
one using all cores available, leading to the situation
where msbuild would start N side by side project builds
that all tried to use N cores as well. leading to severe
memory and compute starvation during the deps build.
2022-04-26 10:50:41 -06:00
d8ef52ca47 Fix: some multi-functions are executed more than once
The good thing is that this fix also makes function evaluation a bit faster.
2022-04-26 17:41:16 +02:00
3e7ee3f3bc Geometry Nodes: Move named attribute nodes out of experimental
Remove the experimental option for named attributes nodes show they are
always available.

Ref T91742
2022-04-26 10:18:30 -05:00
ae94e36cfb Geometry Nodes: refactor array devirtualization
Goals:
* Better high level control over where devirtualization occurs. There is always
  a trade-off between performance and compile-time/binary-size.
* Simplify using array devirtualization.
* Better performance for cases where devirtualization wasn't used before.

Many geometry nodes accept fields as inputs. Internally, that means that the
execution functions have to accept so called "virtual arrays" as inputs. Those
 can be e.g. actual arrays, just single values, or lazily computed arrays.
Due to these different possible virtual arrays implementations, access to
individual elements is slower than it would be if everything was just a normal
array (access does through a virtual function call). For more complex execution
functions, this overhead does not matter, but for small functions (like a simple
addition) it very much does. The virtual function call also prevents the compiler
from doing some optimizations (e.g. loop unrolling and inserting simd instructions).

The solution is to "devirtualize" the virtual arrays for small functions where the
overhead is measurable. Essentially, the function is generated many times with
different array types as input. Then there is a run-time dispatch that calls the
best implementation. We have been doing devirtualization in e.g. math nodes
for a long time already. This patch just generalizes the concept and makes it
easier to control. It also makes it easier to investigate the different trade-offs
when it comes to devirtualization.

Nodes that we've optimized using devirtualization before didn't get a speedup.
However, a couple of nodes are using devirtualization now, that didn't before.
Those got a 2-4x speedup in common cases.
* Map Range
* Random Value
* Switch
* Combine XYZ

Differential Revision: https://developer.blender.org/D14628
2022-04-26 17:12:34 +02:00
9a53599180 Geometry Nodes: rename used attributes panel
The new name is `Internal Dependencies`.
* Is more inline with the general goal of the panel.
* Can also show which external objects are used in the node tree in the future.

This name was choosen in the geometry nodes submodule meeting (2022-04-25).

Differential Revision: https://developer.blender.org/D14752
2022-04-26 16:58:53 +02:00
7b16ddeb5a BLI: small optimization to retrieving CPPType from static type 2022-04-26 16:56:21 +02:00
e9334c5df8 Geometry Nodes: Avoid parallel_for_each with a single geometry
The large call stack can be slightly annoying, and it's possible that
invoking TBB in this case corresponds to some overhead like
e130903060.
2022-04-26 09:24:26 -05:00
5c5ec837b3 Utils: Add macro for C++ default arguments in C headers
This macro allows defining a default argument for when the translation
unit is compiled in C++. Otherwise (in C), the argument has to be passed
explicitly.

A couple of benefits:
* Default arguments are a nice quality-of-life feature in C++. It's
  annoying if these can't be used in C++ files, just because the header
  with the function declaration still needs to be C compatible.
* Adds useful information to the API declaration. E.g. that an argument
  can be nullptr.
* Should help us to move to using default arguments more, helping
  readability (arguably)

Used in D14653.

Reviewed By: LazyDodo

Differential Revision: https://developer.blender.org/D14654
2022-04-26 15:47:19 +02:00
96bdd65e74 Curves: Support applying geometry nodes modifier
This commit adds support for the curves object to the apply modifier
operator. A warning is added when the evaluated result of the modifier
doesn't contain any curves data.

Differential Revision: https://developer.blender.org/D14730
2022-04-26 08:07:54 -05:00
db45292d8e Cleanup: Move anonymous attribute removal to geometry component
Implementing removal of anonymous attributes with `GeometryComponent`
instead of `Mesh` makes it more reusable for other types like curves.
2022-04-26 08:06:04 -05:00
b7458f909c Curves: add "Curves" to brush names
Differential Revision: https://developer.blender.org/D14748
2022-04-26 13:10:45 +02:00
Colin Marmond
4e57b6ce77 Animation: Sensible frame range for motion paths
Motion paths can now be initialised to more sensible frame ranges,
rather than simply 1-250:

    - Scene Frame Range
    - Selected Keyframes
    - All Keyframes

Reviewed By: sybren, looch, dfelinto, pablico

Maniphest Tasks: T93047

Differential Revision: https://developer.blender.org/D13687
2022-04-26 12:33:35 +02:00
6cf148227b WM: disable redraw timer in background mode
Crashing in background mode was reported as part of T78854,
disable via the poll function to give a useful error in background mode.
2022-04-26 19:21:12 +10:00
2492d9852b Fix memory leak in Context.temp_override
Add missing check as the context override dict may have been copied
since it was assigned, also initialize the context manager with
PyType_Ready, while it didn't cause any errors - it's expected
that all types are initialized.
2022-04-26 16:51:20 +10:00
e0e737b72b Cleanup: line length for Python scripts 2022-04-26 15:16:11 +10:00
e3724d29ff Cleanup: autopep8 2022-04-26 15:03:04 +10:00
802bc8e233 pyproject: enable aggressive, ignore E501 (line wrapping)
Aggressive needs to be enabled for many useful edits to take effect,
the ignore list is currently used to disable edits that may need
further checks/investigation before they're enabled.

Note that aggressive was already enabled for the:
source/tools/utils/autopep8_clean.py script which was previously used
when applying autopep8.
2022-04-26 14:59:41 +10:00
a28fd0ceb5 Correct over allocation in "Fix Vertex Group Deform" operator
The pointer size was incorrectly being used instead of the float size.
2022-04-26 14:33:04 +10:00
6d12bc9e91 Cleanup: use boolean arguments and return values 2022-04-26 14:25:58 +10:00
a9d1b3d7e3 Cleanup: replace in-line swapping with SWAP macro
Also use bool array for true/false values.
2022-04-26 14:24:44 +10:00
a32f447c54 Cleanup: remove NULL check and outdated comment 2022-04-26 14:02:49 +10:00
c63a6d3057 Cleanup: names in text functions
- Use filepath instead of file.
- Use relbase instead of relpath.

In both cases the new names are used more frequently throughout
exiting functions.
2022-04-26 13:59:54 +10:00
0f583d9d60 PyAPI: support persistent handlers for class & static methods
Support methods being used as persistent callbacks.

Resolves T97555.
2022-04-26 13:47:24 +10:00
07e2bd443e Fix bone "auto-name by axis" failure to clip long names
Failure to clip automatic-names meant named could end with a "." for e.g.

Error in [0] meant the clipped text was copied then
immediately overwritten.

[0]: 354e6b9c18
2022-04-26 13:46:04 +10:00
3221766820 Fix string escaping in override versioning and modifier renaming 2022-04-26 13:46:02 +10:00
a003547a37 Cleanup: unused return value warning 2022-04-26 13:46:00 +10:00
3ea6dbfe73 Cleanup: simplify text copying string operations
- De-duplicate txt_new_linen & txt_new_line.
- Don't accept NULL as input for txt_new_linen & txt_new_line
  (callers can pass in an empty string instead).
- Avoid duplicate strlen calls in txt_new_linen.
- Use memcpy when the length of the string is known in txt_delete_sel &
  BKE_text_load_ex.
2022-04-26 13:45:59 +10:00
98ad294d17 Fix: Correctly copy and update curve type counts cache
Missing from f431be224f.
2022-04-25 18:48:35 -05:00
96834a7bac Fix T97595: Modifier attribute output broken for vertex groups
`attribute_try_create` didn't understand that the vertex group
attribute already existed because it only looks for names in custom
data layers when the domain matches. Using `attribute_exists`
unfortunately requires another loop through all attribute names,
but that should be optimized separately in the future anyway.

Differential Revision: https://developer.blender.org/D14756
2022-04-25 16:44:30 -05:00
3b4b2bcb13 Cleanup: Remove redundant vertex normal dirty tags
Applying the coordinates already tags the normals dirty
2022-04-25 16:30:06 -05:00
c20b99b70c Vertex Paint: Fix brush color space
The brush color wasn't being converted
to scene linear space properly.
2022-04-25 13:24:22 -07:00
a8331d8c9d Cleanup: remove unused function parameter 2022-04-25 13:14:07 -07:00
2bc0e8d304 Fix T81452: Incorrect trim lasso radius
Added a fallback path to compute the
cursor radius for when the stroke
starts over a blank area of space
(in which case SCULPT_cursor_geometry_update
fails).
2022-04-25 13:12:04 -07:00
891268aa82 Mesh: Make vertex normal property read-only
This commit makes the `MeshVertex.normal` property read-only.
In practice it already was, since the value could be overwritten at any
time if code requests updated normals, so this just clarifies that
position and avoids misleading users.

Differential Revision: https://developer.blender.org/D14696
2022-04-25 14:50:57 -05:00
8e1b16534d Fix: Incorrect implicit enum conversion
Hardcode Catmull Rom curves for now, since nothing else is implemented.
2022-04-25 14:48:14 -05:00
2fd8fa8f84 Geometry Nodes: Add "Named" to "Remove Attribute" node name
The goal is to be consistent with the other two nodes that deal with
named attributes. Ref T97512
2022-04-25 14:45:12 -05:00
42878ffc26 Fix T97597: vertex paint initialization was
called by weight paint mode,
	    causing a crash
2022-04-25 12:32:03 -07:00
38eed4ada3 Fix T97553: SCULPT_handles_colors_report called for non-sculpt brushes 2022-04-25 12:26:02 -07:00
296d734344 Sculpt: Remove hardcoded setting of
auto-iteration property in mask filter

Note: Auto-iteration is still set manually
for increase/decrease contrast.  These should
probably become their own operators.
2022-04-25 12:15:48 -07:00
185d9627b3 Fix T97423: Make mask filter less confusing
by showing redo panel.

The A hotkey has "auto iteration" enabled by default,
which calculates the number of times to run the filter
using a heuristic based on vertex count.

To make clear to the user what is going on the redo
panel is now shown for the mask filter operator.

NOTE: I discovered the source of the bug where sculpt
operators' redo panels were greyed out.  The name
fed to SCULPT_undo_push_begin must match the operator
name.  I've added a comment in sculpt_intern explaining
this.
2022-04-25 12:07:55 -07:00
f431be224f Curves: Cache the number of curves of each type
Remembering the number of curves of every type makes it fast to know
whether processing specific to a single curve type has to be done.
This information was accessed in quite a few places, so this should be
an overall reduction in overhead for the new curves type.

The cache is computed eagerly, in other words every time after changing
the curve types. In order to reduce verbosity I added helper functions
for some common ways to set the types.

Differential Revision: https://developer.blender.org/D14732
2022-04-25 13:40:07 -05:00
845e2ed3a2 Cleanup: Use const for smoot scrolling function 2022-04-25 18:15:14 +02:00
e99cb91530 Transform Snap Refactor: dedicate ghash to different SnapData types
Changes:
- Remove `BLI_memarena` (Use `MEM_cnew` and `MEM_delete` to allocate cached data)
- Implement `snap_object_data_mesh_free_ensure` and `snap_object_data_editmesh_free_ensure` and skip need to get original key Object for editmesh data
- Use `BMEditMesh` as key for editmesh `Ghash`
- Make a better distinction between `SnapObjectData`s. (`SnapData_Mesh` and `SnapData_EditMesh`)
2022-04-25 12:40:01 -03:00
d30f701e84 Cleanup: Turn some 'eTFlag' into macros
Some of the enum values are a mixture of others and make it difficult
for the IDE to identify them.

Separating these values makes debugging easier.
2022-04-25 12:35:56 -03:00
35dc4ba9e2 Fix T97401: Snap options ignored for Nurbs surfaces
The editing data of a `SURF`s is similar to that of Curves and should be supported for snapping.

But unlike Curve objects, for snapping, only support the nurb points if the object is in edit mode.

This matches the solution for Meshes and avoids having to create a kind
of "boundbox" for the SURF nurb points.
2022-04-25 12:35:55 -03:00
6963703801 Nodes: show overlays in node editor even when nodes are collapsed 2022-04-25 16:39:13 +02:00
2b3f7c6481 Geometry Nodes: improve attribute dependency overlay
* Adjust width based on node width, necessary to make the longer name below work.
* Show "X Named Attributes" in the overlay.
* Use "Accessed named attributes" in the tooltip.

Differential Revision: https://developer.blender.org/D14751
2022-04-25 16:28:26 +02:00
09710d5f2a Geometry Nodes: show timing overlay above attributes overlay 2022-04-25 16:03:34 +02:00
26afa23b3b Fix: use natural string sorting for attribute names 2022-04-25 16:00:58 +02:00
c2751f8a11 Cleanup: fix unused variable warning in paint_vertex.cc
No functional changes.
2022-04-25 16:00:15 +02:00
654bc35bc8 Geometry Nodes: improve ui when trying to remove built-in attributes
* If removing an attribute failed (even though it exists), don't log it as being used.
* Make warning message a bit more informative.

Differential Revision: https://developer.blender.org/D14750
2022-04-25 15:52:38 +02:00
Pratik Borhade
0a86ab6639 Fix T96925: Fast diagonal movement in walk navigation
View moves faster with two active directions.
This is probably because `dvec` is not normalized when moving in two directions.
Normalizing this direction vector will fix the problem.

Differential Revision: https://developer.blender.org/D14729
2022-04-25 15:46:00 +02:00
Brecht Van Lommel
d2a01bb7cb Build: add autopep8 to bundled Python packages
For use in "make format" to automatically format Python code, see D14686.

Differential Revision: https://developer.blender.org/D14716
2022-04-25 15:45:03 +02:00
0310638e94 Fix build error on Linux + Clang 10 after recent changes to BLI_any
Differential Revision: https://developer.blender.org/D14749
2022-04-25 15:38:20 +02:00
ab032fba39 CMake: harvest zero-level SO files
Zero-level is built as shared library at the moment, so better to harvest
`*.so*` instead of `*.a`.
2022-04-25 15:26:37 +02:00
42368f2ef4 Revert "CMake: add harvesting of fmt library"
This reverts commit 7c55a7ccca. `fmt` is
only a build-time OIIO dependency and doesn't need to be bundled with
Blender.
2022-04-25 14:37:01 +02:00
1640fbe7c6 CMake: add ^NANOVDB to variables to reset after library upgrade
Cycles needed this to build properly after switching to the newly built
libraries.
2022-04-25 14:28:06 +02:00
7c55a7ccca CMake: add harvesting of fmt library
The library was built with `make deps`, but not installed. Now it is.
2022-04-25 14:26:42 +02:00
b4a4004fb1 Fix memory leak in cryptomatte
Since cbf033c055 the `matte_id` will be allocated in the node
storage for the forward compatibility purposes. However, this
field was never freed, leading to memory leak.

Causes annoying popup on macOS when running Cycles tests,
for example render_passes_cryptomatte_asset.blend

Differential Revision: https://developer.blender.org/D14728
2022-04-25 12:00:51 +02:00
a2d32960b4 BLI: optimize constructing new virtual array
Differential Revision: https://developer.blender.org/D14745
2022-04-25 11:51:34 +02:00
Brad Clark
c63d64a2ce NLA: Add Bake Action to the NLA edit menu
Add Bake Action to the NLA edit menu to aid discoverablity and allow
people to understand that Bake Action is part of working with the NLA.

Part of the NLA road map improvement project for the Animation Module.
This was a community request to add access to the Bake without needing
to turn on developer tools in the preferences and then use search in the
NLA for bake.

It seems this was always intended, as the operator is called `nla.bake`.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D14575
2022-04-25 11:42:46 +02:00
416ef3b6b2 Cleanup: spelling in comments 2022-04-25 16:37:42 +10:00
0efe581a5b Cleanup: add missing doxy sections in customdata 2022-04-25 16:34:28 +10:00
29b9187b32 VSE: Update first thumbnail when moving handle
When handles are moved, job is created only for strips that need to
update first thumbnail.

ref T91618
2022-04-25 04:34:15 +02:00
17eb8a9ceb Cleanup: remove special cases for getting internal span or single
Those are handled in the called function already.
2022-04-24 14:33:33 +02:00
dc7f88fd15 BLI: prioritize detecting single values higher than detecting spans
In some contexts, single values can be handled more efficiently than spans.
2022-04-24 14:32:03 +02:00
bba757ef81 Cleanup: various minor changes
- Add missing doxy-section for Apply Parent Inverse Operator
- Use identity for None comparison in Python.
- Remove newline from operator doc-strings.
- Use '*' prefix multi-line C comment blocks.
- Separate filenames from doc-strings.
- Remove break after return.
2022-04-24 13:41:03 +10:00
a6504aa64b Cleanup: clang-format 2022-04-24 13:41:03 +10:00
99fff90eab pyproject: remove settings that cause other uses of autopep8 to fail
While the ability to run `autopep8 .` to format Blender's Python code
is handy, the settings to perform this can conflict with other uses
of autopep8 (which editors may use to auto-format on save).

Some arguments now need to be passed in, e.g:

    autopep8 . --in-place --recursive --jobs=0

We'll likely include this in `make format` convenience target so the
details for invoking autopep8 shouldn't be an issue in the long term.
2022-04-24 13:41:02 +10:00
c486da0238 Mikktspace: Reduce number of data queries to caller
The current code for computing tangents is not exactly fast.
This has been a long-standing issue, and recently came up again with T97378.

The main bottleneck is fetching the mesh data, since it's handled through a callback system and each vertex might have its data queried dozens of times.

I've tried a lot of things to optimize `mikktspace.c`, but unfortunately most weren't that useful:
- Vectorizing SVec3 gives a ~5% speedup, but I'm not sure if the additional ~70 lines of code are worth it
- Keeping an internal copy of the data instead of re-querying all the time helps a lot (~50-60% time reduction), but requires a lot of extra memory (~100 byte per face)
- Going C++ and replacing the internal quicksort with std::sort shows no difference
- Restructuring the entire file to be a header-only library so that the callbacks can be inlined gives ~10% reduction, but is a major change and deviation from the original library

In the end, two simple fixes that actually help remain:
- Don't re-query the number of faces in each loop iteration
- Don't bother looking for identical vertices if there's only one vertex with that hash

With this, time for the test case in T97378 goes from 6.64sec to 4.92sec. It's something I guess.

I feel like completely refactoring this library would not be a bad idea at some point, but for now it does the job...

Differential Revision: https://developer.blender.org/D14675
2022-04-23 15:09:41 +02:00
cfce5a32a7 Fix a failing bmesh_bevel test by fixing buffer overflow.
The uv fix just submitted had a bug where I forgot to wrap around
after adding 1. This apparently worked anyway in a debug build
but not in release build, hence the buildbot tests were failing.
2022-04-22 22:39:05 -04:00
6787cc13d4 Bake: add UDIM tile baking support
Works for both Cycles and multires bake. Triangles are baked to multiple
UDIM images if they span across them, though such UV layouts are generally
discouraged as there is no filtering across UDIM tiles.

The bake margin currently only works within UDIM tiles. For the extend method
this is logical, for the adjacent faces method it may be useful to support
copying pixels from other UDIM tiles, though this seems somewhat complicated.

Fixes T95190

Ref T72390
2022-04-22 23:15:45 +02:00
bdc537e0a7 Fix deprecation warning when building with OpenVDB 9
Based on patch by Sebastian Parborg.
2022-04-22 23:15:41 +02:00
ac8beb4fda Fix T97453: Blender crash when selecting Caching checkbox in VSE
Merge Audaspace fixes from upstream.
2022-04-22 22:36:04 +02:00
ff6098345a Cleanup: Clang tidy, unused variable warnings
Also remove unnecessary uses of `struct` and add const in one place.
2022-04-22 12:41:25 -05:00
7f726b48ac Cleanup: Remove unused variables, adjust comments 2022-04-22 11:48:53 -05:00
Olivier Maury
58be9708bf Cycles: removed UV requirement for MNEE, along with fixes and cleanups
Remove need for shadow caustic caster geometry to have a UV layout. UVs were
useful to maintain a consistent tangent frame across the surface while
performing the walk. A consistent tangent frame is necessary for rough
surfaces where a normal offset encodes the sampled h, which should point
towards the same direction across the mesh.

In order to get a continuous surface parametrization without UVs, the
technique described in this paper was implemented:

"The Natural-Constraint Representation of the Path Space for Efficient
 Light Transport Simulation" (Supplementary Material), SIGGRAPH 2014.

In addition to implementing this feature:
* Shadow caustic casters without smooth normals are now ignored (triggered
  some refactoring and cleaning).
* Hit point calculation was refactored using existing utils functions,
  simplifying the code.
* The max number of solver iterations was reduced to 32, a solution is
  usually found by then.
* Added generalized geometry term clamping (transfer matrix calculation can
  sometimes get unstable).
* Add stop condition to Newton solver for more consistent CPU and GPU result.
* Add support for multi scatter GGX refraction.

Fixes T96990, T96991

Ref T94120

Differential Revision: https://developer.blender.org/D14623
2022-04-22 18:31:15 +02:00
d8abac7357 LibOverride: Add hierarchy creation from IDTemplate UI widget.
This is fairly tricky to perform, since there is often very limited
contextual information available about the 'active' hierarchy to
override.

This commit is a first step, it is expected to handle decently well
cases like objects and obdata (recreating necessary object and
collection hierarchy, and/or hooking it to a potential existing
hierarchy), at least in most common cases.

Ref: {T95707}.
2022-04-22 18:22:58 +02:00
e96623c19b Fix: Build error on macOS after previous commit 2022-04-22 11:21:19 -05:00
b38491b407 Re-fix some comments in bmesh_bevel.c.
The UV fix just committed had gotten out of sync with some changes
that had been made inside some comments (spelling and folding).
2022-04-22 11:59:05 -04:00
5b87862ddc Curves: Further split of curves draw code from particles
Extends the changes started in f31c3f8114 to completely separate
much of the DRW curves code from the particle hair drawing. In the short
term this increases duplication, but the idea is to simplify development
by making it easier to do larger changes to the new code, and the new
system will replace the particle hair at some point.

After this, only the shaders themselves are shared.

Differential Revision: https://developer.blender.org/D14699
2022-04-22 10:44:01 -05:00
Martijn Versteegh
8f05a547d5 BMesh: Add additional attribute access macros
Add macros to get/set boolean attributes, to set float2/float3
attributes and to get float2/float3 attributes via pointer access.
Needed for D14365 and further generic attribute integration.

Differential Revision: https://developer.blender.org/D14708
2022-04-22 10:35:44 -05:00
984cd552f0 Fix T56625: Bevel sometimes made zero area UV faces.
This substantially redoes the logic by which bevel chooses, for
the middle segment when there are an odd number of segments,
which face to interpolate in, and which vertices to snap to which
edges before doing that interpolation. It changes the UV layouts
of a number of the regression tests, for the better.
An example, in the reference bug, is a cube with all seams, unwrapped
and then packed with some margin around them, now looks much
better in UV space when there are an odd number of segments.
2022-04-22 11:32:27 -04:00
a7c65ef4cb Fix T96498: Modifiers affect multiple curve objects
The original mistake I made in b9febb54a4 was thinking
that the input curve object data to `BKE_displist_make_curveTypes`
was already copied from the original. I think I misread some of its
`ID` flags. This commit places the result of curves evaluation in a
duplicated curve instead, and copies the edit mode pointers
necessary for drawing overlays. `Curve` needs to know not to
free those pointers.

I still don't have a full understanding of why some of the tactics I've
used work and others don't. I've probably tried around 8 different
solutions at this point, and this is the best I came up with.

The dependency graph seems to have some handling of edit mode
pointers that make the edit mode overlays work if the evaluated
result is only an empty curve created by the evaluated geometry set.
This doesn't work with the current method and I need to set the
edit mode pointers at the end of evaluation explicitly.

We're constrained by the confusing duality of the old curves system
combined with the new design using the evaluated geometry set.
Older areas of Blender expect the evaluated `Curve` to be a copy
of the original, even if it was replaced by some arbitrary evaluated mesh.

Differential Revision: https://developer.blender.org/D14561
2022-04-22 10:27:15 -05:00
75aa5ecbda Fix (unreported): Placement Tool not orienting the Object to normal
Regression introduced in
{rB721335553ccb5ce4f7a374b958b7d65befa319df}.

`plane_omat` is only computed if `snap_state->draw_plane` is `true`.
2022-04-22 12:15:13 -03:00
fe43c17083 Fix: Assert failure with certain screw modifier settings
Caused by a typo/mistake in rB6a3c3c77b3ebdbcd4455.
2022-04-22 10:03:36 -05:00
024a4da6b3 Fix various typos and other UI messages issues. 2022-04-22 16:19:05 +02:00
535c9308ef Fix T97429: Translateable Unit Names Missing in the File.
Added some regex magic in i18n py module to also extract UI names from
all of our units definitions.

Those enum values are fully dynamically generated, so they cannot be
extracted from RNA introspection.
2022-04-22 16:19:05 +02:00
Ramil Roosileht
50f0103059 Change vertex paint icon color (fix)
Apply standard green tool color to vertex paint tools, to keep icon
color palette more consistent

https://developer.blender.org/D14694
2022-04-22 15:53:43 +02:00
9c279723da Fix Data Transfer Projected Face/Edge Interpolated mode is wrong
Caused by {rBcfa53e0fbeed}

Above commit mixed up source and destination meshes causing bad lookups
on calculated normals.

Now make sure we get normals from our destination mesh to project along.

Note this was only reported for Projected Face Interpolated mode, but
same was true for Projected Edge Interpolated mode (though that one is a
bit weird to test since I think there is generally something wrong with
that mode -- with or without rBcfa53e0fbeed).

Fixes T97528

Maniphest Tasks: T97528

Differential Revision: https://developer.blender.org/D14726
2022-04-22 15:28:12 +02:00
5179b8236b Fix accessing attribute data in editmode
When in mesh editmode, attributes point to bmesh customdata, the
attribute data is empty since custom data is stored per element instead
of a single array there (same es UVs etc.).
Opposed to e.g. UVs, general attributes were not setting their data
length/size to zero in case of editmode though, which could lead to
- crash in Outliner Data Api view [that was reported in T95922]
- RuntimeError such as the following:
```
RuntimeError: bpy_prop_collection[index]: internal error, valid index 0
given in 8 sized collection, but value not found
```

Now check for mesh editmode in `BKE_id_attribute_data_length` (and
return zero in that case).
Alternatively, the check could also be done in
`rna_Attribute_data_length` only (such as UVs do in
`rna_MeshUVLoopLayer_data_length`).

Ref D11998
Fixes T95922

Maniphest Tasks: T95922

Differential Revision: https://developer.blender.org/D14714
2022-04-22 15:25:11 +02:00
048c769774 Fix T97277: Tweak drag transforming is broken for masks (RMB select)
Regression in 4d0f846b93,
passing selection through to drag relied on tweak events running
even when the press event was handled which is not the case for drag.
2022-04-22 17:36:09 +10:00
Ramil Roosileht
b226236b01 Fix - Display correct units in "Edit voxel size" widget
Fix for T84962
Before the patch, edit voxel size always displayed voxel size without units, just as a number in meters.
Now it changes like in the voxel remesh panel and shows correct units
Video:
{F13009428}

In adaptive mode:
{F13009435}

Reviewed By: JulienKaspar

Maniphest Tasks: T84962

Differential Revision: https://developer.blender.org/D14682
2022-04-22 08:09:18 +02:00
Ramil Roosileht
d724d3ae58 Change viewport shading text from "Color" to "Attribute"
This change from T97104

Reviewed By: JulienKaspar, jbakker

Maniphest Tasks: T97104

Differential Revision: https://developer.blender.org/D14620
2022-04-22 08:06:21 +02:00
Ramil Roosileht
33d102e5b2 Reorder sculpt tools
Changed tool order as proposed in [[ https://developer.blender.org/T97206 | T97206 ]]
{F12987559}

Reviewed By: JulienKaspar, jbakker

Maniphest Tasks: T97206

Differential Revision: https://developer.blender.org/D14612
2022-04-22 08:05:45 +02:00
48f369d63a Fix: VSE channels region visible in preview
Hide region for preview and sequencer/preview combined view.
2022-04-22 02:51:10 +02:00
30acc5f9cd pyproject: add configuration for autopep8
This adds pyproject.toml, needed to configure defaults for autopep8.

The file is auto-discovered in a similar way to .clang-format, other
tools could be configured here too. For now just configure autopep8 so
this can be enabled in IDE's without causing unexpected edits such as
wrapping lines over 80 columns in width.

Now autopep8 can be used from the root directory by running: autopep8 .

This uses multiple-jobs to run autopep8 over all Python scripts except
paths that are explicitly ignored in exclude defined by pyproject.toml.

Reviewed By: mont29, brecht, sybren

Ref D14686
2022-04-22 10:13:39 +10:00
2547c3c70c Cleanup: spelling in comments 2022-04-22 10:11:48 +10:00
Brecht Van Lommel
179100c021 Cycles: enable AMD RDNA GPU support on Linux
This enables building of HIP binaries for AMD RDNA and RDNA2 GPUs.

This requires the 22.10 / ROCm 5.1 driver.

Ref T91571

Differential Revision: https://developer.blender.org/D14360
2022-04-22 00:11:55 +02:00
ce95856f2d Fix: VSE channels area has no background
Draw area background even when there is no sequencer data.
2022-04-21 23:40:36 +02:00
74b9c351b9 Fix: Use alphabetical order in geometry nodes add menu 2022-04-21 14:10:02 -05:00
65e4c91bec Fix: Memory leak writing to builtin attribute from modifier
If the attribute already existed, but had a different domain or data type
than the user tried to write to it with (i.e. writing to `position` with
a float), then the data from field evaluation wasn't freed.

This restructures the geometry nodes modifier attribute writing process
to solve that problem and remove some of the nested if statements
that made the process confusing.

One case that still doesn't work is writing to a builtin attribute from
a different domain. If `OutputAttribute` gets that feature then that
could be supported here too.

Differential Revision: https://developer.blender.org/D14706
2022-04-21 14:05:16 -05:00
9de3ed5c82 Fix T97490: snap to multiple objects with linked data can crash
The problem is old.

rB52be06301257 (fixed by rB4b35d6950d4f) just masked it.

`Object->data`, on evaluated objects, is not a safe pointer to get
objects with the same `BMEditData`.

Use `Object->runtime.data_orig` instead.
2022-04-21 14:08:17 -03:00
9a9a46df46 Cleanup: Remove unused argument to mesh modifier evaluation 2022-04-21 12:02:13 -05:00
Germano Cavalcante
e2d8b6dc06 gpu.types.GPUBatch: warn about deprecated primitive types
As `GPU_PRIM_LINE_LOOP` is not supported on Vulkan or Metal and
`GPU_PRIM_TRI_FAN` is not supported on Metal, they will be removed in
future releases.

So it is important to inform users that they are obsolete and may not
be supported for a long time.

Release Notes: https://wiki.blender.org/wiki/Reference/Release_Notes/3.2/Python_API

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D14679
2022-04-21 12:52:38 -03:00
f807e6effe Cleanup: don't use allocation variables in OpenColorIO config
These are only needed for the legacy GPU renderer, which we don't use.
2022-04-21 17:34:46 +02:00
f991f5ad51 Color Management: add ACEScg to the default configuration
For more easily reading and writing ACEScg EXR files.
2022-04-21 17:34:46 +02:00
f6d5d01715 Fix T97502: Issues/crashes with "color_attributes" AttributeGroup
Property collection functions were not really in sync which could result
in crashes in UI_LISTS.

The reason is that attributes of type color defined on domains other than
Points or Corners are still valid, but should really be skipped for the
special "color_attributes".
`rna_AttributeGroup_color_length` itself was fine here, it skips these,
but the iterator (`rna_AttributeGroup_color_iterator_begin` /
`rna_Attributes_noncolor_layer_skip`) wasnt, so when a UI_LIST
filter_items() would iterate the collection it would actually get
results were it shouldnt.

Now check a suiting domain in `rna_Attributes_noncolor_layer_skip` as
well.

Maniphest Tasks: T97502

Differential Revision: https://developer.blender.org/D14717
2022-04-21 16:18:05 +02:00
b9799dfb8a Geometry Nodes: better support for byte color attributes
Since {rBeae36be372a6b16ee3e76eff0485a47da4f3c230} the distinction
between float and byte colors is more explicit in the ui. So far, geometry
nodes couldn't really deal with byte colors in general. This patch fixes that.
There is still only one color socket, which contains float colors. Conversion
to and from byte colors is done when read from or writing to attributes.

* Support writing to byte color attributes in Store Named Attribute node.
* Support converting to/from byte color in attribute conversion operator.
* Support propagating byte color attributes.
* Add all the implicit conversions from byte colors to the other types.
* Display byte colors as integers in spreadsheet.

Differential Revision: https://developer.blender.org/D14705
2022-04-21 16:11:26 +02:00
aca083fbf3 Nodes: raise exception when creating node group input/output fails
Previously this would silently return `None`.
Now the behavior is similar to when new sockets are added to a node.
2022-04-21 15:48:02 +02:00
75a9830d84 install_deps: Update USD to 22.03.
Add back a patch wrongly removed by rBb9c37608a9e9, and add another fix,
for gcc11 build support.

Re {T95206}.
2022-04-21 15:35:12 +02:00
c196ca3740 Functions: fix procedure executor not writing output in correct buffer
The issue was that the executor would forget about the caller provided
storage if the variable is destructed.
2022-04-21 15:29:18 +02:00
0178e694b7 Geometry Nodes: show used named attributes in modifier
This adds a new subpanel to the geometry nodes modifier which is just
used to display information about used attributes.

* A new panel is used because adding this information anywhere else
  clutters the ui too much imo.
* The general layout is similar to that in the tooltip. I found it to be more
  trouble than it's worth to share this code.

Possible future improvements:
* Don't show the panel if there are no used named attributes.
* Add some heuristics to determine which named attributes the user does
  not have to care about because they are only used in the node group
  and don't affect anything else.

Differential Revision: https://developer.blender.org/D14701
2022-04-21 15:10:07 +02:00
ed971a19fa Curves: show sculpt tool settings in panels
Ref T97444.

Differential Revision: https://developer.blender.org/D14700
2022-04-21 14:51:37 +02:00
Colin Basnett
2882cbe685 Fix T97497: NLA strip names are now properly contained within the strip bounds
Very easy fix, the bug seemed to be a result of a typo on the right-most margin.

Old: {F13013777}

New: {F13013782}

Maniphest Tasks: T97497

Differential Revision: https://developer.blender.org/D14711
2022-04-21 10:45:17 +02:00
2e3edb6995 Fix Empty "Only Axis Aligned" viewing angle depends on object scale
This was projecting the unnormalized z scale axis onto the plane defined
by the view vector. If object scale was very small, this made the empty
still visible at viewing angles far from the object axis.

Now use the normalized z scale axis to make this work the same at all
object scales.

Fixes T97004.

Maniphest Tasks: T97004

Differential Revision: https://developer.blender.org/D14557
2022-04-21 10:36:06 +02:00
298e9c7ebd Fix T97465: Moving compositor BG image cannot be cancelled
This was possible with the gizmo, but no using the operator (e.g. from
the sidebar).

Now store original offsets and reset to these on calcel (ESC or RMB).

Maniphest Tasks: T97465

Differential Revision: https://developer.blender.org/D14704
2022-04-21 10:30:41 +02:00
01333cb47f Sculpt: fix missing null pointer check
in workbench_engine.c
2022-04-21 00:58:45 -07:00
c342b3cede Fix T95932: Auto-close text breaks outliner drag-n-drop
Text inserted via TEXT_OT_insert would always have auto-close
logic applies which interfered any insertion of literal strings
containing brackets.

Now auto-closing brackets is restricted to characters read from
events from the operators invoke functions.
2022-04-21 17:56:56 +10:00
4d9ddb4a77 Cleanup: clang format 2022-04-21 09:37:20 +02:00
7a943428de Cleanup: fix various warnings after recent commit 2022-04-21 09:36:39 +02:00
14f2d37ad1 Vertex paint: Fix debug compile error and a
few warnings.
2022-04-21 00:18:12 -07:00
b0c428c063 Fix T97185: Data transfer modifier doesn't display
individual layers.

A few RNA property strings were misspelled.
2022-04-21 00:04:58 -07:00
6f190f7f43 Fix T97469: Sculpt colors crash in multiresolution or dynamic topology modes.
Sculpt paint tools now pop up an error message if
dynamic topology or multires are enabled.

Implementation notes:

* SCULPT_vertex_colors_poll is now a static function in sculpt_ops.c.
  It is now used solely by the legacy color attribute conversion
  operators (SCULPT_OT_vertex_to_loop_colors and SCULPT_OT_loop_to_vertex_colors)
  and should be deleted when they are.
* There is a new method, SCULPT_handles_colors_report, that returns true if
  the sculpt session can handle color attributes; otherwise it returns false
  and displays an error message to the user.
2022-04-20 23:38:55 -07:00
575ade22d4 Commit D14179: Revamp Vertex Paint With C++
- Verrtex paint mode has been refactored into C++ templates.
  It now works with both byte and float colors and point
  & corner attribute domains.
- There is a new API for mixing colors (also based
  on C++ templates).  Unlike the existing APIs byte
  and float colors are interpolated identically.
  Interpolation does happen in a squared rgb space,
  this may be changed in the future.
- Vertex paint now uses the sculpt undo system.

Reviewed By: Brecht Van Lommel.

Differential Revision: https://developer.blender.org/D14179
Ref D14179
2022-04-20 22:14:03 -07:00
Jon Denning
c6ed879f9a Text Editor: add Python 3.10 soft keywords to builtinfunc list
Python 3.10 has added "soft keywords" [0] to their list of identifiers.
This patch adds these soft keywords to the list of builtin functions
that the text editor searches for when highlighting Python code.

The only soft keywords that Python 3.10 current has are: `match`,
`case`, and `_`, but more will likely be added in future versions.

Currently, the `_` soft keyword is ignored from highlighting. It is a
wildcard matching pattern when used with `case` (similar to `default`
for `switch`es in C/C++), but `_` is far more often used in other
contexts where highlighting the `_` might seem strange. For example,
ignoring elements when unpacking tuples (`_, g, _, a = color`).

This patch also updates the commented Python code for creating the list
of keywords, for convenience.

Before:

{F13012878}

After:

{F13012880}

Example from PEP-636 [1]

Note: These soft keywords are only reserved under specific contexts.
However, in order for the text editor to know when the keywords are used
in the appropriate contexts, the text editor would need a full-blown
Python grammar [2] parser. So, for now, these keywords are simply added
in along with the other keywords in order to highlight them in the text
editor.

[0]: https://docs.python.org/3/reference/lexical_analysis.html#soft-keywords
[1]: https://peps.python.org/pep-0636/#matching-specific-values
[2]: https://docs.python.org/3/reference/grammar.html

Ref D14707
2022-04-21 12:35:41 +10:00
5fc488559c Cleanup: explicitly disable autopep8 for rna_manual_reference
Currently the "exclude" option for autopep8 isn't as reliable as it
should be since passing in absolute paths to autopep8 causes
the paths not to match. See: D14686 for details.

So explicitly disable autopep8 in this generated file (the generator
has already been updated).

Also use spaces for indentation otherwise autopep8 re-indents them.
This seems like a bug in autopep8 since it's changing lines with
autopep8 disabled. Use a workaround instead of looking into a fix since
it's simpler for all our Python files to use spaces instead of tabs and
there isn't much benefit mixing indentation for scripts.
2022-04-21 11:16:25 +10:00
b719fa267a Fix typo in previous commit 2022-04-21 02:26:54 +02:00
0c3d2461b7 Cleanup: VSE effect relationship checking
Use `SEQ_relation_is_effect_of_strip` for checking effect-input
relationship where this is applicable.
2022-04-21 02:01:10 +02:00
Shrey Aggarwal
502f3debf9 Fix T70844: Incorrect snappping of strips when effects attached
Sometimes, when moving strip with 2 input effect attached and causing
strip overlap, this overlap is resolved incorrectly - too big offset
is applied. This is because effects are not taken into consideration
when "shuffeling" to resolve overlap.

To fix usual cases (transitions), overlap between strip and it's effect
is considered to be impossible.

There are edge cases, but these would be much more complicated to
implement and could have negative impact on performance.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D14578
2022-04-21 02:01:10 +02:00
ok what
e16ff4132e VSE: Add frame selected operator for preview
This operator moves the view to show the selected visible strips.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D14222
2022-04-21 02:01:10 +02:00
2bd9cbe405 Fix T97254: VSE channel mute does mute sound
Add missing RNA update function
2022-04-21 02:01:10 +02:00
3cef9ebaf8 Fix T97356: Crash when adding adjustment layer strip
Crash was caused by incorrectly assuming, that rendered strip is meta
when editing code in bulk, but this wasn't true and strip had no
channels initialized, which caused crash on NULL dereference.

Correct approach is to find list of channels where on same level as
rendered strip, similar to how `SEQ_get_seqbase_by_seq` function works
for list of strips.
2022-04-21 02:01:10 +02:00
b67ccc333a GL: Change array macro to not conflict with opensubdiv variable names
Fix T97449 GPU subdivision: Crash on adding subdivision surface modifier
2022-04-20 21:32:03 +02:00
4a03c5acf9 Revert "Fix GPU subdivision: Crash on adding subdivision surface modifier"
The fix does not fix the case of shaders comming from the OpenSubdiv API.

This reverts commit f5191b8760.
2022-04-20 21:32:03 +02:00
8d2da45f98 Revert "Fix Cycles HIP assuming warp size 32"
This reverts commit 390b9f1305. It seems to
break things on Linux for unknown reasons, so leave it out for now. A solution
to this will be required for Vega cards though.
2022-04-20 18:09:23 +02:00
3a6813ea65 LibOverride: Make 'custom bone shape' and 'bbone custom handle' non-overridable.
There is not much point in having those editable in overrides, and since
those are pointers, their value always differs from ref linked ID vs.
local override one, generating 'noise' in Outliner's override property
view.
2022-04-20 17:03:05 +02:00
Jung Jaeyun
56d1d19c88 UI: Add option to create color attribute directly from canvas selector.
Added + and - buttons to create and delete color attributes from canvas selector.

{T97345}

{F13006374}

Reviewed By: jbakker, Ethan1080

Maniphest Tasks: T97345

Differential Revision: https://developer.blender.org/D14672
2022-04-20 16:55:33 +02:00
604c33e694 Build: updates for Blender to build against new 3.2 libraries
Building against the existing 3.1 libraries should continue to work, until
the precompiled libraries are committed for all platforms.

* Enable WebP by default.
* Update Windows for new library file names.
* Automatically clear outdated CMake cache variables when upgrading to new
  libraries.
* Fix static library linking order issues on Linux for OpenEXR and OpenVDB.

Implemented by Ray Molenkamp, Sybren Stüvel and Brecht Van Lommel.

Ref T95206
2022-04-20 16:42:16 +02:00
b9c37608a9 Build: upgrade many library dependencies to new versions for Blender 3.2
This only updates the build system, precompiled libraries for the various
platforms will be committed over the coming week.

New:
fmt 8.0.0
level_zero v1.7.15
pystring v1.1.3
robinmap v0.6.2
webp 1.2.2

Updated:
alembic 1.8.3
blosc 1.21.1
boost 1.78.0
embree 3.13.3
ffmpeg 5.0
fftw 3.3.10
flac 1.3.4
imath 3.1.4
ispc v1.17.0
jpeg 2.1.3
ogg 1.3.5
oidn 1.4.3
openal 1.21.1
opencolorio 2.1.1
openexr 3.1.4
openimageio v2.3.13.0
openjpeg 2.4.0
opensubdiv v3_4_4
openvdb 9.0.0
osl 1.11.17.0
sdl 2.0.20
tbb 2020_u3
tiff 4.3.0
usd 22.03
vorbis 1.3.7
vpx 1.11.0
x264 35fe20d1b
zlib 1.2.12

Implemented by Ray Molenkamp, Sybren Stüvel and Brecht Van Lommel.

Ref T95206
2022-04-20 16:42:16 +02:00
7cb6fb0183 Cleanup: Remove redundant types from custom data masks
Colors and byte colors are already included in `CD_MASK_PROP_ALL`.
2022-04-20 09:12:40 -05:00
03ec505fa5 Cleanup: Rename CD_MLOOPCOL to CD_PROP_BYTE_COLOR
The "PROP" in the name reflects its generic status, and removing
"LOOP" makes sense because it is no longer associated with just
mesh face corners. In general the goal is to remove extra semantic
meaning from the custom data types.
2022-04-20 09:10:10 -05:00
0385e2f1f9 PBVH: Pass Mesh to extract internals.
More mesh data is required when extracting the UV seams. This is an
API change for to support this future enhancement.
2022-04-20 13:42:51 +02:00
5b8a3ccd37 Fix T94775: Buggy liboverride default apply code for items insertion in RNA collections.
For some reason, the rework of liboverride handling of Collection items
insertion (rB33c5e7bcd5e5) completely missed to update accordingly the
default liboverride apply code...

Many thanks to Wayde Moss (@GuiltyGhost) for the investigation and
proposed solution.
2022-04-20 11:05:54 +02:00
97dbcf9746 Fix (unreported) huge liboverride slow-down due to non-disabled UV layer props.
Was revealed by yesterday's fix (rB6f56bd4083f9).
2022-04-20 10:10:29 +02:00
8adc7cad00 Fix compilation without OpenVDB 2022-04-20 09:58:42 +02:00
31a2feceb8 Cleanup: remove unused curves toolsetting 2022-04-20 09:51:14 +02:00
f5191b8760 Fix GPU subdivision: Crash on adding subdivision surface modifier
This was caused by the use of a reserved keyword macro that is not
directly used but causes an error on some compiler.

Change the occurences to not match the macros.
2022-04-20 09:12:02 +02:00
65a1fcdaf7 Cleanup: run autopep8 on tests/performance/benchmark
This file was skipped by source/tools/utils/autopep8_clean.py
since it doesn't have a .py extension, running the autopep8 tool
recursively detects Python scripts without extensions.
2022-04-20 17:07:46 +10:00
67a4908bfc Cleanup: re-run autopep8 with E401 enabled
Put imports on their own line which was almost always the case already.
2022-04-20 16:26:49 +10:00
3adef61942 Cleanup: run autopep8 on release/scripts/presets 2022-04-20 16:21:04 +10:00
41b8e0316a Cleanup: use autopep8 on release/lts 2022-04-20 16:18:42 +10:00
28e068b55c Cleanup: run autopep8 on release/scripts/freestyle 2022-04-20 16:18:30 +10:00
8898251584 Cleanup: run autopep8 on intern/cycles/
Disable autopep8 for the block that yields passes in list_render_passes,
for better readability.
2022-04-20 16:10:05 +10:00
11dd7941af Cleanup: run autopep8 with max-line-length=120 (missed a file) 2022-04-20 15:55:17 +10:00
67516d0dae Cleanup: run autopep8 with max-line-length=120 2022-04-20 15:47:24 +10:00
8ed8fa80f4 Cleanup: use autopep8 for bl_i18n_utils.settings
Disable autopep8 for some regex blocks that use indentation
to signify regex grouping.
2022-04-20 15:39:36 +10:00
08dbd3bc7f Cleanup: run autopep8 on release/scripts/modules/ 2022-04-20 15:12:10 +10:00
38d8b088e7 Cleanup: run autopep8 on release/scripts/templates_py 2022-04-20 15:11:22 +10:00
c2cdbe1e88 Cleanup: run autopep8 on doc/ 2022-04-20 15:10:14 +10:00
df3316cbe9 Cleanup: run autopep8 on build_files/
Replace multiple hashes with over-lines for make_source_archive.py.
2022-04-20 15:08:46 +10:00
972a697f82 PyAPI: improve deprecation warning for bpy.ops context override
- Increase the stack level so the reported line number references
  script authors code (not Blender's wrapper function).
- Include the operator name and poll/call usage in the warning.
2022-04-20 13:17:16 +10:00
feea852b10 Fix crash passing no arguments to Context.temp_override 2022-04-20 13:01:14 +10:00
9364e17936 Docs: update examples to use Context.temp_override 2022-04-20 12:49:13 +10:00
f438344cf2 PyAPI: temporary context override support
Support a way to temporarily override the context from Python.

- Added method `Context.temp_override` context manager.
- Special support for windowing variables "window", "area" and "region",
  other context members such as "active_object".
- Nesting context overrides is supported.
- Previous windowing members are restored when the context exists unless
  they have been removed.
- Overriding context members by passing a dictionary into operators in
  `bpy.ops` has been deprecated and warns when used.

This allows the window in a newly loaded file to be used, see: T92464

Reviewed by: mont29

Ref D13126
2022-04-20 12:19:35 +10:00
6d9268c2c7 PyAPI: utility functions for parsing typed RNA arguments
These functions can be used with PyArg_ParseTupleAndKeywords
(and related functions) to take typed RNA arguments without
having to extract and type-check them separately.

No functional changes, extracted from D13126.
2022-04-20 12:16:11 +10:00
16afff2ddc Cleanup: spelling in comments 2022-04-20 10:41:31 +10:00
42717596d0 Cleanup: clang-format 2022-04-20 10:41:31 +10:00
f8f8edbe1a Cleanup: unused argument warning 2022-04-20 10:41:31 +10:00
Nate Rupsis
75ccfa63d0 UI: Fix typo in Apply Parent Inverse tooltip
There's a small typo in the tool tip for applying the Parent Inverse. This patch fixes that typo

old:
{F13010751}

new:
{F13010749}

Reviewed By: Blendify

Maniphest Tasks: T97437

Differential Revision: https://developer.blender.org/D14693
2022-04-19 20:40:59 -04:00
6a3c3c77b3 Mesh: Avoid unnecessary normal calculation and dirty tags
This is mostly a cleanup to avoid hardcoding the eager calculation of
normals it isn't necessary, by reducing calls to `BKE_mesh_calc_normals`
and by removing calls to `BKE_mesh_normals_tag_dirty` when the mesh
is newly created and already has dirty normals anyway. This reduces
boilerplate code and makes the "dirty by default" state more clear.
Any regressions from this commit should be easy to fix, though the
lazy calculation is solid enough that none are expected.
2022-04-19 17:08:02 -05:00
9ec94c3882 Cleanup: Don't recalculate normals in versioning code
Normals are not read from files anymore, calculating them in versioning
is unnecessary and wasteful.
2022-04-19 16:51:58 -05:00
d813ee55fd Fix: Incorrect info message in set material node
The node does have support for curves since c4f7f59c65.
2022-04-19 13:20:19 -05:00
5a06996722 Fix: Assert when sculpting empty curves 2022-04-19 12:09:29 -05:00
67962824e9 GPU: Fix Adresse Sanitizer errors 2022-04-19 19:03:40 +02:00
37d298391e Cleanup: GPUMaterial: Remove GPU_material_is_volume_shader 2022-04-19 19:03:40 +02:00
2890c11cd7 Cycles: add support for volume motion blur
This adds support for rendering motion blur for volumes, using their
velocity field. This works for fluid simulations and imported VDB
volumes. For the latter, the name of the velocity field can be set per
volume object, with automatic detection of velocity fields that are
split into 3 scalar grids.

A new parameter is also added to scale velocity for more artistic control.

Like for Alembic and USD caches, a parameter to set the unit of time in
which the velocity vectors are expressed is also added. For Blender gas
simulations, the velocity unit should always be in seconds, so this is
only exposed for volume objects which may come from external OpenVDB
files.

These parameters are available under the `Render` panels for the fluid
domain and the volume object data properties respectively.

Credits: kernel advection code from Tangent Animation's Blackbird based
on earlier work by Geraldine Chua

Differential Revision: https://developer.blender.org/D14629
2022-04-19 17:07:53 +02:00
56cfd60d43 Cleanup: remove unused code 2022-04-19 16:50:25 +02:00
Robert Guetzkow
721a9bc35c Fix T97338: Correct reference count for COM handling and removal of gotos
The fix ensures that the reference count for `IShellItem *pSI` is decremented,
preventing a memory leak. For `IFileOperation *pfo` the decrement of the
reference count is only attempted when `CoCreateInstance` is successful.
Additionally, the gotos have been replaced with nested if/else statements.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D14681
2022-04-19 16:30:22 +02:00
Germano Cavalcante
3e98331a09 PyGPU: remove outdated function 'code_from_builtin'
Since shader sources are now parsed on demand via `GPUShaderCreateInfo`,
sources are not available to be read via
`GPU_shader_get_builtin_shader_code`.

Currently this results in a crash as the code tries to read `NULL`
pointers.

`GPU_shader_get_builtin_shader_code` was created with the intention of
informing the user how a builtin shader works, thus "replacing"
detailed documentation.

Therefore this function doesn't really have a practical use in an addon.

So, instead of updating the function (which would require several
changes to the gpu module), remove it and improve the documentation.

Release Notes: https://wiki.blender.org/wiki/Reference/Release_Notes/3.2/Python_API#Breaking_Changes

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D14678
2022-04-19 11:23:51 -03:00
47de3659f0 improve hover tip for 'Lock Object Modes' property 2022-04-19 15:58:28 +02:00
6f56bd4083 Fix wrong logic in comparison code of RNA collection proerties.
Noted as part of T94775 investigation by Wayde Moss (@GuiltyGhost),
thanks!

NOTE: this mistake probably did not have any pratical impact in current
code, at least for overrides.
2022-04-19 15:53:54 +02:00
767939231d DRW: Volume: Fix warning about unused variable 2022-04-19 14:47:09 +02:00
058ce64be0 Fix: Uninitialized paint brush when using byte textures.
This is a fix for the 3d texturing brush.
2022-04-19 12:31:00 +02:00
14a2706886 EEVEE: Fix compilation caused by missing file 2022-04-19 12:27:27 +02:00
fa3bd17ae8 GPU: Replace GPUMaterialVolumeGrid by GPUMaterialAttribute
This is to make the codegen and shading nodes object type agnostic. This
is essential for flexibility of the engine to use the nodetree as it see
fits.

The essential volume attributes struct properties are moved to the
`GPUMaterialAttribute` which see its final input name set on creation.

The binding process is centralized into `draw_volume.cc` to avoid
duplicating the code between multiple engines. It mimics the hair attributes
process.

Volume object grid transforms and other per object uniforms are packed into
one UBO per object. The grid transform is now based on object which simplify
the matrix preparations.

This also gets rid of the double transforms and use object info orco factors
for volume objects.

Tagging @brecht because he did the initial implementation of Volume Grids.
2022-04-19 12:09:18 +02:00
1e3f4c70ab Material: Add name to default shaders
Improve debugging experience.
2022-04-19 12:09:18 +02:00
c2c17cc076 Workbench: Volume: Fix errors about unboud texture 2022-04-19 12:09:18 +02:00
6296cb5129 DRW: Centralize smoke domain texture management
This code was duplicated in multiple engines. Now it is the draw manager
responsability to manage the throwaway fluid textures.
2022-04-19 12:09:18 +02:00
eccc9d8eba Cleanup: Remove unused function in Cycles queue
Noticed while looking into oneAPI patch.

Seems to be unused, without clear indication why/when it might be
needed. Removing the function simplifies adding the new backend.

Differential Revision: https://developer.blender.org/D14652
2022-04-19 10:32:07 +02:00
3035235def Cleanup: run autopep8 on tests/ 2022-04-19 15:25:55 +10:00
58d86527ae Cleanup: run autopep8 on release/scripts/startup/ 2022-04-19 15:07:04 +10:00
8c25889bb6 Refactor: Move mesh face dot tag out of MVert
Continuing the refactors described in T93602, this commit moves
the face dot tag set by the subdivision surface modifier out of
`MVert` to `MeshRuntime`. This clarifies its status as runtime data
and allows further refactoring of mesh positions in the future.

Before, `BKE_modifiers_uses_subsurf_facedots` was used to check
whether subsurf face dots should be drawn, but now we can just check
if the tags exist on the mesh. Modifiers that create new new geometry
or modify topology will already remove the array by clearing mesh
runtime data.

Differential Revision: https://developer.blender.org/D14680
2022-04-18 23:48:43 -05:00
775f0d76d5 Fix missing C/Python methods in API docs
The following methods weren't included in API docs.

- BlendDataLibraries.load
- BlendDataLibraries.write
- Text.region_as_string
- Text.region_from_string
2022-04-19 13:08:48 +10:00
7e045094c1 PyDoc: quiet warnings for duplicate members bpy.context 2022-04-19 12:19:08 +10:00
f401741544 PyDoc: remove multiple children properties for Bone type
This doesn't cause any functional change as the RNA property
of Bone wasn't overridden by the _GenericBone's property,
however the `children` property was documented twice, causing a warning.
2022-04-19 12:18:53 +10:00
76acc5e999 PyDoc: fix including literal text immediately after function args
Literal text from examples could be included directly after function
arguments, this caused a warning with mis-matching indentation.
2022-04-19 12:17:58 +10:00
adcce654e3 Cleanup: Use correct capitalization of "F-Curve" 2022-04-18 20:17:41 -04:00
Colin Basnett
549f68149d UI: Fix typo in UI description for bpy.types.ActionFCurves.remove function
The UI description for the `bpy.types.ActionFCurves.remove` was incorrect;
seemingly a copy-paste typo from the `rna_Action_groups_remove` function.

Reviewed By: sybren, Blendify

Differential Revision: https://developer.blender.org/D14659
2022-04-18 20:11:45 -04:00
b90e892a17 Fix call of 'BLI_assert' instead 'BLI_assert_msg'
Error in 5da02548e9
2022-04-18 19:15:46 -03:00
5da02548e9 Cleanup: remove redundant 'DEG_get_original_object' call
The `BMEditMesh` pointer is the same in the original or evaluated mesh.

Also a clang-format was missed.
2022-04-18 19:00:55 -03:00
a0c2d6bf85 Transform: small optimization in snap to edit mesh
In some cases, selected elements do not contribute to snapping.
So ignore these elements when creating the edit meshes bound box.
2022-04-18 18:25:16 -03:00
bec057a453 Fix assert on meshes without mloop in snap code
Meshes without loops are still valid for snapping.
2022-04-18 18:24:50 -03:00
03d39a04a3 Fix T97002: Preserve multi socket link order
Preserve multi socket link order when copying nodes or adding a new
group input sockets by linking directly to multi inputs from the group
input node's extension socket.

This is done by also copying the `multi_input_socket_index` when
the new links are created by copying existing or temporary links.

Reviewed By: Hans Goudey

Differential Revision: http://developer.blender.org/D14535
2022-04-18 22:28:03 +02:00
314b27850c Cleanup: Remove incorrect comment 2022-04-18 14:08:29 -05:00
95cce6f6b0 Cleanup: Move object_modifier.c to C++
This allows using C++ only APIs/data structures, and potentially
simplifies adding support to apply modifiers for the Curves object.
2022-04-18 12:40:23 -05:00
98fc998c70 Cleanup: Clang tidy
- Inconsistent parameter names
- Else after return
- Braces around statements
- Qualified auto
- Also (not clang tidy): Pass StringRef by value, unused parameter
2022-04-18 12:36:37 -05:00
fc58368263 Build: link with GameController and CoreHaptics frameworks on macOS
In preparation of upcoming SDL upgrade, which uses these.
2022-04-18 19:14:36 +02:00
2cb76a6c8d Cleanup: consistently use parallel_for without tbb namespace in Cycles 2022-04-18 19:14:36 +02:00
029b0df81a Fix Cycles blackbody shader not taking into account OpenColorIO config
Keep the existing Rec.709 fit and convert to other colorspace if needed, it
seems accurate enough in practice, and keeps the same performance for the
default case.
2022-04-18 19:14:34 +02:00
41b3feea85 Fix Cycles build error with latest TBB after recent changes
From changes in 869a46df29, ref D14454
2022-04-18 18:49:35 +02:00
Angus Stanton
ccd2e89d37 Fix T94559: Copying geometry node group does not copy animation data
Reimplement copy geometry node groups in C. The version implemented in
Python could also manually copy the animation data, but it's more
standard to do this with `BKE_id_copy_ex` and `LIB_ID_COPY_ACTIONS`.

Differential Revision: https://developer.blender.org/D14615
2022-04-18 10:15:30 -05:00
ef2b8c1c3a Nodes: Remove unnecessary RNA pointer creation
`rna_NodeSocket_refine` and `rna_Node_refine` take significant time
when building the `NodeTreeRef` acceleration data structure, but they
aren't used at all. This commit removes their eager calculation and
instead creates them on-demand in the `rna()` functions. They also
aren't inlined to avoid including `RNA_prototypes.h` in the header.

Differential Revision: https://developer.blender.org/D14674
2022-04-18 10:12:17 -05:00
933fed2a17 Minor tweaks to labels/tooltips of override operation in the Outliner. 2022-04-18 12:21:33 +02:00
bf80dc2bd4 Add debugging info for Wintab activated by argument --debug-wintab.
Bonus: Added docs for `--debug-ghost`.

Differential Revision: https://developer.blender.org/D14610
2022-04-17 15:21:59 -07:00
213cd39b6d OBJ: further optimize, cleanup and harden the new C++ importer
Continued improvements to the new C++ based OBJ importer.

Performance: about 2x faster.
- Rungholt.obj (several meshes, 263MB file): Windows 12.7s -> 5.9s, Mac 7.7s -> 3.1s.
- Blender 3.0 splash (24k meshes, 2.4GB file): Windows 97.3s -> 53.6s, Mac 137.3s -> 80.0s.
- "Windows" is VS2022, AMD Ryzen 5950X (32 threads), "Mac" is Xcode/clang 13, M1Max (10 threads).
- Slightly reduced memory usage during import as well.

The performance gains are a combination of several things:
- Replacing `std::stof` / `std::stoi` with C++17 `from_chars`.
- Stop reading input file char-by-char using `std::getline`, and instead read in 64kb chunks, and parse from there (taking care of possibly handling lines split mid-way due to chunk boundaries).
- Removing abstractions for splitting a line by some char,
- Avoid tiny memory allocations: instead of storing a vector of polygon corners in each face, store all the corners in one big array, and per-face only store indices "where do corners start, and how many". Likewise, don't store full string names of material/group names for each face; only store indices into overall material/group names arrays.
- Stop always doing mesh validation, which is slow. Do it just like the Alembic importer does: only do validation if found some invalid faces during import, or if requested by the user via an import setting checkbox (which defaults to off).
- Stop doing "collection sync" for each object being added; instead do the collection sync right after creating all the objects.

Cleanup / Robustness:

This reworking of parser (see "removing abstractions" point above) means that all the functions that were in `parser_string_utils` file are gone, and replaced with different set of functions. However they are not OBJ specific, so as pointed out during review of the previous differential, they are now in `source/blender/io/common` library.

Added gtest coverage for said functions as well; something that was only indirectly covered by obj tests previously.

Rework of some bits of parsing made the parser actually better able to deal with invalid syntax. E.g. previously, if a face corner were a `/123` string, it would have incorrectly treated that as a vertex index (since it would get "hey that's one number" after splitting a string by a slash), instead of properly marking it as invalid syntax.

Added gtest coverage for .mtl parsing; something that was not covered by any tests at all previously.

Reviewed By: Howard Trickey
Differential Revision: https://developer.blender.org/D14586
2022-04-17 22:07:43 +03:00
a3eb4027c2 Fix T97095: export of Poly curves, export crash when object contains multiple curve types
- Was not exporting "Poly" curves at all,
- Had a crash when a single object contains multiple curves of different types -- it had a check for "is this nurbs compatible?" only for the first curve, and then proceeded to treat the other curves as nurbs as well, without checking for validity.

Fixed both issues by doing the same logic as in the old python exporter:
- Poly curves are supported,
- Treat object as "nurbs compatible" only if all the curves within it are nurbs compatible.

Added test coverage in the gtest suite. While at it, made "all_curves" test use the "golden obj file template" style test, instead of a manually coded test that checks intermediate objects but does not check the final exported result.

Reviewed By: Howard Trickey
Differential Revision: https://developer.blender.org/D14611
2022-04-17 21:59:55 +03:00
b32cb0266c Fix T96824: New 3.1 OBJ exporter writes incorrect polygon/vertex groups in some cases
The new 3.1 OBJ exporter code had incorrect code to determine which vertex group a polygon belongs to -- for each vertex, it was only looking at the first vertex group it has, and not using the group weight either.

This 99% fixes T96824, but not 100% on the user's submitted mesh -- exactly two faces from that mesh get assigned a different group compared to the old exporter. Either choice is "correct" given that on these two faces there are two vertex groups with equal contribution. The old Python exporter was picking the group based on internal python group name map order, whereas the new C++ exporter is picking the group with the lowest index, in case of ties. I'm not sure if it's possible to fix this TBH, will have to wait until the importer is also C++.

While at it, the new vertex group calculation code was doing a lot of redundant work for each and every face (traversing group lists several times, allocating & freeing memory), so I fixed that. Exporting a 6-level subdivided Monkey mesh with 30 vertex groups was taking 810ms, now takes 330ms.

Reviewed By: Howard Trickey
Differential Revision: https://developer.blender.org/D14500
2022-04-17 21:54:51 +03:00
e88807e71c Cleanup: Use C++ Array type 2022-04-17 13:30:30 -05:00
b9f1b64801 USD/Ctest: Add basic USD-Imaging test.
This adds a basic unit test to check USD has been correctly
build with imaging components to support building both with
the old and new libs, it automatically adds the test when it
detects a library with imaging enabled. (platform devs will
have to pay attention it runs the test to validate the libs
build correctly)

For future use in the code it also defines a USD_HAS_IMAGING
define one could check if we're building against an USD lib
that has it (just because we build/ship with it, doesn't
mean downstream builds will ship with it, so we'll have
to be a little pro-active there)

Reviewed By: sybren

Differential Revision:https://developer.blender.org/D14456
2022-04-16 15:32:48 -06:00
98eb111568 Fix T97366: Misdetection of numbers as UDIMs in certain filepaths
In some circumstances singular files with numbers in their name (like
turntable-1080p.png or frame-1042.png) might be detected as a UDIM.

The root cause in this particular instance was because `BKE_image_get_tile_info`
believed this file to be a tiled texture and replaced the filename with
a tokenized version of it. However, later on, the code inside `image_open_single`
did not believe it was tiled because only 1 file was detected and our
tiled textures require at least 2. This discrepancy lead to the broken
filename situation.

This was a regression since rB180b66ae8a1f as that introduced the
tokenization changes.

Differential Revision: https://developer.blender.org/D14667
2022-04-16 14:18:08 -07:00
2b191cd2b4 Mask by color now auto-creates a
color attribute if one does not exist,
and no longer passes through to the
translate tool on tweak grab.
2022-04-15 18:49:38 -07:00
8eb40d2063 This patch changes Sculpt Multi-Plane Scrape tool icon to be red and have a little outline around the color, like the other scraping tools T97271
Also, as a suggestion, this patch changes Mask By Color and Color Filter to be the same shade of green as paint and smear tool icons

{F12998856}

{F12998857}

{F12998858}

Reviewed By: Julian Kaspar & Joseph Eagar
Differential Revision: https://developer.blender.org/D14632
Ref D14632
2022-04-15 18:06:47 -07:00
dc5ae10692 Fix T96988: Merge by distance node crash with certain input
If the `wpoly` vector was small, the `wpoly_new` pointer could point
to part of its inline buffer on the stack, which becomes invalid out of
that scope. Instead, store `wpoly_new` as a span, and assign it properly
from the moved vector.
2022-04-15 16:55:15 -05:00
cb3c233ed3 Cleanup: Return early 2022-04-15 16:44:15 -05:00
65194f47b0 UI: Improve wording for some USD export descriptions
The HIG mentions that redundant words like "Enables" or "Activates"
shouldn't be used for tooltips of boolean properties. In this case
"When checked" was the redundant language that was implied by
the checkbox itself-- convention is to just state what the property
does when it's on.

Also change a few conjugations to the imperative and simplify
wording slightly, in order to be more consistent with language
elsewhere in Blender, and to be a bit more direct.

Differential Revision: https://developer.blender.org/D14644
2022-04-15 13:50:54 -05:00
ad324316ce Fix: Missing Null Check
Introduced by my recent commit: {rB3acbe2d1e933}

Lead to crash when insert_keyframe_direct() was called. Keyframing
crashed for NLA special properties (influence, animated_time),
driven properties, etc.
2022-04-15 13:45:00 -04:00
089e701191 Fix T97363: Duplicate elements node doesn't tag loose edges 2022-04-15 12:38:34 -05:00
4e6c0669e3 Cleanup: fix warning for differing parameter names 2022-04-15 13:21:07 -04:00
0f9057390d Cleanup: Clang tidy 2022-04-15 11:59:02 -05:00
7484f274dc Curves: Port curve to mesh node to the new data-block
This commit changes the Curve to Mesh node to work with `Curves`
instead of `CurveEval`. The change ends up basically completely
rewriting the node, since the different attribute storage means that
the decisions made previously don't make much sense anymore.

The main loops are now "for each attribute: for each curve combination"
rather than the other way around, with the goal of taking advantage
of the locality of curve attributes. This improvement is quite
noticeable with many small curves; I measured a 4-5x improvement
(around 4-5s to <1s) when converting millions of curves to tens of
millions of faces. I didn't obverse any change in performance compared
to 3.1 with fewer curves though.

The changes also solve an algorithmic flaw where any interpolated
attributes would be evaluated for every curve combination instead
of just once per curve. This can be a large improvement when there
are many profile curves.

The code relies heavily on a function `foreach_curve_combination`
which calculates some basic information about each combination and
calls a templated function. I made assumptions about unnecessary reads
being removed by compiler optimizations. For further performance
improvements in the future that might be an area to investigate.
Another might be using a "for a group of curves: for each attribute:
for each curve" pattern to increase the locality of memory access.

Differential Revision: https://developer.blender.org/D14642
2022-04-15 10:15:48 -05:00
cc6db8921b GPU: Make viewport not acquireable during rendering
This is a partial fix to the fact that rendering with EEVEE or other GL
render engines is currently blocking the whole UI when asking to redraw
a viewport.

This patch just bypasses the viewport bind (containing the Draw Context
lock) and the following drawing. There is an update tagging to not
loose a viewport update if there was one asked.

Other queries other than view redraw (such as selection depth drawing or
offscreen drawing) will still block the whole UI as they need immediate
data feedback.

Ping @Severin for the change in `WM_draw_region_viewport_bind()`.
I'm assuming this is not an issue because it's highly unlikely to
bring up this operator during rendering. But in this case, it would just
lock as usual.

The bypassing in `DRW_notify_view_update` might be a bit overparanoid.
2022-04-15 17:09:30 +02:00
47d961a4b1 Fix: Apply tilt in curves data-block normals calculation
The ported normal calculation from ceed37fc5c neglected to
use the tilt attribute to rotate the normals around the tangents.
This commit adds that behavior back, adding a new math header file
to avoid duplicating the rotation function for normalized axes.

Differential Revision: https://developer.blender.org/D14655
2022-04-15 09:54:45 -05:00
Jeroen Bakker
e96a809a68 PBVH Pixel extractor.
This patch contains an initial pixel extractor for PBVH and an initial paint brush implementation.
PBVH is an accelleration structure blender uses internally to speed up 3d painting operations.
At this moment it is extensively used by sculpt, vertex painting and weight painting.

For the 3d texturing brush we will be using the PBVH for texture painting.
Currently PBVH is organized to work on geometry (vertices, polygons and triangles).
For texture painting this should be extended it to use pixels.

{F12995467}

Screen recording has been done on a Mac Mini with a 6 core 3.3 GHZ Intel processor.

# Scope

This patch only contains an extending uv seams to fix uv seams. This is not actually we want, but was easy to add
to make the brush usable.

Pixels are places in the PBVH_Leaf nodes. We want to introduce a special node for pixels, but that will be done
in a separate patch to keep the code review small. This reduces the painting performance when using
low and medium poly assets.

In workbench textures aren't forced to be shown. For now use Material/Rendered view.

# Rasterization process

The rasterization process will generate the pixel information for a leaf node. In the future those
leaf nodes will be split up into multiple leaf nodes to increase the performance when there
isn't enough geometry. For this patch this was left out of scope.

In order to do so every polygon should be uniquely assigned to a leaf node.

For each leaf node
   for each polygon
     If polygon not assigned
       assign polygon to node.

Polygons are to complicated to be used directly we have to split the polygons into triangles.

For each leaf node
  for each polygon
    extract triangles from polygon.

The list of triangles can be stored inside the leaf node. The list of polygons aren't needed anymore.
Each triangle has:

    poly_index.
    vert_indices
    delta barycentric coordinate between x steps.

Each triangle is rasterized in rows. Sequential pixels (in uv space) are stored in a single structure.

    image position
    barycentric coordinate of the first pixel
    number of pixels
    triangle index inside the leaf node.

During the performed experiments we used a fairly simple rasterization process by
finding the UV bounds of an triangle and calculate the barycentric coordinates per
pixel inside the bounds. Even for complex models and huge images this process is
normally finished within 0.5 second. It could be that we want to change this algorithm
to reduce hickups when nodes are initialized during a stroke.

Reviewed By: brecht

Maniphest Tasks: T96710

Differential Revision: https://developer.blender.org/D14504
2022-04-15 16:40:01 +02:00
25196f8a36 EEVEE: Support disabling all lightprobe object contribution in viewport
This is supported throught the visibility toggle. The light cache will
then only be used for world lighting. This is the behavior as light
objects.
2022-04-15 14:05:18 +02:00
2839fe9a4d Curves: initial geometry nodes support for curves objects
* Curves objects now support the geometry nodes modifier.
* It's possible to use the curves object with the Object Info node.
* The spreadsheet shows the curve data.

The main thing holding this back currently is that the drawing code
for the curves object is very incomplete. E.g. it resamples the curves
always in the end, which is not expected for curves in general.

Differential Revision: https://developer.blender.org/D14277
2022-04-15 09:08:50 +02:00
Wayde Moss
db6287873c Object: Set Parent (Keep Transform Without Inverse)
**Relevant to Artists:** This patch adds an option to the Parenting
menu, `Object (Keep Transform Without Inverse)`, and Apply menu, `Parent
Inverse`. The operators preserve the child's world transform without
using the parent inverse matrix. Effectively, we set the child's origin
to the parent. When the child has an identity local transform, then the
child is world-space aligned with its parent (scale excluded).

**Technical:** In both cases, the hidden parent inverse matrix is
generally set to identity (cleared or "not used") as long as the parent
has no shear. If the parent has shear, then this matrix will not be
entirely cleared. It will contain shear to counter the parent's shear.
This is required, otherwise the object's local matrix cannot be properly
decomposed into location, rotation and scale, and thus cannot preserve
the world transform.

If the child's world transform has shear, then its world transform is
not preserved. This is currently not supported for consistency in the
handling of shear during the other parenting ops: Parent (Keep
Transform), Clear [Parent] and Keep Transform. If it should work, then
another patch should add the support for all of them.

Reviewed By: sybren, RiggingDojo
Differential Revision: https://developer.blender.org/D14581
2022-04-14 20:25:06 -04:00
48ff456a4b Fix T96875: Envelope modifier strokes cannot be eselected with Tweak
The new created strokes were not setting the right `orig` pointers, so the select operator could not select the strokes and points.

Now, the original pointers are set in the new strokes. To set the values is necessary assign the original pointer from the reference stroke because in modifiers the stroke is evaluated, so we need back two levels: Eval->Eval->Orig
2022-04-14 21:51:38 +02:00
48d2f536e1 Fix crash when loading Blender due to recent change
Issue introduced in {rB80859a6cb272}

Only seen on Windows.

The `keyword_parse` lambda function code did not consider `\r` as a
whitespace char, resulting in a wrong parse.

(More investigation needs to be done).
2022-04-14 15:54:09 -03:00
05715eaea1 Fix: Use after free when removing attribute on instances
Assume that only one layer matches the id and return instead
of continuing to iterate over attributes after the layers have
been potentially reallocated.
2022-04-14 13:04:23 -05:00
80859a6cb2 GPU: Make nodetree GLSL Codegen render engine agnostic
This commit removes all EEVEE specific code from the `gpu_shader_material*.glsl`
files. It defines a clear interface to evaluate the closure nodes leaving
more flexibility to the render engine.

Some of the long standing workaround are fixed:
- bump mapping support is no longer duplicating a lot of node and is instead
  compiled into a function call.
- bump rewiring to Normal socket is no longer needed as we now use a global
  `g_data.N` for that.


Closure sampling with upstread weight eval is now supported if the engine needs
it.

This also makes all the material GLSL sources use `GPUSource` for better
debugging experience. The `GPUFunction` parsing now happens in `GPUSource`
creation.

The whole `GPUCodegen` now uses the `ShaderCreateInfo` and is object type
agnostic. Is has also been rewritten in C++.

This patch changes a view behavior for EEVEE:
- Mix shader node factor imput is now clamped.
- Tangent Vector displacement behavior is now matching cycles.
- The chosen BSDF used for SSR might change.
- Hair shading may have very small changes on very large hairs when using hair
  polygon stripes.
- ShaderToRGB node will remove any SSR and SSS form a shader.
- SSS radius input now is no longer a scaling factor but defines an average
  radius. The SSS kernel "shape" (radii) are still defined by the socket default
  values.

Appart from the listed changes no other regressions are expected.
2022-04-14 18:47:58 +02:00
66dc4d4efb Cleanup: Alembic, use a structure to pass parameters
This adds a structure, `ABCReadParams`, to store some parameters passed
to `ABC_read_mesh` so we avoid passing too many parameters, and makes it
easier to add more parameters in the future without worrying about
argument order.

Differential Revision: https://developer.blender.org/D14484
2022-04-14 17:48:31 +02:00
45f30543db Fix T97135: Fix selection issues with parented masks in the MCE
Box, Circle and Lasso select were not taking into account if a
mask(point) was parented; selection was only succeeding in the original
place.

Now check coordinates from evaluated mask (points) instead while
setting selection flags and DEG tagging still happens on the original ID.

Maniphest Tasks: T97135

Differential Revision: https://developer.blender.org/D14651
2022-04-14 16:59:50 +02:00
ad245a25e2 Fix T85756: Adjust Last Operation panel is slow.
Extremely subttle bug that would only appear in some specific
circumstances, would cause memfile undo writing code to falsely detect
some ID as changed because it would get the wrong 'starting point' of
comparison with existing previous memfile step.

See T85756 for detailed explanation and reproducible case.
2022-04-14 16:46:51 +02:00
c71013082d Geometry Nodes: show used named attributes in nodes
This adds a new node editor overlay that helps users to see where
named attributes are used. This is important, because named
attributes can have name collisions between independent node
groups which can lead to hard to find issues.

Differential Revision: https://developer.blender.org/D14618
2022-04-14 16:31:09 +02:00
a9b94e5f81 Fix T95700: Oject Info node does not work with GPU subdivided meshes
When GPU subdivision is enabled the mesh objects remain unsubdivided on
the CPU side, and subdivision should be requested somewhat manually (via
`BKE_object_get_evaluated_mesh`).

When referencing an object, the Object Info node calls
`bke::object_get_evaluated_geometry_set` which first checks if a Geometry
Set is present on the object (unless we have a mesh in edit mode). If so
it will return it, if not, the object type is discriminated, which will
return a properly subdivided mesh object via `add_final_mesh_as_geometry_component`.

The unsubdivided mesh is returned because apparently the check on the
Geometry Set always succeeds (as it is always set in `mesh_build_data`).
However, the mesh inside this Geometry Set is not subdivided.

This adds a check for a MeshComponent in this Geometry Set, and if one
exists, calls `add_final_mesh_as_geometry_component` which will ensure
that the mesh is subdivided on the CPU side as well.

Differential Revision: https://developer.blender.org/D14643
2022-04-14 15:11:58 +02:00
31b2b84b3c Fix T97262: Crash with specific view layer setup
Originally was noticed when using a linked background scene and a scene
camera from another (local) scene.

The root issue was that relation from view layer to object's base flags
evaluation was using wrong view layer. This is because the relation was
created between object and currently built view layer, and it only was
happening once (since the object-level relations are only built once).
Depending on order in which `build_object` was called it was possible
that relation from a wrong view layer was used.

Now the code is better split to indicate which parts of object relations
are built when object comes from a base in the view layer, and which ones
are built on indirect linking of object to the dependency graph.

This patch makes relations correct in the cases when the same object is
used as a base in both active and set scenes. But, the operation which
handles object-level flags might not behave correctly as there is no
known design of what is the proper thing to do in this case. Making a
clear design and implementation of case when object is shared between
active and set scene is outside of the scope of this patch.

Differential Revision: https://developer.blender.org/D14626
2022-04-14 14:57:49 +02:00
1440074cac Tests: Change force disable render test messages to be warnings
These were easilly missable and took some effort to find why the test
were disabled.
2022-04-14 13:10:26 +02:00
c9574412c7 Curves: fix some issues with operator to convert to particle system
Ref T97171.

Differential Revision: https://developer.blender.org/D14637
2022-04-14 12:25:54 +02:00
Jason Fielder
8f0e06a0ca Metal: GPU_PRIM_LINE_LOOP alternative implementations.
Prefer using immVertex3f when 3D shaders are used for 2D rendering due to overhead of vertex padding in hardware. CPU overhead is negligible.

Authored by Apple: Michael Parkin-White

Ref T96261

Reviewed By: fclem

Maniphest Tasks: T96261

Differential Revision: https://developer.blender.org/D14494
2022-04-14 12:01:31 +02:00
Jason Fielder
e28f07b5c8 Metal: GLSL shader compatibility 4th pass
MSL follows C++ standard convention, and such variable declarations within switch statements must have their scope localised within each case. Adding braces in all cases ensures correct behaviour and avoids 'case ... bypass initialization of local variable' compilation error.

struct initialisation to follow C++ rules for Metal. Implicit constructors replaced with either explicit constructors or list-initialization where appropriate.

Ref T96261

Authored by Apple: Michael Parkin-White

Reviewed By: fclem

Maniphest Tasks: T96261

Differential Revision: https://developer.blender.org/D14451
2022-04-14 12:00:39 +02:00
3acbe2d1e9 NLA: Keyframe Remap Through Upper Strips
Add a new operator, "Start Tweaking Strip Actions (Full Stack)", which
allows you to insert keyframes and preserve the pose that you visually
keyed while upper strips are evaluating,

The old operator has been renamed from "Start Tweaking Strip Actions" to
"Start Tweaking Strip Actions (Lower Stack)" and remains the default for
the hotkey {key TAB}.

**Limitations, Keyframe Remapping Failure Cases**:
1. For *transitions* above the tweaked strip, keyframe remapping will
   fail for channel values that are affected by the transition. A work
   around is to tweak the active strip without evaluating the upper NLA
   stack.

   It's not supported because it's non-trivial and I couldn't figure it
   out for all transition combinations of blend modes. In the future, it
   would be nice if transitions (and metas) supported nested tracks
   instead of using the left/right strips for the transitions. That
   would allow the transitioned strips to overlap in time. It would also
   allow  N strips to be part of the (previously) left and right strips,
   or perhaps even N strips being transitioned in sequence (similar to a
   blend tree). Proper keyframe remapping through all that is currently
   beyond my mathematical ability. And even if I could figure it out,
   would it make sense to keyframe remap through a transition?

   //This case is reported to the user for failed keyframe insertions.//

2. Full replace upper strip that contains the keyed channels.

   //This case is reported to the user for failed keyframe insertions.//

3. When the same action clip occurs multiple times (colored Red to
   denote it's a linked strip) and vertically overlaps the tweaked
   strip, then the remapping will generally fail and is expected to
   fail.

   I don't plan on adding support for this case as it's also non-trivial
   and (hopefully) not a common or expected use case so it shouldn't be
   much of an issue to lack support here.

   For anyone curious on the cases that would work, it works when the
   linked strips aren't time-aligned and when we can insert a keyframe
   into the tweaked strip without modifying the current frame output of
   the other linked strips. Having all frames sampled and the strip
   non-time aligned leads to a working case. But if all key handles are
   AUTO, then it's likely to fail.

   //This case is not reported to the user for failed keyframe
   insertions.//

4. When using Quaternions and a small strip influence on the tweaked
   Combine strip. This was an existing failure case before this patch
   too but worth a mention in case it causes confusion. D10504 has an
   example file with instructions.

   //This case is not reported to the user for failed keyframe insertions. //

5. When an upper Replace strip with high influence and animator keys to
   Quaternion Combine (Replace is fine). This case is similar to (4)
   where Quaternion 180 degree rotation limitations prevent a solution.

   //This case is not reported to the user for failed keyframe insertions.//

Reviewed By: sybren, RiggingDojo

Differential Revision: https://developer.blender.org/D10504
2022-04-14 11:55:08 +02:00
Jason Fielder
b0dc3aff2c Metal: GLSL shader compatibility 3rd pass
Undefined behaviour for divergent control-flow fixes, replacement for partial vector references, and resolution of a number of calculation precision issues occuring on macOS.

Authored by Apple: Michael Parkin-White

Ref: T96261

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D14437
2022-04-14 11:49:18 +02:00
Ethan-Hall
d62f443f2d GPUTexture: Fixed typo where wrong enum was used
This patch fixes a typo in commit e59f754c16 which incorrectly uses `GPU_TEXTURE_ARRAY` instead of `GPU_FORMAT_COMPRESSED`.

`GPU_FORMAT_COMPRESSED` and `GPU_TEXTURE_ARRAY` both currently evaluate to 16,  so this patch does not change anything functionally; however, this patch will prevent issues from arising in the future.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D14384
2022-04-14 11:46:49 +02:00
Colin Basnett
f1ae6952a8 Animation: Select markers before/after current frame
Add operator to select markers left/right of the current frame
(including the current frame).

`bpy.ops.marker.select_leftright(mode='LEFT', extend=False)`

`mode` can be either 'LEFT' or 'RIGHT'.

The naming and defaults of the above variables match similar operators
(e.g., `bpy.ops.nla.select_leftright`)

This also adds a new sub-menu to the Marker menu found in animation
editors, exposing both the new `bpy.ops.marker.select_leftright`
operator as well as the `bpy.ops.marker.select_all` operator.

Despite the name "Before Current Frame" and "After Current Frame", it
also selects a marker that falls on the current from for both of the
modes. This is to match the behavior found in the `nla.select_leftright`
operator.

RCS: https://blender.community/c/rightclickselect/OgmG/

Reviewed by: sybren, looch

Differential Revision: https://developer.blender.org/D14176
2022-04-14 11:30:12 +02:00
RedMser
d6e7241237 Animation: Add F2 for renaming markers
F2 allows renaming lots of different types of active items, and now it
also works for markers.

Before, Ctrl+M was used, and it's context-sensitive: you often get
"Mirror Keys" instead, when your cursor isn't on the markers region, and
that operator has nothing to do with either renaming or markers.

**What this commit does:**

- Replace Ctrl+M shortcut with F2.
  - Adds the `TOPBAR_PT_name_marker` panel which is implemented similar
    to the global rename panel. This having to press enter twice to
    confirm or escape twice to cancel, which would happen if the
    `marker.rename` operator was called directly.
- Replace usages of `marker.rename` in the UI with `wm.call_panel`.
- To make the Industry Compatible keymap consistent with Blender
  Default, the rename shortcut only works when hovering the markers
  area.

Reviewed By: ChrisLend, sybren

Differential Revision: https://developer.blender.org/D12298
2022-04-14 10:58:14 +02:00
4fa3eadce9 Icons: Re-sync Blender with latest svn icon file
There are no real difference from the previous icons, but since some
manual changes were introduced in the icons file, we still needed
a final sync between them.
2022-04-14 09:57:15 +02:00
b1908f2e0b View 3D: disable object mode selection cycling on first-click
Unlike regular selection cycling that is activated when clicking again
in the same location, object mode would cycle to another object
if the object that was selected happened to already be active.

This made it impossible to click-drag to tweak the active object
if there were other objects behind it as those would be activated first.

Resolves T96752.
2022-04-14 17:20:36 +10:00
678b76d99a Correct error in 405bff7fd8
Was adding 1 to dietime twice in init_particle_interpolation.
2022-04-14 17:03:01 +10:00
405bff7fd8 Fix T68290: Baked particles don't render in final frame
Particles baked into memory would never load the final frame because
of an off-by-one error calculating the particles `dietime`.

This value indicates the frame which the particle ceases to exist but
was being set to the end-frame which caused this bug as the scenes
end-frame is inclusive.

While the last frame was properly written and read from memory,
the `dietime` was set to the last frame causing all the particles to be
considered dead when calculating the cached particle system.
2022-04-14 16:58:15 +10:00
bc8dcf6db7 Cleanup: unused argument warning 2022-04-14 16:58:09 +10:00
180163c4e4 Cleanup: Further hair to curves renaming
These were missed in previous passes. Also remove some logic
in `draw_hair.c` that was redundant after f31c3f8114.
2022-04-13 22:52:09 -05:00
f31c3f8114 Curves: Split curve EEVEE/workbench functions from particle hair
The GPU evaluation for curves will have to change significantly from the
current particle hair drawing code, due to its more general use cases
and support for more curve types. To simplify that process and avoid
introducing regressions for the rendering of hair particle systems,
this commit splits drawing functions for the curves object and
particle hair.

The changes are just inlining of functions and copying code
where necessary.

Differential Revision: https://developer.blender.org/D14576
2022-04-13 22:07:31 -05:00
f84f9eb8ed Fix T96563: tangents artifacts with GPU subdivision
When tangent are computed from generated coordinates, the result for GPU
subdivision would be compressed to 16-bit when it shouldn't.
2022-04-14 03:49:44 +02:00
3e25561d51 Fix part of T96596: wrong generated coordinates with GPU subdivision
Problem is that the orco layer was not taken care of by the GPU
subdivision routines. This only handles the issues for EEVEE/Workbench.
For Cycles, this would need to be handled at the wrapper level somehow.
2022-04-14 03:39:28 +02:00
927cb5bfac Cleanup: separate format-units for Python argument parsing
Recent addition to the Python API [0] didn't follow this convention.
See [1] for the rationale behind this change.

[0]: 9bc678969a
[1]: 982aea88e0
2022-04-14 11:21:51 +10:00
f076493dbb Keymap: restore key-shortcut to remove from local-view
Use Alt-Slash to remove objects from local-view (was M prior to [0]),
following the convention of using Alt to perform the reverse of an
action. Also remove the confirmation menu as this key as it can be
undone and it's not likely to be pressed by accident.

This can be useful to quickly subtract items from a complex selection
with items that only become visible when entering local-view.

The M key was originally used in 2.4x since moving between layers wasn't
possible. Now moving between collections is possible in local-view
the keys collided.

[0]: cf5d582b77
2022-04-14 11:14:32 +10:00
3f305b9ab3 Fix T97053: on cage GPU subdivision shows subdivided edges as actual
edges

When wireframe mode is turned on, the subdivision edges not originating
from coarse edges were also drawn as regular edges, which would confuse
users trying to select them. These should not be drawn in edit mode,
only in object mode when optimal display is turned off (matching the CPU
subdivision case).
2022-04-14 03:04:37 +02:00
8826db8f03 Fix T97310: BLF Line Height While Text Wrapping
Fix word-wrapped tooltip text not showing by aligning to pixel grid.

See D14639 for more details.

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

Reviewed by Campbell Barton
2022-04-13 17:45:32 -07:00
8e4c3c6a24 Cleanup: Make curve deform argument optional
The "dir" argument to `BKE_where_on_path` was only actually
used in a few places. It's easier to see where those are if there
isn't always a dummy argument.
2022-04-13 19:22:10 -05:00
0ba061c3bc Edit Mesh: Parallelize bounds calculation with deform modifiers
When displaying a deform modifier in edit mode, a cached
array of positions is used. Parallelizing bounds calculation when
that array exists can improve the framerate when editing slightly
(a few percent). I observed an improvement of the min/max itself
of about 10x (4-5ms to 0.4ms).
2022-04-13 18:49:11 -05:00
232b388455 Cleanup: Declare variables where initialized
Also adjust comment formatting and use nullptr
where the previous commit missed.
2022-04-13 18:02:21 -05:00
ad3378215c Cleanup: Clang tidy 2022-04-13 17:51:20 -05:00
abd02da4bd Cleanup: Move three mesh files to C++
This will allow easier interaction with other areas also using C++
features, and a potential optimization to edit mesh bounding box
calculation.
2022-04-13 17:51:05 -05:00
5a98e38275 Curves: Avoid duplicating evaluated positions with all poly curves
If all of the curves are poly curves, the evaluated positions are the
same as the original positions. In this case just reuse the original
positions span as the evaluated positions.
2022-04-13 17:13:30 -05:00
078aa677b6 Fix: Curves: Add missing builtin attribute definition 2022-04-13 17:05:35 -05:00
a8ee279aa9 Fix: Use consistent type for nurbs order attribute
An 8 bit integer should be enough for now. We can change this if we ever
want to allow increasing the order past 256.
2022-04-13 17:00:18 -05:00
94495049a8 Fix: Assert evaluating single point Bezier curve
Just return early in that case to keep the rest of the function simpler.
2022-04-13 16:57:13 -05:00
95236d8a75 Rename Color Attributes domain from "Point" to "Vertex"
Addresses T97257, to make it consistent with regular attributes tab

Review by: Julian Kaspar

Differential Revision: https://developer.blender.org/D14631
Ref D14631
2022-04-13 09:53:31 -07:00
6da5ee8368 Fix: compilation error with MSVC
Similar issue as e22fd7247a.
2022-04-13 10:15:00 -06:00
Hallam Roberts
7dc4ac71e8 Fix T97278: wrong hair particle shape with kink spiral
Revert change from 3da84d8b that incorrectly used M_PI_4.

Differential Revision: https://developer.blender.org/D14636
2022-04-13 16:23:47 +02:00
9c09e5ba24 Fix some usages of 'GPU_shader_get_uniform_block'
`GPU_shader_get_uniform_block` is marked as deprecated and the value
returned does not match what `GPU_uniformbuf_bind` expects.

Also, small typo fix in python error message.

Differential Revision: https://developer.blender.org/D14638
2022-04-13 10:51:51 -03:00
e22fd7247a Fix compilation error with MSVC
Caused by previous DNA change.
2022-04-13 15:19:36 +02:00
fb84408aa5 Cleanup: Update icons_geom CMakeLists.txt 2022-04-13 15:18:16 +02:00
0a57d6d076 Docs: correct RST syntax for GPU documentation 2022-04-13 22:39:26 +10:00
24fea2bdc4 Cleanup: Split paint_canvas into BKE and ED.
The BKE part is needed for the 3d texture paiting brush to be part of blender
kernel.
2022-04-13 14:27:19 +02:00
babd027fae Cleanup: make format 2022-04-13 12:30:29 +02:00
cf5d582b77 Fix T97207: Move to Collections Menu Grayed out when in Local View
This behaviour was introduced in a687d98e67 to bring the old obscure
"M" operator to remove objects from the local view. In order to avoid
the keymap clash with the Move to Collection operator, the Move to
Collection was artificially restricted to work in local view.

In retrospect, the "Remove from Local View" operator is in the menu anyways,
so it didn't even need to have a shortcut (back in 2.79 the operator was
not in a menu).

The changes introduced here are:
* No shortcut for "Remove from Local View"
* No more restrictions to "Move/Link to Collection" from local view.

Thanks for Philipp Oeser for digging the old commit that introduced this
and for the rationale on the changes.
2022-04-13 12:29:19 +02:00
c31b89e76e Cycles: Add support for "stageMetersPerUnit" Hydra render setting
This can be useful to match transforms to what native Cycles
would see in Blender, as USD typically uses centimeters, but
Blender uses meters. This patch also fixes the hardcoded focal
length multiplicator, which is now using the same units as
everything else. Default of "stageMetersPerUnit" is 0.01 to match
the USD default of centimeters.

Differential Revision: https://developer.blender.org/D14630
2022-04-13 12:24:21 +02:00
3a88f151c4 Cleanup: Proper printing of a string
Print it as a "%s" so that possible percentage symbols in the
error message does not cause issues.

Use proper assert (assert(true) is a no-op).

Also use `empty()` instead of `length()`.

Reviewed with Clement in real life.
2022-04-13 11:55:37 +02:00
402845744f Cleanup: Strict compiler warning in remesher 2022-04-13 11:51:38 +02:00
25c357124d Cover some DNA files with C++ utility macros
Solves compilation warning with Clang, and moves manipulation with
DNA structures to the designed way for C++.

The tests and few other places are update to the new code by Jacques.

Ref T96847

Maniphest Tasks: T96847

Differential Revision: https://developer.blender.org/D14625
2022-04-13 11:48:12 +02:00
da66c0519f Fix (unreported) collections not being append-reusable.
Related to T97289, appending collections would never re-use already
appended one, since the flag was not set for this ID type...
2022-04-13 10:28:48 +02:00
a63982a65b Fix T97289: Linked collection assets disappear.
After appending, new link/append code would delete linked IDs, even if
those where pre-existing. Note that this would actually lead to invalid
memory access later in append code (ASAN crash).
2022-04-13 10:28:48 +02:00
4a70561bbd Fix T97164: Voxel remesh only supports vertex float
color attributes.

Voxel remesher now supports all color attribute
types.
2022-04-13 00:48:10 -07:00
e0c8d0913b Curves: remove Test1 brush
This was one of multiple placeholder brushes to simplify development.
Having it is not necessary anymore.

It was a brush that could add new curves according to a specific density.
This functionality will be brought back as a new brush later.

Ref T97255.
2022-04-13 09:27:54 +02:00
d1418dd151 Updated voxel remesher defaults
Implements T97163
Newly created meshes have all voxel remesher checkboxes aside from Fix Poles enabled.
Startup files updated with versioning.

Reviewed By @JulianKaspar
Differential Revision: https://developer.blender.org/D14608
Ref D14608
2022-04-12 23:33:36 -07:00
567aad9dcd Fix T97152: Selection tools do nothing in particle hair edit
Regression in [0] which caused canceled PRESS events not to generate
CLICK_DRAG.

Resolve by checking for an active brush tool in poll instead of the
PARTICLE_OT_brush_edit invoke function.

[0]: 4d0f846b93,
2022-04-13 16:27:21 +10:00
9a659f2573 WM: improve logging for handling operators
- Add logging for CLICK_DRAG event handling to debug drag events.
- Use logging API for reporting the key-map, operator and event.

This command now prints useful information for investigating
key-map and event handling issues:

  blender --log "wm.handler.*" --log-level 4
2022-04-13 16:10:32 +10:00
02de1bff1e Cleanup: warning for 'float' to 'int' with MSVC 2022-04-13 14:22:58 +10:00
7d3db7a3ae Cleanup: use C++ comments for disabled code
Also ensure space around text in C-comment blocks.
2022-04-13 13:47:04 +10:00
4b5195a9d7 Cleanup: clang-format 2022-04-13 13:45:42 +10:00
21ae323dbf Cleanup: avoid redundant float/int conversions in BLF
Internally many offsets for BLF were integers but exposed as floats,
since these are used in pixel-space, many callers were converging them
back to integers. Simplify logic by using ints.
2022-04-13 13:06:29 +10:00
ae43872ad5 BLF: sub-pixel positioning support
Support sub-pixel kerning and hinting for future support for improved
character placement. No user visible changes have been made.

- Calculate sub-pixel offsets, using integer maths.
- Use convenience functions to perform the conversions and hide the
  underlying values.
- Use `ft_pix` type to distinguish values that use sub-pixel integer
  values from freetype and values rounded to pixels.

This was originally based on D12999 by @harley with the user visible
changes removed so they can be applied separately.
2022-04-13 11:58:42 +10:00
d0a70adf8f Cleanup: shadowed variable warning 2022-04-13 11:57:45 +10:00
af17676005 gpy.types.GPUUniformBuf: support any object exposing buffer interface
Since uniform buffers are generally structs and not sequences,
`BPyGPU_BufferType` objects are not suitable for filling the buffer.
2022-04-12 22:44:57 -03:00
132576ebb1 gpu.types.Buffer: fill buffer interface with just what is requested
Use the `flags` parameter to avoid unnecessary allocations.
2022-04-12 22:34:52 -03:00
8fad71799f Fix size of MAT3 and MAT4 in GPUShaderCreateInfo.push_constant
It was being wrongly multiplied by 2.
2022-04-12 22:31:27 -03:00
17a19069db Fix cases where 'Py_buffer' might not be released 2022-04-12 22:16:09 -03:00
cd4a9c488f Fix possible pointer being freed without being allocated in pygpu module
The `clear` method can be called before dealloc, which can
mislead buffer ownership.
2022-04-12 20:52:50 -03:00
Germano Cavalcante
9bc678969a pyGPU: Port 'StageInterfaceInfo' and 'ShaderCreateInfo' types
In order to allow GLSL Cross Compilation across platforms, expose in
Python the `GPUShaderCreateInfo` strategy as detailed in
https://wiki.blender.org/wiki/EEVEE_%26_Viewport/GPU_Module/GLSL_Cross_Compilation

The new features can be listed as follows:
```
>>> gpu.types.GPUShaderCreateInfo.
                                  define(
                                  fragment_out(
                                  fragment_source(
                                  push_constant(
                                  sampler(
                                  typedef_source(
                                  uniform_buf(
                                  vertex_in(
                                  vertex_out(
                                  vertex_source(

>>> gpu.types.GPUStageInterfaceInfo.
                                    flat(
                                    name
                                    no_perspective(
                                    smooth(

>>> gpu.shader.create_from_info(
```

Reviewed By: fclem, campbellbarton

Differential Revision: https://developer.blender.org/D14497
2022-04-12 18:50:56 -03:00
359b6baf32 Fix: Assert when curve has no evaluated points
It is valid for NURBS curves to have no evaluated points in some cases.
2022-04-12 14:56:14 -05:00
b1d915d027 Cleanup: Remove reference to CD_NORMAL in poly custom data
Vertex and face normals are not stored in custom data anymore,
in both Mesh and DerivedMesh.
2022-04-12 13:55:41 -05:00
88ab34488b Cleanup: Correct wording in comments 2022-04-12 13:55:41 -05:00
Michael Jones
869a46df29 Cycles fp consistency for Apple Silicon CPUs
Propagate the fp settings from the main thread to all the worker threads (the fp settings includes the FZ settings among other things) - this guarantees consistency in execution of floating point math regardless if its executed in tbb thread arena or on main thread

Add FZ mode to arm64/aarch64 in parallel to the way its been done on intel processors, currently compiling for arm target does not set this mode at all, hence potentially runs slower and with possible results mismatch with intel x86.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D14454
2022-04-12 19:43:47 +01:00
2d472b70e5 Revert "Cycles: enable HIP for Vega and Vega II (Radeon 7) GPUs on Windows"
This is not currently working, reverting until the driver/compiler has a fix.

This reverts commit c46e58817c.
2022-04-12 19:18:58 +02:00
a0957ceab2 Fix T97069: Null collection object during layercollection resync when relinking.
We better handle NULL object pointers before doing layer collections
resync, otherwise said resync process has to deal with those NULL
pointers. By the look of it this mistake has been there since the origin
of the remapping/relinking code.

Also for safety (and optimization), do not perform layer collection
resync from `libblock_remap_data_postprocess_object_update` when
`libblock_remap_data_postprocess_collection_update` is called
immediately afterwards.

Also added same 'skip on NULL collection object pointer' check to
`layer_collection_local_sync` as the one in
`layer_collection_objects_sync`, since it's fairly hard to always
guaranty there is no such NULL pointer when calling that code.
2022-04-12 18:43:26 +02:00
48014fbf14 Fix (unreported) use-after-free case in Properties Editor ID remapping code.
Regression in rBa21bca0e20a051, found while investigating T97069.
2022-04-12 18:43:26 +02:00
77db370cb6 Fix: BMesh Python API errors after vertex_normals addition
64cd927519 didn't update the argument parsing strings,
and updated the docstring of `from_object` incorrectly.

Fixes T97025, T97213
2022-04-12 11:08:21 -05:00
05a1770ab0 Fix T97280: Typo in tooltip of image texture node 2022-04-12 17:36:12 +02:00
ee9688da99 Cleanup: redundant logical not
Overlooked at rB0ebcc711f.

The logical not in this case was only applied to the left hand side of
the comparison.
2022-04-12 10:02:33 -03:00
d1944dee86 Cleanup: remove unused multi-function 2022-04-12 11:59:23 +02:00
5cae213750 Cleanup: pass vectors by reference
Passing them by value caused measurable overhead for me.
2022-04-12 11:56:02 +02:00
b4a2096415 Fix T95679: Outliner 'Unlink' directly on action misses DEG update
Animation would still play in the viewport.

There are two ways to unlink an action from the Outliner:
[1] `Unlink Action` on the Animation Data context menu.
This does `outliner_do_data_operation` / `unlinkact_animdata_fn` and has
the correct DEG update.
[2] `Unlink` on the Action context menu
This does `outliner_do_libdata_operation` / `unlink_action_fn` and was
missing the DEG update.

Now add the missing DEG update to the second case.

Maniphest Tasks: T95679

Differential Revision: https://developer.blender.org/D14089
2022-04-12 11:16:45 +02:00
4fd3d96f46 Fix Pushdown of an action from the Action Editor lacks immediate updates
The issue reported was that the recently introduced manual framerange of
an action (see rB5d59b38605d6) was not having an immediate effect in
case the action was pushed down from the Action Editor and only showed
its effects after e.g. saving and reloading the file. However doing the
same thing (pushing down the action) was working fine when done from the
NLA.

Now bring pushdown in sync (in terms of DEG update tagging) between the
Action Editor and the NLA, meaning that now both the owner and the
action are tagged when pushdown happens from the Action Editor as well.

Fixes T96964.

Maniphest Tasks: T96964

Differential Revision: https://developer.blender.org/D14564
2022-04-12 11:02:44 +02:00
fbca6aeb7c Fix T97132: Create a color attribute automatically
for color filter tool instead of canceling.
2022-04-11 23:25:56 -07:00
4a3bcfa102 Fix T97100: Fix ordering in color attribute list items
The new tab in the properties panel for "Color Attributes" shows the
data type and domain, just like the Attributes tab.
The issue is that the UI does not scale well and can only display the
full names when dragged to an extreme width.
This is due to the inclusion of the render icon in between the
attribute name and attribute type description.

This patch changes the order that items are displayed in the Color
Attributes Panel. Moving the render icon to the very right.
The result is consistent with other parts of the Blender UI and does
not take as much space to display the full text.

Reviewed By: @jbakker
Differential Revision: https://developer.blender.org/D14567
Ref D14567
2022-04-11 23:08:23 -07:00
d683ea4862 Fix T97098: Color filter sharpening artifacts.
Color filter sharpening now clamps the output.
The sharpening delta is now calculated from the
difference of two levels of vertex averaging instead
of one smooth iteration and the base color.

TODO: Sharpen in a different color space;
SRGB-linear has saturation artifacts.  I
tried HSL but it had value artifacts.  I'd
like to try LAB but we don't seem to have
conversion functions for it (at least as far
as I could see).
2022-04-11 22:54:32 -07:00
2451d7d57e Cleanup: use _NUM suffix for space/region type ranges
- Replace SPACE_TYPE_LAST with SPACE_TYPE_NUM (adding 1).
- Rename RGN_TYPE_LEN to RGN_TYPE_NUM

This makes it possible to tag space-type/region-type combinations
with `bool tag[SPACE_TYPE_NUM][RGN_TYPE_NUM]` which reads more clearly
than `bool tag[SPACE_TYPE_LAST + 1][RGN_TYPE_LEN]`.
2022-04-12 11:59:25 +10:00
6f1ad5f5e7 Fix wrong key type for GSet in Grease Pencil same material selection
The type of the key was changed from string to integer in 66da2f537a, but
the GSet was still being created for string keys.

As long as the integers stay small enough, this even kind of works on
little-endian systems, but of course it should use an integer hash instead.
2022-04-12 00:01:30 +02:00
3c62e539af Cleanup: clang-format 2022-04-11 23:49:37 +02:00
484a914647 UI: Add support for showing socket descriptions in tooltips
Currently, hovering over a socket itself shows no tooltip at all, while
hovering over its value field shows "Default value", which is not helpful.

This patch therefore implements socket tooltips following the proposal at
https://blender.community/c/rightclickselect/2Qgbbc/.

A lot of the basic functionality was already implemented for Geometry Nodes,
where hovering over the socket itself shows introspection info.

This patch extends this by:
- Supporting dynamic tooltips on labels, which is important for good tooltip
  coverage in a socket's region of the node.
- Adding a function to setting a dynamic tooltip for an entire uiLayout, which
  avoids needing to set it manually for a wide variety of socket types.
- Hiding the property label field in a tooltip when dynamic tooltip is also
  provided. If really needed, this label can be restored through the dynamic
  tooltip, but in all current cases the label is actually pointless anyways
  since the dynamic tooltip gives more accurate and specific information.
- Adding dynamic tooltips to a socket's UI layout row if it has a description
  configured, both in the Node Editor as well as in the Material Properties.

Note that the patch does not add any actual tooltip content yet, just the
infrastructure to show them. By default, sockets without a description still
show the old "Default value" tooltip.

For an example of how to add socket descriptions, check the Cylinder node
in the Geometry Nodes.

Differential Revision: https://developer.blender.org/D9967
2022-04-11 23:40:48 +02:00
Ethan-Hall
b3525c3487 UI: make snap self inactive if proportional editing
When using proportional editing, the 'project onto self' snap setting
is ignored since proportional editing does not allow snapping to
self. The UI should reflect this fact. This patch makes 'project onto
self' active only when proportional editing is off.

Reviewed By: mano-wii

Differential Revision: https://developer.blender.org/D14496
2022-04-11 17:32:24 -03:00
4aa9888854 PyGPU: make sure the UniformBuffer is padded to 16 bytes
Alignment with `vec4` is a requirement in C++, so it should be a
requirement in Python as well.
2022-04-11 16:59:18 -03:00
07cacb6d14 Fix crash when creating a 'gpu.types.Buffer'
Buffer creation may crash when passed a PyBuffer with no `shape` defined.
(Which is common for strucs).
2022-04-11 16:59:18 -03:00
Christophe Hery
c4f7f59c65 Curves: Add support for new curves type in Set Material node
Simply add the few lines so that the Cycles renderable New Curves
(with a small temporary patch to output the new type to render engines)
would get assigned a shader (in particular a hair shader).

Differential Revision: https://developer.blender.org/D14622
2022-04-11 14:52:20 -05:00
5f2317fa9b Update RNA to user manual references 2022-04-11 15:28:44 -04:00
c65b022e62 Fix OpenColorIO error with configs using <USE_DISPLAY_NAME>
* Don't assume the display colorspace name fully defines the transform
  to display space, this is not true in OpenColorIO 2 where view transforms
  may be defined in more complexs ways than just specifying a colorspace.
* In places where we need to store the display colorspace name, resolve
  <USE_DISPLAY_NAME> token manually.

Ref T96590
2022-04-11 20:10:42 +02:00
a99639792b Fix T97097: Color Filter saturates colors that have no saturation 2022-04-11 10:24:01 -07:00
7163db99c4 Fix T97096: Color filter brush was corrupting alpha. 2022-04-11 10:19:40 -07:00
4aac251b42 Fix adding certain nodes can cause python errors
Adding nodes via `NodeAddOperator` could fail if the node's poll fails
in `rna_NodeTree_node_new`. Examples are trying to add a RenderLayers
node or a Cryptomatte node to a nodegroup.

Now except the python error and use blender error reporting only instead
of throwing full python stacktraces at the user.

Differential Revision: https://developer.blender.org/D14584
2022-04-11 18:49:16 +02:00
e7a69b438f Cleanup: Clarify a few comments in pbvh_intern.h 2022-04-11 09:47:55 -07:00
0329145712 Cleanup: fix attribute.c incorrectly using
CustomDataLayer.type to check for
	 CD_FLAG_TEMPORARY instead of .flag.
2022-04-11 09:40:13 -07:00
0d0a45b89d Fix/workaround i18n script not finding some messages anymore.
For some reasons(c) some base classes (like `bpy.types.Modifier`) are
not listed anymore by a call to
`bpy.types.ID.__base__.__subclasses__()`, unless they are first accessed
explicitely (e.g. by executing `bpy.types.Modifier` etc.).
2022-04-11 15:45:52 +02:00
883dbfb72f Fix T85467: Mask transform center doesn't take parent Track into account
Coordinate checks in `spline_under_mouse_get` need to take place with
the evaluated mask to get the right center. This is now more in line to
how this is done in `ED_mask_point_find_nearest`.

Note: similar issues are reported with box/circle/lasso selection in
T97135, will tackle these separately though.

Maniphest Tasks: T85467

Differential Revision: https://developer.blender.org/D14598
2022-04-11 15:40:55 +02:00
20846596b5 Curves Sculpting Icons: Snake Hook and Grow updates
This implements the icon for snake hook, as well as tweak the
growth brush to make it bigger and with the triangles more
distinct for better reading of the icon.

Differential Revision: https://developer.blender.org/D14616
2022-04-11 15:11:43 +02:00
043555c78f install_deps: Tweak rBbc9c9631a46f, libwebp is not only a dependency from ffmpeg. 2022-04-11 14:52:26 +02:00
Charles Flèche
b6eb7dae59 Fix Cycles missing nullptr check in case mesh has no shader
Did not affect Blender, but could happen with other integrations.

Differential Revision: https://developer.blender.org/D14538
2022-04-11 14:24:59 +02:00
cda3334586 Fix setting key shortcuts for insert keyframe menu items
It was not possible to assign a shortcut to menu items in the insert
key-frame menu going back to version 2.7x. Doing so would replace the
current key that opens the insert keyframe menu (I-key by default),
instead of binding a key to insert a key-frame for the keying-set
referenced by the menu item.

Now each menu item can be bound to a key or added to the "Quick
Favorites" menu, directly inserting a key-frame for the corresponding
keying-set.

Note that users must use the operator `anim.keyframe_insert_by_name`
when setting up key-shortcuts as `anim.keyframe_insert` is only intended
to launch the menu.

Keymap Editor:

When editing these key-map items in the key-map editor, the keying-set
identifier must be used. At the moment the key-map editor doesn't
support showing a drop-down list. The identifiers can be used from the
tool-tip or the info editor.

{F12994924}

Details:

Use `ANIM_OT_keyframe_insert_by_name` instead of
`ANIM_OT_keyframe_insert_menu` for the insert keyframe popup menu to
resolve the following issues binding keys to keying sets:

- The index of the keying set isn't stable (adding/removing keying sets
  may change it).
- Binding a key to items in the popup menu triggers a popup instead of
  inserting a key using the keying set from the menu item.

While support for using the current operator could be improved, it will
still only work for built-in keying sets, so I'd prefer to use an
operator that is intended for key-bindings.

Besides supporting binding keys to menu items there are no functional
changes.

Reviewed By: sybren

Ref D14289
2022-04-11 21:10:05 +10:00
b2143da253 BMesh Python API: add access to vertex crease layer
This simply adds access to the vertex crease layer from Python
code. Documentation was modified to remove "Edge" as it is
shared between edges and vertices, similarly to bevel weights.

Differential Revision: https://developer.blender.org/D14605
2022-04-11 11:54:11 +02:00
e03810693c Cleanup: use doxy-comments and r_ prefix return arguments 2022-04-11 15:42:28 +10:00
5e47056e8d Cleanup: malformed C-style comment blocks, spelling
- Missing star prefix.
- Unnecessary indentation.
- Blank line after dot-points
  (otherwise doxygen merges with the previous dot-point).
- Use back-slash for doxygen commands.
- Correct spelling.
2022-04-11 12:03:09 +10:00
1c264ebdc0 Cleanup: quotes, line length 2022-04-11 11:40:58 +10:00
2e77a8f974 Render: Add operators to add all used or remove all unused lightgroups
These operators build a list of all lightgroups that are used by the view layer's
scene and either add all used lightgroups that are not part of the view layer yet
or remove all lightgroups in the view layer that are not being used.

Differential Revision: https://developer.blender.org/D14596
2022-04-10 18:45:16 +02:00
0b05e0b97e Fix T97159: AOV Pass in Cycles always gets Alpha Value of 1 for whole image
As far as I can see, it makes a lot of sense to have the alpha channel here, it matches the 2.x behavior and also matches what Eevee is doing.

Differential Revision: https://developer.blender.org/D14595
2022-04-10 18:43:57 +02:00
Viktoriia Safiullina
a4f970e86b UI: improve descriptions for camera lens and lens unit
Differential Revision: https://developer.blender.org/D14602
2022-04-10 16:31:11 +02:00
Martijn Versteegh
811371a6bd Fix T96942: disable Adjacent Faces margin for UVs and tangent space bake
Use the Extend method for these, as these do not work correctly. For UVs
it's better to extend the UVs from the same face, and for tangent space
the normals should be encoded in a matching tangent space.

Later the Adjacent Faces method might be improved to support these cases.

Ref T96977

Differential Revision: https://developer.blender.org/D14572
2022-04-10 16:31:11 +02:00
Simon Lenz
1db3e26c74 Mask: refactor mask_rasterize vector copying into a utility function
Add a separate scanline function scanfill_vert_add_v2_with_depth that
adds a vertex from 2D coordinate array & the specified z-value.

Ref D13460
2022-04-10 17:29:06 +10:00
8315e97754 Cleanup: missing-prototypes warning 2022-04-10 17:25:33 +10:00
881c566032 Cleanup compilation warnings.
Missing include statement.
2022-04-09 20:15:07 +02:00
749636bdb9 Missing forward declaration. 2022-04-09 20:10:44 +02:00
ceed37fc5c Curves: Port tangent and normal calculation to the new data-block
Port the "Normal" and "Curve Tangent" nodes to the new curves data-block
to avoid the conversion to `CurveEval`. This should make them faster by
avoiding all that copying, but otherwise nothing else has changed.

This also includes a fix to move the normal mode as a built-in curve
attribute when converting to and from `CurveEval`. The attribute is
needed because the option is used implicitly in many nodes currently.

Differential Revision: https://developer.blender.org/D14609
2022-04-09 12:46:30 -05:00
69a4d113e8 Fix T97133: Crash when creating a scene copy
Crash happened in sequencer editor, because pointer to displayed
channels was not set in `scene_copy_data`.
2022-04-09 18:16:21 +02:00
3f2d5dfc0d GPencil: Fix unreported error in Grab Brush for transformed layers
If the layer was transformed the grab brush was not initialized as expected because it was using an untrasformed matrix.
2022-04-09 16:39:35 +02:00
32da64c17e Fix T95276: Effect strip animation not updated when moving strips
Since effect strips can't be transformed directly, their selection had
to be forced in order to process them. This often failed in more
complicated scenarios, because there was no attempt to parse hierarchy
completely. In worst case only one effect in chain would be selected.
This code was marked by `XXX_DURIAN_ANIM_TX_HACK`.

Instead solution described above, a collection of strips that depend
on non effect strip position is built by function
`query_time_dependent_strips_strips` and it is stored in `TransSeq`.
In `flushTransSeq` this collection is iterated and transformation offset
is applied to effect strip animation. Strips in collection should be
consistent with true state of dependency and should be complete.

Functional changes:
- When 2-input effect strip changes position, animation is offset even
if only handles are moved. This only applies to 2-input effect however.
- Selection is not extended to include effect strips anymore. If effects
are to be moved, they must be selected manually. This is because
previously it was very hard to reorganize effects in chain, since moving
first strip in chain would always select anywhere from 1 to n effects.
So creating or filling gap in channel would almos always result in
collision especially if their order in timeline doesn't perfectly
represent their order in chain.
2022-04-09 16:29:40 +02:00
a3827d4b29 Fix: error in previous commit 2022-04-09 11:24:30 +02:00
Angus Stanton
a45976957e Curves: correctly initialize new attributes
Previously, the new attributes were zero-initialized. However, sometimes
the default has to be something else. The old behavior led to unexpected
behavior in the Snap Curves to Surface operator in Deform mode, when the
curves were not attached to the surface before.

Differential Revision: https://developer.blender.org/D14588
2022-04-09 10:51:07 +02:00
92c89d7b87 UDIM: Move UDIM grid controls to the Overlay panel
This change moves the grid panel UI from the View tab up into the
Overlay panel.

Reasons to move to the Overlay panel include:
 - Consistency with the grid options in the 3D viewport
 - The grid has been drawn as an Overlay for quite some time already

Additional changes that now make sense to have:
 - The grid responds to the main Overlay show/hide toggle
 - Adds a toggle to show/hide the grid which is consistent with overlays in general

As before, these grid controls are only available for active UV edit
sessions.

Differential Revision: https://developer.blender.org/D11862
2022-04-08 21:40:05 -07:00
502d16e667 Fix: Various fixes and cleanups in new curves code
- Use "curve" instead of "spline" in comments
- Use non-plural variable names
- Tag topology dirty after resolution modified rather than positions
- Reorder enum values to change which value is zero (and the default)
- Remove a duplicate unused variable
2022-04-08 17:50:00 -05:00
4f96190122 Fix: Build issue with MSVC
draw_common.h was included in a C++ file
leading to the linker looking for the
decorated name for `G_draw` which lead
to a linker error.

adding an extern "C" for C++ fixes
the issue.
2022-04-08 12:52:35 -06:00
eb40b231f9 Add a utility for sampling segment indices and factors from arbitrary
lengths along a set of points. This can be used for the sample curves
node, or finding new points along a curve when extending
or shrinking it.

This commit uses it in the snake hook brush as an example.

The logic is similar to the uniform length sampling, but the next
sample length is retrieved from the input instead of multiplication.

For the sample node in the future, though this sort of sampling can be
potentially done more efficiently for specific curve types besides
poly curves, it's simpler, at least as a start, to work on a set of
evaluated points that can be treated like a poly curve.

Differential Revision: https://developer.blender.org/D14571
2022-04-08 13:13:35 -05:00
bc9c9631a4 install_deps: only install codecs libs if building ffmpeg.
Avoid installing all the ogg, theora, xvid etc. codec lib dev packages
unless we actually build ffmpeg itself. Otherwise they are not necessary
for Blender build itself.
2022-04-08 18:58:55 +02:00
e15320568a Curves edit mode: show dots for points
This adds support to show dots for the curves points when in edit mode,
using a specific overlay.

This also adds `DRW_curves_batch_cache_create_requested` which for now
only creates the point buffer for the newly added `edit_points` batch.
In the future, this will also handle other edit mode overlays, and
probably also replace the current curves batch cache creation.

Maniphest Tasks: T95770

Differential Revision: https://developer.blender.org/D14262
2022-04-08 18:23:40 +02:00
3039b215ba GPencil: Fix unreported missing Sculpt popover menu
The menu with the options was not visible because the tool checked must be the sculpt, not draw.

This was broken in old version, but I cannot determine when or if never worked at expected.
2022-04-08 18:16:07 +02:00
d55a64a4fa install_deps: Add pystring and libwebp.
Re. {T95206}.
2022-04-08 18:12:20 +02:00
2c19d2eb2e Cleanup: quiet a couple more compilation warnings on MSVC 2022-04-08 18:06:09 +02:00
c0a9ec222f Alembic: fix clamping of frame offset during exports
The `frame_offset` used for creating `TimeSamplings` when exporting was
being clamped, which would make subframe sampling potentially fail, or
get out of sync.
2022-04-08 18:01:26 +02:00
f3a475a767 Cleanup: CacheFile, use double precision for time
Both the Alembic and USD libraries use double precision floating
point numbers internally to store time. However the Alembic I/O
code defaulted to floats even though Blender's Scene FPS, which is
generally used for look ups, is stored using a double type. Such
downcasts could lead to imprecise lookups, and would cause
compilation warnings (at least on MSVC).

This modifies the Alembic exporter and importer to make use of
doubles for the current scene time, and only downcasting to float
at the very last steps (e.g. for vertex interpolation). For the
importer, doubles are also used for computing interpolation weights,
as it is based on a time offset.

Although the USD code already used doubles internally, floats were used
at the C API level. Those were replaced as well.

Differential Revision: https://developer.blender.org/D13855
2022-04-08 17:57:35 +02:00
Jeroen Bakker
8b7cd1ed2a Painting: Canvas switcher for painting brushes/tools.
This patch adds color attributes to TexPaintSlot. This allows an easier selection
when painting color attributes.

Previously when selecting a paint tool the user had to start a stroke, before the
UI reflected the correct TexPaintSlot. Now when switching the slot the active
tool is checked and immediate the UI is drawn correctly.

In the future the canvas selector will also be used to select an image or image texture node
to paint on. Basic implementation has already been done inside this patch.

A limitation of this patch is that is isn't possible anymore to rename images directly from
the selection panel. This is currently allowed in master. But as CustomDataLayers
aren't ID fields and not owned by the material supporting this wouldn't be easy.

{F12953989}

In the future we should update the create slot operator to also include color attributes.
Sources could also be extended to use other areas of the object that use image textures
(particles, geom nodes, etc... ).

Reviewed By: brecht

Maniphest Tasks: T96709

Differential Revision: https://developer.blender.org/D14455
2022-04-08 16:42:50 +02:00
63d2980efa NLA: Remove Hold resetting between Hold_Forward Behavior
Avoid Blender overwriting artist's choices. The automatic change from
"Hold" (i.e. bidirectional extrapolation) to "Hold Forward" (i.e. only
extrapolate forward in time) has been removed.

This patch does not change strip evaluation. Between two strips, the
first with `None` extrapolation and the next with `Hold`, neither strip
will evaluate, which matches previous behavior. A future patch can
change the evaluation behavior.

Reviewed By: RiggingDojo, sybren

Maniphest Tasks: T82230

Differential Revision: https://developer.blender.org/D14230
2022-04-08 15:36:56 +02:00
f2455c7939 install_deps: Update OpenEXR to 3.1.4, Add Imath 3.1.4.
This has been... painful to get working.
2022-04-08 15:31:09 +02:00
9743f76582 Fix: accidentally swapped value with itself
Found in T96889.
2022-04-08 15:19:33 +02:00
db918ae9a4 install_deps: proper update of OpenVDB to 9.0.
Previous commit (rBrB59681a7ccdcf) was effectively doing nothing, due to
weird hacks we had to do with OpenVDB 8.0 to 'integrate' NanoVDB.

Now OpenVDB 9.0 natively includes NanoVDB, which allows us to greatly
simplify that part of the code in install_deps.
2022-04-08 14:51:01 +02:00
9439ac41eb I/O tests: change all_geometry scene to not have subd surface, and always print obj failure output diff details
The all_objects.blend test scene (in subversion tests repo) contained an
object with a subdivision surface. Which changes vertex positions
slightly, depending on used OpenSubDiv version and the compile flags. It
seems that the intent of the test was "test export of meshes that use
modifiers", so I changed that object to be a cube with a simple "taper"
modifier instead.

While at it, changed OBJ exporter test code to always print the
"expected and what we got" text difference details, when a test fails.
Much easier to see than just "the files are different" output. The code
to print that was behind an off by default flag for some reason.

This diff should get comitted together with updated all_objects templates
in subversion tests repo.

Reviewed By: Sebastian Parborg
Differential Revision: https://developer.blender.org/D14597
2022-04-08 15:09:22 +03:00
aa1e8bb9ab Fix T97150: Export GPencil to PDF or SVG crashes blender
The problem was the original file had some vertex  weight information, but the weights array was empty, so the duplication was not done and the free memory crashed.

To avoid this type of errors, now before duplicate weights the function checks the pointer and also the number of weights elements in the array to avoid the duplicatiopn of empty data.
2022-04-08 12:18:27 +02:00
aa46a67634 Fix lightgroup creation without a specified name 2022-04-08 11:51:31 +02:00
a410cea291 Fix prefix used for display OCIO shader
Didn't notice this to have real harmful behavior, but is still best
to do things properly.
2022-04-08 11:27:51 +02:00
30f9ebb644 Curves: expose convert to particle system operator in sculpt mode
Ref T96889.
2022-04-08 10:58:33 +02:00
ee292a1d66 PyAPI: use keyword only arguments for Text.region_{from/to} string
This is the convention for most parts of Blender Python API.
2022-04-08 13:28:55 +10:00
982aea88e0 Cleanup: separate format-units for Python argument parsing
With the increased use of multi-character format units and keyword-only
arguments these are increasingly difficult to make sense of.

Split the string onto multiple lines, one per argument.
While verbose it's easier to understand and add new arguments.
2022-04-08 11:49:50 +10:00
87a3bf3356 Cleanup: Define new curves normal mode in DNA
Don't include the tangent mode for now, since that
was never implemented for geometry nodes curves.
2022-04-07 18:10:29 -05:00
3214028ae8 Cycles: Support adding Lightgroups from the object/world properties
Currently, only Lightgroups that exist in the current view layer can be
selected from object or world properties.

The internal UI code already has support for search fields that accept
unknown input, so I just added that to the API and use it for lightgroups.

When a lightgroup is entered that does not exist in the current view layer
(e.g. because it's completely new, because the view layer was switched or
because it was deleted earlier), a new button next to it becomes active and
adds it to the view layer when pressed.

Differential Revision: https://developer.blender.org/D14540
2022-04-08 01:08:03 +02:00
5dd8551021 Fix T97144 Overlay: Illegal recursive expansion of macros
Was caused by the shaderCreateInfo port.
2022-04-07 22:51:31 +02:00
d197e272bb Fix Clang/Linux build error after line primitive parallelization 2022-04-07 20:36:15 +02:00
aaa5a80763 Fix Cycles build error after recent changes 2022-04-07 20:33:34 +02:00
0de0950ad5 Cycles: various Linux build fixes related to Hydra render delegate
* Add missing GLEW and hgiGL libraries for Hydra
* Fix wrong case sensitive include
* Fix link errors by adding external libs to static Hydra lib
* Work around weird Hydra link error with MAX_SAMPLES
* Use Embree by default for Hydra
* Sync external libs code with standalone
* Update version number to match Blender
* Remove unneeded CLEW/GLEW from test executable

None of this should affect Cycles in Blender.

Ref T96731
2022-04-07 19:52:53 +02:00
51a7e4b488 Cleanup: remove unused mface tesselation code from modifier stack
This seems to serve no purpose anymore, I don't see anywhere that
CD_MFACE is requested for modifier evaluation, and it's confusing
to have this in this final normals computation function.

Found while looking into D14579.

Differential Revision: https://developer.blender.org/D14580
2022-04-07 19:48:54 +02:00
be799749dc Fix T97035: crash transferring face corner data
The mechanism to instance meshes when there are no modifiers did not take
into account that modifiers might get re-evaluated from an operator that
requests loop normals. Now check for that case and no longer use the
instance then.

In the future, a better solution may be to compute loop normals on demand
as is already done for poly and vertex normals, but that would be a big
change.

Differential Revision: https://developer.blender.org/D14579
2022-04-07 19:48:54 +02:00
46c54b12b0 Cleanup: Return early in metaball tessellation code
Also declare variables where initialized and use const.
2022-04-07 12:34:06 -05:00
a5beca7ba0 BLI: inline fast path of IndexRange::as_span
This frequently showed up in profiling but shouldn't.

This also updates the code to use atomics for more correctness and
adds multi-threading for better performance.
2022-04-07 19:28:41 +02:00
67c42e7f03 Functions: optimize simple generated multi-functions
This implements two optimizations:
* Reduce virtual function call overhead when a non-standard virtual
  array is used as input.
* Use a lambda in `type_conversion.cc`.

In my test setup, which creates a float attribute filled with the index,
the running time drops from `4.0 ms` to `2.0 ms`.

Differential Revision: https://developer.blender.org/D14585
2022-04-07 18:48:29 +02:00
8f344b530a Geometry Nodes: Parallelize mesh line node
I observed a 4-5x performance improvement (from 50ms to 12ms)
with five million points, though obviously the change depends on
the hardware.

In the future we may want to disable the parallelization in
`parallel_invoke` when there is a small amount of points.

Differential Revision: https://developer.blender.org/D14590
2022-04-07 11:44:32 -05:00
Henrik Dick
f8c21937d2 GPencil: Add skip option to envelope modifier
This patch adds an option to only use every n-th segment of the
envelope result. This can be used to reduce the complexity of the
result.

Differential Revision: http://developer.blender.org/D14503
2022-04-07 17:41:49 +02:00
1a09024eac Cleanup: Compilation warning about virtual functions
Method which overrides a base class's virtual methods are expetced to
be marked with `override`. This also gives better idea to the developers
about what is going on.
2022-04-07 17:14:47 +02:00
9db15f502c Fix T97123: Applying modifier to multi-user: other objects were also converted
The first element of the iterator was not being tested against the flag.
So in some cases it would lead to more objects been made into
single-user than the active (or selected) ones.
2022-04-07 15:18:20 +02:00
8306f89c37 Cleanup: add clarifying comment to bpy_app_getsets
No functional changes.
2022-04-07 13:20:32 +02:00
434521a9e2 Curves: improve Add menu for new curves object
The goal is to make the Add menu more convenient for the new curves object.
The following changes are done:
* Add `curves` submenu.
* Add an `Empty Hair` operator that also sets the surface object.
* Rename the old operator to `Random`. It's mostly for testing at this point.

Differential Revision: https://developer.blender.org/D14556
2022-04-07 13:02:03 +02:00
50869b408b Curves: operator to snap curves to surface
This operator snaps the first point of every curve to the corresponding
surface object. The shape of individual curves or their orientation is
not changed.

There are two different attachment modes:
* `Nearest`: Move each curve so that the first point is on the closest
  point on the surface. This should be used when the topology of the
  surface mesh changed, but the shape generally stayed the same.
* `Deform`: Use the existing attachment information that is stored
  for curves to move curves to their new location when the surface
  mesh was deformed. This generally does not work when the
  topology changed.

The purpose of the operator is to help setup the "ground truth"
for how curves are attached to the surface. When the ground
truth surface changed, the original curves have to be updated
as well. Deforming curves based on an animated surface will be
done with geometry nodes independent of the operator.

In the UI, the operator is currently exposed in curves sculpt mode
in the `Curves > Snap Curves to Surface` menu.

Differential Revision: https://developer.blender.org/D14515
2022-04-07 12:50:15 +02:00
e5c7f37223 Cleanup: make CustomMF_* implementations more similar 2022-04-07 11:51:47 +02:00
6d1fbd249b Pose Library: avoid errors in the legacy panel when the add-on is disabled
Avoid errors in the legacy Pose Library panel (in Armature properties)
when the Pose Library add-on is disabled.

It's unfortunate that a built-in panel now has knowledge of an add-on.
Then again, it's temporary (one or two Blender releases), and it now uses
feature detection instead of just assuming the add-on is enabled.
2022-04-07 11:27:23 +02:00
951e43bee8 Pose Library: use the right icon for the "More Info" button 2022-04-07 11:27:23 +02:00
7b7c78c4dc Cleanup: remove incorrect comment
No functional changes.
2022-04-07 11:27:23 +02:00
1d18c0682f Fix T96888: data transfer operator crash in certain situation
The operator could crash in case the context "object" was overridden
from python, but the "active_object" wasnt (and the active object was
not a mesh).

Reason for the crash is a mismatch in the operators poll function
`data_transfer_poll` vs. `dt_layers_select_src_itemf` -- in the former,
the overriden "object" was respected (and if this was a mesh, the poll
was permissive), in the later it wasnt and only the "active_object" was
used (if this was not a mesh, a crash would happen trying to get an
evaluated mesh).

Now rectify how the object which is used is being fetched -> use
`ED_object_active_context` everywhere (see also rBe560bbe1d584).

Maniphest Tasks: T96888

Differential Revision: https://developer.blender.org/D14552
2022-04-07 10:52:20 +02:00
384a02a214 BLI: add missing materialize methods for virtual arrays
This does two things:
* Introduce new `materialize_compressed` methods. Those are used
  when the dst array should not have any gaps.
* Add materialize methods in various classes where they were missing
  (and therefore caused overhead, because slower fallbacks had to be used).
2022-04-07 10:02:34 +02:00
2aff04917f Functions: parallelize materializing arrays after field evaluation
This improves performance e.g. when creating an integer attribute
based on an index field. For 4 million vertices, I measured a speedup
from 3.5 ms to 1.2 ms.
2022-04-07 09:48:07 +02:00
fd5e5dac89 Geometry Nodes: avoid data copy in store named attribute node 2022-04-07 09:40:37 +02:00
120a17a45a BLI: add CPPType utility to copy elements to a shorter array 2022-04-07 09:34:07 +02:00
e2f4c4db8d Cleanup: pass the buffer length into txt_insert_buf
Also remove redundant NULL check.
2022-04-07 15:45:20 +10:00
Matheus Santos
f49a736ff4 Text Editor: Get/Set region text API
Add the ability to get/set the selected text.

**Calling the new methods:**

- `bpy.data.texts["Text"].region_as_string()`
- `bpy.data.texts["Text"].region_from_string("Replacement")`
2022-04-07 15:17:04 +10:00
7cd6bda206 Cleanup: spelling in comments, minor reformatting changes 2022-04-07 14:48:20 +10:00
792a481bee Cleanup: clang-format 2022-04-07 14:34:51 +10:00
Aleksi Juvani
81ec3dce65 Geometry Nodes: Add "Connected" mode to Merge by Distance node
Expose the "Connected" mode from the weld modifier in the
"Merge by Distance" geometry node. This method only merges
vertices along existing edges, but it can be much faster
because it doesn't have to build a KD Tree of all selected
points.

Differential Revision: https://developer.blender.org/D14321
2022-04-06 17:30:56 -05:00
Yevgeny Makarov
181d577d7d Fix T86200: Properties editor rearranges columns poorly when very wide
Use a regular property split layout instead of a grid flow.
Also fix part of T65393.

Differential Revision: https://developer.blender.org/D13558
2022-04-06 17:08:23 -05:00
Ujwal Kundur
f16033c0f5 Fix T91541: Naming of Freestyle Curvature 3D modifier
Change the modifier name in the modifier stack to "Curvature 3D"
to be consistent with the modifier name in the drop-down.

Differential Revision: https://developer.blender.org/D14476
2022-04-06 17:05:33 -05:00
Pratik Borhade
77ae30517f Fix: UI alignment in knife tool settings popover
Remove the extra space given for decorators on right of the popover.

Differential Revision: https://developer.blender.org/D14518
2022-04-06 17:01:07 -05:00
Aleksi Juvani
236643606e Fix: Division by zero in UV packing function
If all islands had a size of zero, a division by zero would occur in
`GEO_uv_parametrizer_pack`, causing the UV coordinates to be set to
NaN. An alternative approach would be to skip packing islands with a
zero size, but If UV coordinates are for example outside the 0-1 range,
it's better if they get moved into that range.

Differential Revision: https://developer.blender.org/D14522
2022-04-06 16:58:59 -05:00
Mattias Fredriksson
52af51708f Fix: Copy resolution when creating CurveEval from Curves
Set the curve resolution to Bezier and Nurbs curves when converting
data using `curves_to_curve_eval`. This was missed in 9ec12c26f1.

Differential Revision: https://developer.blender.org/D14577
2022-04-06 16:54:22 -05:00
Mattias Fredriksson
c9f485195b Cleanup: Incorrect comment in IndexRange header 2022-04-06 16:53:58 -05:00
8551e89068 Curves: Name mutable data retrieval functions explicitly
Add "for_write" on function names that retrieve mutable data arrays.
Though this makes function names longer, it's likely worth it because
it allows more easily using the const functions in a non-const context,
and reduces cases of mistakenly retrieving with edit access.

In the long term, this situation might change more if we implement
attributes storage that is accessible directly on `CurvesGeometry`
without duplicating the attribute API on geometry components,
which is currently the rough plan.

Differential Revision: https://developer.blender.org/D14562
2022-04-06 16:30:27 -05:00
8b04308953 Curves: Hair to Curves rename in Cycles/EEVEE UI
Change uses of "Hair" in Render Settings UI in the property editor
and the "Hair Info" node to use the "Curves" name to reflect the
design described in T95355, where hair is just a use case of a more
general curves data type.

While these settings still affect the particle hair system,
the idea is that if we have to choose one naming scheme to align
with, we should choose the option that aligns with future plans
and current development efforts, especially since the particle
system is considered a legacy feature.

A few notes:
- "Principled Hair BSDF" is not affected since it's meant for hair.
- Python API property identifiers are not affected.

Differential Revision: https://developer.blender.org/D14573
2022-04-06 16:20:38 -05:00
74db0f3d5f Fix: Curve parameter node broken for Bezier curves after refactor
The last length value was not initialized, and all length values were
moved one position towards the front of each curve incorrectly.
Also fix an assert when a curve only had a single point.
2022-04-06 16:13:06 -05:00
eb470bfbfe BVH Utils: use fall-through in 'BKE_bvhtree_from_mesh_get'
This deduplicates the code a bit.
2022-04-06 17:36:56 -03:00
99b82116ef Cleanup: remove workaround to set treedata members
This workaround is not needed since
228f7f1c85
2022-04-06 16:37:47 -03:00
howetuft
fcf06d2ad7 Fix standalone image output not working when not running in background mode
Differential Revision: https://developer.blender.org/D14471
2022-04-06 21:30:10 +02:00
howetuft
013d0631e6 Add CMake option to control CUDA host compiler
This revision allows to specify CUDA host compiler (nvcc's -ccbin command
line option) when configuring the build. It addresses the case where the
C/C++ compiler to be used in CUDA toolchain should be different from the
default C/C++ compiler, for instance in case of compilers versions conflicts
or multiple installed compilers.

The new CMake option is named `CUDA_HOST_COMPILER` and can be used as follows:
`cmake -DCUDA_HOST_COMPILER=<path-to-host-compiler>`

If the option is not specified, the build configuration behaves as previously.

Differential Revision: https://developer.blender.org/D14248
2022-04-06 21:30:07 +02:00
6aaae44473 Fix: Missing virtual destructor on virtual class
This caused an ASAN report for new/delete type mismatch
when using the snake hook brush in curves sculpt mode.
2022-04-06 11:42:52 -05:00
d8a9bcea6c Fix F-Curve visibility toggle disabled for library overridden rig
When showing an action data-block added to a library overridden object
in the Graph Editor, the visibility toggles would be disabled.
Toggling the visibility should be possible still and works with the
shortcuts, just the button was incorrectly disabled.

Also added the usual disabled hint for the tooltip.

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

Reviewed by: Bastien Montagne
2022-04-06 18:30:51 +02:00
c14ed182f5 Fix T96595: Animation not duplicated for meta children
Iterate over meta strip content and duplicate animation for all strips.
recursively.
2022-04-06 15:12:16 +02:00
Bastien Montagne
1ec93507e1 API doc: Tweak sphinx to get date of source commit instead of build date.
This commit disables the 'last updated' value (which is the date the
sphinx doc is generated), and instead modifies the 'commit' field from
the 'html_context' data to get:
  - a link to the commit itself.
  - the date of that commit.

This avoids having the whole documentation detected as changed every
time it is re-generated by the buildbot.

Reviewed By: dfelinto, campbellbarton

Differential Revision: https://developer.blender.org/D14429
2022-04-06 11:43:14 +02:00
Bastien Montagne
e06399c223 Fix badly broken caches handling during undo/redo.
Original rework of caches during undo/redo (see D8183) had a very bad
flaw hidden in it: using the key of a ghash as source of data.

While this was effectively working then (cache pointer itself being part
of the key, and said cache pointers not being cleared on file write),
this is a general very bad way to do things.

Now that cache pointers are more and more cleared on file write (as part
of clearing runtime-data to reduce false-positives when checking if an
ID has changed or not), this has to be fixed properly by:
* Not storing the cache pointer itself in the IDCacheKey.
* In undo context, in readfile code trying to preserve caches, store the
  cache pointers as values of the mapping, together with the usages counter

The first change potentially affects all usages of
`BKE_idtype_id_foreach_cache`, but in practice this code is only used by
memfile reading code (i.e. undo) currently.

Related to T97015.

Reviewed By: brecht

Maniphest Tasks: T97015

Differential Revision: https://developer.blender.org/D14559
2022-04-06 11:37:15 +02:00
8dd3387eb7 Cleanup: spelling & poor wording in code & comments 2022-04-06 19:08:10 +10:00
2d2baeaf04 Fix: T78228 Send all python errors to info editor
Python exceptions are now shown in the info editor,
this also resolves an old bug where errors were printed twice.

This was originally based on D9752 by @ShadowChaser although many
changes have been made from the original patch.

Details:

- BPy_errors_to_report no longer prints additional output.
- BKE_report_print_test was added so it's possible to check if calling
  BKE_report also printed to the stdout.
- Callers to BPy_errors_to_report are responsible for ensuring output
  is printed to the stdout/stderr.
- Python exceptions no longer add a trailing newline,
  needed to avoid blank-space when displayed in the info-editor.
2022-04-06 18:02:58 +10:00
e4f71e5ef3 Fix off by one error placing the text cursor from a Python exception
Off by one error placing text from an error.
2022-04-06 13:14:21 +10:00
2e9e2715ef Cleanup: use context.path_resolve instead of eval(..) 2022-04-06 11:48:56 +10:00
7bb8eeb3a8 PyAPI: Add Context.path_resolve wrapper that supports context members
This avoids script authors using `eval("context.%s" % data_path)`
to access paths starting from the context,
which isn't good practice especially if the data_path isn't trusted.

Now it's possible to resplve paths such as:

   context.path_resolve('active_object.modifiers[0].name')
2022-04-06 11:48:51 +10:00
5d31252c76 Fix accessing an empty context succeeding when it shouldn't
Internally an empty string is used to access context member `__dir__`,
which caused `getattr(context, "")` to succeed returning None.
2022-04-06 11:47:43 +10:00
f208713b02 UI: use a faster method of finding colliding layer names
Access the keys of the collection instead of the layers names
and use a set to detect collisions. There is no need to access the
duplicate layers themselves. Roughly twice as fast.
2022-04-06 11:42:44 +10:00
8bd28ef16c Doxygen: update doxyfile to 1.9.3
Resolves deprecation warnings.
2022-04-06 11:42:42 +10:00
11b0824d89 Cleanup: line wrapping, remove unused args, variables in UI scripts 2022-04-06 09:40:14 +10:00
a776385b26 Cleanup: zero initialize VColRef before setting members
Ensures new members will be zeroed, the compiler is able to optimize
this into identical compiled output.
2022-04-06 09:40:13 +10:00
20bb859d9b Cleanup: quiet compiler warnings
Ideally this wouldn't be needed, I couldn't find a good solution
to avoid casting when comparing const/non-const pointers in this case.
2022-04-06 09:40:11 +10:00
931ae424b9 BVH Utils: remove 'isolate' parameter
This is an internal usage parameter.

No functional changes.
2022-04-05 20:33:06 -03:00
9fbf7f1180 BVH Utils: Remove '_allocated' members from 'BVHTreeFromMesh'
The parameters indicating whether it is allocated are always `false` and
it is up to the caller to free them.

Also clang-format was triggered.
2022-04-05 19:56:03 -03:00
Germano Cavalcante
684b95804e Refactor: remove cache parameters from bvhtree_from_ functions
The `BVHCacheType bvh_cache_type` parameter defines specific
`BVHTrees` that cannot be customized.

So it doesn't make sense to pass this value to any
`*bvhtree_from_[...]_ex` function as the `BVHTrees` created in these
cases are custom and cannot be saved in the cache.

This also resulted in a nice cleanup in the code.

Differential Revision: https://developer.blender.org/D14479
2022-04-05 19:32:56 -03:00
bb7e3c2b56 Cleanup: Simplify if statements, clang tidy 2022-04-05 16:40:44 -05:00
228f7f1c85 Refactor: Deduplicate and simplify BVH Utils code
In summary the changes are:
- Merge all `bvhtree_from_mesh_*.*_setup_data` in a single utility
- Create `bvhtree_from_editmesh_setup_data`
- Setup data only once in `BKE_bvhtree_from_mesh_get` and `BKE_bvhtree_from_editmesh_get`

Also the behavior of `BKE_bvhtree_from_mesh_get` and
`BKE_bvhtree_from_editmesh_get` changed a bit:
- If a null tree is cached, don't set the `data` to zero. This tree is not an error and the others data can still be used.
- If a null tree is returned, don't set the `data` to zero. Matches the previous change.

Differential Revision: https://developer.blender.org/D14549
2022-04-05 18:14:22 -03:00
7a5e663843 Fix: Pass const arguments to object snapping 2022-04-05 16:13:55 -05:00
7455bb85cc GPencil: Fix buiding with GTEST 2022-04-05 22:53:10 +02:00
5f1adfc508 Cleanup: fix various typos
Contributed by luzpaz.

Differential Revision: https://developer.blender.org/D14443
2022-04-05 22:21:13 +02:00
0d43ff43a4 Fix T96904: texture paint sample tool not working with closest interpolation
For drawing pixel art. Based on patch by Philipp Oeser.
2022-04-05 21:32:03 +02:00
eae36be372 Refactor: Unify vertex and sculpt colors into new
color attribute system.

This commit removes sculpt colors from experimental
status and unifies it with vertex colors. It
introduces the concept of "color attributes", which
are any attributes that represents colors.  Color
attributes can be represented with byte or floating-point
numbers and can be stored in either vertices or
face corners.

Color attributes share a common namespace
(so you can no longer have a floating-point
sculpt color attribute and a byte vertex color
attribute with the same name).

Note: this commit does not include vertex paint mode,
      which is a separate patch, see:
      https://developer.blender.org/D14179

Differential Revision: https://developer.blender.org/D12587
Ref D12587
2022-04-05 11:42:55 -07:00
a3e122b9ae Curves: fix missing updates switching to sculpt mode
This would cause the viewport to draw stale data until a stroke
is done.
2022-04-05 20:00:31 +02:00
fc8bcd26c0 Curves: fix edit mode detection
This adds missing cases to detect edit mode for Curves objects.
Unlike other object types, Curves do not have specific edit data,
rather we edit the original data directly, and rely on `Object.mode`.

For this, `BKE_object_data_is_in_editmode` had to be modified to
take a pointer to the object. This affects two places: the outliner
and the dependency graph. For the former place, the object pointer
is readily available, and we can use it. For the latter, the object
pointer is not available, however since it is used to update edit
mode pointers, and since Curves do not have such data, we can
safely pass null to the function here.

This also fixes the assertion failure that happens when closing a file
in edit mode.

Differential Revision: https://developer.blender.org/D14330
2022-04-05 19:59:20 +02:00
4de704a6df Overlay: Fix edit mode shader compilation after recent commit
This was caused by rBd889762590a4f068aa312879976e98dbd0ee93fc
2022-04-05 18:56:31 +02:00
b84255f590 Curves: Port legacy curve viewport drawing to the new data-block
Instead of using `CurveEval` to draw the curve wire edges, use
the new `Curves` data-block, which is already built as part of
an object's evaluated geometry set whenever there is a
`CurveComponent`.

This means that we can remove `Curve`'s temporary ownership
of `CurveEval` for drawing (added in 9ec12c26f1),
which caused a memory leak as described in T96498.

In my testing this improved performance by around 1.5x during
viewport playback, back to the performance of 3.1 before the
curve data structure transition started.

The next step of using the GPU to do the final curve evaluation
for the viewport is described in T96455, but is unrelated.

Differential Revision: https://developer.blender.org/D14551
2022-04-05 11:36:12 -05:00
edcbf741df Refactor: Evaluate surface objects as mesh components
This commit furthers some of the changes that were started in
rBb9febb54a492 and subsequent commits by changing the way surface
objects are presented to render engines and other users of evaluated
objects in the same way. Instead of presenting evaluated surface objects
as an `OB_SURF` object with an evaluated mesh, `OB_SURF` objects
can now have an evaluated geometry set, which uses the same system
as other object types to deal with multi-type evaluated data.

This clarification makes it more obvious that lots of code that dealt
with the `DispList` type isn't used. It wasn't before either, now it's
just *by design*. Over 1100 lines can be removed. The legacy curve
draw cache code is much simpler now too. The idea behind the further
removal of `DispList` is that it's better to focus optimization efforts
on a single mesh data structure.

One expected functional change is that the evaluated mesh from surface
objects can now be used in geometry nodes with the object info node.

Cycles and the OBJ IO tests had to be tweaked to avoid using evaluated
surface objects instead of the newly exposed mesh objects.

Differential Revision: https://developer.blender.org/D14550
2022-04-05 11:31:18 -05:00
e513687288 Cycles: Fix a few type casting warnings
Stumbled over the `integrate_surface_volume_only_bounce` kernel
function not returning the right type. The others too showed up as
warnings when building Cycles as a standalone which didn't have
those warnings disabled.

Differential Revision: https://developer.blender.org/D14558
2022-04-05 18:09:21 +02:00
f60cffad38 Cycles: Use USD dependencies when building Hydra render delegate
Adds support for linking with some of the dependencies of a USD
build instead of the precompiled libraries from Blender, specifically
OpenSubdiv, OpenVDB and TBB. Other dependencies keep using the
precompiled libraries from Blender, since they are linked statically
anyway so it does't matter as much. Plus they have interdependencies
that are difficult to resolve when only using selected libraries from
the USD build and can't simply assume that USD was built with all
of them.

This patch also makes building the Hydra render delegate via the
standalone repository work and fixes various small issues I ran into
in general on Windows (e.g. the use of both fixed paths and
`find_package` did not seem to work correctly). Building both the
standalone Cycles application and the Hydra render delegate at the
same time is supported now as well (the paths in the USD plugin JSON
file are updated accordingly).

All that needs to be done now to build is to specify a `PXR_ROOT`
or `USD_ROOT` CMake variable pointing to the USD installation,
everything else is taken care of automatically (CMake targets are
loaded from the `pxrTargets.cmake` of USD and linked into the
render delegate and OpenSubdiv, OpenVDB and TBB are replaced
with those from USD when they exist).

Differential Revision: https://developer.blender.org/D14523
2022-04-05 17:23:52 +02:00
190334b47d Curves: new Grow/Shrink brush
This adds a new Grow/Shrink brush which is similar to the Length
brush in the old hair system.
* It's possible to switch between growing and shrinking by hold
  down ctrl and/or by changing the direction enum.
* 3d brush is supported.
* Different brush falloffs are supported.
* Supports scaling curves uniformly or shrinking/extrapolating
  them. Extrapolation is linear only in this patch.
* A minimum length settings helps to avoid creating zero-sized curves.

Differential Revision: https://developer.blender.org/D14474
2022-04-05 15:24:12 +02:00
e40b0d52cf Preferences: enable Duplicate Data for curves and point cloud objects
Those geometry types are expected to behave the same as e.g. mesh
with respect to data copying. The fact that this was not enabled
already was an oversight in the initial commit that added these types.

Differential Revision: https://developer.blender.org/D14554
2022-04-05 15:19:43 +02:00
fc848e9440 Fix T97010 GPencil: Artifacts on Grease Pencil
Was caused by wrong name for uniform update.

Regression introduced in rBeccb0b222e34
2022-04-05 15:08:05 +02:00
d5550c7b2c Fix T97071: Duplicating strip in locked channel creates overlapping strips
Add flag `SEQ_IGNORE_CHANNEL_LOCK` to indicate, that channel lock
should not apply to strip. This flag must be cleared after
transformation.
2022-04-05 14:56:50 +02:00
d889762590 Cleanup: Change globalBlock members to snake case
This avoid conflicting defines in GLSL

Fix T96998 Blender 3.2.0 Alpha crashes on startup
2022-04-05 14:36:53 +02:00
c8d658c5ed Cleanup: Overlays: Remove unused facefill shader 2022-04-05 14:35:36 +02:00
328dfab423 Fix T97003: color-management settings can't be animated
Regression in [0] which missed excluding FRAME_CHANGE from
deg_recalc_flags_for_legacy_zero causing all
DEG_id_tag_update(&scene->id, 0) calls to re-calculate animation data.

When this tagging was done in the RNA update function, changing
key-framed values in the UI would be immediate reset to their
keyed-values.

Thanks to Philipp Oeser for finding the root cause.

[0]: 35aedd87e7
2022-04-05 21:04:46 +10:00
Pratik Borhade
f87029f7b1 Fix T96424: Don't register undo step for empty knife cut
Prevents undo push when no cut has been made.

Reviewed By: campbellbarton

Ref D14329
2022-04-05 20:55:10 +10:00
Pratik Borhade
d00de988c3 WM: avoid unnecessary undo step creation when duplicating
Calling duplicate operation without selecting anything registers an undo
step. If nothing is selected (keyframe, curve, object, etc.), cancel the
operator execution to prevent undo push.

Patch improves following operators:

- ACTION_OT_duplicate
- GPENCIL_OT_duplicate
- GRAPH_OT_duplicate
- MESH_OT_duplicate
- NODE_OT_duplicate
- OBJECT_OT_duplicate

Reviewed By: campbellbarton

Ref D14511
2022-04-05 20:30:00 +10:00
d88b821d28 Fix: wrong operator return value 2022-04-05 12:04:47 +02:00
Alaska
850b887339 Fix T96745: UI: Change "Inverts" to "Invert" for selection tool
This is to improve grammatical consistency with other selection options.

Maniphest Tasks: T96745

Differential Revision: https://developer.blender.org/D14444
2022-04-05 09:24:27 +02:00
Yann Lanthony
7cf3e713f7 Gizmos: enable gizmos for the action space
Support gizmos for the the action space type based on how it is done for
other types of spaces in Blender (e.g: view3d, image).

See patch submission for sample code.

Reviewed By: campbellbarton, sybren

Ref D13999
2022-04-05 17:14:40 +10:00
c1d461bcbc Cleanup: avoid unnecessary undo steps for curves & simplify code
Some edit-curve operators used an 'ok' variable to represent
if the selection was found and if a change was made.

Previously it would only return cancel if an error was shown
causing a redundant undo step to be added without a selection.

Since this is simple behavior that shouldn't need much explanation,
use two variables with meaningful names to avoid confusion.

Reviewing D14511 highlighted this issue.
2022-04-05 13:15:57 +10:00
8333b681a7 Keymap: use "use_tweak_select_passthrough" preference for tweak tool
This experimental preference was not making much difference with
selection set to left-mouse for the 3D view and UV editor. Now dragging
the existing selection is possible when this preference is enabled.
2022-04-05 12:29:34 +10:00
53261df6f0 Fix keymap "use_tweak_tool_lmb_interaction" blocking sequencer scrub
Ignore this experimental preference for the sequencer.
2022-04-05 12:29:32 +10:00
0f530b0b03 Fix T96885: drag fallback on tweak is using active tool instead
Ensure the fallback transforms on drag when used as a fallback.
2022-04-05 12:29:31 +10:00
f2b9bbd194 Fix T97032: Tweak Select preference causes selection issues
Disable select-passthrough on release events.
2022-04-05 12:29:29 +10:00
d5f5788b10 Keymap: remove reference to missing view2d_edge_pan property
This was added [0] but the property is missing in the operator.

[0]: e49fef45ce
2022-04-05 10:24:32 +10:00
1d86d61782 Fix: Assert fails when evaluating single point Bezier curve
Return early when there is only one point,
since that means there are no segments.
2022-04-04 18:42:01 -05:00
43a582a2ab Sequencer: skip redundant F-curve GSet allocation 2022-04-05 09:30:26 +10:00
25a283acce Fix memory leak duplicating sequencer strips
Regression in [0] also skip creating a GSet when there are no F-curves.

[0]: e74420124f
2022-04-05 09:23:14 +10:00
11183ebc3c Fix T97034: tweak strips uses cursor position after threshold reached 2022-04-05 09:11:51 +10:00
e994b72812 UI: move "use_select_nearest_on_first_click" into it's own panel
Add a new panel called "Tweaks" so we can get feedback from users
about minor tweaks to behavior as exposing these minor changes.

Currently this only has a single item in it, however we may want to
get feedback from users about small changes in the future so I'd
prefer to have a place to list these kinds of options.

Ref D14542
2022-04-05 08:51:36 +10:00
521fab080b Cleanup: use doxygen links to struct members 2022-04-05 08:02:01 +10:00
b51d6d5068 Cleanup: clang-format
Also add space below file references.
2022-04-05 08:01:46 +10:00
744369c114 Cleanup: move doc-strings into headers
- The comment for create_normals was moved into an inline note
  as it's not related to the public API.
- Use a colon after parameters.

Ref T92709
2022-04-05 07:49:36 +10:00
22184f3aee Cleanup: spelling in comments 2022-04-05 07:39:40 +10:00
5eab5713c0 Fix T97019: Regression - GPencil Shrinkwrap modifier not longer working
Bug introduced in the smooth function changes done in commit rBd4e1458db3a0e0eaf80219dc8e6d10cb27620793

Differential Revision: https://developer.blender.org/D14548
2022-04-04 22:33:20 +02:00
Germano Cavalcante
0ebcc711fc Fix T95678: Thumbnails are not working with big / large Objects
The internal camera used to render the thumbnails also has to consider
`clip_start` and `clip_end`.

Reviewed By: Severin

Maniphest Tasks: T95678

Differential Revision: https://developer.blender.org/D14138
2022-04-04 16:20:34 -03:00
b5f3f8ef1d Fix collection assets hidden in old files with asset browser open
Make sure the filtering in the Asset Browser doesn't filter out
collection assets.
2022-04-04 17:54:39 +02:00
9eb4cb956b Cleanup: Remove unused function
Unused after 943b919fe8
2022-04-04 10:28:10 -05:00
432ad4c632 Cleanup: Move interface.c to C++
This is similar to 4537eb0c3b
2022-04-04 10:24:14 -05:00
9c962b2e2b Fix T96999: RNA mesh transform does not mark normals dirty 2022-04-04 09:59:45 -05:00
aa1ae1d3c8 Fix overlapping GPU device bitmasks
This did not end up affecting actual behavior, but it is wrong.
Found by Ethan Hall.

Ref D14525
2022-04-04 16:38:30 +02:00
d6f5b02940 OBJ: fix printf specifier compile warning on some compilers 2022-04-04 17:37:13 +03:00
e4289f2360 Fix errors in sequencer channel headers
Failing constraint test uncovered crashes on NULL dereference and
missing channels initialization in `SEQ_editing_ensure()`.
2022-04-04 16:30:16 +02:00
e7f4aa8f0c Fix T96838: Missing translations in link drag search 2022-04-04 08:46:53 -05:00
81b55d7988 Pose library: add deprecation notices
The legacy Pose Library operators now refer to the "Legacy Pose Library",
and their description mentions they are deprecated and will be removed
from Blender 3.3. The same was added to the `Object.pose_library` RNA
property.

Ref: T93405

The removal of these deprecated properties is tracked in T93406.
2022-04-04 15:26:02 +02:00
a824c076b7 Pose library: remove much of old pose library interface
Remove much of the old legacy pose library:
- Remove from the Pose & Armature menus.
- Remove from the default keymap.
- Pose Library panel in Armature properties: Add "(legacy)" to title.
- Add note that the functionality of that panel is obsolete, with a
  button that opens the manual on the chapter of the new pose library.
- Add button to convert the selected legacy pose library to pose assets.
- The rest of the functionality is greyed out to further communicate
  it's been deprecated. It's still functional, though.

Ref: T93405
2022-04-04 14:43:17 +02:00
068d2b0861 Fix T96575: Can't set vertex theme color
UV editor used wire color for drawing unselected vertices.
Add color variable to shader, so theme color can be used.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D14373
2022-04-04 14:28:55 +02:00
e49fef45ce VSE: Use edge panning
Add edge panning feature to transform operator. It works in same way as
in node editor, but Y axis is limited by usable range up to 128
channels.

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D14310
2022-04-04 14:28:55 +02:00
3ce6c5adfc UserDef: Add experimental flag for 3d texturing brush.
This only adds a experimental flag to enable the 3d texturing brush,
so future developments could check. Currently the flag does nothing
as no functionality of the 3d texturing brush has been implemented.
2022-04-04 14:12:33 +02:00
a818a0f427 BlenLib: Add ushort2 to math vec types.
Needed for the 3d texturing brush project.
2022-04-04 14:12:33 +02:00
9c2b5900c0 Move ImageTileWrapper to BKE.
ImageTileWrapper is a wrapper around ImageTile to centralize tile calculations when
using CPP. Currentry used by the image engine and will be used for the 3d
texturing brush project.
2022-04-04 14:12:33 +02:00
a56f53ad56 OBJ: fix mac/linux tests and compile warnings in the new obj importer
Related to D13958
2022-04-04 14:58:45 +03:00
277fa2f441 VSE: Add channel headers
This patch adds channel region to VSE timeline area for drawing channel
headers. It is synchronizedwith timeline region. 3 basic features are
implemented - channel visibility, locking and name.

Channel data is stored in `SeqTimelineChannel` which can be top-level
owned by `Editing`, or it is owned by meta strip to support nesting.
Strip properties are completely independent and channel properties are
applied on top of particular strip property, thus overriding it.

Implementation is separate from channel regions in other editors. This
is mainly because style and topology is quite different in VSE. But
also code seems to be much more readable this way.

Currently channels use functions similar to VSE timeline to draw
background to provide illusion of transparency, but only for background
and sfra/efra regions.

Great portion of this patch is change from using strip visibility and
lock status to include channel state - this is facilitated by functions
`SEQ_transform_is_locked` and `SEQ_render_is_muted`

Originally this included changes in D14263, but patch was split for
easier review.

Reviewed By: fsiddi, Severin

Differential Revision: https://developer.blender.org/D13836
2022-04-04 12:56:43 +02:00
5a0b4e97e6 Fix memleak in VSE proxy creation.
We didn't properly free allocated ffmpeg data structures.
2022-04-04 12:43:54 +02:00
e6a9b22384 OBJ: New C++ based wavefront OBJ importer
This takes state of soc-2020-io-performance branch as it was at
e9bbfd0c8c (2021 Oct 31), merges latest master (2022 Apr 4),
adds a bunch of tests, and fixes a bunch of stuff found by said
tests. The fixes are detailed in the differential.

Timings on my machine (Windows, VS2022 release build, AMD Ryzen
5950X 32 threads):

- Rungholt minecraft level (269MB file, 1 mesh): 54.2s -> 14.2s
  (memory usage: 7.0GB -> 1.9GB).
- Blender 3.0 splash scene: "I waited for 90 minutes and gave up"
  -> 109s. Now, this time is not great, but at least 20% of the
  time is spent assigning unique names for the imported objects
  (the scene has 24 thousand objects). This is not specific to obj
  importer, but rather a general issue across blender overall.

Test suite file updates done in Subversion tests repository.

Reviewed By: @howardt, @sybren
Differential Revision: https://developer.blender.org/D13958
2022-04-04 13:36:10 +03:00
ee3f71d747 Functions: allow for better compiler optimization
This extracts the inner loops into a separate function.
There are two main reasons for this:
* Allows using `__restrict` to indicate that no other parameter
  aliases with the output array. This allows for better optimization.
* Makes it easier to search for the generated assembly code,
  especially with the `BLI_NOINLINE`.
2022-04-04 11:57:58 +02:00
992d51bbcf Cleanup: Simplify zero-initializing DNA structures in C++
Avoids duplication of type which previously was specified twice in a line.
2022-04-04 11:47:28 +02:00
e5688f67aa Cleanup: Left-over debug print in own recent commit.
Kudos to Aaron Carlisle (@Blendify) for noticing it!
2022-04-04 11:36:39 +02:00
5dbd6968a6 Cleanup: clang-tidy 2022-04-04 15:43:25 +10:00
f699dbba86 Cleanup: use event parameters for functions that create key-map items
Replace 5 arguments with a single struct as the same arguments
are used in many places.

This didn't read well and was confusing with both arguments named
`val` & `value` in the case of WM_modalkeymap_add_item.
2022-04-04 14:32:42 +10:00
0ef96cd392 Cleanup: ensure space after file named in headers
Add blank lines after file references to avoid them being interpreted as
doc-strings the following declarations.
2022-04-04 13:34:42 +10:00
dc5b1d6c75 Cleanup: pass selection threshold to curve picking
Remove the extended version of ED_curve_editnurb_select_pick,
pass the size threshold directly to this function but as the distance in
pixels instead of a multiplier for ED_view3d_select_dist_px.

Using a multiplier is a less direct way to reference the threshold.
2022-04-04 13:11:44 +10:00
ff82bb5e3a Curve Pen Tool: set the first newly added points active
Other newly created points were already active, just not for newly
created curves.
2022-04-04 12:55:56 +10:00
0cb9926cd9 Fix crash removing the last point of a spline with the new pen tool 2022-04-04 12:42:11 +10:00
e26cc6aee3 Cleanup: indentation 2022-04-04 12:35:33 +10:00
85a0115c44 Cleanup: spelling in comments 2022-04-04 12:35:33 +10:00
27fea7a3a5 Cleanup: clang-format
Add ccl_gpu_kernel_postfix as a statement macro to prevent the following
declarations from being indented.
2022-04-04 12:35:33 +10:00
f6a20fca5e Cleanup: compiler warnings 2022-04-04 12:35:33 +10:00
637fe6f5ff Fix T97001: Grease pencil array modifier relative offset broken
This has been broken for two years, since rB29f3af952725,
which retrieved the bounding box from an object and immediately
overwrote it with -1, 1. That commit had another problem though--
the modifier stack shouldn't use object level data, it should use
data from the previous modifier.

Differential Revision: https://developer.blender.org/D14524
2022-04-03 12:57:37 -05:00
933d56d9e9 Curves: Support set origin and apply transform operators
Add support for the Curves object to the "Set Origin" and "Apply Object
Tansform" operators. Also change the automatic handle calculation to
avoid adding Bezier attributes if they don't need to be added.

Differential Revision: https://developer.blender.org/D14526
2022-04-03 12:54:42 -05:00
f6baba695c Curves: Inline some simple methods
These functions are very simple, but some of them were showing up in
in profiles for curves sculpt mode and various curve nodes. Making sure
they are inlined will allow avoiding the compiler to optimize this logic
much better.

Differential Revision: https://developer.blender.org/D14529
2022-04-03 12:51:05 -05:00
Dilith Jayakody
336082acba Curves: Curve Pen
This tool can be used to rapidly edit curves. The current set of
functionalities for Bezier splines are as follows:

The functionalities are divided into three versions of the operator:
* Left-Click
* Ctrl + Left-Click
* Double Click

All current functionalities and their defaults are as follows:
* Extrude Point: Add a point connected to an existing point.
Enabled for Left-Click.
* Extrude Handle Type: Type of the handles of the extruded points.
Can be either Vector or Auto. Defaults to Vector.
* Delete Point: Delete existing point.
Enabled for Ctrl + Left-Click.
* Insert Point: Insert a point into a curve segment.
Enabled for Ctrl + Left-Click.
* Move Segment: Move curve segment.
Enabled for Left-Click.
* Select Point: Select a single point or handle at a time.
Enabled for Left-Click.
* Move point: Move existing points or handles.
Enabled for Left-Click.
* Close Spline: Close spline by clicking the endpoints consecutively.
Defaults to True.
* Close Spline Method: The condition for Close Spline to activate.
Can be one of None, On Press or On Click.
Defaults to On Click for Left-Click and None for the others.
  * None: Functionality is turned off.
  * On Press: Activate on mouse down.
  This makes it possible to move the handles by dragging immediately
  after closing the spline.
  * On Click: Activate on mouse release.
  This makes it possible to avoid triggering the Close Spline
  functionality by dragging afterward.
* Toggle Vector: Toggle handle between Vector and Auto handle types.
Enabled for Double Click on a handle.
* Cycle Handle Type: Cycle between all four handle types.
Enabled for Double Click on the middle point of a Bezier point.

The keybindings for the following functionalities can be adjusted from
the modal keymap
* Free-Align Toggle: Toggle between Free and Align handle types.
Defaults to Left Shift. Activated on hold.
* Move Adjacent Handle: Move the closer handle of the adjacent vertex.
Defaults to Left Ctrl. Activated on hold.
* Move Entire: Move the entire point by moving by grabbing on the handle
Defaults to Spacebar. Activated on hold.
* Link Handles: Mirror the movement of one handle onto the other.
Defaults to Right Ctrl. Activated on press.
* Lock Handle Angle: Move the handle along its current angle.
Defaults to Left Alt. Activated on hold.

All the above functionalities, except for Move Segment and
those that work with handles, work similarly in the case of Poly
and NURBS splines.

Reviewed By: HooglyBoogly, weasel, campbellbarton
Differential Revision: http://developer.blender.org/D12155
2022-04-03 22:37:22 +05:30
1cdf8b19e5 Fix T96957: creating paint curve crashes
This was essentially double free due to a dangling pointer,
because `op->customdata` was not properly set to null after
the paint stroke was freed.
2022-04-03 10:49:20 +02:00
be699936af Cleanup: Move interface View2D files to C++
Similar to 4537eb0c3b
2022-04-03 00:00:42 -05:00
79ff65d07b Fix T96978: Objects that emit light do not appear in light groups
The initial commit only wrote direct and indirect lighting into the lightgroup passes,
but not rays that directly hit the light source itself.
2022-04-02 23:46:22 +02:00
4537eb0c3b Cleanup: Remove interface region files to C++
Moves all `interface_region*` files to C++ except for the tooptip region
which is slightly more complicated. Also move a few other files as well.
This helps to simplify and speed up code, especially through the use
of better C++ data structures. This change builds on all platforms on
the buildbot.
2022-04-02 16:17:48 -05:00
Alaska
351c00d29a Fix T96973: Re-add Cycles shading menu to lights
This patch re-adds the shading menu to lights to allow people to use lights in light groups.
This patch also hides all settings in the shading menu that are not useful for the light object.

Reviewed By: lukasstockner97

Maniphest Tasks: T96973

Differential Revision: https://developer.blender.org/D14527
2022-04-02 22:42:57 +02:00
a567bef5cc Fix: Assert with set origin operation and single active object
Array has bounds checking that a raw pointer didn't have before.
2022-04-01 23:22:51 -05:00
ad35453cd1 Cycles: Add support for light groups
Light groups are a type of pass that only contains lighting from a subset of light sources.
They are created in the View layer, and light sources (lamps, objects with emissive materials
and/or the environment) can be assigned to a group.

Currently, each light group ends up generating its own version of the Combined pass.
In the future, additional types of passes (e.g. shadowcatcher) might be getting their own
per-lightgroup versions.

The lightgroup creation and assignment is not Cycles-specific, so Eevee or external render
engines could make use of it in the future.

Note that Lightgroups are identified by their name - therefore, the name of the Lightgroup
in the View Layer and the name that's set in an object's settings must match for it to be
included.
Currently, changing a Lightgroup's name does not update objects - this is planned for the
future, along with other features such as denoising for light groups and viewing them in
preview renders.

Original patch by Alex Fuller (@mistaed), with some polishing by Lukas Stockner (@lukasstockner97).

Differential Revision: https://developer.blender.org/D12871
2022-04-02 06:14:27 +02:00
5387d33e5f Cleanup: Further use of const for object bounding boxes
Also solves two warnings from the previous similar commit,
f688e3cc31. The change to the grease pencil
modifier is quite suspicious, but doesn't change the behavior,
which was already broken.
2022-04-01 18:30:09 -05:00
69c07adb51 Cleanup: Remove object bounding box function
This abstraction doesn't serve any purpose after 11c6d4e88e.
The flag on bounding boxes isn't used, except for the dirty tag.
2022-04-01 14:58:32 -05:00
59c3194f8e Cleanup: Use float3 type
This can help make some refactoring to bounding boxes slightly easier.
2022-04-01 14:48:48 -05:00
11c6d4e88e Cleanup: Remove unused boundbox flag
This flag hasn't been used for around four years. The convention in this
header seems to be commenting out the flag and adding "UNUSED" after it.
2022-04-01 13:55:17 -05:00
f688e3cc31 Cleanup: Use const for bounding boxes where possible 2022-04-01 13:45:02 -05:00
999f6526b1 Fix compiler error when building without USD and alembic 2022-04-01 20:12:09 +02:00
Stefan Werner
65dcb5ebd3 Cycles: Semantically separate 2D and 3D texture objects
Currently there are no functional changes.

Preparing for an upcoming oneAPI integration where such separation
in types is needed.
2022-04-01 19:44:31 +02:00
Stefan Werner
9c6dff70c8 Cycles: Introduce postfix for kernel body definition
Increases flexibility of code-generation for kernel entry points.

Currently no functional changes, preparing for integration with oneAPI.
2022-04-01 19:44:02 +02:00
Stefan Werner
542c03fed5 Cycles: Use single floating point precision sine/cosine in sky
Should be no functional changes.
2022-04-01 19:43:34 +02:00
Stefan Werner
633c8fc3c8 Cycles: Optimize Nishita sky
Reduce register pressure.
Helps with kernel compile time and render time.

Should be no functional changes.
2022-04-01 19:42:00 +02:00
8bec875586 install_deps: Update Embree to 3.13.3 and OIDN to 1.4.3.
Re {T95206}.
2022-04-01 17:47:15 +02:00
Olivier Maury
1fb0247497 Cycles: approximate shadow caustics using manifold next event estimation
This adds support for selective rendering of caustics in shadows of refractive
objects. Example uses are rendering of underwater caustics and eye caustics.

This is based on "Manifold Next Event Estimation", a method developed for
production rendering. The idea is to selectively enable shadow caustics on a
few objects in the scene where they have a big visual impact, without impacting
render performance for the rest of the scene.

The Shadow Caustic option must be manually enabled on light, caustic receiver
and caster objects. For such light paths, the Filter Glossy option will be
ignored and replaced by sharp caustics.

Currently this method has a various limitations:

* Only caustics in shadows of refractive objects work, which means no caustics
  from reflection or caustics that outside shadows. Only up to 4 refractive
  caustic bounces are supported.
* Caustic caster objects should have smooth normals.
* Not currently support for Metal GPU rendering.

In the future this method may be extended for more general caustics.

TECHNICAL DETAILS

This code adds manifold next event estimation through refractive surface(s) as a
new sampling technique for direct lighting, i.e. finding the point on the
refractive surface(s) along the path to a light sample, which satisfies Fermat's
principle for a given microfacet normal and the path's end points. This
technique involves walking on the "specular manifold" using a pseudo newton
solver. Such a manifold is defined by the specular constraint matrix from the
manifold exploration framework [2]. For each refractive interface, this
constraint is defined by enforcing that the generalized half-vector projection
onto the interface local tangent plane is null. The newton solver guides the
walk by linearizing the manifold locally before reprojecting the linear solution
onto the refractive surface. See paper [1] for more details about the technique
itself and [3] for the half-vector light transport formulation, from which it is
derived.

[1] Manifold Next Event Estimation
Johannes Hanika, Marc Droske, and Luca Fascione. 2015.
Comput. Graph. Forum 34, 4 (July 2015), 87–97.
https://jo.dreggn.org/home/2015_mnee.pdf

[2] Manifold exploration: a Markov Chain Monte Carlo technique for rendering
scenes with difficult specular transport Wenzel Jakob and Steve Marschner.
2012. ACM Trans. Graph. 31, 4, Article 58 (July 2012), 13 pages.
https://www.cs.cornell.edu/projects/manifolds-sg12/

[3] The Natural-Constraint Representation of the Path Space for Efficient
Light Transport Simulation. Anton S. Kaplanyan, Johannes Hanika, and Carsten
Dachsbacher. 2014. ACM Trans. Graph. 33, 4, Article 102 (July 2014), 13 pages.
https://cg.ivd.kit.edu/english/HSLT.php

The code for this samping technique was inserted at the light sampling stage
(direct lighting). If the walk is successful, it turns off path regularization
using a specialized flag in the path state (PATH_MNEE_SUCCESS). This flag tells
the integrator not to blur the brdf roughness further down the path (in a child
ray created from BSDF sampling). In addition, using a cascading mechanism of
flag values, we cull connections to caustic lights for this and children rays,
which should be resolved through MNEE.

This mechanism also cancels the MIS bsdf counter part at the casutic receiver
depth, in essence leaving MNEE as the only sampling technique from receivers
through refractive casters to caustic lights. This choice might not be optimal
when the light gets large wrt to the receiver, though this is usually not when
you want to use MNEE.

This connection culling strategy removes a fair amount of fireflies, at the cost
of introducing a slight bias. Because of the selective nature of the culling
mechanism, reflective caustics still benefit from the native path
regularization, which further removes fireflies on other surfaces (bouncing
light off casters).

Differential Revision: https://developer.blender.org/D13533
2022-04-01 17:45:39 +02:00
253e4e7ed2 Assets: Enable collection assets (no longer experimental)
With automatic collection previews (810e225c26) and a toggle for
collection instancing (previous commit) supported, there are no known
blocking issues for collection assets. There are still further
improvements to come as part of regular developemt (e.g. bounding box
based snapping).
2022-04-01 16:51:29 +02:00
eb1ede5693 Assets: Instancing operator option for collection asset dropping
Makes it possible to toggle instancing via the "Adjust Last Operation"
panel after dropping a collection asset into the viewport.

A design task that puts this into more context is pending still, but
this is a useful option to have either way.

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

Reviewed by: Bastien Montagne
2022-04-01 16:44:52 +02:00
1de051a7a9 install_deps: Updated Alembic to 1.8.3 and OSD to 3.4.4.
Re {T95206}.
2022-04-01 16:43:29 +02:00
e81d7bfcc9 Cycles: enable Alembic procedural for final renders
The Alembic procedural was only enabled during viewport renders
originally because it did not have any caching strategy. Now that
is does, we can allow its usage in final renders.

This also removes the `dag_eval_mode` argument passing to
`ModifierTypeInfo.dependsOnTime` which was originally added to detect if
we are doing a viewport render for enabling the procedural.

Differential Revision: https://developer.blender.org/D14520
2022-04-01 16:30:45 +02:00
5c80543c43 Cleanup: Move geometry set fields to a separate header
This commit moves declarations that depend on `FN_field.hh` out of
`BKE_geometry_set.hh` into `BKE_geometry_fields.hh`. This helps to
reduce the number of areas that need to depend on the functions module,
which recently came in in review of D11591.

In the future we may have a library of standard field inputs in order to
make composing algorithms easier, so it makes sense to have a header
that could contain them and some basic related utilities relating the
concepts of geometry and fields.

Reducing use of unnecessary headers may also reduce compilation time.

Differential Revision: https://developer.blender.org/D14517
2022-04-01 08:40:45 -05:00
3ecdfd0938 Geometry Nodes: Add search to named attribute input node
This commit adds attribute search the the attribute input field node.
Because it's a field node, finding which attribute to display without
increasing the complexity a lot isn't obvious. In this commit, all
attributes used by nodes in the current group are included.

When an attribute is chosen from the list, the node's data type is
updated, and links connected to the output socket are reconnected.

Ref T96271

Differential Revision: https://developer.blender.org/D14516
2022-04-01 08:33:03 -05:00
00ba51d37b Geometry Nodes: Port set handle nodes to new data-block
This commit ports the "Set Handle Positions" and "Set Hanle Type"
nodes to use the new curves data-block. The nodes become simpler
and likely much faster too, though they're usually not the bottleneck
anyway.

Most of the code is ported from `BezierSpline` directly. The majority
of the complexity comes from the interaction between different
automatically calculated handle types. In comparison `BezierSpline`,
the calculation of auto handles is done eagerly-- mostly because it's
simpler. Eventually lazy calculation might be good to add.

Differential Revision: https://developer.blender.org/D14464
2022-04-01 08:12:41 -05:00
a250d3d1b7 Fix compositor memory leak after recent color management changes 2022-04-01 15:04:18 +02:00
d120a083da Fix T96763: New OBJ Exporter Incorrectly saving the materials in the MTL file
Original report (T96763) only reported the issue of double-space before the texture path, but while adding test coverage I found some other issues that I fixed while at it:

- Incorrectly emits two spaces between `map_Xx` keyword and the texture path, leading to some 3rd party software not finding the textures,
- Emissive texture map (`map_Ke`) was not exported,
- When Mapping node is used on the texture UVs, the "Location" and "Scale" values were mixed up (location written as "scale", scale written as "location).

Added gtest coverage.

Reviewed By: Howard Trickey

Differential Revision: https://developer.blender.org/D14519
2022-04-01 14:59:19 +03:00
b073f58a8e Fix T96930: Cloth Disk cache not being saved and being deleted on files that have been linked and library override enabled.
PointCache handing is just horrible from RNA, makes dealing with
overrides a nightmare...

Ended up having to add a specific 'apply' callback for the `use_disk_cache`
property, that would explicitely NOT call the the `update` callback of
this property, to avoid having the whole disk cache nuked away...

But the whole thing remains fairly britle, to say the least.
2022-04-01 12:41:59 +02:00
1264142f78 LibOverride: RNA Apply: let apply function responsible for calling update or not on overridden properties.
While this is the desired behavior in almost cases, there are a few
hairy nightmares that may require not to do so.

NOTE: this change should should not modify any current behavior at all.
2022-04-01 12:35:25 +02:00
d34c4089f1 Fix T96931: Crash on load with library overrides + multiple cloth cache slots.
Not really clear why that would only show with multiple caches... But
point cache system is beyond brittle anyway.

This fix solves the issue at two different levels:
* General safety check in `rna_Cache_info_length` that we do get a valid
  `pid`.
* Forbid usage of this `PointCache.info` RNA property in any
  diffing/LibOverride processing (since it's by definition runtime, volatile
  data).
2022-04-01 11:05:30 +02:00
9a67f9173b Cleanup: Improve variable naming
The variable `ofs` in `widget_numslider` was referring to the radius.
`rad` is more clear and consistent with the other widget functions.
2022-04-01 07:05:50 +02:00
aab9047f9d Fix T88785: Keep value slider from clipping
Keep the value slider from clipping through rounded corners for
low values by ensuring the width of the slider rectangle is at least
twice the corner radius.

Reviewed By: Hans Goudey

Differential Revision: https://developer.blender.org/D11474
2022-04-01 06:51:22 +02:00
42853bacc9 GPencil: Fix regression with dots uvs
This was introduced by rBeccb0b222e3465baa71430223c5ee2f0206a7b02.
2022-03-31 19:14:31 +02:00
ce5428b294 install_deps: Update OCIO to 2.1.1 and OIIO to 2.3.13.
Re {T95206}.
2022-03-31 17:40:37 +02:00
59681a7ccd install_deps: Update openVDB to 9.0.
Re {T95206}.
2022-03-31 16:56:34 +02:00
3d5085375f install_deps: default boost version to 1.78 and TBB to 2020_U3.
Re  T95206.
2022-03-31 16:25:02 +02:00
ca28f376f7 OBJ: mark the new 3.1+ exporter as experimental for now
While it still has known issues/bugs/limitations. Also do not make it the very first export menu item, while at it.

Differential: D14512
2022-03-31 16:15:02 +03:00
4c1393c202 Fix T76746: Alembic, wrong result importing back exported curves
In Alembic curve topology is stored with an array of values describing
how many points each sub-curve has. Instead of writing the number of
points for the current curve, the Alembic exporter would write the
accumulated number of points.

This error has existed since the initial implementation.
2022-03-31 15:01:27 +02:00
eb4155cc1e Fix T94888: LineArt use the same triangulation as viewport.
This fixes inconsistencies between line art output and viewport triangulation result.
2022-03-31 21:00:26 +08:00
2f7171622d DRW: Rename DRW_shgroup_uniform_vec4_array_copy to mat4_copy
This function was not used for anything other than mat4. This
was because of a limitation of the DRW module/
This makes it cleaner for the GLSL and also less tempting to use
it for other unconventional purpose.
2022-03-31 13:48:17 +02:00
ca37654b63 Fix T96920 DRW: Regression: Hair strands are drawn in wrong place
This was caused by the recent changes made to the way we handle matrix
copies. The matrix copy assumed that the uniform iteration was the same
as creation order. But this was far from true. The reality was that
the iterator was reverse for `unichunk` but not for `unichunk->uniforms`
so this was recreating wrong matrix.

I rewrote this part to always use reverse iteration and fix the
copy destination.

Also I simplified the code making the assumption this won't be used for
anything else than mat4.
2022-03-31 13:36:04 +02:00
0c6dc7c59e Outliner: New "Hierarchies" view mode for Library Overrides
Adds a dropdown for the Library Overrides display mode that lets users
choose between a "Properties" and a "Hierachies" view mode. The former
is what was previously there (a mode that displays all overridden
properties with buttons to edit the values), the latter is new. It
displays the hierarchical relationships between library overridden
data-blocks. E.g. to override the mesh of an object inside a linked
collection, the entire collection > object > mesh hierarchy needs to be
overridden (whereby the former two will be automatically overridden
using system overrides).
The Hierarchies mode will also show the override hierarchies of
data-blocks that were linked and are overridden in the source file. This
information is useful to have, especially for debugging scenes.

Part of T95802.

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

Reviewed by: Bastien Montagne
2022-03-31 12:21:14 +02:00
2202259e9c Fix T96909: crash when assigning new node group to group node
The node group returned by `bpy.data.node_groups.new(...)` was not
updated properly.
2022-03-31 11:57:45 +02:00
dc73c71b3b Fix T96915: GPU subdivision modifier: Smooth Shade doesn't work
Simple error in an earlier commit, the flags should be or-ed.
2022-03-31 11:52:46 +02:00
7e54f5c218 Cleanup: make format 2022-03-31 11:00:42 +02:00
0d223f6aca Cleanup: Unused variable in release build warning 2022-03-31 09:26:46 +02:00
92f2b77e78 Cleanup: Compilation warnings in gpencil code after DNA C++ changes
Direct replacement of code:
- memcpy of a single point is done as a shallow_copy() assignment.
- memcpy of a range of points is done with an explicit cast to void*
  to tell compiler that we really want to memcpy even a non-trivial
  type.

In some cases it seems that memcpy can be used more (points are copied
in a loop). Those left as-is since this is supposed to be a simple
cleanup.

Differential Revision: https://developer.blender.org/D14505
2022-03-31 09:18:21 +02:00
ae1f8315f7 Depsgraph: minor optimization in order of checks
Checking BKE_image_user_id_has_animation loops over ID users
which never needs to run for material & world data-blocks.
2022-03-31 13:07:14 +11:00
3d132ead50 Cleanup: spelling, trailing space for comment-blocks 2022-03-31 13:01:41 +11:00
41ee5382f6 Cleanup: Remove unnecessary namespace specification 2022-03-30 20:55:40 -05:00
762d3a48e8 Cleanup: Avoid storing pointers for attribute search callback
It's better to use some local/stable identifiier to avoid relying on
the data not being freed in between creating the search menu and
the exec function. This is similar to c473b2ce8b.
2022-03-30 20:54:11 -05:00
Gilberto Rodrigues
49858bf526 UI: Fix outliner and buttons icons alignment
029cf23d71 changed some icons alignment, but after 9be49a1069
the icons don't align anymore. This commit reverts 029cf23d71 and
also makes a couple of other outliner icons left aligned, instead of
right aligned, for consistency and general alignment.

Differential Revision: https://developer.blender.org/D14501
2022-03-30 18:57:24 -05:00
8466fd4bd1 Cleanup: Curves draw cache renaming, use references
Also change some remaining cases of "hair object" to "curves object".
2022-03-30 18:25:06 -05:00
4edde244da Nodes: Cut hidden links when creating node groups
Add a check to the creation of node groups to remove hidden links
that are connected to the outside of the node group. This avoids
creating sockets in the group's interface that aren't (visibly)
connected to anything within the node group.

Reviewed By: Jacques Lucke, Hans Goudey

Differential Revision: https://developer.blender.org/D14249
2022-03-30 23:07:11 +02:00
2670032038 UI: Improve node editor dot background
This commit makes the dot grid used as background in the node editor
more visually stable when zooming in and out.

The dot grid now uses a continuously subdividing pattern, where
each level of subdivision divides the previous five times, similar to
the line grid in the 3D viewport.

The maximum for the "Grid Levels" theme setting is changed to 3, since
any further subdivisions are too small to be visible.
The "Grid Levels" value for the default themes "Blender Dark" and
"Blender Light" is therefore changed to 3, as well.

Reviewed By: Hans Goudey, Pablo Vazquez

Differential Revision: http://developer.blender.org/D13302
2022-03-30 21:21:57 +02:00
Jason Fielder
922d53a791 Metal: Adding alternative support for GPU_PRIM_TRI_FAN/LINE_LOOP For Metal backend.
- Metal uniform array compatibility in DRW module.
- Guard OpenGL-specific workarounds and flushes behind GPU_type_matches_ex API guard. Add further render boundaries for render paths called outside of the main loop.

Authored by Apple: Michael Parkin-White

Ref: T96261

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D14438
2022-03-30 20:31:12 +02:00
84fde382e4 Fix T85689: Assume Win32 Volumes are Valid
Skip validation when inserting items into the Win32 "Volumes" list.
This fixes some long hangs when launching Blender with disconnected
network shares.

See D14506 for more details.

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

Reviewed by Brecht Van Lommel
2022-03-30 11:10:15 -07:00
Jason Fielder
49bc640b76 Metal: GLSL Shader compatibility 5
MSL does not have an implicit global scope, this is emulated via macro's adding an indirection for uniforms, attributes, shader stage inputs and outputs such as:

#define roughness shaderinst->roughness.

Variables in GLSL which exist within uniform blocks can be directly referenced via the global scope, unlike standard C++. This means that variable name pollution occurs if subsequent local variables in the code use the same name, resulting in compilation errors.

A number of these conflicting names have been renamed to ensure unique naming and no further scope pollution.

Ref T96261

Reviewed By: fclem

Maniphest Tasks: T96261

Differential Revision: https://developer.blender.org/D14452
2022-03-30 19:53:22 +02:00
Jason Fielder
7c9e128bbf Metal: GLSL Compatibility - explicit mat4_to_mat3 conversion
Explicit constructor for mat3 from a mat4 is not valid and cannot be overloaded.

Adding explicit texture resource type flags for depth textures. This is an explicit requirement for Metal Shading language. This is a temporary compatibility, as this path is already supported in GPU_SHADER_CREATE_INFO under ImageType::DEPTH_2D, though required in shader source for MSL shaders which do not have create info.

Authored by Apple: Michael Parkin-White

Ref T96261

Reviewed By: fclem

Maniphest Tasks: T96261

Differential Revision: https://developer.blender.org/D14418
2022-03-30 19:47:00 +02:00
60a6fbf5b5 Curves: Port resample node to the new data-block
This commit re-implements the resample curve node to use the new curves
type instead of CurveEval. The largest changes come from the need to
keep track of offsets into the point attribute arrays, and the fact
that the attributes for all curves are stored in a flat array.

Another difference is that a bit more of the logic is handled by
building of the field network inputs. The idea is to let the field
evaluator handle potential optimizations while making the rest of the
code simpler.

When resampling 1 million small poly curves,the node is about 6
times faster compared to 3.1 on my hardware (500ms to 80ms).

This also adds support for Catmull Rom curve inputs.

Differential Revision: https://developer.blender.org/D14435
2022-03-30 10:37:39 -05:00
ba28c10199 Fix T96344: edit mode GPU subdivision crashes with X-ray mode and modifiers
The crash happens because the origindex layers created as part of
the modifier stack evaluation are not set in the `MeshRenderData` when
they should have been.

This is because when selecting in X-ray mode, a subdivision wrapper
is created to ensure that selection happens with a subdivided
geometry, and this replaces the `MDATA` wrapper which is also used to
setup the `MeshRenderData`.

As we do not seemingly have an `MDATA` wrapper, the draw code decides
that we can extract draw buffers directly from the BMesh, instead of
the mapped Mesh with origin indices layers.

To fix this, we should also consider to use mapped extraction if a
subdivision wrapper exists on the mesh.

Differential Revision: https://developer.blender.org/D14485
2022-03-30 17:31:40 +02:00
9b9fda2122 Overlay: Port Armature shader to ShaderCreateInfo
Should have no regression.
2022-03-30 15:50:06 +02:00
883326040e GL: Fix Invalid enum error on Apple Silicon
Guard shader storage related gets and bypass a buggy enum.

Fix T95592 OpenGL Invalid Enum
2022-03-30 15:50:05 +02:00
05a77bb0d8 Overlay: Port Edit Mode shaders to ShaderCreateInfo
This should have no regression.
2022-03-30 15:50:05 +02:00
4cd409ca98 DRW: Port draw_common.c to use shared definition with GLSL
# Conflicts:
#	source/blender/draw/intern/draw_common_shader_shared.h
#	source/blender/draw/intern/shaders/draw_view_info.hh
2022-03-30 15:50:05 +02:00
fb524d1675 GPUShaderCreateInfo: Add DepthWrite option
This option lets specify explicitely how the fragment shader will change
the fragment's depth.
2022-03-30 15:13:25 +02:00
5aa81594e6 GPU: ShaderBuilder: Remove do_static_compilation_ inheritance
This is because the inheritance is not done before checking if the shader
should be statically compiled. Also some inheritance scheme
might have intermediate permutation that are not compilable.
2022-03-30 15:13:25 +02:00
Pratik Borhade
66010b6deb Add soft limit for Bevel segments in modifier.
The recent change to allow a max segments of 1000 in the modifier
causes a lag when dragging or wheeling in the segments box.
This change makes the soft limit back to 100, but you can still
type numbers up to 1000 in the box.

Reviewed By: Howard Trickey
Differential Revision: https://developer.blender.org/D14477
2022-03-30 08:51:20 -04:00
9c3adb789a GPU: ShaderBuilder: Fix compilation on non-Mac platform
Regression introduced in rB664eb1936946a077498a17c22576763c664e3186
2022-03-30 14:02:11 +02:00
ecafa4c27c Compositor: Fix Missing output UI for Normal node
There were multiple issues at hand here:

- The default value has been changed to `{0, 0, 1}` see: rB25f1783673de636a6f0ca4457df8c05bc685981a
- The output needs the subtype set `PROP_DIRECTION`
- The noder properties were missing in `node_composit_set_butfunc`

Fixes T96860
2022-03-30 08:00:23 -04:00
3656e66ac2 Curves: support converting curves to legacy hair system
This adds a new operator that converts all selected curves objects
into hair particle systems on their respective surface objects. Existing
particle systems with the correct name are updated, otherwise a new
particle system is added.

The purpose of the operator is the make the new curve sculpting tools
useful even before all functionality is ported over from the old hair system.

The operator can be found in the `Object > Convert` menu in object mode,
when a curves object is active.

Differential Revision: https://developer.blender.org/D14441
2022-03-30 13:29:49 +02:00
9b25fafbec Cleanup: Left over from review of apply transform
I miss the review notes about this for the
8621fdb10d commit.
2022-03-30 12:24:46 +02:00
ebb49ddd83 GPencil: Fix double-free issue in update cache
When a `GPencilUpdateCacheNode` is created, it always allocates the
`children` pointer. This should not be freed until the whole cache is
deleted.
The `cache_node_update` would free the `children` pointer in a specific
case, causing a double-free later when the cache was removed.
2022-03-30 11:41:27 +02:00
8621fdb10d Apply Object Transform: Multi-user data support
The current behaviour is to prevent multi-user data from having its
transformation applied.

However in some particular cases it is possible to apply them:
* If all the users of the multi-user data are part of the selection.
* If not all the users are in the selection but the selection is made
single-user.

The active object is used as reference to set the transformation of the
other selected objects.

Note: For simplicity sake, this new behaviour is only available if all
the selection is using the same data.

Differential Revision: https://developer.blender.org/D14377
2022-03-30 11:07:57 +02:00
35f34a3cf8 Modifiers: Support applying modifiers for multi-user data
The current behaviour is to prevent multi-user data from having its
modifier applied.

Instead, with this patch, we now warn the user that if they want to
proceed the object will be made single-user.

Note that this only makes the object data single-user. Not the material
or actions.

As a future step we can apply the same behaviour for the Grease Pencil modifiers

Differential Revision: https://developer.blender.org/D14381
2022-03-30 11:06:10 +02:00
218bcff32d Iterator to loop over objects based on a flag 2022-03-30 11:06:01 +02:00
0f94c99ee7 Cleanup: clang-format 2022-03-30 18:02:59 +11:00
a8ec7845e0 Cleanup: use "num" as a suffix in: source/blender/blenlib
Also replace "num" with:
- "number" when it's not used to denote the number of items.
- "digits" when digits in a string are being manipulated.
2022-03-30 18:01:22 +11:00
af3aaf8034 Cleanup: use "num" as a suffix in: source/blender/gpencil_modifiers 2022-03-30 17:41:34 +11:00
e26c89cd76 Fix: Failing curves test after recent commit
87e9451d66 missed updating the behavior for Catmull Rom curves.
2022-03-29 23:39:03 -05:00
e74880a659 Cleanup: use utility function to initialize SelectPick_Params 2022-03-30 15:03:12 +11:00
0f33f0de00 Fix leak transforming in the node-editor without a selection 2022-03-30 14:05:33 +11:00
573b78b351 Cleanup: remove redundant lattice de-selection 2022-03-30 13:18:46 +11:00
Aleksi Juvani
eddffdd398 Cleanup: Move UV edit parameterize code to geometry module
This will allow reusing it elsewhere, such as in a geometry node.

Differential Revision: https://developer.blender.org/D14453
2022-03-29 20:57:59 -05:00
4a93c4bf1d Geometry Nodes: Remove soft min from extrude node scale
Extusion with a negative offset is possible and expected.
2022-03-29 20:46:41 -05:00
2499768e07 Keymap: "Mouse Select & Move" now uses click to de-select others
While it's useful for click-drag to leave the selection as-is
(when clicking on items that are already selected), it's useful
for a single click to de-select all other elements.

This also removes the need for the initial selection to set the object
as active since this is possible by clicking on it.
2022-03-30 12:34:14 +11:00
400ea40dca Curves: Port curves total length node to the new data-block
Ref T95443
2022-03-29 20:24:41 -05:00
62334c6ee4 Curves: Port length node to the new data-block
Ref T95443
2022-03-29 20:17:35 -05:00
f4f89a76a8 Curves: Port parameter node to the new data-block
Using the evaluated lengths cache from 72d25fa41d, re-implement
the curve parameter node with the new data structure. Conceptually
it works the same way, but the code is restructured and cleaned up
a bit as well. This also adds support for Catmull Rom curves.

Differential Revision: https://developer.blender.org/D14461
2022-03-29 20:11:38 -05:00
87e9451d66 Fix: Remove special case from curve segment size function
The idea that curves with two points cannot be cyclic came from some
existing code, but there's not fundamental reason for it, so remove the
check in this function. The case can be handled elsewhere if necessary.
2022-03-29 19:56:38 -05:00
72d25fa41d Curves: Add length cache, length paramerterize utility
This commit adds calculation of lengths along the curve for each
evaluated point. This is used for sampling, resampling, the "curve
parameter" node, and potentially more places in the future.

This commit also includes a utility for calculation of uniform samples
in blenlib. It can find evenlyspaced samples along a sequence of points
and use linear interpolation to move data from those points to the
samples. Making the utility more general aligns better with the more
functional approach of the new curves code and makes the behavior
available elsewhere.

A "color math" header is added to allow very basic interpolation
between two colors in the `blender::math` namespace.

Differential Revision: https://developer.blender.org/D14382
2022-03-29 19:45:59 -05:00
bcb9379c6d Cleanup: quiet warning for description ending with a full stop 2022-03-30 11:41:34 +11:00
9ae98f305a Cleanup: spelling in comments 2022-03-30 11:38:24 +11:00
be8270bc76 Cleanup: use equality instead of contains for single-item sets 2022-03-30 11:27:54 +11:00
87e5c4230f Cleanup: unbalanced doxy sections 2022-03-30 11:17:16 +11:00
ee1d5fb9e4 UI: Fix cosmetic papercuts of the reroute node
Fix small cosmetic issues with the reroute node:
1. Remove special case that allowed curved links to attach vertically.
2. Center align the reroute node's label.

The vertically attached node links could lead to kinks in the otherwise
smooth curves. This would break the visual flow and make the link
potentially intersect the node's label.

The center alignment of the label gives more consistent results for
different label lengths and also reduces the chance of the label
interfering with the node links.

Reviewed By: Hans Goudey, Pablo Vazquez

Differential Revision: D14457
2022-03-29 23:39:50 +02:00
08b4b657b6 Geometry Nodes: Don't create node tree when adding nodes modifier
Don't always create a new geometry nodes node tree when adding a
geometry nodes modifier.

This avoids files getting cluttered with empty and unused geometry node
trees that are created every time a nodes modifier is added to an
object - even if only to apply an already existing.
This is also more consistent with other modifiers that also don't
automatically create new data blocks.

The new modifier still automatically gets populated with a new node
tree when adding it via the "New" button in the header of the
geometry nodes editor.

Reviewed By: Hans Goudey, Dalai Felinto, Pablo Vazquez

Differential Revision: D14458
2022-03-29 22:30:51 +02:00
4eb4c90cf6 GPencil: Remove UI prefix Use in Dot-Dash modifier
The "Use" word must not be used in UI.
2022-03-29 22:26:44 +02:00
ac9ddf54a0 Fix: incorrect assert in new code 2022-03-29 14:39:18 -05:00
ac40d40cb7 GPencil: Fix Windows compiler errors
For non trivial data must be used `MEM_new`
2022-03-29 19:32:28 +02:00
5596f79821 LibOverride: Massive edits to 'editable' IDs checks in editors code.
Add new `BKE_id_is_editable` helper in `BKE_lib_id.h`, that supercedes
previous check (simple `ID_IS_LINKED()` macro) for many editing cases.

This allows to also take into account 'system override' (aka
non-editable override) case.

Ref: {T95707}.
2022-03-29 17:59:55 +02:00
354db59fb1 LibOverride: Rename 'delete hierarchy' to 'clear hierarchy', add 'clear single' operations.
'Delete' was a confusing name, even though it would delete the overrides
it would replace them by linked data.

Adding the 'single' version of that operation made it even more
confusing, since often it has to keep the override ID for sakes of
hierarchy, and just reset it and turn it back into a non-editable system
override.

Ref: {T95707}.
2022-03-29 17:59:43 +02:00
6cc9ba94b7 LibOverride: Implement default 'user override' behavior.
Implement default behavior to decide which overrides remain 'system'
ones, and which become 'user editable' ones, when creating hierarchy
override from 3DView or the Outliner.

3DView:
If from an Empty-instanced collection, only Armature objects in
that collection are user overrides.
If from a set of selected objects, all overrides created from selected
objects are user overrides.

Outliner:
All override IDs created from selected elements in the Outliner are user
overrides.
There is one special case: When a collection is selected, and is
'closed' in the outliner, all its inner armature objects are also user
overrides.

Ref: {T95707}.
2022-03-29 17:59:31 +02:00
d7c802c25f LibOverride: Add initial handling of system overrides in creation/duplication/resync code, and some basic do_version.
When creating with hierarchies, core code only generates system
overrides, responsibility to define 'user overrides' is then for the
higher-level calling code (Editor/Operator-level).

do_version code uses fairly basic euristics, should be good enough here
though in most cases. and can always be refined later if needed.

Ref: {T95707}.
2022-03-29 17:59:17 +02:00
b5f2c77658 LibOverride: make some override properties 'overridable'.
The whole liboverride data is still ignored by override diffing etc.,
but some of their flags should be editable (from script and/or advanced
technical/debug UI). So using a weird combination of flags to achieve
this.

Ref: {T95707}.
2022-03-29 17:59:05 +02:00
9394d455af LibOverride: Add a new 'virtual' non-editable override icon and use it in Outliner.
Ref: {T95707}.
2022-03-29 17:58:53 +02:00
5adcf6c85e LibOverride: Add initial System Override flag.
This merely adds the flag, exposes it in RMA, and uses it in some of the
most common 'is editable' checks (RNA, `BASE_EDITABLE` macro...).

Next step: do_version and defining systemoverrides at creation.

Ref: {T95707}.
2022-03-29 17:58:40 +02:00
1013084038 GPencil: Small UI tweaks to Build modifier
Changes in some names.
2022-03-29 17:38:22 +02:00
9a0e1950ea Cover DNA_gpencil_types.h with C++ structure methods
Ref T96847

Maniphest Tasks: T96847

Differential Revision: https://developer.blender.org/D14487
2022-03-29 17:21:02 +02:00
1f6c2507f8 Cleanup: Remove legacy dupli system from point cloud object
The "dupli" system now has a faster, more powerful, and more flexible
alternative with geometry nodes. Since the point cloud objects haven't
been exposed in the non-experimental UI yet, we can remove the dupli
implementation and the panel for the object type.

Differential Revision: https://developer.blender.org/D14482
2022-03-29 10:16:05 -05:00
c4e4924096 GPencil: Fading for build modifier.
Adds fading support for build modifier so it's not a hard cut off

Reviewed By: Antonio Vazquez (antoniov), Matias Mendiola (mendio)

Differential Revision: https://developer.blender.org/D14309
2022-03-29 22:46:56 +08:00
Henrik Dick
0e0977f3e6 GPencil: Fix sculpt mask ignoring one point strokes
The check for the selected status was missing in the case
where the stroke one has one point.

Differential Revision: http://developer.blender.org/D14490
2022-03-29 16:22:52 +02:00
810e225c26 Assets: Support automatic collection previews
Adds supports for collection previews that are rendered automatically when
collections are marked as assets. (Or when preview rendering is triggered
differently, e.g. through the //Refresh Data-Block Previews// operator).

Idea in this patch is to create a collection instance empty outside of main for
the collection, and then reuse the object rendering code to render the preview.
This keeps things very simple and works just fine.

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

Reviewed by: Bastien Montagne
2022-03-29 15:37:22 +02:00
Yuki Hashimoto
9ec77d709c Fix T63795: Display custom properties with brackets in info
When custom properties are changed, they are displayed with brackets in
info.

Ref D14380
2022-03-30 00:29:15 +11:00
4a5cd4e6c7 Fix T96844: Crash when switching workspaces and outliner modes
Error exposed by ba49345705. Code just assumed that the tree-element
pointed to a real ID, but this is often not the case, and the ID pointer
contains completely different data. E.g. before ba49345705, it would
be a pointer to one of the `Main` listbases, so this code would have
undefined behavior. Now the pointer is null for elements in the "Current
File" element, causing a null-pointer dereference rather than undefined
behavior (that just happened to virtually always result in the intended
code path).
2022-03-29 15:24:02 +02:00
fced604acf Curves: improve Snake Hook brush
This implements the spherical brush and different falloff
modes for the Snake Hook brush.

Differential Revision: https://developer.blender.org/D14408
2022-03-29 14:46:14 +02:00
4def6e8072 Icons: Programmatically create indirect library icon, remove from SVG
The indirect library data icon was just a grayed out version of the
regular one. This graying out is now done in code, so the icon can be
removed from the SVG. Note that the icon is still defined as
`ICON_LIBRARY_DATA_INDIRECT` (or `LIBRARY_DATA_INDIRECT` in BPY).
2022-03-29 14:36:06 +02:00
62c73db734 Fix T96835: Grease pencil tweak tool selects but doesn't drag
Use the pass-through matching the view3d.select operator.
2022-03-29 22:20:38 +11:00
2aa49107a2 Fix T96356: artefacts with GPU subdivision and vertex paint mask
The lines paint mask IBO extraction was not implemented for GPU subdivision.
For it to work, we also now need to preserve the subdivision loop to
subdivision edge map, which until now was overwritten to store coarse edges
(the map to coarse edges is still preserved).

Also the paint flag stored in the 4th dimension of the loop normal buffer
was not properly set for flat shaded faces, leading to other kind of
artefacts and render issues.
2022-03-29 12:04:51 +02:00
17757eabc7 Cleanup: Remove commented lines of previous commit 2022-03-29 11:28:38 +02:00
9450057b43 Fix T96799: GPencil weight_get API cannot retrieve weights
The problem was when the stroke had less weights that the total number of vertex groups.

The API checked the total number of groups, but this is not required because `BKE_defvert_find_index` returns NULL is the vertex group index does not exist.
2022-03-29 11:26:13 +02:00
31bcab0ecb Fix (unreported) LibOverride: re-creation of overrides in consecutive partial overrides of a same hierarchy.
If creating partial hierarchy overrides (from the outliner e.g.), that
need to create extra overrides, those could be re-created everytime,
leading to very bad situation where there would be several overrides of
the same reference ID in the same override hierarchy.

This fix makes it so that existing overrides in a given hierarchy will
always be re-used in case other overrides are added to the hierarchy.
2022-03-29 11:21:39 +02:00
c772461741 Cleanup: Use higher level semantic for zeroing DNA objects in C++
Replaces old-style memzero-style of call with zero-initializer.
Allows to shorten typical initialization code to a single line:

  Object foo = blender:🧬:shallow_zero_initialize<Object>()

This will allow to more easily convert designated initializer
which is often used to fill object with zeroes to the explicit
function calls:

  MyDNAStruct foo = {};

will be translated to

  MyDNAStruct foo = blender:🧬:shallow_zero_initialize<MyDNAStruct>();

Differential Revision: https://developer.blender.org/D14486
2022-03-29 11:04:50 +02:00
a264dff4fa BLI: optimize Map/Set/VectorSet.clear methods
Previously, those methods would destruct and reconstruct
the data structure. While that was more simple in initial
implementation, it has some downsides which are not resolved:
* Already allocated memory is lost. So new memory would have
  to be allocated when the data structure is refilled.
* The clearing process itself was slower because it did unnecessary
  work.
2022-03-29 10:41:01 +02:00
29d9bb89ce Cleanup: Remove redundant DNA C++ helper function
Use shallow_copy, no need in copy_memory.

The latter appeared as some last minute solution for a compilation
warning on Friday.
2022-03-29 10:14:57 +02:00
3c6c15d676 Functions: move loops into function builders
This simplifies debugging, and can help improve performance
by making it easier for the compiler.

More optimization might still be possible by using `__restrict` in
a few places.
2022-03-29 10:11:49 +02:00
c55afdf30b BLI: add utility to convert IndexMask to best mask type 2022-03-29 10:07:18 +02:00
7bd614d431 Cleanup: use value initialization instead of copying default value
Value-initialization has the potential to be more efficient.
Also, the code becomes simpler.
2022-03-29 09:29:09 +02:00
d7c6442118 BLI: support value initialization in CPPType
Value initialization differs from default-construction in that it
also zero-initializes trivial types.
2022-03-29 09:29:09 +02:00
d4bdf21929 Fix T96701: RMB select fails to show gizmo on mouse button release
Regression in [0] which removed a special check when tweak events ended.
Add a similar check for drag events that runs drag is disabled in the
main event handling loop.

[0]: 4986f71848
2022-03-29 16:56:55 +11:00
540bfbbb27 Fix T96582: Wipe effect not working
Caused by oversight in 0e38002dd5. Constant x/y value was used to
calculate transition instead of pixel x/y coords.
2022-03-29 05:07:58 +02:00
e74420124f Fix T96699: Splitting strip does not copy animation
Since e49bf4019b, animation is handled explicitly. Split operator
wasn't updated.

Re-use backup-duplicate-restore animation functions, that other
operators use for splitting.
2022-03-29 04:19:27 +02:00
f99beb730a Fix T96347: Pose gizmo shown at wrong location with multiple objects
Regression in [0] error iterating over pose bones which only used the
active-object, also follow the same logic as edit-mode for using the
local-matrix.

[0]: d052169e7e
2022-03-29 12:57:33 +11:00
87d9d33c00 Fix T96691: Heap corruption in file_browse_exec
Regression in [0], also use pad buffer by 1 instead of 2 which is no
longer needed as the trailing slash is no longer added
after allocating the string.

0682af0d63
2022-03-29 11:39:22 +11:00
27424b758a Cleanup: Move two grease pencil files to C++
This is meant to allow using C++ data structures in this file
as a performance improvement. Particularly `Vector` instead
of `ListBase` for `duplilist`. This changes builds on all
platforms on the buildbot.
2022-03-28 16:29:36 -05:00
fc288d3970 Cleanup: Move scene.c to C++
This is meant to allow using C++ data structures in this file
as a performance improvement. Particularly `Vector` instead
of `ListBase` for `duplilist`. This change builds and passes
tests on all platforms on the buildbot.
2022-03-28 15:53:19 -05:00
c9f54cd644 Cleanup: Use const mesh arguments
Also correct an enum value from review of D14475.
2022-03-28 15:12:30 -05:00
037f789111 Cleanup: Move transform_snap_object.c to C++
This is meant to allow using C++ data structures in this file
as a performance improvement. Particularly `Vector` instead
of `ListBase` for `duplilist`.

Differential Revision: https://developer.blender.org/D14475
2022-03-28 14:59:42 -05:00
21e72496a6 Fix T96728: 'Automatic Constraint' using the wrong orientation
If the `Automatic Constraint` modifier was activated while an axis
constraint was already set, the orientation used would be the default
orientation of the mode and not that of the scene.

This was because the `initSelectConstraint` function was not called in
this case and the `Automatic Constraint` mode was enabled by other
indirect means.

So the solution is to call `initSelectConstraint` in either case and
remove these "indirect means" of enabling `Automatic Constraint`.
2022-03-28 14:21:33 -03:00
df4d6c22cf Transform: avoid excessive recalculation with 'TREDRAW_SOFT'
Contrary to the initial intention (in rB9916e0193c36), `TREDRAW_SOFT`
flag, when isolated, is not cleared in `transformApply` and therefore is
used in the `drawTransformApply` callback which basically recalculates
the `transformation` which finally clears the flag.

So remove the `drawTransformApply` callback so `transformApply` is not
called when unnecessary.

Differential Revision: https://developer.blender.org/D14430
2022-03-28 14:18:56 -03:00
854af0cd09 Cleanup/Refactor: remove unused 'SNAP_ONLY_ACTIVE' enum parameter
`SNAP_ONLY_ACTIVE` was implemented in order to be used in the Knife tool,
but the project did not go ahead.
2022-03-28 13:55:13 -03:00
39df927b4a Transform: Improve 'absolute grid snap' support detection
The solution supposedly listed all cases that `absolute grid snapping`
was supported. But it ignored some occasions like: Editing Surface
objects, Texture Space.

List now only the cases where this feature should not be supported.
2022-03-28 13:55:13 -03:00
4c66021ccc Cleanup: transform, use early returns
This makes the flow clearer and avoids many `else` conditions.
2022-03-28 13:55:12 -03:00
8b5292a60e Outliner: Don't show indirectly linked Library Overrides properties
The Library Overrides display mode is meant to show overridden
properties from the current file only, not library overrides in
data-blocks that just were linked in. The upcoming Hierarchies view mode
for Library Overrides will also display linked in data-blocks that have
overrides in the source file (but not the individual overridden
properties), see T95802.
2022-03-28 18:03:57 +02:00
2e99295d5e Fix T96812: Regression: Snapping is broken with proportional editing
This was a mistake in the conditional structure introduced in 4b35d6950d

This commit also adds a new type of snap exclusion: `SNAP_NOT_EDITED`.

Thanks to @Ethan1080 for pointing out the error.
2022-03-28 11:26:48 -03:00
e6dfe570cc Fix T96828: GPencil primitives handlers not working
Following the logic is not necessary to check the mouse button because the status has changed before.
2022-03-28 13:11:07 +02:00
555e7c2091 Cleanup: Use bool literals in return statements of text editor poll functions. 2022-03-28 12:11:44 +02:00
da130d751f Fix various UI messages issues. 2022-03-28 10:40:14 +02:00
587efa9949 Fix (unreported) crash in some mesh-from-object code.
Crashed e.g. FBX exporter.

Mistake in rB0c33e84020deca.
2022-03-28 09:53:17 +02:00
af1341322f Fix T96670: bake from multires not reflected in the Image Editor. 2022-03-28 08:28:09 +02:00
387b34f0c2 Cleanup: return success from python_script_error_jump
Relying on checks for the assignment of return arguments isn't so
clear especially when there are multiple return arguments.
2022-03-28 17:15:41 +11:00
1466f480c4 Python: select the start-end range of syntax errors
Python 3.10's syntax errors can specify a range.
Use this for text editor error selection.
2022-03-28 17:06:38 +11:00
0ce6ed4753 Cleanup: variable/argument naming for Python exception access
Names filename/filepath/fn were used interchangeably.
2022-03-28 16:54:31 +11:00
3ea90de9e6 Fix text editor failure to move the cursor for syntax errors
This broke between 3.0 and 3.1, upgrading to Python 3.10 seems the
likely cause as this code didn't change.
2022-03-28 16:44:25 +11:00
e8fd2d8469 Cleanup: early exit when there is no exception
Reduces noise in D9752, no functional change as PyErr_NormalizeException
doesn't do anything when there is no exception set.
2022-03-28 15:06:47 +11:00
6f305577b3 Cleanup: use "num" as a suffix in: source/blender/modifiers
Also rename DNA struct members.
2022-03-28 14:41:31 +11:00
24839fdefa Cleanup: use "num" as a suffix in: source/blender/nodes 2022-03-28 14:14:31 +11:00
556384ca1d Cleanup: use "num" as a suffix in: source/blender/render
See T85728
2022-03-28 14:14:31 +11:00
83c274ccfc Cleanup: use "num" as a suffix in: source/blender/python
See T85728
2022-03-28 14:14:31 +11:00
77155ae1c0 Cleanup: Reduce duplication to prepare for UDIM packing
In preparation for supporting packing of UDIM tiled textures, this patch
refactors a small portion of image.cc. The refactor should lead to less
duplicate code now and when Tiled images are added in the near future.

This patch is based on the prior work done for D6492 where it was
requested this part be split and can be summarized as follows:
 - `load_sequence_single` is removed and merged with `load_image_single`
 - `image_load_sequence_file` is removed and merged with `image_load_image_file`

Reviewed By: lukasstockner97

Differential Revision: https://developer.blender.org/D14327
2022-03-27 17:49:26 -07:00
e2e4c1daaa OBJ: use fmt library instead of sprintf for faster formatting
On Windows/MSVC this gives a minor (~20%) speedup presumably due to a faster float/int formatter. On macOS (Xcode13), this gives a massive speedup, since snprintf that is in system libraries ends up spending almost all the time inside some locale-related mutex lock.

The actual exporter code becomes quite a bit smaller too, since it does not have to do any juggling to support std::string arguments, and the buffer handling code is smaller as well.

Windows (VS2022 release build, Ryzen 5950X 32 threads) timings:
- Blender 3.0 splash scene (2.4GB obj): 4.57s -> 3.86s
- Monkey subdivided level 6 (330MB obj): 1.10s -> 0.99s

macOS (Xcode 13 release build, Apple M1Max) timings:
- Blender 3.0 splash scene (2.4GB obj): 21.03s -> 5.52s
- Monkey subdivided level 6 (330MB obj): 3.28s -> 1.20s

Linux (ThreadRipper 3960X 48 threads) timings:
- Blender 3.0 splash scene (2.4GB obj): 10.10s -> 4.40s
- Monkey subdivided level 6 (330MB obj): 2.16s -> 1.37s

The produced obj/mtl files are identical to before.

Reviewed By: Howard Trickey, Dalai Felinto

Differential Revision: https://developer.blender.org/D13998
2022-03-27 14:25:48 +03:00
3e12488b4e Cleanup: Remove frameserver cmake definition
Left over from rBaab5ac25f2c2e6fbc50f9fb352e71ef0ae0ba2f1
2022-03-26 21:59:22 -04:00
Lictex Steaven
08d2428632 GPencil: Add an xray toggle for each annotation layer
so a layer can be occluded by the scene instead of always showing in front

---

{F12827163}

Reviewed By: fclem, antoniov

Differential Revision: https://developer.blender.org/D13931
2022-03-26 18:26:43 +01:00
082b063f2a Increase bevel segment limit in modifier from 100 to 1000.
A user asked for this increase. The performance lags when reaching
the upper limit of this number of segments, but if you need that
many segments, I guess you are willing to wait.
2022-03-26 13:20:16 -04:00
ffafe494f6 Cleanup: Remove double #ifdef WITH_TBB check 2022-03-26 09:55:08 -06:00
9d25418a52 Fix T95901: Crash in Fill curve (set to N-gon)
The code that eats away faces until you find input faces in
the Constrained Delaunay Triangulation goes too far and crashes
when there are no input faces. In the test case there were input
faces but they only had two vertices, so were all ignored.
2022-03-26 10:47:09 -04:00
4039e94422 Fix T96790: Gpencil Inverted Fill makes extra stroke at origin
The problem was the stroke was created in the inverted loop before checking if the total of points is 0 and exit the loop.

Also some code Cleanup.
2022-03-26 13:20:46 +01:00
23bbc0d748 DRW: Port draw_common.c to use shared definition with GLSL 2022-03-26 13:16:01 +01:00
6073b6b874 GPU: ShaderBuilder: Skip shader compilation for unsupported shaders. 2022-03-26 13:16:01 +01:00
ab97add5fa GL: Fix shader error logging on Apple M1 hardware 2022-03-26 13:16:01 +01:00
664eb19369 GPU: ShaderBuilder: Fix compilation on Mac
This is less than ideal as it seems to link against all
of blender disregarding the stubs.
2022-03-26 13:16:01 +01:00
9c41767d57 Cleanup: move eFileSel_Action from DNA to WM_api.h
This isn't stored in blend files so it can be moved out of DNA.

Also use an enum for `WM_FILESEL_*` members.
2022-03-26 18:42:33 +11:00
4d5e8e5477 Fix incorrect argument for rigid-body world export 2022-03-26 18:36:28 +11:00
c01afe9562 Cleanup: use "use_" prefix for booleans 2022-03-26 18:04:27 +11:00
c330c7a5da Cleanup: quiet compiler warning 2022-03-26 18:04:19 +11:00
1909fd2781 Windows/Installer: Fix capital B in shortcut
the shortcut placed on the desktop and in the start
menu on windows were labelled `blender` rather than `Blender`

spotted by @Severin
2022-03-25 15:17:48 -06:00
6bf51ab03a CMake: Give some extra space to info_cfg_option
WITH_PYTHON_INSTALL_ZSTANDARD was too long and
didn't align very well compared to the other
items in the list.
2022-03-25 14:33:39 -06:00
ba49345705 Fix Outliner highlighting multiple base elements in different libraries
In the Blender File display mode of the Outliner, mouse hovering a
"base" element (e.g. "Objects", "Materials", ...) would also highlight
that same base element in other libraries linked into the scene. In fact
operations like (un)collapsing would be applied to both too.
Issue was that we'd always use the listbase containing the data-blocks
from the current main as a way to identify the tree element. So for the
same data-block types we'd use the same listbase pointers. Instead use
the the library pointer + a per library index.
2022-03-25 19:00:04 +01:00
2631b44e71 MSVC: Fix linker issue with USD
USD requires to be linked with /WHOLEARCHIVE so
the linker won't remove their static initializers.

This strangely has never worked for MSVC since
the flags were set on the LINK_FLAGS property
which is only used to link .dll and .exe files,
given this is a static lib, the flags were not
used, nor did CMake propagate the link directive
to the final targets that did link. Not quite sure
how this has not lead to more problems in the past.

Setting the link directive on the INTERFACE_LINK_OPTIONS
makes cmake do the right thing.

Differential Revision: https://developer.blender.org/D14394
Reviewed by: sybren
2022-03-25 10:15:11 -06:00
19bcfba56f USD I/O: explicitly set or clear the OPTYPE_UNDO flag
Exporting USD cannot be undone, but importing should be undo'able.
2022-03-25 16:53:17 +01:00
2fc77071b5 Image editor: not updating after image operation.
Fixes T96324, T96312, T96323
2022-03-25 16:36:50 +01:00
c671a26637 USD: Support building against USD 21.11+
For 3.2 USD will be bumped to a newer version with some
slight API changes, however since we cannot simultaneously
land the libs for all platforms as well as these code changes,
we'll have to support both 21.02 and 21.11+ for at least a
short period of time making the code slightly more messy than
it could have been.

Differential Revision: https://developer.blender.org/D14184
Reviewed by: sybren
2022-03-25 09:29:39 -06:00
378022c797 BLI: Adjust interpolation to support integers, other tweaks
In order to allow interpolation of integers with a float, add a separate
template parameter for the factor and multiplication types.
Also move some helper constexpr variables to the "base" header
(reversing the dependency to "base" -> "vector").

This also adds a distance function for scalar types, which is
helpful to allow sharing code between vectors and basic types.

Differential Revision: https://developer.blender.org/D14446
2022-03-25 09:57:10 -05:00
1243cb803e Cleanup: Add asserts, remove default case 2022-03-25 09:12:31 -05:00
cea51c1bb5 Curves: Bezier and general interpolate to evaluated utility
This commit implements generic evaluation for Bezier curves (which is
really just linear interpolation, since attributes are not stored on
Bezier handles). For complete parity with the old curve type, we would
have to add options for this (RNA: `Spline.radius_interpolation`),
but it's not clear that we want to do that.

This also adds a generic `interpolate_to_evaluate` utility on curves
that hides the implementation details. Though there is theoretically
a performance cost to that, without some abstraction calling code
would usually be too complex.

Differential Revision: https://developer.blender.org/D14447
2022-03-25 09:03:35 -05:00
c0016d85b2 Curves: Add a utility to count curves of each type
This commit adds a utility that returns an array with the number
of curves of every type. One use case for this is detecting whether
to remove handle or NURBS attributes when changing curve types.
It's best to avoid using this when it's not necessary, but sometimes
it can't really be avoided, and having a utility at least makes using
an optimized version simple.

In the future, this information can be cached in the curves runtime.

Differential Revision: https://developer.blender.org/D14448
2022-03-25 09:00:30 -05:00
59de9ceda0 MSVC: Fix build issue with webp
The webp variables should only be set if
the libs actually exist in the lib folder
2022-03-25 07:31:15 -06:00
97f2210157 GPencil: Cyclic flag for dot dash modifier
Cyclic option per segment, allows interesting "loop" visual effects.

Reviewed by: Antonio Vazquez (antoniov)

Differential Revision: https://developer.blender.org/D14439
2022-03-25 20:13:50 +08:00
Henrik Dick
d4e1458db3 GPencil: Improve smooth operation
This patch makes the grease pencil smooth operation symmetric.
It also increases the performance a lot if strong smoothing is
required. Additionally there is an option for the position smooth
operation to keep the shape closer to the original for more iterations.

Since the result differs from the previous algorithm, versioning is used
to change the iterations and factor to match the old result.

Differential Revision: http://developer.blender.org/D14325
2022-03-25 11:51:45 +01:00
0c33e84020 Fix compilation warnings after previous change
Thanks Jacques for finding solution for deprecation warning
which was generated by GCC for constructor.

The rest of the change is related on fixing memaccess warning
which was happening when memset/memcpy was used directly on
the DNA object pointer. Now there are two utility functions
for this:

- blender:🧬:zero_memory
- blender:🧬:copy_memory
2022-03-25 11:45:50 +01:00
03df72ee4e Implement C++ methods for DNA structures
This change makes it possible to add implementation of common
C++ methods for DNA structures which helps ensuring unsafe
operations like shallow copy are done explicitly.

For example, creating a shallow copy used to be:

  Object temp_object = *input_object;

In the C++ context it was seen like the temp_object is
properly decoupled from the input object, while in the
reality is it not. Now this code becomes:

  Object temp_object = blender:🧬:shallow_copy(*input_object);

The copy and move constructor and assignment operators are
now explicitly disabled.

Other than a more explicit resource management this change
also solves a lot of warnings generated by the implicitly
defined copy constructors w.r.t dealing with deprecated fields.
These warnings were generated by Apple Clang when a shallow
object copy was created via implicitly defined copy constructor.

In order to enable C++ methods for DNA structures a newly added
macro `DNA_DEFINE_CXX_METHODS()` is to be used:

  tpyedef struct Object {
    DNA_DEFINE_CXX_METHODS(Object)
    ...
  } Object;

For the shallow copy use `blender:🧬:shallow_copy()`.

The implementation of the memcpy is hidden via an internal DNA
function to avoid pulling `string.h` into every DNA header.
This means that the solution does not affect on the headers
dependencies.

---

Ideally `DNA_shallow_copy` would be defined in a more explicit
header, but don;t think we have a suitable one already. Maybe
we can introduce `DNA_access.h` ?

Differential Revision: https://developer.blender.org/D14427
2022-03-25 11:45:50 +01:00
75b8c4fc18 LibOverride: Prevent some more potential modification of overridden collections. 2022-03-25 11:39:06 +01:00
484af996aa Revert "Implement C++ methods for DNA structures"
This reverts commit 8c44793228.

Apparently, this generated a lot of warnings in GCC.

Didn't find a quick solution and is it not something I want to be
trading between (more quiet Clang in an expense of less quiet GCC).

Will re-iterate on the patch are re-commit it.
2022-03-25 10:57:13 +01:00
8c44793228 Implement C++ methods for DNA structures
This change makes it possible to add implementation of common
C++ methods for DNA structures which helps ensuring unsafe
operations like shallow copy are done explicitly.

For example, creating a shallow copy used to be:

  Object temp_object = *input_object;

In the C++ context it was seen like the temp_object is
properly decoupled from the input object, while in the
reality is it not. Now this code becomes:

  Object temp_object = blender:🧬:shallow_copy(*input_object);

The copy and move constructor and assignment operators are
now explicitly disabled.

Other than a more explicit resource management this change
also solves a lot of warnings generated by the implicitly
defined copy constructors w.r.t dealing with deprecated fields.
These warnings were generated by Apple Clang when a shallow
object copy was created via implicitly defined copy constructor.

In order to enable C++ methods for DNA structures a newly added
macro `DNA_DEFINE_CXX_METHODS()` is to be used:

  tpyedef struct Object {
    DNA_DEFINE_CXX_METHODS(Object)
    ...
  } Object;

For the shallow copy use `blender:🧬:shallow_copy()`.

The implementation of the memcpy is hidden via an internal DNA
function to avoid pulling `string.h` into every DNA header.
This means that the solution does not affect on the headers
dependencies.

---

Ideally `DNA_shallow_copy` would be defined in a more explicit
header, but don;t think we have a suitable one already. Maybe
we can introduce `DNA_access.h` ?

Differential Revision: https://developer.blender.org/D14427
2022-03-25 10:37:56 +01:00
315210c22b XR: Fix crash on executing some action operators
Since the XR area does not have any region geometry, hud updates from
operators would cause invalid access when updating region sizes.
2022-03-25 13:22:04 +09:00
93f2ebe7dd Cleanup: use doxy sections for customdata.cc 2022-03-25 14:54:16 +11:00
8ed4638960 Fix: Small fixes for NURBS evaluation
Clear the nurbs basis cache dirty flag when its evaluation finishes.
Remove an incorrect assert that the evaluated size couldn't be zero.
It can, when `check_valid_size_and_order` returns false.
2022-03-24 22:31:50 -05:00
9b2879f8b3 Cleanup: Simplify logic, rename variables
Return the map of gathered attributes directly, use simpler
naming for "attributes" and "gathered_attributes".
2022-03-24 22:29:23 -05:00
83c99ccb21 Cleanup: Use more specific variable name 2022-03-24 22:17:54 -05:00
797a1356ca Curves: Tweak evaluated offset functions
Add a function to retrieve the points for an index range of curves,
and move "ensuring" the offsets to a separate function, since it's
often nicer to call that if you don't need the result span immediately.
2022-03-24 20:58:01 -05:00
6e72e3fdb2 Cleanup: Further renaming in new curves code
A follow-up to e253f9f66d. Follow the policy from T85728
completely (using "num" as a prefix) and rename another function.
2022-03-24 20:48:08 -05:00
d3999683ff WebP: Fix use after free 2022-03-24 21:21:18 -04:00
6e86cf0daa Docs: include WEBP in --help text 2022-03-25 12:10:30 +11:00
2eeb79805c Cleanup: remove argument to doxygen \file
Doxygen doesn't require this to be set.
2022-03-25 12:10:30 +11:00
1ba20947cc Cleanup: rename CustomDataExternal.filename => filepath
Reserve "filename" when only the name component is used.
2022-03-25 12:10:30 +11:00
7d1d9e6015 Cleanup: rename ParticleSettings.child_nbr => child_percent
child_nbr was used as a percentage as well as the final
number of particles. Rename to avoid confusion.
2022-03-25 12:10:21 +11:00
4d46fac65d Cleanup: use count or num instead of nbr
Follow conventions from T85728.
2022-03-25 12:04:20 +11:00
c594cfbe50 Cleanup: use array syntax for sizeof, zero before float suffix 2022-03-25 12:04:19 +11:00
bbd787275f Cleanup: spelling in comments, strings 2022-03-25 12:04:16 +11:00
1d2dfc5e9e Cleanup: sort cmake file lists 2022-03-25 12:04:14 +11:00
a446c53f16 Cleanup: unused warnings 2022-03-25 12:04:12 +11:00
d3a1e9cbb9 Geometry Nodes: Multi-thread creation of selection from field
When boolean fields are evaluated and used as selections, we create
a vector of indices. This process is currently single-threaded, but
226f0c4fef added a more optimized multi-threaded version
of this process. It's simple to use this in the field evaluator.

I tested this with the set position node and a random
value node set to boolean mode on a Ryzen 2700x:
|              | Before  |  After  | Improvement |
| 10% Selected | 40.5 ms | 29.0 ms | 1.4x        |
| 90% Selected | 115 ms  | 45.3 ms | 2.5x        |

In the future there could be a specialized version for non-span
virtual array selections that uses `materialize` to lower virtual
call overhead.

Differential Revision: https://developer.blender.org/D14436
2022-03-24 18:48:38 -05:00
b030ec8760 BLF Cleanup: Use FreeType Enum FT_Err_Ok
Replace comparisons of FT_Error against 0 with FT_Err_Ok instead.

See D14052 for more details.

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

Reviewed by Campbell Barton
2022-03-24 16:20:10 -07:00
4fd0a69d7b ImBuf: Add support for WebP image format
Currently only supports single image frames (no animation possible).

If quality slider is set to 100 then lossless compression will be used,
otherwise lossy compression is used.

Gives about 35% reduction of filesize  save when re-saving splash screens with lossless
compression.
Also saves much faster, up to 15x faster than PNG with a better compression ratio as a plus.

Note, this is currently left disabled until we have WebP libs (see T95206)

For testing precompiled libs can be downloaded from Google:
https://storage.googleapis.com/downloads.webmproject.org/releases/webp/index.html

Differential Revision: https://developer.blender.org/D1598
2022-03-24 18:24:06 -04:00
Jesse Yurkovich
07846b31f3 Cleanup: Optimize viewport view data creation
Each time the user clicks the viewport 2 sets of engine views are
created. Each set is currently composed of 8 view objects, each of size
592 bytes.

Because space is not reserved in the vector that holds them, several
unnecessary re-allocation/copy cycles occur as the vector resizes and
the total allocation load is 8880 bytes. This happens twice.

Reduce to just the allocations necessary and with exactly 4736 bytes
allocated for each set
 - Before: 8 allocations and 8 deallocations totaling 17760 bytes
 - After: 2 allocations and 2 deallocations totaling 9472 bytes

Reviewed By: fclem, jbakker

Differential Revision: https://developer.blender.org/D13782
2022-03-24 21:26:11 +01:00
3c4947cdaa Fix T96756: Blender hanges on rendering after file save, after recent changes 2022-03-24 19:42:59 +01:00
9ef400ddf7 Cycles: don't write light passes for shadow catcher objects
Makes it easier to composite the Combined image from these passes.

Fixes T96758
2022-03-24 19:42:59 +01:00
4a1b0ea902 Fix T94001: OpenColorIO configuration with 1D textures not working 2022-03-24 19:42:59 +01:00
067d0d4466 Fix: Missing "Hair" to "Curves" rename
Missed in fe1816f67f
2022-03-24 13:10:16 -05:00
fb3a0a34b4 Fix: Build error with flag usage and strict warnings 2022-03-24 12:54:30 -05:00
a6214ce7ac Outliner: Don't show empty base elements in the library overrides mode
In the library overrides mode, in some situations there would be empty
base elements like "Collections" or "Objects". Don't show them, it's
confusing wihout use. Code just failed to consider that case.
2022-03-24 18:38:21 +01:00
511dfb7743 Outliner: Don't draw library overrides indicator for override buttons
All the buttons in the Library Overrides display mode would be shown in cyan,
indicating that they are library overrides. Given that this is solely what this
display mode is about, the indicator is just redundant, confusing (why are the
buttons purple?) and looks weird.

Part of T95802.

Reviewed by: Bastien Montagne

Differential Revision: https://developer.blender.org/D14416
2022-03-24 18:17:44 +01:00
ef228d92f2 Fix: Volume grid duplication on USD import.
Fix provided by Piotr Makal in patch D14204.

This patch fixes volume grid duplication which was occurring during
importing USD files. This was caused by calling BKE_volume_grid_add
twice per grid (excluding 'density' grid) for the same Volume
object: (1) in USDVolumeReader::read_object_data and (2) later in
BKE_volume_load.

Differential Revision: https://developer.blender.org/D14204
2022-03-24 12:42:11 -04:00
Lictex Steaven
db4d5d1583 Fix T90110: Dupli Window Not Immediately Active
When creating a new window from a duplicated area - by shift-dragging
on corner action zones - on the Windows platform the resulting window
is initially unresponsive. This patch fixes this by releasing the parent
window's mouse capture.

See D14085 for more details.

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

Reviewed by Ray Molenkamp
2022-03-24 09:41:29 -07:00
dcb520a7af Outliner: Remove list of library overrides from general display modes
There is a dedicated Library Override display mode now, and showing
these elsewhere just adds noise and makes the code problematic to
maintain (since the same element hierarchy will be used in two entirely
different contexts). The corresponding filter settings are removed too.

Part of T95802.

Reviewed by: Bastien Montagne

Differential Revision: https://developer.blender.org/D14411
2022-03-24 17:25:24 +01:00
1ff853a3f0 Outliner: Don't display library overrides from linked files
Instead of having the "Current File" and then the individual libraries
containing indirect library overrides in the Library Overrides display
mode, only show what's in the current file. Agreement was that this
isn't very useful in this view, we may want to add it to the Hierarchy
view though (see T95802).

Part of T95802.

Also expands the top level ID type items ("Objects", "Materials", ...)
by default. See D14410 for details.

Reviewed by: Bastien Montagne

Differential Revision: https://developer.blender.org/D14410
2022-03-24 17:22:37 +01:00
00018bfaa2 Tracking: Fix incorrect angle calculation on marker slide
Now the mouse cursor will exactly follow the tilt/scale sliding area.
2022-03-24 16:56:31 +01:00
dd7250efb1 Tracking: Fix jump when sliding tild/scale of marker
Was a mistake in coordinate handling: need to take possible offset
from the sliding area.

Mouse us still not fully perfectly follows changes of the tilt slide
area, but that is a separate issue.
2022-03-24 16:21:59 +01:00
Henrik Dick
cee6af0056 GPencil: New Envelope Modifier
This new modifier creates a shape known as envelope. It connects all
points that are n points apart. There is also a mode which fits a
single stroke to the envelope shape that is determined by that rule.

For more details, refer to the patch.

Reviewed By: NicksBest, antoniov, frogstomp, mendio

Differential Revision: http://developer.blender.org/D14341
2022-03-24 13:01:46 +01:00
Henrik Dick
dd161ff7a4 Complex Solidify: handle vertex creases
This implements the same interpolation method as for bevel weights
now for vertex and edge creases as well to improve the flexibility.

Differential Revision: http://developer.blender.org/D14170
2022-03-24 12:30:48 +01:00
4a674d08dd Outliner: tweak handling of liboverrides in delete code.
Essentially, we only allow deletion of hierarchy roots of liboverrides,
when hierarchy deletion option is enabled.

Also add some checking code in the generic, non-object/collection ID
delete code, to prevent any deletion of liboverrides that would be part
of a hierarchy.
2022-03-24 12:01:48 +01:00
24c30e001f 3D View: preference to disable selection cycling on first click
Object mode selection does a kind of cycling that excludes the active
selected object. This is separate from regular selection cycling which
is enabled when clicking multiple times without moving the cursor.

This has the down-side that clicking on an object to drag it always
selects the object behind it (in the case of overlapping objects).

Since object mode selection is fundamental functionality, this is
exposed as an experimental preference for user feedback & testing.

See T96752 for details.
2022-03-24 21:48:22 +11:00
643da14a4e Fix make source_archive_complete for release branches
In Blender 3.1 we can't run the source_archive_complete because the
cmake program is trying to download the packages from svn trunk. However
3.2 (aka master) already changed the version of some of the source
packages.

For example the OpenXR-SDK. It should be looking for
OpenXR-SDK-1.0.17.tar.gz in:
https://svn.blender.org/svnroot/bf-blender/tags/blender-3.1-release/lib/packages/

But instead it tries to look for it in:
https://svn.blender.org/svnroot/bf-blender/trunk/lib/packages/

Which can't be found since it was replaced with OpenXR-SDK-1.0.22.tar.gz

---

Release checklist: https://wiki.blender.org/wiki/Process/Release_Checklist

The release checklist was updated to include the new instructions:
`In the release branch, update and uncomment BLENDER_VERSION in download.cmake`

Differential Revision: http://developer.blender.org/D14292
2022-03-24 11:39:34 +01:00
Henrik Dick
acd7a648b1 GPencil: Add Scale Thickness to Pivot Point Pie Menu similar to Only Locations
In my opinion Scale Thickness feels similar to Only Locations and was missing from the pie menu in grease pencil edit mode, so here I added it.

Differential Revision: https://developer.blender.org/D12530
2022-03-24 11:22:33 +01:00
a2c2f6a39e Correct syntax error for MSVC 2022-03-24 21:13:58 +11:00
7a028330d2 Cleanup: clang-format 2022-03-24 11:01:12 +01:00
Henrik Dick
8d4244691a GPencil: lower bounds for gap in dot dash modifier
This patch maximizes the possible bounds for the dash and
gap parameters in the dot dash modifier. This makes e.g.
chopping up lines without gaps possible.

Differential Revision: http://developer.blender.org/D14428
2022-03-24 10:51:14 +01:00
bc290b47cd Keymap: experimental preference always use "Mouse Select & Move"
This was already as a preference for the tweak tool,
this preference enables the option for all selection
in the 3D view & UV editor.

This extends on changes from T96544.
2022-03-24 20:45:13 +11:00
e006e66084 Cleanup: use struct member identifiers for initialization
Relying on the order of struct members can be error prone. Update other
instances of ObjectsVisibleIteratorData initialization for MSVC/C++.
2022-03-24 17:30:45 +11:00
4682a0882f Cleanup: use "filepath" instead of "filename" for full paths
Reserve "filename" when only the name component is used.
2022-03-24 16:54:01 +11:00
5058c4b144 Cleanup: localize finding the nearest non-active object on selection
Move this into it's own block since it only needs to run if the
nearest object is currently selected & active.
2022-03-24 15:56:05 +11:00
0ee95e83ea View 3D: Don't prioritize pose objects unless in pose-mode
Always prioritizing bones caused pose-objects to be selected in object
mode even if they were behind other objects.

Now prioritizing pose bones is limited to pose mode.
2022-03-24 15:56:05 +11:00
3e5e204c81 3D View: order by depth when selecting cycles through objects
When cycling through objects select the nearest first
instead of using the order of object-bases in the view_layer.

This matches how pose selection works.
2022-03-24 15:56:05 +11:00
e67cd1f9a8 Cleanup: remove redundant argument for key-map selection template 2022-03-24 15:56:05 +11:00
6d61cf4e80 Cleanup: Typo, improve variable names
`accumulate_counts_to_offsets` wasn't just used for the point domain.
2022-03-23 23:50:10 -05:00
7ef3a1a6e6 BLI: Add utility for tacking average and min runtime
This is useful to save time manually averaging many timing results.
The minimum is included because often it can be more stable than an
average, and it can help to expose calls from other contexts with lower
times that would make the average useless.

Differential Revision: https://developer.blender.org/D14417
2022-03-23 23:35:23 -05:00
610ec34c1f Geometry Nodes: Improve performance writing to vertex groups
In a test file from T96282, this commit reduces the runtime of the
delete geometry node from 82 ms to 23 ms, a 3.6x improvement.
Writing to vertex groups in other cases should be faster too.

The largest improvement comes from not writing a new weight
of zero if the vertex is not in the group. This mirrors the behavior
of custom data interpolation in `layerInterp_mdeformvert`.
Other improvements come from using `set_all` for writing
output attributes and implementing that method for vertex groups.

I also implemented `materialize` methods. Though I didn't obverse
an improvement from this, I think it's best to remove virtual method
call overhead where it's simple to do so.

The test file for the delete geometry node needs to be updated.
These methods could be parallelized too, but better to do that later.

Differential Revision: https://developer.blender.org/D14420
2022-03-23 23:27:26 -05:00
aeb2c2afaf Cleanup: Clang tidy
- Deprecated headers
- Else after return
- Inconsistent parameter names (I used the most recently modified)
- Raw string literals
2022-03-23 23:24:54 -05:00
e253f9f66d Cleanup: Adjust naming in new curves code
Rename "size" variables and functions to use "num" instead,
based on T85728 (though this doesn't apply to simple C++
containers, it applies here). Rename "range" to "points" in
some functions, so be more specific.

Differential Revision: https://developer.blender.org/D14431
2022-03-23 23:05:46 -05:00
a1598d6835 UDIM: Improve tile format detection in filenames
There are some filenames where the UDIM pattern guessing would fail
unnecessarily. The user can fix these up afterwards but it would be
nicer if they would detect properly in the first place.

Examples:
`test.1001.ver0023.png` would guess wrong since it uses the image
sequence detection code which finds the first sequence from the end. It
would guess `filename.1001.ver<UDIM>.png`

`uv-test.u1_v2.png` would fail detection due to a bug in the processing.

Make this much more reliable and add tests for the most important tile
related get/set/detection functions.

Differential Revision: https://developer.blender.org/D14320
2022-03-23 21:01:36 -07:00
ead2c71a90 Cleanup/fix wrong enum items for object.gpencil_modifier_add
No functional changes as the actual list used for display is generated
at runtime via a callback.
2022-03-24 03:43:41 +01:00
ead9ed7e16 Cleanup: extra property update for ShaderFxGlow.opacity 2022-03-24 03:25:10 +01:00
98d4872d7f Cleanup: remove debug prints 2022-03-24 01:35:27 +01:00
Brian Savery
c46e58817c Cycles: enable HIP for Vega and Vega II (Radeon 7) GPUs on Windows
Basic testing on windows only so far. Will need some testing on Linux as well
when the Linux enablement patch is ready.

Does not enable Vega APUs yet (which would be gfx902 or gfx90c).

Differential Revision: https://developer.blender.org/D14432
2022-03-24 01:12:45 +01:00
ad976c0dd7 Fix missing updates for external render engines rendering tiles
For render image buffers to be acquired, a lock must be provided. Also
fixed wrong usage of release, it must always be called regardless if the
returned image buffer is NULL.
2022-03-24 01:03:47 +01:00
51380b9346 Fix Cycles Metal build error and GCC warning after recent changes
Function overloading of make_float4() doesn't work since it's a macro, just
don't do this minor cleanup then.
2022-03-23 23:25:31 +01:00
d84b4becd3 Fix compile error on GCC
Explicit template specialization has to happen outside of class
definition (some compilers are more lenient). Since it is not possible to
specialize the method without also specializing the enclosing class for
all of its possible types, the method is moved outside of the class, and
specialized there.
2022-03-23 22:01:32 +01:00
945dfd200b Cleanup: add const qualifier
This adds a const qualifier to some code path in the Alembic and USD
importers. More could be added elsewhere. This change is done as it will
be required when GeometrySets are supported and helps keeping diff noise
in the patch to a bare minimum.
2022-03-23 21:32:09 +01:00
03a7747aa6 Cleanup: use nullptr 2022-03-23 21:32:09 +01:00
300239b01f UI: Correct error message wording
Fixes T96724
2022-03-23 16:13:09 -04:00
Yuki Hashimoto
31bfa17a1f Cleanup: delete unused ViewMapIO files in Freestyle
ViewMapIO.h is only included in Controller.cpp init_options().
However, g_models_path and g_flags set here are never used elsewhere.
Therefore, ViewMapIO files can be deleted without affecting anything.

Differential Revision: https://developer.blender.org/D14423
2022-03-23 20:06:12 +01:00
Charles Flèche
e7b1be52e0 Cycles: add Alembic procedural to Cycles standalone xml
Example:

<alembic filepath="/tmp/cube.abc" scale="1.45">
  <object path="/Cube/Cube" />
</alembic>

Differential Revision: https://developer.blender.org/D14391
2022-03-23 20:06:12 +01:00
Ethan-Hall
f5066d43ae Cleanup: use make_float4(f) zero_float4() to simplify code
Differential Revision: https://developer.blender.org/D14426
2022-03-23 20:06:12 +01:00
Ethan-Hall
4e56e738a8 Cycles: optimize CPU texture sampler interpolation
Use templates to optimize the CPU texture sampler to interpolate using
float for single component datatypes instead of using float4 for all types.

Differential Revision: https://developer.blender.org/D14424
2022-03-23 20:06:12 +01:00
d67f9820b8 Curves: improve Comb brush
New supported features:
* 3D/spherical brush that samples a good position on the curves.
* Falloff.

The custom falloff curve mapping is not yet available in the ui because that
requires some more ui reorganization. This is better done when we have
a better understanding of what settings we need exactly.

Currently, the depth of the 3d brush is only sampled once per stroke, when
first pressing LMB. Sometimes it is expected that the depth of the brush can
change within a single brush. However, implementing that in a good way
is not straight forward and might need additional options. Therefore that
will be handled separately. Some experimentation results are in D14376.

Ref T96445.

Differential Revision: https://developer.blender.org/D14376
2022-03-23 18:19:59 +01:00
5d38b13e61 CMake: Rename "USD_LIBRARY_PREFIX" to "PXR_LIB_PREFIX" for consistency
rBc1909770e7f192574ea62449dd14b4254637e604 introduced "PXR_LIB_PREFIX" for building the
dependencies, so only makes sense to use the same name in the Hydra render delegate CMake too
2022-03-23 16:52:02 +01:00
d350976ba0 Cycles: Add Hydra render delegate
This patch adds a Hydra render delegate to Cycles, allowing Cycles to be used for rendering
in applications that provide a Hydra viewport. The implementation was written from scratch
against Cycles X, for integration into the Blender repository to make it possible to continue
developing it in step with the rest of Cycles. For this purpose it follows the style of the rest of
the Cycles code and can be built with a CMake option
(`WITH_CYCLES_HYDRA_RENDER_DELEGATE=1`) similar to the existing standalone version
of Cycles.

Since Hydra render delegates need to be built against the exact USD version and other
dependencies as the target application is using, this is intended to be built separate from
Blender (`WITH_BLENDER=0` CMake option) and with support for library versions different
from what Blender is using. As such the CMake build scripts for Windows had to be modified
slightly, so that the Cycles Hydra render delegate can e.g. be built with MSVC 2017 again
even though Blender requires MSVC 2019 now, and it's possible to specify custom paths to
the USD SDK etc. The codebase supports building against the latest USD release 22.03 and all
the way back to USD 20.08 (with some limitations).

Reviewed By: brecht, LazyDodo

Differential Revision: https://developer.blender.org/D14398
2022-03-23 16:39:05 +01:00
827e9ccb29 Revert "Fix T96728: 'Automatic Constraint' using the wrong orientation"
This reverts commit 6cc83f9079.

That commit removed the feature of cancel the 'Auto Constraint'
if it is enabled without drag.
2022-03-23 12:26:58 -03:00
6cc83f9079 Fix T96728: 'Automatic Constraint' using the wrong orientation
If the `Automatic Constraint` modifier was activated while an axis
constraint was already set, the orientation used would be the default
orientation of the mode and not that of the scene.

This was because the `initSelectConstraint` function was not called in
this case and the `Automatic Constraint` mode was enabled by other
indirect means

So the solution is to call `initSelectConstraint` in either case and
remove these "indirect means" of enabling `Automatic Constraint`.
2022-03-23 12:20:39 -03:00
e25238e146 Fix build error on GCC after recent changes 2022-03-23 16:12:55 +01:00
d40d5e8d0f Cleanup: move Mesh Sequence Cache modifier to C++
This moves `MOD_meshsequencecache.c` to C++ and fixes compile warnings
introduced from the change. This uses C++ style casts, as well as
`nullptr` instead of `NULL`.

This will allow to output `GeometrySets` from the modifier, which is C++.

Differential Revision: https://developer.blender.org/D13662
2022-03-23 15:34:13 +01:00
5ac4e6c911 Color Management: add support for OpenColorIO color space aliases
This enables the configuration to specify aliases for compatibility with other
configurations.

When a colorspace name is saved in a.blend, that is the alias of a colorspace
in the current configuration, it will show the main colorspace from the
configuration in the user interface and Python API instead.

Loading & saving the .blend file does not make any changes to the stored name,
so as to not make hidden modifications. Only when setting the property again
will the alias name be overwritten by the main colorspace name.

Fixes T96049

Differential Revision: https://developer.blender.org/D14419
2022-03-23 15:21:58 +01:00
7aab508e32 Color Management: support different settings for render and compositing output
The Output Properties > Output panel now has a Color Management subpanel to
override scene settings. When set to Override instead of Follow Scene, there
are settings to:

* For OpenEXR, choose a (linear) colorspace for RGBA passes
* For other file formats, use different display/view/look/exposure/gamma

These settings affect animation render output, image save of renders and the
compositor file output node. Additionally, the image save operator and
compositor file output nodes also support overriding color management.

Includes some layout changes to the relevant panels to accomdate the new
settings and to improve consistency. Ideally subpanels would be used to better
organize these settings, however nodes and operators don't currently support
creating subpanels.

Differential Revision: https://developer.blender.org/D14402
2022-03-23 15:21:58 +01:00
Jeroen Bakker
51727fe86f Fix T96502: Compilation error OCIO when using GradingPrimaryTransform.
When using GradingPrimaryTransform the generated GLSL code fails to compile. The actual issue is
inside OCIO (https://github.com/AcademySoftwareFoundation/OpenColorIO/issues/1603).

The reason is that unset clamping values are rendered out as `inf`, which isn't recognizable
by GLSL.

The issue is worked around by defining a default for `inf`.

Reviewed By: brecht

Maniphest Tasks: T96502

Differential Revision: https://developer.blender.org/D14425
2022-03-23 14:13:09 +01:00
3d5d8b7f71 Cleanup: Run clang-format on the OBJ exporter 2022-03-23 12:43:03 +01:00
f22331ad21 Cleanup: Move include statements outside of extern "C"
The linking type is to be specified in thew header when
it is really needed.
2022-03-23 12:43:03 +01:00
2d3a62fe16 Fix invalid NULL check in GPU_viewport_unbind_from_offscreen
Mistake from 1d49293b80.
2022-03-23 21:52:01 +11:00
f634010c6e Event System: improve handling of unknown keys
When converting ghost keys to Blender's event system:

- All keys that aren't part of the GHOST_TKey enum map to EVENT_NONE
  (ignored), note that it's an internal error if the value of key isn't
  a known value.

- Modify the switch statement so any missing members of GHOST_TKey
  warn at compile time (GCC & Clang only).

- GHOST_kKeyUnknown maps to EVT_UNKNOWNKEY.
  We could ignore this key, changing can be evaluated separately.
2022-03-23 21:30:36 +11:00
8f63dccaa9 Event System: ignore keys such as print-screen & num-lock
Avoid adding events with their type set to EVENT_NONE as these
can't be categorized usefully (keyboard/mouse/NDOF ... etc),
and add an extra case that needs to be accounted for.

Adding these events seems to be an unintentional change from [0],
these keys used to be ignored in 2.4x.

[0]: a1c8543f2a
2022-03-23 21:17:59 +11:00
ad370868a2 Fix T96712: Debug Assert with PrintScrn & ScrollLock keys
Caused by 08d8eee006.
2022-03-23 20:52:12 +11:00
94b2d83421 Cleanup: move documentation to headers, other minor corrections 2022-03-23 17:18:42 +11:00
56dba4df3c Revert "Fix T89560: Keymap editor no longer shows keying set dropdown"
This reverts commit e55f4657f7.

It's not intended to support assigning shortcuts to this operator,
which could only work for built-in keying sets caused warnings to be
reported warnings when exporting key-maps.

Prefer D14289, preventing users running into this problem to begin with.
2022-03-23 16:47:47 +11:00
d356edf420 UV: support "Tweak Tool: Left Mouse Select & Move"
- Follow the same conventions as the 3D viewport for UV selection
  (using SelectPick_Params internally).

- Use WM_operator_properties_mouse_select for selection properties.
2022-03-23 16:09:22 +11:00
cf1a0ca612 UI: Change subdiv to subdivision for EEVEE hair
Reviewed By: Blendify

Author: @Alaska

Differential Revision: https://developer.blender.org/D14346
2022-03-22 23:09:36 -04:00
612ec0ecdf Fix T96372: UV editor selection display wrong with GPU subdivision
Vertices were not drawn properly as the logic for mapped mesh was used
in the BMesh case.

Edge display would ignore subdivided edges which would come from coarse
edges when setting display flags.
2022-03-23 04:01:12 +01:00
694fe9f77b Fix outliner/selection updates when selecting in the 3D view
The checks for calling outliner flushing didn't account for
entering pose mode for the first time or that pose-bone selection
can also change the object selection.

Resolve by recording what changed and refresh accordingly.

Also de-duplicate calls to DEG_id_tag_update.
2022-03-23 13:44:15 +11:00
5f350a4acd Cleanup: various improvements to ed_object_select_pick
- Document parameters.
- Add code-comments.
- Remove some historic/unhelpful code-comments.
- Rename argument names that were ambiguous
  (object was a boolean for e.g.).
- Move `gpu` picking into an allocated struct which is only
  allocated & used when using GPU picking.
- Move variable declarations after menu picking has been handled.
2022-03-23 13:44:15 +11:00
4822153b85 Cleanup: spelling in comments 2022-03-23 12:15:50 +11:00
6bb28a1a52 Cleanup: follow Python code-style/conventions 2022-03-23 12:00:33 +11:00
3a038f8a60 CMake: add missing headers to source list 2022-03-23 11:58:59 +11:00
d2336237cf License headers: add license header to source/blender/gpu/metal 2022-03-23 11:47:05 +11:00
366abae3e7 Cleanup: use ifdef to disable enum string allocation
Restore variable removed in [0], using an ifdef to avoid the warning.

[0]: c3ecfdf40b
2022-03-23 11:43:21 +11:00
5c27391b0f UI: Clarify fluid sim CFL Number tooltip
Fixes T93863
2022-03-22 18:06:02 -04:00
cc3ec1fc6f Fix minor error in last commit (4b35d6)
If there is no active object, it is to be expected that we are in
object mode as well.
2022-03-22 17:30:03 -03:00
4b35d6950d Fix T96711: snap in edit mode for selected objects does not work
Regression introduced in 52be063012

The `SNAP_NOT_SELECTED` option should only consider base selected if
we are in object mode.
2022-03-22 17:21:58 -03:00
b7b3c4c40c Fix T96705: Crash when pressing F3 outside a Blender window if Developer extras
If the mouse is not hovering the window, there is no active region. This is a
valid state, but the UI-list filter operator didn't account for that case.
2022-03-22 18:35:28 +01:00
b40ac9684c Tiny visual fixes/tweaks for new library override buttons in Outliner
Tweaks:
- Increase horizontal padding for the buttons from 1 point to 2, looked like an
  unintentional placement error before.

Fixes:
- Missing horizontal padding for array buttons
- Small gap between separator line and right column when using a high interface
  scale
- Properly center buttons vertically.
2022-03-22 18:09:46 +01:00
87a0770bb9 Fix T96361: missing update when changing texture mapping properties 2022-03-22 16:33:55 +01:00
8344ef7394 Fix T96524: Regression: The Material Preview doesn't show
The preview does not work well with deferred render result pixels
allocation: it breaks the refresh and requires to toggle current
panels.

Since there is no tiled rendering for previews we don't save any
memory by deferring pixels allocations, so do it for the render
result during the render result creation.

Differential Revision: https://developer.blender.org/D14414
2022-03-22 16:00:09 +01:00
Leon Schittek
7de3caa05d Fix: Drag link search doesn't always connect to socket
Connecting to some sockets of a few nodes via the drag link search
would fail and trigger an assert, because the picked socket wasn't
available. This was due to some sockets only being available with
certain settings.

This patch fixes these cases by adding the availability conditions of
the socket to the node declaration with the `make_available` method
or manually adding a `node_link_gather_search` function.

Differential Revision: https://developer.blender.org/D14283
2022-03-22 09:57:50 -05:00
Laurynas Duburas
6bbc3b5610 Curve: Validation message split from nurb_check_valid
Split retrieval of translated text for the "invalid" messages for NURBS
curves from the actual calculation, which is a lower-level function.
Also fixes an issue where "At least two points required" would always
display in the "Active Spline" panel.

Differential Revision: https://developer.blender.org/D14315
2022-03-22 09:54:13 -05:00
b0aaf6ff4a Fix T96294: Crash and error with shape key normal calculation
A mistake in the mesh normal refactor caused the wrong mesh to
be used when calculating normals with a shape key's deformation.

This commit fixes the normal calculation by using the correct mesh,
with just adjusted vertex positions, and calculating the results
directly into the result arrays when possible. This completely avoids
the need to make a local copy of the mesh, which makes sense,
since the only thing that changes is the vertex positions.

Differential Revision: https://developer.blender.org/D14317
2022-03-22 09:43:02 -05:00
1c790555a0 Cleanup: Use bool for BMesh creation params
These boolean options are passed as uint, but they would be
easier to understand if using bool.

Differential Revision: https://developer.blender.org/D14405
2022-03-22 09:38:12 -05:00
64cd927519 Fix T96308: Mesh to BMesh conversion doesn't calculate vertex normals
Currently there is a "calc_face_normal" argument to mesh to bmesh
conversion, but vertex normals had always implicitly inherited whatever
dirty state the mesh input's vertex normals were in. Probably they were
most often assumed to not be dirty, but this was never really correct in
the general case.

Ever since the refactor to move vertex normals out of mesh vertices,
cfa53e0fbe, the copying logic has been explicit: copy the
normals when they are not dirty. But it turns out that more control is
needed, and sometimes normals should be calculated for the resulting
BMesh.

This commit adds an option to the conversion to calculate vertex
normals, true by default. In almost all places except the decimate
and edge split modifiers, I just copied the value of the
"calc_face_normals" argument.

Differential Revision: https://developer.blender.org/D14406
2022-03-22 09:33:50 -05:00
86d87fcbdb GL: Fix compilation error on MSVC (for real) 2022-03-22 14:52:51 +01:00
a43f3c761e GL: Fix compilation error on MSVC 2022-03-22 14:51:32 +01:00
e0ce1c45f8 Fix T96577: setting curve handles not working correctly with multiple curves
Differential Revision: https://developer.blender.org/D14409
2022-03-22 14:41:43 +01:00
3b5224b57c Cleanup: refactor passing of color management settings for image save
Make a copy of ImageFormatData that contains the effective color management
settings, and pass that along to the various functions. This will make it
possible to add more complex logic later.

For compositing nodes, passing along view and display settings through
many functions made it harder to add additional settings, so just get those
from the scene now.

Differential Revision: https://developer.blender.org/D14401
2022-03-22 14:15:20 +01:00
2ebcb7fab3 Cleanup: make format and fix warning 2022-03-22 13:44:15 +01:00
Jason Fielder
19c793af35 Metal: Make GLSL shader source MSL compliant also
Metal shading language follows the C++ 14 standard and in some cases requires a greater level of explicitness than GLSL. There are also some small language differences:

- Explicit type-casts (C++ requirements)
- Explicit constant values (C++ requirements, e.g. floating point values using 0.0 instead of 0).
- Metal/OpenGL compatibility paths
- GLSL Function prototypes
- Explicit accessors for vector types when sampling textures.

Authored by Apple: Michael Parkin-White

Ref T96261

Reviewed By: fclem

Maniphest Tasks: T96261

Differential Revision: https://developer.blender.org/D14378
2022-03-22 12:54:44 +01:00
Jason Fielder
309ea31485 Metal: Initial Implementation of Metal Backend for GPU Module.
Adding WITH_METAL option to CMAKE to guard compilation for macOS only. Implemented stub METALBackend to mirror GPUBackend interface and added capabilities initialisation, along with API initialisation paths.

Global rendering coordination commands added to backend with GPU_render_begin and GPU_render_end() commands globally wrapping GPU work. This is required for Metal to ensure temporary resources are generated within an NSAutoReleasePool and freed accordingly.

Authored by Apple: Michael Parkin-White, Vil Harvey, Marco Giordano, Michael Jones, Morteza Mostajabodaveh, Jason Fielder

Ref T96261

Reviewed By: fclem

Maniphest Tasks: T96261

Differential Revision: https://developer.blender.org/D14293
2022-03-22 12:54:34 +01:00
Pratik Borhade
913b6b9ec1 Fix T96624: NLA crash when reordering tracks if no object is selected.
Caused by rBc0bd240ad0a1.
To avoid crash, make boolean value false if active object data is NULL.

Should be backported to 2.93 LTS and 3.1 corrective releases.
2022-03-22 12:04:41 +01:00
3b745f3455 Cleanup: make format + extra parenthesis
Nested ? : get better formatted with some parenthesis around the expressions.
2022-03-22 11:36:10 +01:00
2ba72d847b Fix (unreported) Crash in Array modifier.
Typo (copy/paste mistake) in rB923b28aab85768e2b.
2022-03-22 11:25:54 +01:00
ceaa787e42 Fix T96420: Set ID node not working for instances
Previously, instances used the point domain, but now there is a special
domain for instance attributes that the node has to use.
2022-03-22 11:09:53 +01:00
c1909770e7 CMake: prep USD build & find scripts for USD >= 21.11
Since USD 21.11 the libraries are prefixed with "usd_", i.e.
"libusd_m.a" became "libusd_usd_m.a". This commit adjusts our
`usd.cmake` (for building USD) and `FindUSD.cmake` (for finding the USD
libraries) so that they work with and without this `usd_` prefix.

See for more info:
https://github.com/PixarAnimationStudios/USD/blob/release/CHANGELOG.md#2111---2021-11-01

Reviewed By: LazyDodo, brecht, mont29

Differential Revision: https://developer.blender.org/D14334
2022-03-22 10:56:21 +01:00
47451af027 Cleanup: remove unused code from ed_object_select_pick
- No need to store is_pose_mode, check the object_mode flag instead.

- Remove redundant pose-mode check which now skips object selection.

- Remove disabled grease pencil cursor toggling,
  since I couldn't manage to reproduce a situation where the cursor
  failed to update - also, as there are other places the active object
  can change this would need a more general solution anyway.
2022-03-22 18:07:47 +11:00
6d9de230df Cleanup: refactor 3D view selection picking to early exit for menus
Selecting that opens a menu is now returns early. Handling the menu
selection in-line made this function more difficult to follow.

Also split out selecting an object by it's center into it's own function.
2022-03-22 17:34:37 +11:00
fa96f7381c Cleanup: de-duplicate object-mode locking when selecting 2022-03-22 17:34:37 +11:00
8c072cdc93 Obj: try to fix Linux tests
Related to previous D14368 bug fix, the sorting
operator was not necessarily a stable order sort.
2022-03-22 06:39:50 +02:00
127baac44d Fix pose-selection from menu not activating the object
Unlike the regression from T96663 selecting pose bones from menus
never activated the object.
2022-03-22 13:42:37 +11:00
59870796ea Fix T96663: Selecting a pose-bone doesn't activate the object
Regression in [0] that removed object selection changes while remaining
in pose-mode. This unintentionally removed object activation.

[0]: 859c062a2a
2022-03-22 13:39:01 +11:00
4046f61b39 Fix pose-bone menu selecting before activating the menu
Regression in 1d88aeb95f.
2022-03-22 12:07:00 +11:00
4e1e057ced Cleanup: variable names for menu selection
- Rename baseCount to bone_count, was copy-pasted from object code.
- Also rename baseCount to base_count for object selection,
  following snake case naming conventions.
- Use int instead of short for counters, as there is no reason to use
  short ints.
2022-03-22 11:57:25 +11:00
8bccc7d861 Cleanup: add proper IMB_openexr.h instead of including file from intern/ 2022-03-22 01:30:19 +01:00
9cf40eee4b Fix build error when WITH_OPENEXR=OFF, after recent refactor 2022-03-22 01:30:19 +01:00
fab14f7854 Fix build when using WITH_TBB=OFF after recent changes
And wrap tbb::parallel_sort in blender namespace similar to other TBB
functionality.
2022-03-22 01:30:19 +01:00
976c91cd77 Cleanup: Clang tidy 2022-03-21 17:12:22 -05:00
def1c0c538 Cleanup: Small changes to multires bake normals access
- Order return arguments last, add `r_` prefix
- Use explicit size on array argument
- Avoid double negative in if statement
2022-03-21 17:11:39 -05:00
3a8a7d93f9 Fix T96401: Broken multires baked normals result
A 7 year old commit, 2ec00ea0c1, used incorrect indexing for
the optional array of precomputed poly normals. Apparently that code
path was never used, or this issue would have been discovered earlier.
Recent changes calculate normals on a temporary mesh and use those
for the "low-res" layer, meaning the precomputed path was always taken.
2022-03-21 16:55:55 -05:00
923b28aab8 Fix T96494: Array modifier with caps crash on curve objects
Since 3b6ee8cee7, a list of vertex groups cannot be retrieved
from curve objects for merging because curve objects do not support
vertex groups. Previously the empty list on the object was returned.
Only mesh objects are supported for the caps.
2022-03-21 14:44:39 -05:00
eb1755be35 Fix T96511: New OBJ exporter no longer groups faces by material
Old python exporter in 3.0 and earlier ordered faces by material,
but the new C++ exporter in 3.1+ did not, and was just writing them
in whatever is the order of the mesh data structure.

This mostly does not cause problems, except in some apps e.g.
Procreate -- for large enough meshes, this lack of
"order by material" (which ends up having more usemtl lines)
ends up creating more mesh subsets than necessary inside Procreate.

The change is not computationally heavy, e.g. exporting 6-level
subdivided Monkey mesh goes 1085ms -> 1105ms on my machine.

Reviewed By: @howardt
Differential Revision: https://developer.blender.org/D14368
2022-03-21 20:20:09 +02:00
a58be397e2 Curves: new Add brush
This adds a new Add brush for the new curves object type in sculpt mode.
The brush is used to insert new curves (typically hair) on the surface object.

Supported features:
* Add single curve exactly at the cursor position when `Add Amount` is 1.
* Front faces only.
* Independent interpolate shape and interpolate length settings.
* Smooth and flat shading affects curve shape interpolation.
* Spherical and projection brush.

This also adds the `surface_triangle_index` and `surface_triangle_coordinate`
attributes. Those store information about what position on the surface each
added curve is attached to:
* `surface_triangle_index` (`int`): Index of the internal triangle that a curve
  is attached to. `-1` when the curve is not attached to the surface.
* `surface_triangle_coordinate` (`float2`): First two numbers of a barycentric
  coordinate that reference a specific position within the triangle.

Ref T96444.

Differential Revision: https://developer.blender.org/D14340
2022-03-21 18:59:03 +01:00
Ethan-Hall
f8d19ec5a3 UI: improve names and tooltips in viewport preferences
Rename OpenGL to GPU, Show to Text Info Overlay, and various other tweaks.

Differential Revision: https://developer.blender.org/D14344
2022-03-21 18:09:43 +01:00
Hallam Roberts
c7e25a25b0 Fix T96132: Cycles RGB/Vector/Float Curve shaders ignore extrapolation setting
Differential Revision: https://developer.blender.org/D14393
2022-03-21 17:41:17 +01:00
f92e3b39f1 UI: Use title case for labels 2022-03-21 11:35:17 -05:00
8530e48f86 Cleanup: move render image and multilayer EXR write code to image_save.cc
These share a lot of logic with regular image saving and should be unified
more in the future.
2022-03-21 16:38:13 +01:00
b96462519f Cleanup: move image_save.c to c++ 2022-03-21 16:38:13 +01:00
1897df891c Cleanup: move OpenEXR channel name construction to OpenEXR code 2022-03-21 16:38:13 +01:00
6e4d2fa914 Cleanup: add image_format.cc for functions related to ImageFormatData
Also fixes missing code to read/write/free/copy color management settings
in various places. This can't be set through the UI currently, but still
should be handled consistently.
2022-03-21 16:38:13 +01:00
Ethan-Hall
4abb8a14a2 Cycles: make 3D texture sampling at boundaries more similar to GPU
CPU code for cubic interpolation with clip texture extension only performed
texture interpolation inside the range of [0,1]. As a result, even though the
volume's color is sampled using cubic interpolation, the boundary is not
being interpolated. The GPU appears was interpolating samples that span the
clip boundary softening the edge, which the CPU now does also.

This commit also includes refactoring of 2D and 3D texture sampling in
preparation of adding new extension modes.

Differential Revision: https://developer.blender.org/D14295
2022-03-21 16:38:13 +01:00
Ethan-Hall
be3eef19c0 GPU: Allow the user to set an anisotropic filtering setting below the implementation-defined value of GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT
Allow the user to set an anisotropic filtering setting below the implementation-defined value of `GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT`.

This bug-fix is also needed for 2.93 LTS.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D14392
2022-03-21 13:47:08 +01:00
Hallam Roberts
c5456819ee Fix T96655: Bloom crashes Eevee
This patch fixes T96655, bloom crashing Eevee.

The error occurs because rB472fc0c55848b2e2d428cfb4f7debb80a4e12081 added `vec3 safe_color(vec3 c)` to `common_math_lib.glsl`.

However, `vec3 safe_color(vec3 c)` already exists in `effect_bloom_frag.glsl`.
This means `vec3 safe_color(vec3 c)` is duplicated within `common_math_lib.glsl` and `effect_bloom_frag.glsl`.

{F12938060 size=full}

The duplicate code in `effect_bloom_frag.glsl` can be removed since it's no longer needed.

(I checked the remaining methods, there shouldn't be any additional duplicate code)

Reviewed By: fclem

Maniphest Tasks: T96655

Differential Revision: https://developer.blender.org/D14396
2022-03-21 13:20:06 +01:00
Sergey Sharybin
ae21729557 Cycles: Un-pause render when switching to rendered viewport
Consider switching to rendered shading type as a request to start
rendering, without requiring to un-pause.

This minimizes amount of clicks needed to start rendering after
viewport was paused once, and then shading mode got changed.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D14244
2022-03-21 10:59:08 +01:00
Pierre Risch
e4278b72bb T84815: Missing preview image in compositing file output node
Hello,
I saw that this revision was stalled for a few months so I tried to update it.
https://developer.blender.org/D10995
I added a function that adds a preview on the first connected input of the file output node.
I removed the preview on the single layer format
Thanks

Reviewed By: #compositing, jbakker

Maniphest Tasks: T84815

Differential Revision: https://developer.blender.org/D14219
2022-03-21 10:56:40 +01:00
9ed63ebb45 Fix T96572: eevee crash with motion blur and stereoscopy
This was a use-after-free bug due to dangling pointers.
2022-03-21 10:05:39 +01:00
fb87578698 Fix T96255: Node socket fails to drag
This is a general issue exposed by moving from tweak to click-drag
events [0], however this bug would have existed for both click &
click-drag events beforehand.

Since [1] the following behavior could occur:

- Click-drag the cursor away from the button.
- Leaving the button would flag it as disabled.
- The disabled button would then break
  causing the event to be considered handled.
- Once handled no click / click-drag action would be tested.

The bug would only happen if the cursor left the button before the drag
threshold was reached which tended to happen with an UI-scale 2 or more.
Or with an increased drag threshold.

Revert [1] (fix for T78503), which is no longer needed since as of [2].

[0]: 4986f71848
[1]: 6f96dd8576
[2]: 87c13ac68c
2022-03-21 18:20:44 +11:00
c4ce1b70e3 Correct error in 3dc44f8c89
The array for event.flag was too big, harmless but incorrect.
Remove the size from the declaration as it's not needed.
2022-03-21 17:21:28 +11:00
3dc44f8c89 Event System: improve event printing
- Use set-style printing of modifier flags instead of booleans.
- Include event.flag.
- Print on a single line (so output can be more easily filtered).
2022-03-21 17:19:26 +11:00
52af3b20d4 Cleanup: cursor motion events now have value set to KM_NOTHING
In some cases value of cursor motion events was set from the last event
written to the wmWindow.eventstate. Avoid potential errors by ensuring
cursor motion events always have their value set to KM_NOTHING.
2022-03-21 15:49:15 +11:00
8ecaa2d624 Fix T96510: ASAN failure when selecting text in Text Editor
Regression in 541ba68991
2022-03-21 13:36:07 +11:00
Aras Pranckevicius
b9123b806f Fix T96470 new obj exporter writing material groups
This is patch D14349 from Aras Pranckevicius.

The logic in the code was _completely different_ from the documentation
and what the python exporter in 3.0 did. The new code assumed that
"export material groups" meant "append material name to the object name",
and was only ever kicking in when the "export object groups" option was
also checked. But the proper behavior (as in 3.0 exporter & the online docs),
is to emit g objectname_materialname before each usemtl line. Which is something entirely else.
2022-03-20 08:59:16 -04:00
Aras Pranckevicius
5bfdaaa800 Fix T96415: new OBJ exporter was applying scaling factor incorrectly
This is patch D14347 from Aras Pranckevicius.

Instead of scaling "the scene" (i.e. transform vertices by object matrix,
then multiply by scale factor), it was instead first applying the scale
factor in local space, and then transforming by the object matrix.
2022-03-19 17:14:53 -04:00
eccb0b222e GPencil: Port main object shader to ShaderCreateInfo
This is quite a huge cleanup. Making use of the `common_gpencil_lib.glsl`
to share more codes and use more consistent codestyle.

The gpencil engine specifics are now out of the `gpencil_vertex()`
function making it easier to add more features.

There should be no regression as all workarounds are kept as is.
2022-03-19 22:05:34 +01:00
36b02c3815 GPUSource: Fix failure case in the enum preprocessor
Some C headers might define the typedefs of the enum themselves.
Even if they are guarded by preprocessor `#if`, our enum preprocessor
has no idea of the validity of the statement. So we just bypass
if there is a typedef just before any `enum` keywords.

Note that the typedef matching is quite fragile.
2022-03-19 22:05:34 +01:00
472fc0c558 DRW: Port improvements in common_math_lib.glsl from eevee-rewrite
Mostly quality of life functions and macros.
2022-03-19 22:05:34 +01:00
6ae03375b6 DRW: Make use of shader shared header
# Conflicts:
#	source/blender/draw/intern/draw_manager.h
#	source/blender/draw/intern/draw_manager_exec.c
#	source/blender/draw/intern/draw_shader_shared.h
2022-03-19 22:05:34 +01:00
3eaf345352 DRW: Introduce GPencil common GLSL library
This library contains the needed functions to render GPencil object
geometry. Centralizing these will make it possible for other draw
engines (EEVEE, Overlay) to reuse the same vertex shader code and
possibly the same fragment rejection methods.
2022-03-19 22:05:34 +01:00
84a0e04296 GPencil: Use ShaderCreateInfo for fullscreen shaders
Simple port. Shouldn't break anything.
2022-03-19 22:05:34 +01:00
568c453ff3 GPencil: Use ShaderCreateInfo for antialiasing shaders
Simple port. Shouldn't break anything.
2022-03-19 22:05:34 +01:00
337343ecc9 GPencil: Use ShaderCreateInfo for vfx shaders
Simple port. Shouldn't break anything.
2022-03-19 22:05:34 +01:00
d7ecd4a0f3 DRW: Add new texture from pool acquire/release mechanism
This adds a simple and more manageable temp texture behavior.

The texture is garanteed to be available only between the acquire/release pair.
This makes the same engine able to reuse the textures and even overlap the acquire
& release calls.
2022-03-19 22:05:34 +01:00
dbf1e7c07f DRW: GPU wrappers: Some quality of life improvements
- Add name support to storage buffers
- Delete view functions for TextureFromPool
- Add support for different size acquire and assert on mulitple acquire
- Allow multiple release
2022-03-19 22:05:34 +01:00
Aras Pranckevicius
8aa365745a Fix T96430: new OBJ exporter wrong normals for non-uniform scale, and wrong face order for negative scale
This applies patch D14343 from Aras Pranckevicius, with a description:

The new 3.1+ OBJ exporter did not have correct logic when faced with
non-uniform & mirrored (negative on odd number of axes) object scale:

- Normals were not transformed correctly (should use inverse transpose of the matrix),
 and were not normalized,
- Face order was not "flipped" when transform has negative scale on odd number of axes
 (visible when using "face orientation" viewport overlay).
2022-03-19 16:20:22 -04:00
873801d25e Make Format Changes
Only formatting changes found by running "make format", no functional
changes

Committed without review, but with verbal approval by Hans Goudey
2022-03-19 10:24:56 -07:00
f381c73a21 Fix T95257: Filter files on "name" and "relpath"
When filtering File Browser items by name, use entry's "name" field as
well as the "relpath" field since they can vary.

See D13940 for details.

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

Reviewed by Bastien Montagne
2022-03-19 09:23:05 -07:00
82c852f387 Fix D14173: Chinese IME Full Width Numbers
Windows IME: Fix duplicated initial character when entering numbers
while in Chinese full width character mode.

See D14354 for more details.

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

Reviewed by Brecht Van Lommel
2022-03-19 09:05:10 -07:00
8711483632 BLI: generalize converting CPPType to static type
Previously, the conversion was done manually for a fixed set of types.
Now, there is a more general utility that can be used in other contexts
(outside of geometry nodes attribute processing) as well.
2022-03-19 10:57:40 +01:00
3e16f3b3ef BLI: move generic data structures to blenlib
This is a follow up to rB2252bc6a5527cd7360d1ccfe7a2d1bc640a8dfa6.
2022-03-19 08:26:29 +01:00
c655146b87 Fix T96584: Properly translate operator on splash screen
The previous fix looks to have been accidentally removed as part of
rB7aec5b06227.

Restore the change.
2022-03-18 20:31:24 -07:00
7fed213ba4 Revert "Compositor: Support backdrop offset for the Viewer node"
This reverts commit 33409f9f1c, as it breaks
panning in the image editor.

Fixes T96543
2022-03-19 00:37:30 +01:00
356073c13e Cleanup: Move object_transform.c to C++
Compilation and clang tidy fixes, use Vector instead of the
macro-based C array system. Builds on all platforms on the
buildbot.
2022-03-18 15:50:46 -05:00
2297db5c49 DRW: gpu wrappers: Fix compilation in release mode 2022-03-18 20:59:48 +01:00
16dd382f06 GPUTexture: Add Cube view as 2D array
This is useful to read/write to the textures directly using compute
shaders and imageLoad/Store.
2022-03-18 20:59:44 +01:00
c509a12fd8 DRW: Expose stencil view in gpu_wrapper 2022-03-18 20:59:40 +01:00
daa26ac0f5 Cleanup: DRW: Fix comments in DRW_gpu_wrapper 2022-03-18 20:59:37 +01:00
e5c2bfb341 DRW: Add support for compute indirect command.
This just expose the GPU API through DRW.
2022-03-18 20:59:33 +01:00
d7df0dcccb GPU: Add indirect dispatch support.
This uses a StorageBuf as the source of indirect dispatch argument.
The user needs to make sure the parameters are in the right order.

There is no support for argument offset for the moment as there is no
need for it. But this might be added in the future.

Note that the indirect buffer is synchronized at the backend level. This is
done for practical reasons and because this feature is almost always used
for GPU driven pipeline.
2022-03-18 20:59:27 +01:00
7ee816e32f GPU: StorageBuf: Add method to clear the buffer in place.
This is a faster way to clear a buffer instead of reuploading new data.
It is equivalent to `memset` and runs directly on the GPU.

This is better to clear huge buffers and to avoid the sync cost of data upload.
2022-03-18 20:59:20 +01:00
5bd38f3be8 Cleanup: GPUStorageBuf: Fix header license 2022-03-18 20:57:15 +01:00
33b4e21820 Cleanup: SSBO: Rename ubo to ssbo in arguments. 2022-03-18 20:54:58 +01:00
93bf17d952 GPU: Add support for stencil buffer texturing mode.
This adds the possibility to read the stencil buffer inside shaders.
This is only available on GL 4.3 so use it accordingly.
2022-03-18 20:54:42 +01:00
054957659f GL: Check texture framebuffer feedback only if not using compute pipeline.
This was getting in the way in multiple instances. Compute shaders dispatch
are still made in the presence of the last bound framebuffer even if they
do not interact with it.
2022-03-18 20:54:27 +01:00
935136f844 GPUTexture: Fix bug in texture view creation
The switch case was based on an uninitialized value.
2022-03-18 20:54:18 +01:00
081255671a GL: Add missing format in image layout conversion 2022-03-18 20:54:02 +01:00
3f484c502f GPUShaderCreateInfo: Add explicit early_fragment_test 2022-03-18 20:53:52 +01:00
0f08453ea9 DRW: Add simple texture view wrappers to draw::Texture 2022-03-18 20:53:41 +01:00
3b75ca2f60 GPUTexture: Expose layer & mip count 2022-03-18 20:53:17 +01:00
374cb32d4a GLShader: Fix two small issues with compute shader generated code 2022-03-18 20:53:04 +01:00
2580869901 DRW: Add support for GPUStorageBuf in wrappers
# Conflicts:
#	source/blender/draw/engines/eevee/eevee_light.cc
#	source/blender/draw/engines/eevee/eevee_shadow.cc
2022-03-18 20:50:25 +01:00
8c93f8c6cc DRW: Add support for GPUStorageBuf 2022-03-18 20:49:45 +01:00
bacfd55a0e GPU/GL: Add StorageBuf implementation
Almost 1:1 identical to UniformBuf implementation.
2022-03-18 20:49:41 +01:00
4544761a2d GPUShader: Fix crash when compilation error is a linking error 2022-03-18 20:49:22 +01:00
59f53f5802 EEVEE: Add new experimental "EEVEE Next" option
This is supposed to hold the latest improvement from the EEVEE rewrite branch.
Note that a restart is necessary in order for the engine to appear.

The registration code is a bit convoluted as it needs to be after the WM_init.
2022-03-18 20:49:09 +01:00
Christoph Lendenfeld
37b93b5df8 Animation: Blend To Default Implementation
Add a new operator to the Graph Editor that blends selected keyframes
to their default value.
The operator can be accessed from
Key>Slider Operators>Blend To Default Value

Reviewed by: Sybren A. Stüvel
Differential Revision: https://developer.blender.org/D9376
Ref: D9367
2022-03-18 20:07:16 +01:00
63f9cb5a0b Fix T96608: GPencil Simplify must check general Simplify switch
As the grease pencil simplify is a subotion of general simplify, if the general switch is disabled, the grease pencil simplify must be disabled too.

This patch also disable the UI panel.
2022-03-18 19:50:38 +01:00
298d8a7b4a Curves: Port reverse curves node to the new data-block
Create a function on CurvesGeometry that can also be used for an edit
mode operator in the future. Dealing with CustomData directly means the
code is a bit more verbose than would be ideal, but this would be a
simple thing to clean up in the future if we get an attribute API here.

Also change the reverse node to first work on a read-only geometry
component, and only get write access if there is a curve selected.

Differential Revision: https://developer.blender.org/D14375
2022-03-18 12:24:05 -05:00
d2726e4626 Cleanup: Remove unnecessary namespace usage, use const 2022-03-18 12:21:13 -05:00
b2cb99d3fd Curves: Port fill curve node to the new data-block
This will mostly just remove the overhead of converting
to and from the old curves type, though it also does open
some opportunities for multi-threading in the future.
2022-03-18 12:18:19 -05:00
8146c996eb Fix: Curves last evaluated segment is empty
A mistake in 8538c69921. The offsets include the segment at the
corresponding index, but the evaluated offset calculation was adjusting
the offset for the second to last segment.
2022-03-18 12:05:14 -05:00
5d7f4f2cab Curves: Port transform node to new data-block
Make the new curves' translate and transform functions also affect
the handle position attributes.

Differential Revision: https://developer.blender.org/D14372
2022-03-18 10:30:27 -05:00
fe9e7036b0 Fix UV's not aligning with image.
This reverts a part of {rB33409f9f1cd42e899f2706fe7878e5e89b50d617}.
2022-03-18 14:17:19 +01:00
65b8b38787 Cleanup: Redundant parenthesis 2022-03-18 14:16:16 +01:00
c3ecfdf40b Cleanup: Compilation warnings
Mainly -Wset-but-unused-variable.
Makes default compilation on macOS way less noisy.

Differential Revision: https://developer.blender.org/D14357
2022-03-18 12:07:08 +01:00
2252bc6a55 BLI: move CPPType to blenlib
For more detail about `CPPType`, see `BLI_cpp_type.hh` and D14367.

Differential Revision: https://developer.blender.org/D14367
2022-03-18 10:57:45 +01:00
7509a74116 Fix T96278: missing update after alpha socket connection
Differential Revision: https://developer.blender.org/D14299
2022-03-18 10:49:54 +01:00
c7954d5904 Cleanup: Remove unused function 2022-03-18 10:34:06 +01:00
578c2f117a Curves: Port handle type selection node to new data-block
The node's structure isn't changed, it basically still works the
same way. The use of virtual arrays could be optimized in the
future if necessary.
2022-03-18 00:16:54 -05:00
389807624d Curves: Port Bezier Segment node to the new data-block
Ref T95443
2022-03-17 22:47:56 -05:00
0eb394af74 Fix resizing nodes not respecting the drag-start
Resizing nodes used the cursor location when the event was triggered
instead of the drag-start, harmless but means the drag location isn't
under the cursor especially with a high drag threshold.

Noticed when investigating other drag issues,
unrelated to recent changes to drag behavior.
2022-03-18 13:20:11 +11:00
5035fbdd23 License headers: use SPDX identifiers in intern/itasc
Added license headers based on the original LGPL files from:
gitlab.kuleuven.be/rob-itasc
2022-03-18 10:27:01 +11:00
a0e2373b7e Docs: add license text file for LGPL2.1 2022-03-18 10:27:01 +11:00
89ab3cdc56 Fix wrong documentation/UI text for NodeLink
`RNA_def_struct_ui_text(srna, ...)` was reused for `is_valid` and `is_muted`
which would set the documentation to theirs (actually to that of the last
call).

`RNA_def_property_ui_text(prop, ...)` should be used for the properties.
2022-03-17 23:57:06 +01:00
a67c7693a7 Fix typo in smooth brush tooltip 2022-03-17 23:56:55 +01:00
8407c0b64e Cleanup: unused class members. 2022-03-17 23:56:18 +01:00
d4bd9f6a27 Curves: Port convex hull node to new data-block
This uses the evaluated positions calculations from 8538c69921.
2022-03-17 17:45:37 -05:00
7bdba5f1e0 Cleanup: Remove unused includes 2022-03-17 17:16:53 -05:00
0835996cc9 Cleanup: Rename "spline" variables to "curve"
Ref T95355
2022-03-17 17:08:36 -05:00
ee2d39b3a7 Cleanup: Reorganize duplicate elements file
Use sections to keep all the code for a specific mode together,
rather than keeping the attribute duplication separate.
2022-03-17 16:46:58 -05:00
663bd38ed6 Curves: Port duplicate elements node to new data-block
Remove the conversion to and from `CurveEval` by supporting the
new Curves data-block in the node. This allows for some simplifications
to the code, as well as a fix for transfering curve domain attributes
when duplicating the curve domain.

The performance improvements (obverved through the timings overlay)
can be relatively massive with many curves. When duplicating 10000
4-point curves to become 2 million curves, I observed an approximate
150x improvement, from about 3 seconds to about 20ms.
2022-03-17 16:36:43 -05:00
6d97a5f93c Cleanup: Miscellaneous improvements to duplicate geometry node
- Pass less redundant information in function arguments.
- Use `IndexRange` more instead of direct offset calculations.
- Use specific geometry component types for specialized functions.
- Use const arguments.
- Declare variables closer to where they are created or used.
- Remove some redundant logic.
- Simplify the description for the output geometry.
2022-03-17 16:23:58 -05:00
7fed4c06c2 Fix keying-set selector broken
The menu for Timeline > Keying > Active Keying Set wouldn't show up.

Caused by d8e3bcf770. The function to attach search menu data to the button
would be called twice with different arguments for the same button now.
Shouldn't be an issue in general, but the first call now had the unexpected
side effect that the button would get disabled. Make sure it's re-enabled when
the second call sets the proper search data now.
2022-03-17 17:52:50 +01:00
17906794f5 Fix T96330: Three times slower 'relink to new id' process in 3.1.
Caused by rB43bc494892c3, moving this 'new id' relink to generic
remapping code added the over-head of proper, generic post-processing,
compared to the special-cases previous code was only designed to handle.

Fortunately with recent 'multi-remapping' work we can easily rewrite
that new id relink code to use the multi-remapping approach too.

No behavioral change is expected from this commit, besides the improved
performances (essentially restored to what they where before
rB43bc494892c3).
2022-03-17 17:23:57 +01:00
Henrik Dick
236ef11a07 GPencil: Fix cyclic flag cleared by simplify modifier
Change the sample mode to don't duplicate the last vertex of the
stroke and instead use the cyclic flag to close previously cyclic
strokes. This is necessary for the following modifiers.

Reviewed By: NicksBest

Differential Revision: http://developer.blender.org/D14359
2022-03-17 14:09:29 +01:00
d0968a9c52 BLI: add probabilistic rounding utility 2022-03-17 12:48:41 +01:00
8f68cff01b Cleanup: name enums 2022-03-17 12:42:01 +01:00
dd483215e5 Hair: Sculpt Mode Icons
From hair particle mode:
* Add
* Comb
* Cut
* Grow

New:
* Delete

Only comb and delete are used at the moment (by the new tools which are
under experimental).
2022-03-17 12:12:53 +01:00
b6702aa604 Curves: separate sculpt brushes into separate files
This makes it easier to work on these brushes in parallel.
2022-03-17 10:04:02 +01:00
884b167f74 View 3D: scale object center selection penalty by the pixel size
All screen-space UI thresholds should scale by the interface scale.
2022-03-17 20:02:37 +11:00
e0a8f9b78e Fix unintended de-selection when selecting the object center
Selecting an object that was already active & selected would de-select
it when the cursor was over the objects center.

This was caused by [0] that added a check which assumed more than one
hits from GPU_select meant there were multiple objects to select from.
This is not necessarily the case since bones, camera tracks or the
objects own center can add additional hits.

Resolve by keeping track of the best hit with & without the
active-selected object, only using the non-active-selected if it's found.

[0] 1550573360
2022-03-17 18:21:47 +11:00
bb735bd518 Tweak Tool: supports select & tweak on LMB (with RMB-select key-map)
Support for differentiating the tweak tool from the 3D cursor when
select is set to RMB.

This is currently an experimental preference:
Tweak Tool: Left Mouse Select & Drag

When enabled the tweak tool can now tweak the existing selection
without de-selecting first, a single click can be used to replace
the selection.
This matches selection in the graph & node editors.

This preferences is only available with "Developer Extras" enabled.

Ref T96544.
2022-03-17 16:47:14 +11:00
3017585ebf View 3D: the select operator now uses the cancel flag on failure
Needed so mapping selection to click doesn't pass the click event
through to setting the 3D cursor for e.g.

While this doesn't happen with the default key-map, setting selection
to LMB-click would set the 3D cursor as well (when the selection
fell through to nothing).
2022-03-17 16:22:33 +11:00
859c062a2a View 3D: multi-object pose selection no longer de-selects objects
De-selecting objects meant that selecting a bone would de-select
all the other pose objects - making exiting & entering pose-mode
loose the current set of pose objects.

Match edit-mode behavior: avoid de-selecting objects in the current mode
(unless the action is explicitly performed in the outliner for e.g.).
2022-03-17 14:39:38 +11:00
ba6d59a85a Cleanup: simplify logic for skipping object selection
Previously setting the 'basact' to NULL was done, but this wasn't
so simple to use with deselect_all which needs to check if there was
anything found at the cursor.

Add a 'handled' variable to differentiate this case, when set
don't attempt object selection.
2022-03-17 14:38:38 +11:00
42f430e9a2 Cleanup: minor clarifications to comments & use const variables 2022-03-17 14:37:23 +11:00
83fd242546 Fix 3D view movie-clip track selection
While basic single track selection worked,
toggling and de-selection has been broken since at least 2.83.

Support SelectPick_Params with the exception of deselect_all
which doesn't make sense for tracks as de-selecting all objects
is expected in that case.
2022-03-17 14:37:22 +11:00
7bc6a04767 Cleanup: split movie clip track selection into it's own function
This was an involved operation to include inline,
making ed_object_select_pick more difficult to follow.

Prepare for track selection to properly support SelectPick_Params.
2022-03-17 14:37:21 +11:00
1d88aeb95f View 3D: support for select passthrough when picking selected items
Currently this isn't used in the key-map, it will eventually
allow the 3D viewports tweak tool to match the behavior of other
editors that support tweaking a selection without first de-selecting
all other elements.
2022-03-17 14:37:20 +11:00
ea0c86e961 Cleanup: spelling in comments
Use <pre>..</pre> for pseudo-code.
2022-03-17 10:08:41 +11:00
27388f7f46 Cleanup: include argument names for drop-box callbacks
Indicates typical names for callbacks and allows them to be documented.
2022-03-17 10:08:41 +11:00
Habib Gahbiche
33409f9f1c Compositor: Support backdrop offset for the Viewer node
This is only part of the experimental "Full Frame" mode (disabled
by default). See T88150.

Currently the viewer node uses buffer paddings to display image offset
in the backdrop as a temporal solution implemented for {D12466}.
This solution is inefficient memory and performance-wise. Another
issue is that the paddings are part the image when saved.

This patch instead sets the offset in the Viewer node image
as variables and makes the backdrop take it into account
when drawing the image or any related gizmo.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D12750
2022-03-16 23:28:36 +01:00
22de21bef1 Fix: Compiler error on windows and mac
The previous fix including `<algorithm>` was an improvement
but not the actual error, which appears to be that `int64_t` is
long long int on one platform but just long int on another.
The fix includes the template argument directly.
2022-03-16 16:49:31 -05:00
7a4af7a01b Fix: Build error after curve evaluation commit 2022-03-16 16:29:24 -05:00
8538c69921 Curves: Initial evaluation for curves data-block
This patch adds evaluation for NURBS, Bezier, and Catmull Rom
curves for the new `Curves` data-block. The main difference from
the code in `BKE_spline.hh` is that the functionality is not
encapsulated in classes. Instead, each function has arguments
for all of the information it needs. This makes the code more
reusable and removes a bunch of unnecessary complications
for keeping track of state.

NURBS and Bezier evaluation works the same way as existing code.
The Catmull Rom implementation is new, with the basis function
based on Cycles code. All three types have some basic tests.

For NURBS and Catmull Rom curves, evaluating positions is the
same as any generic attribute, so it's implemented by the generic
interpolation to evaluated points. Bezier curves are a bit special,
because the "handle" control points are stored in a separate attribute.
This patch doesn't include generic interpolation to evaluated points
for Bezier curves.

Ref T95942

Differential Revision: https://developer.blender.org/D14284
2022-03-16 15:47:00 -05:00
9af791f873 Fix: Update icons for hair to curves rename
ddf189892c missed recreating the icons with the new names.
This commit runs `make icons` and replaces the names in CMake.
2022-03-16 12:48:00 -05:00
Bastien Montagne
7e06fc11b7 Add 'multiple' variant of ID relink function.
Similar to other changes to ID remapping, gives huge speedups in some
cases, like certain types of liboverride creation.

Case from {T96092} goes from 1725 seconds (almost 30 minutes) to 45
seconds to generate the liboverride, on my machine.

Reviewed By: jbakker

Maniphest Tasks: T96092

Differential Revision: https://developer.blender.org/D14240
2022-03-16 18:34:20 +01:00
2564d152d6 Cleanup: Remove unnecessary namespace specification
Ever since d5b72fb06c, shader nodes have been in the
`blender::nodes` namespace, so they don't need to use that to access
Blender's C++ types and functions.
2022-03-16 12:33:36 -05:00
263c5b33d6 Fix: Build error from missing build dependencies
Somehow exposed after 943b919fe8, linking could fail because
bf_nodes was not properly configured as a dependency of bf_nodes_shader.
Also add the dependency to the geometry nodes module.
2022-03-16 12:20:05 -05:00
390b9f1305 Fix Cycles HIP assuming warp size 32
In HIP these masks are 64 bit, while in CUDA only 32 bit.
2022-03-16 18:05:48 +01:00
076079454f Cleanup: remove some unused Cycles GPU code
To make porting to other architectures easier, clarifying that this does not
need to be supported. The unused parallel_reduce implementation assumed warp
size 32, but is easy to update if we ever need it in the future.
2022-03-16 18:05:08 +01:00
213d00607e Cleanup: Further removal for legacy geometry nodes
943b919fe8 missed removing the experimental
option and the nodes from the add menu.
2022-03-16 10:56:53 -05:00
79e74b1486 Fix T96518: Gpencil Fill freezes when use invert and click inside areas
When using inverted filling and click inside a closed area and not outside as is expected, the algorithm to detect the contour to fill is unable to find the filling shape and try to fill outside of the valid index.

The infinite loop was adding more memory for each loop and the process continued while there was system resources and finally crashed the system.

As the tool in negative mode is designed to fill all areas when you click outside of any shape, now the algorithm check if the outline is not working as expected and cancels the filling process.
2022-03-16 16:30:53 +01:00
943b919fe8 Geometry Nodes: Remove legacy node code
This commit removes the implementations of legacy nodes,
their type definitions, and related code that becomes unused.
Now that we have two releases that included the legacy nodes,
there is not much reason to include them still. Removing the
code means refactoring will be easier, and old code doesn't
have to be tested and maintained.

After this commit, the legacy nodes will be undefined in the UI,
so 3.0 or 3.1 should be used to convert files to the fields system.

The net change is 12184 lines removed!

The tooltip for legacy nodes mentioned that we would remove
them before 4.0, which was purposefully a bit vague to allow
us this flexibility. In a poll in a devtalk post showed that the
majority of people were okay with removing the nodes.
https://devtalk.blender.org/t/geometry-nodes-backward-compatibility-poll/20199

Differential Revision: https://developer.blender.org/D14353
2022-03-16 08:51:11 -05:00
cb267cec55 Fix T96512: Crash selecting an edge
Regression in 5e5285baf6.
2022-03-16 23:42:31 +11:00
31f31496af Document some flags controlling BKE_library_foreach_ID_link behavior. 2022-03-16 13:15:41 +01:00
42e13ea4bf Cleanup: Deprecated field access in outliner_duplicate
Solved by introducing introducing a variant of MEM_cnew which behaves
as a copy-constructor for a trivial types.

Alternative approach would be to surround DNA structs with clang/gcc
diagnostics push/modify/pop so that implicitly defined constructors
and copy operators are allowed to access deprecated fields.

The downside of the DNA approach is that it will require some way to
easily apply diagnostics modifications to many structs, which is not
possible currently.

The newly added MEM_cnew has other good usecases, so is easiest to
use this route, at least for now.

Differential Revision: https://developer.blender.org/D14356
2022-03-16 12:38:23 +01:00
ddc54a2a6b Cleanup: Remove use of deprecated std::iterator in Freestyle
Resolves a fair amount of noisy warnings with default build on macOS.

Tested using render_layer render test which includes Freestyle layer.

Differential Revision: https://developer.blender.org/D14355
2022-03-16 11:56:30 +01:00
fbc36c77b0 Fix error with pose & deselect_all with 5e5285baf6 2022-03-16 21:25:38 +11:00
79ae5f5014 Fix T96386: crash when changing shader to node group in properties
The previous code updated the wrong node tree. The result was that
the new group node did not have the socket that was supposed to
be linked.
2022-03-16 11:23:45 +01:00
a45108840e CMake: Extra flags to ignore for strict compiler
Solves warnings generated by default build on macOS.
2022-03-16 10:33:04 +01:00
2d42187395 View 3D: refactor edit-mode meta-element selection
Meta-element selection now follows conventions for other picking
functions (e.g. EDBM_select_pick).

- Split meta-element find-nearest into a separate function.

- Cycle the meta-element starting from the active & selected
  instead of comparing & setting a static variable.

- Order elements using depth (from front-to-back)
  when cycling multiple elements.
2022-03-16 20:09:55 +11:00
9df27e7f00 Fix object centers & geometry selecting meta-elements in edit-mode 2022-03-16 19:57:47 +11:00
4f37b548bd Cleanup: de-duplicate struct declaration
Also use boolean instead of int.
2022-03-16 15:55:10 +11:00
8cfdad99a0 Cleanup: incorrect comments, use C comments 2022-03-16 15:30:22 +11:00
24ada9c960 Cleanup: Remove volatile from RenderResult and related APIs
Volatile fields were introduced to the RenderResult struct years ago[1].

However, volatile is most likely not doing what it was intended to do
in this instance, and is problematic when moving files to c++ (see
discussion from D13962). There are complex rules around what happens to
these fields but none of them guarantee what the above commit alluded to.

This patch drops the volatile and cleans up the APIs surrounding it.

[1] rB7930c40051ef1b1a26140629cf1299aa89eed859

Passing on all platforms:
https://builder.blender.org/admin/#/builders/18/builds/338

Differential Revision: https://developer.blender.org/D14298
2022-03-15 21:12:49 -07:00
f1501ac060 Cleanup: rename variables in view3d_select_exec
- Rename 'location' to 'mval', typically used for region cursor coords.
- Rename 'retval' to 'changed', typically used for operators
  when their return value depends on a change being made.
2022-03-16 15:05:05 +11:00
5e5285baf6 View 3D: move picking arguments into a struct & minor refactor
- Add SelectPick_Params struct to make picking logic more
  straightforward and easier to extend.

- Use `eSelectOp` instead of booleans (extend, deselect, toggle)
  which were used to represent 4 states (which wasn't obvious).

- Handle deselect_all when pocking instead of view3d_select_exec,
  de-duplicate de-selection which was already needed in when replacing
  the selection in picking functions.

- Handle outliner update & notifiers in the picking functions
  instead of view3d_select_exec.

- Fix particle select deselect_all option which did nothing.
2022-03-16 14:48:25 +11:00
9a763d24f2 Fix missing update selecting 3D text-box 2022-03-16 13:40:16 +11:00
be7855591e Cleanup: rename cnt to count
Follow naming from T85728.
2022-03-16 11:58:22 +11:00
379bd6d50c Curves: Port count spline length output to new data-block
This fixes T96487 in a similar way to 5791835678,
and also removes the conversion to old curve type for the
"Point Count" output.
2022-03-15 16:22:36 -05:00
d8e3bcf770 Outliner: Display buttons to edit library override properties
As proposed in T95802, this adds buttons to a new column on the right to modify
the override in the Library Override display mode. Some further usability
improvements are planned. E.g. this does not yet expand collections (modifiers,
constraints, etc) nicely or group modified properties of a modifier together.
Vector properties with more than 3 items or matrices aren't displayed nicely
yet, they are just squeezed into the column. If this actually becomes a problem
there are some ideas to address this.

Differential Revision: https://developer.blender.org/D14268
2022-03-15 18:48:52 +01:00
7f77bd95d9 Fix T96381: Cycles GPU wrong render with camera inside multiple volumes 2022-03-15 18:42:08 +01:00
c2f9133b29 Fix Cycles kernel error on Metal after recent changes 2022-03-15 17:56:45 +01:00
630d2b6497 Cycles: allow Adaptive Sampling with Scrambling Distance
While the correlation may not work well with adaptive sampling, in practice
this appears to work ok in most cases

Automatic scrambling distance uses the minimum samples from adaptive sampling,
which provides a good default estimate to avoid artifacts.

Contributed by Alaska.

Differential Revision: https://developer.blender.org/D13325
2022-03-15 16:12:13 +01:00
f9d3632cde Cycles: change Scrambling Distance Multiplier to a soft limit
This allows users to type in values larger than 1, for use in conjunction
with automatic scrambling distance.

Contributed by Alaska.

Differential Revision: https://developer.blender.org/D13580
2022-03-15 16:12:13 +01:00
af51b0d8d8 Fix T96417: Cycles issue with multiscatter GGX and self intersection avoidance
When the light direction is not pointing away from the geometric normal and
there is a shadow terminator offset, self intersection is supposed to occur.
2022-03-15 16:12:13 +01:00
19bff8eb51 Fix T96263: command line rendering affected by current scene subframe 2022-03-15 16:12:13 +01:00
2613a2552d Fix some properties missing in the UI for new Curves object type
Missed some renames from HAIR to CURVES.
2022-03-15 16:12:13 +01:00
3bb4597b2d Disable GPU subdivision if the maximum number of SSBO binding is reached
Some old platforms and drivers have limited amount of SSBO binding per
compute shader. This disables GPU subdivision if we cannot possibly
bind all required buffers within this limit.

For now the maximum number of buffers used by the GPU code is hardcoded,
but will be programmatically detected when shader creation is automated.

Ref D14337
2022-03-15 16:07:32 +01:00
45b637e1e7 GPU capabilities: detect max SSBO bindings
This adds detection of the maximum number of shader storage buffer
bindings that is supported on the current platform. This can be
useful to turn off features that require compute shaders but use
more buffer bindings than available.

Differential Revision: https://developer.blender.org/D14337
2022-03-15 16:04:41 +01:00
e08180fdab Fix slow tracking of long sequences
The performance issue was noticeable when tracking a lot of tracks
which are using keyframe pattern matching. What was happening is that
at some cache gets filled in and the furthest away frame gets removed
from the cache: the frame at marker's keyframe gets removed and needs
to be re-read from disk on the next tracking step.

This change makes it so frames at markers' keyframes are not removed
from cache during tracking.

Steps to easily reproduce:
- Set cache size to 512 Mb.
- Open image sequence in clip editor
- Detect features
- Track all markers

Originally was reported by Rik, thanks!
2022-03-15 15:50:40 +01:00
2156841c8c Fix T96452: Armature corrupted after undoing 'Join' operation.
Modified source Armature ID in the join operation was not properly
tagged as such for the depsgraph (and therefore memfile undo)..

Issue caused/revealed by rBe648e388874a.

Should be backported to 3.1 should we make a corrective release.
2022-03-15 15:02:39 +01:00
256d36683b Cleanup: remove redundant 'extern StructRNA' declarations
After rB9b298cf3dbec, the `StructRNA` declarations can now be accessed via
`RNA prototypes.h`

Also, since all redundated declarations are now removed,
`_WM_MESSAGE_EXTERN_BEGIN` and `_WM_MESSAGE_EXTERN_END` are also no
longer needed.

Differential Revision: https://developer.blender.org/D14342
2022-03-15 09:14:38 -03:00
7ec2c5c10b Cleanup: Remove confusing double negation in RNA helper function
Much more readable that way.
2022-03-15 13:11:41 +01:00
46b35c6836 Cleanup: remove accidental shallow mesh copy 2022-03-15 12:32:18 +01:00
49fc4449e7 Fix T96357: Issue clicking on stem of arrow gizmos to scale on axis
Caused by 0cb5eae9d0 which restored
support for 3D depth when selecting gizmos - making it difficult
to select single lines drawn in front of other gizmos.
Previously the first hit was always used.

Resolve by using a margin around arrow stems when selecting
which was already done for 2D arrows.
2022-03-15 20:03:33 +11:00
a0a572ce8b Cleanup: correct unbalanced doxy sections 2022-03-15 17:29:54 +11:00
683c130b06 Docs: correct doc-string for BPY_driver_reset
Remove outdated reference to "pydrivers.py", also document BPY_DECREF.
2022-03-15 15:31:11 +11:00
8c60050d30 Cleanup: comments in bpy_driver.c, minor corrections 2022-03-15 15:20:38 +11:00
7c24804d62 Cleanup: de-duplicate Py_DECREF when evaluating PyDrivers 2022-03-15 15:06:25 +11:00
977c958242 Fix memory leak when there is an error evaluating a PyDriver
In practice users are unlikely to ever run into this error.
2022-03-15 15:03:27 +11:00
3cbf20228e Cleanup: use single back-ticks in regular comments
Double back-ticks are used for RST literals.
2022-03-15 14:53:49 +11:00
f410efbda0 UI: expose "Dolly View" in the menu
This is mainly to expose the shortcut to make Dolly discoverable.
2022-03-15 13:01:10 +11:00
Iyad Ahmed
fc259d4c30 Fix gpu.types.GPUTexture not passing data buffer to 3D textures
Missed in rB4430e8a00810ca8df2fa20029c4cb8078e8cdbe6

Reviewed By: mano-wii

Differential Revision: https://developer.blender.org/D14333
2022-03-14 16:06:32 -03:00
d4e46c13cc Geometry Nodes: Add named attribute nodes behind experimental flag
This commit adds three nodes:
- `Remove Attribute`: Removes an attribute with the given name
- `Named Attribute`: A field input node
- `Store Named Attribute`: Puts results of a field in a named attribute

They are added behind a new experimental feature flag, because further
development of attribute search and name dependency visualization will
happen as separate steps.

Ref T91742

Differential Revision: https://developer.blender.org/D12685
2022-03-14 11:48:11 -05:00
a5578351c3 Auto-generate RNA-structs declarations in RNA_prototypes.h
So far it was needed to declare a new RNA struct to `RNA_access.h` manually.
Since 9b298cf3db we generate a `RNA_prototypes.h` for RNA property
declarations. Now this also includes the RNA struct declarations, so they don't
have to be added manually anymore.

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

Reviewed by: brecht, campbellbarton
2022-03-14 17:08:46 +01:00
cc98b40f87 Cleanup: Clang tidy 2022-03-14 10:55:48 -05:00
9b298cf3db RNA: Generate property declerations header, solving msg-bus C++ incompatibility
Lets `makesrna` generate a `RNA_prototypes.h` header with declarations for all
RNA properties. This can be included in regular source files when needing to
reference RNA properties statically.

This solves an issue on MSVC with adding such declarations in functions, like
we used to do. See 800fc17367. Removes any such declarations and the related
FIXME comments.

Reviewed By: campbellbarton, LazyDodo, brecht

Differential Revision: https://developer.blender.org/D13837
2022-03-14 16:50:49 +01:00
cff6eb6580 Cleanup: Remove duplicate Bake modifier code
This patch remove all duplicate code for the same Bake modifier logic.

Still some modifiers need custom bake functions and cannot use this generic bake.
2022-03-14 16:13:59 +01:00
8c4ddd5dde Fix dead-lock in movie cache
Steps to reproduce:
- Add image sequence to movie clip editor.
- Set cache limit to a low value in the user preferences.
- Playback until old frames starts to be removed from cache.
- Jump to the beginning of the image sequence.

The reason of dead-lock comes from two factors:
- Due to global nature of the cache limiter calls needs to be
  guarded with locks.
- Image buffers stored in the cache can have their own cache
  (which is used for color management).

Didn't find a better solution than to use recursive lock.
Kind of makes sense since the thread-guardable resource is
recursive (moviecache can have nested moviecaches).

Differential Revision: https://developer.blender.org/D14331
2022-03-14 14:46:49 +01:00
e0241e0860 Convert moviecache to C++ 2022-03-14 14:46:22 +01:00
a5cd1799fc Cleanup: Deduplicate code in Multiply modifier 2022-03-14 11:35:26 +01:00
8eb189925e Cleanup: Make more obvious from the name that function is not public 2022-03-14 11:21:23 +01:00
7306417ae4 Revert "Animation: Sensible frame range for motion paths"
This reverts commit 1558b270e9.

An earlier commit (rB101fadcf6b93c) introduced some new functionality,
which was overlooked in reviewing this commit & got broken.

Will re-commit after the issue has been fixed.

Ref: D13687
2022-03-14 11:17:45 +01:00
Henrik Dick
4045b3d7b6 GPencil: Fix offset modifier negative scale thickness
If the scale in the offset modifier was set to a value lower than -1,
the object would get mirrored. The problem was, that the thickness
was set to 0 by that. This fix makes the thickness calculation only
use the absolute values.

Differential Revision: http://developer.blender.org/D14324
2022-03-14 11:11:22 +01:00
bf5e9ef2df Fix T96402: fix case when material output is contained in node group
For now just assume that a node group without output sockets is
an output node. Ideally, we would use run-time information stored
on the node group itself to determine if the group contains a
top-level output node (e.g. Material Output). That can be
implemented separately.

In the larger scheme of things, top-level outputs within node
groups seem to break the node group abstraction and reusability
a bit.
2022-03-14 10:49:35 +01:00
c6642f06ab Fix T96395: NDOF entries prevent loading of custom keymaps in 3.2
Even though the default key-map didn't use NDOF types some key-maps did.
2022-03-14 20:42:12 +11:00
82e7956f12 Fix T96396: cannot set active node group output with Python
This is essentially the same fix as in rB22a341d9d8d3d337f79df228ab2e4e0726f81430.
2022-03-14 10:21:47 +01:00
b3d0abd893 Fix T96378: B-Bone selection fails in pose-mode
Regression in 3267c91b4d.
2022-03-14 20:10:24 +11:00
d7dd7403a8 WM: avoid hard coded modifier key checks in object.hide_collection
These checks aren't always valid when there are multiple events
in the queue.
2022-03-14 15:50:06 +11:00
541ba68991 Cleanup: use size_t for BLF text API functions
Also minor cleanup to txt_sel_to_buf:

- Use memcpy instead of strncpy as the strings don't contain nil bytes.
- Replace while loops with for loops.
2022-03-14 14:25:33 +11:00
a5571fd0e8 Cleanup: spelling 2022-03-14 14:25:32 +11:00
6ea1455ce3 Fix mistake in 4c951bfa82
Removed WITH_SYSTEM_GLEW by mistake, thanks to @The_Orb for spotting.
2022-03-14 14:25:31 +11:00
b959f603da Fix T96267: Sidebar Tab Font Size Correction
Correction to the calculation of font size used for the tabs on the
Sidebar so that they are always the same size as other content on the
panel.

See D14322 for more details.

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

Reviewed by Brecht Van Lommel
2022-03-13 17:08:15 -07:00
4ec1c8bc9c Cleanup: Use helper variable, const argument 2022-03-13 16:53:48 -05:00
25b4e41875 Curve: Store NURBS basis cache as a single vector
Instead of allocating a vector of the basis weights cache for
each evaluated point, allocate a single vector for all of the
weights. This should reduce memory usage by avoiding the
overhead of storing many vectors. I noticed a small performance
improvement to evaluated position calculation with an order of 5,
which is larger than `Vector`'s default inline buffer capacity.

This change is possible because of previous commits that
made the basis cache for each evaluated point always have
the same "order" size.
2022-03-13 16:53:48 -05:00
3c8182409c Cleanup: Simplify NURBS basis cache arguments
Only pass a mutable span and a return argument to the calculation
function, so it's simpler and doesn't worry about where either are
stored.
2022-03-13 16:53:48 -05:00
29dc6fb1c1 Curve: Remove temporary buffer during NURBS evaluation
Currently a single buffer is used as working space for all evaluated
points. In order to make evaluations more independent, opening
options like multi-threading in the future, instead use a separate
array for each call. Using an inline buffer capacity higher than
the default allows a few percent performance improvement, and removes
allocations for every evaluated point.
2022-03-13 16:53:48 -05:00
34a61ceeaa Cleanup: Remove unnecessary NURBS optimization
The step after calculating the NURBS basis for a single evaluated
point trimmed extra zeroes from the weights. However, in practice
this rarely did anything, only for the first and last evaluated point
of certain knot configurations. Remove it in order to simplify code.

Also use a separate span for the result, to clarify its length.
2022-03-13 16:53:48 -05:00
Octave C
3b16530aa1 UI: Fix incoherent brush size in popover menu and brush settings
Previously, the popover menu in sculpt/texture paint mode did not
take into account the `UnifiedBrushSettings` for the unit.

To fix this,  the behavior of `class _draw_tool_settings_context_mode`  is matched
by checking the same conditions when setting up the UI of the right-click popover menu.

Fixes T81616

Reviewed By: #sculpt_paint_texture, pablodp606

Maniphest Tasks: T81616

Differential Revision: https://developer.blender.org/D9168
2022-03-13 17:45:35 -04:00
Yevgeny Makarov
301fac5ded UI: Fix Label alignment in top bar
Label alignment in top bar by using `ui_text_icon_width_ex` instead of `w_hint`

Old:

{F12733743}

New:

{F12733742}

Fixes T61558

Reviewed By: Severin

Maniphest Tasks: T61558

Differential Revision: https://developer.blender.org/D13552
2022-03-13 17:38:55 -04:00
Henrik Dick
a6b5d5bfe8 GPencil: Simplify modifier minimal vert count fix
Lower the minimal vert count for all simplify modes.

Differential Revision: http://developer.blender.org/D14319
2022-03-13 17:21:30 +01:00
Aras Pranckevicius
70720c42c2 Fix T96303: C++ OBJ exporter needs presets and skip modifiers.
This patch, D14303, from Aras Pranckevicius adds presets to the OBJ exporter,
and also adds a checkbox (default on) to apply modifiers before export.
2022-03-13 12:04:52 -04:00
91dbc28363 Cleanup: clang format 2022-03-13 00:49:41 -05:00
f6b7396610 Fix transform gizmo check for shift to constrain to a plane
The eventstate was checked instead of the current event being handled,
causing the check to be invalid in some cases.
2022-03-12 21:29:14 +11:00
a2bb3c4cad GPencil: Fix unreported select error in Normalize operator
The curve selection was wrongly checked.
2022-03-12 10:48:42 +01:00
8617ab153e Fix T96352: Gpencil crash using Normalize Thickness with Curves
The stroke curve data could be NULL.
2022-03-12 10:33:32 +01:00
Dilith Jayakody
39c070ed8f Fix T96229: GN Fillet Node unexpected limit radius behavior for 3 point splines
This commit fixes T96229.

The maximum possible radius was being used for 3 point
splines, regardless of the current radius.

Reviewed By: HooglyBoogly

Maniphest Tasks: T96229

Differential Revision: https://developer.blender.org/D14311
2022-03-12 10:19:26 +05:30
f19582ebf4 UI: Use property split in curves surface panel 2022-03-11 14:57:50 -06:00
db7c4d7a1c Cleanup: Use new enum for NURBS curve knots modes
Move the definition of the enum to `Curves` DNA, since the values
will be saved in files, and ongoing development needs to use this.
2022-03-11 14:55:42 -06:00
bd9f94e917 Fix T94692: Show Cached OneDrive Thumbnails
When OneDrive files are offline, show preexisting thumbnails.

See D13930 for details.

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

Reviewed by Julian Eisel
2022-03-11 10:05:16 -08:00
22807d2075 Curves: Move constructor/assignment
Add the ability to move `CurvesGeometry` without copying its attributes
and data. The benefit is more intuitive management of the data-block
copying, and less overhead for copying in some cases. The "moved-from"
source is left in an empty but valid state. A test file is added to test
the move constructor.
2022-03-11 11:34:03 -06:00
Ethan-Hall
3b28c785d4 Cycles: show viewport hair settings when using Cycles
Before this patch, users had to switch render engines just to change how the
hair should be displayed in solid and material preview viewport shading modes.

Differential Revision: https://developer.blender.org/D14290
2022-03-11 18:27:58 +01:00
Ethan-Hall
3902bebf18 Cycles: make smart interpolation fallback to cubic for GPU
Matching CPU and Eevee behavior.

Differential Revision: https://developer.blender.org/D14296
2022-03-11 18:27:58 +01:00
1842cef210 Fix wrong line width when using Show Lines in Histogram scope
By not resetting the line width, other scopes were using the
wrong line thickness.

Contributed by RedMser.

Differential Revision: https://developer.blender.org/D12030
2022-03-11 18:27:58 +01:00
Hallam Roberts
3da84d8b08 Cleanup: use M_PI_2 and M_PI_4 where possible
The constant M_PI_4 is added to GLSL to ensure it works there too.

Differential Revision: https://developer.blender.org/D14288
2022-03-11 18:27:58 +01:00
62a0984d72 Cleanup: fix source typos homogenous->homogeneous
Contributed by luzpaz.

Differential Revision: https://developer.blender.org/D14306
2022-03-11 18:27:58 +01:00
e1a1dc868b Cleanup: fix source comment typos
Contributed by luzpaz.

Differential Revision: https://developer.blender.org/D14307
2022-03-11 18:27:58 +01:00
dbd9472ef5 Fix: Assert in set spline type node after recent commit
My own error when committing 0602852860. It appears that
the "Endpoint" knots modes should be handled together, otherwise
out of bounds array access is possible.
2022-03-11 11:27:34 -06:00
ae3c8bc9f0 Fix T85689: Replace SHGetFileInfoW for Drive Name
Win32: Replace SHGetFileInfoW as means to get friendly display names
for volumes because it causes long pauses for disconnected remote
drives.

See D14305 for more details.

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

Reviewed by Brecht Van Lommel
2022-03-11 09:26:59 -08:00
5c86f0369c Fix: Deleting vertex group attribute can change original mesh
There was an error with the attribute API implementation for vertex
groups. If the vertex group layer referenced an original mesh, it wasn't
properly duplicated for writing.
2022-03-11 11:25:59 -06:00
28434dab0c Cleanup: Use helper variable
For a NURBS curve, the order is just the degree plus one.
So just pass around the degree instead of always subtracting one.
2022-03-11 10:46:48 -06:00
9097c97767 Fix T96243: Workbench Curvature not rendering in background.
When rendering using the command line the curvature wasn't rendered. The reason
was that the ui_scale wasn't initialized and therefore the same pixels where
sampled to detect the curvature. This is fixed by setting the ui_scale to 1 for any
image render.
2022-03-11 13:52:12 +01:00
9bee8e46a1 Event System: limit early evaluation of drag actions to mouse buttons
Change early drag evaluation added in
1f1dcf41d5 to only apply to drag events
from mouse buttons. Otherwise pressing two keyboard keys at one would
create a drag event for the first pressed key. While this didn't cause
any bugs as far as I know, this behavior makes most sense for drags
that come from cursor input.
2022-03-11 23:06:45 +11:00
c87c12b2a4 Event System: only set press values in win->eventstate
Only set press events in the windows eventstate, not the current event
since it's not useful for these to be set current events press values.
This makes it possible for a press event to access values for the
previous press.
2022-03-11 23:04:11 +11:00
789b1617f7 Fix out of order event handling when calling operators from gizmos
Activating a gizmo used the windows eventstate which may have values
newer than the event used to activate the gizmo.

This meant transforms check for the key that activated transform
could be incorrect.

Support passing an event when calling operators to avoid this problem.
2022-03-11 22:49:47 +11:00
e20fe18706 Correct error in 1032f111d0
Thanks to Jacques Lucke for spotting.
2022-03-11 22:37:16 +11:00
f4c8b4eb3e Fix threading conflict with movie cache line
It was possible that a render thread will be freeing cache while the
interface is iterating over cache items to build cache line.

Found while looking into T94738. It might be a fix, but I am unable
to reproduce the original issue, so can not know for sure whether
there is something else going or or not.
2022-03-11 12:34:37 +01:00
f6564df351 Cleanup: remove duplicate compiler attribute 2022-03-11 15:29:11 +11:00
cf58648409 Correct error in d2222d5b2c 2022-03-11 15:27:34 +11:00
d2222d5b2c RNA: use a function to access the nurbs error message
It makes more sense to use a function in this case as this
creates an error message which is not data associated with
the NURBS curve.
2022-03-11 15:21:30 +11:00
8cc5483331 Text: use simplified logic for txt_to_buf
This function was copied from txt_sel_to_buf, including unnecessary
complexity to support selection as well as checks for the cursor
which don't make sense when copying the whole buffer.

Use a simple loop to copy all text into the destination buffer.
2022-03-11 15:14:14 +11:00
231eac160e PyAPI: use C/RNA API for Text.from_string/to_string
Use faster C code for getting the buffer from text.
2022-03-11 14:44:02 +11:00
1032f111d0 RNA: support functions returning allocated strings
Now it's possible for a C/RNA function to return a dynamic string,
The PROP_NEVER_NULL flag is also supported so a NULL string returns
None in Python.
2022-03-11 14:42:39 +11:00
f527d6582b Cleanup: remove unused variable 2022-03-11 12:38:34 +11:00
d73726dbbe Cleanup: use doxy sections for the outliner 2022-03-11 12:00:08 +11:00
0327a464ba Fix dragging items in the outliner
Regression in b8960267dd,
it's important for box-select to use the drag start to check
if the cursor is over an icon.
2022-03-11 11:46:23 +11:00
Laurynas Duburas
0602852860 Curve: Improve NURBS knot generation modes
This patch enables all 8 combinations of Nurbs modes: Cyclic,
Bezier and Endpoint. Also removes restriction on Bezier Nurbs order.

The most significant changes are mode combinations bringing new
meaning. In D13891 is a scheme showing NURBS with same control
points in a modes, and also further description of each possible case.

Differential Revision: https://developer.blender.org/D13891
2022-03-10 18:34:27 -06:00
27fb63381e Fix T94121: PyAPI: ID property group returns wrong type with iter()
Regression in 265d97556a.
Where iterating directly on a property group failed, e.g.:
`iter(group)`, tests missed this since only `group.keys()`
was checked.
2022-03-11 10:26:27 +11:00
4a8bd31825 Cleanup: use doxy sections in image.cc
Also minor improvements & clarifications to comments.
2022-03-11 09:41:48 +11:00
d449deec21 Cleanup: use enum for local versioning enum 2022-03-11 09:27:37 +11:00
Germano Cavalcante
e3de755ae3 Transform/UI: individualize the option to use snap per editor type
`3DView`'s `use_snap` option has little or nothing to do with using
snapping in `UV`, `Nodes` or `Sequencer`.
So there are no real advantages to keeping these options in sync.

Therefore, individualize the option to use snap for each "spacetype".

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D13310
2022-03-10 18:47:38 -03:00
edcb2ad7b3 Fix: Handle handles reset when realizing with other curve types
The result handle attributes for non-bezier types are zeroed.
By mistake though, the entire array was zeroed, not just the
area corresponding to that curves source.
2022-03-10 15:42:30 -06:00
fe3a9fcce1 Fix incorrect meta strip background color
When viewing meta strip, it had orange color. This was caused by
overflow because of hard-coded offset. Theme got darker, and background
was also set again further in code, but redundant drawing was removed in
f4492629ea.
2022-03-10 20:26:21 +01:00
3f91e7d779 Curves: actually delete curves with Delete brush
Previously, the position was just set to zero as part of the prototype.

Differential Revision: https://developer.blender.org/D14291
2022-03-10 18:06:43 +01:00
22a341d9d8 Fix T96292: unable to set active material output using Python
Differential Revision: https://developer.blender.org/D14301
2022-03-10 18:04:07 +01:00
338fe9e2b5 Cleanup: Reduce duplication in realize instances code
Realizing and copying attributes of meshes, curves, and points are very
similar processes, but currently the logic is duplicated three times in
the realize instances code. This commit combines the implementation
for copying generic attributes and creating the result id attribute.

The functions for threaded copying and filling should ideally be in
some file elsewhere, since they're not just useful here. But it's not
clear where they would go yet.

Differential Revision: https://developer.blender.org/D14294
2022-03-10 09:37:56 -06:00
8cdee3a6d4 Fix T93710: Artifacts denoising hi-res images using OPtiX
Caused by an integer overflow in the tiling utilities of OptiX SDK.

Seems for now it's easier to copy and modify code to our sources so
that we don't need to bump SDK version requirement (which might lead
to an increased driver requirement as well).

There are still some fixes needed from a newer driver to have such
denoising to work properly: Windows requires 511.79, Linux 510.54.

Thanks Patrick for investigation!

Differential Revision: https://developer.blender.org/D14300
2022-03-10 16:17:59 +01:00
Ethan-Hall
34d8ef8fa4 Fix: closest image texture interpolation inconsistent in geometry nodes
The `-0.5f` offset is inconsistent with shader nodes.
See D14235 for an example file.

Differential Revision: https://developer.blender.org/D14235
2022-03-10 11:38:08 +01:00
7b62203fc7 IK: make Ik chain length non-animatable
Mark the chain length of regular and spline IK constraints
non-animatable. Changing the IK chain length requires a rebuild of
depsgraph relations. This makes it unsuitable for animation. It's better
to simply avoid having this property animatable than to allow animation
but produce unstable results.

Ref: T96203
2022-03-10 11:34:51 +01:00
1f1dcf41d5 Event System: key-press while dragging now activates drag first
When dragging with a large threshold (using a tablet for example),
it's possible to press another key before the drag threshold is reached.

So tweaking then pressing X would show the delete popup instead of
transforming along the X-axis.

Now key presses while dragging cause the drag event to be evaluated
before the key press.

Note that to properly base the mouse-move event on the previous
state the last handled event is now stored in the window.
Without this the inserted mouse-move event may contain invalid values
from the next event (it's modifier state or other `prev_*` values).

Requested by @JulienKaspar.
2022-03-10 21:26:15 +11:00
ef6d108b75 Fix T96279: 'Emulate 3 button mouse' fails to emulate MMB
Regression in 08d8eee006 caused
emulate-middle mouse to work once, clearing the modifier key.

Now the modifier key from emulated mouse events is never stored
in the windows event-state.
2022-03-10 20:50:58 +11:00
b33d38ebd9 Cleanup: de-duplicate event customdata freeing logic 2022-03-10 16:44:47 +11:00
8c3aee2faf Cleanup: use SPDX license header 2022-03-10 16:27:18 +11:00
36dd3f42bc Cleanup: use 'WM_file_' prefix for file operations 2022-03-10 16:27:18 +11:00
1829232598 Cleanup: spelling in comments & some minor clarifications 2022-03-10 16:27:18 +11:00
0ef8a6179d Cleanup: Move image.c to c++
Passing on all platforms:
https://builder.blender.org/admin/#/builders/18/builds/329

Differential Revision: https://developer.blender.org/D13962
2022-03-09 21:03:02 -08:00
f379943734 Cleanup: Simplify/deduplicate curves built-in attribute access
Separate two templated functions that deal with custom data so that
each built-in attribute accessor doesn't need the same boilerplace and
logic.
2022-03-09 22:59:39 -06:00
24c543d4af Fix: Add missing break 2022-03-09 10:27:08 -06:00
115ff08fdb Fix: Use "construct" instead of "assign" for uninitialized memory
The realize instances code used "assign", but the attribute buffers on
the result aren't necessarily initialized. This doesn't make a difference
for trivial types like `int`, but it would with more complex types.
2022-03-09 10:23:17 -06:00
6c6f591f90 Curves: Port realize instances node to the new data-block
This commit replaces the temporary conversion to `CurveEval` with
use of the new curves data-block. The end result is that the
process looks more like the other components-- somewhere in between
meshes and point clouds in terms of complexity.

The final result is that the logic between meshes and curves is
very similar. There are a few different strategies to reduce
duplication here, so I'll investigate that separately.

There is some special behavior for the radius and handle position
attributes. I used the attribute API to store spans of these
attributes temporarily. Using access methods on `CurvesGeometry`
would be reasonable to, storing spans separately feels a bit more
predictable for now though.

There should be significant performance improvements in some cases,
I haven't tested that specifically though.

Differential Revision: https://developer.blender.org/D14247
2022-03-09 09:58:02 -06:00
39c50d8f31 Outliner: Ensure compiler error when passing wrong tree-element to macro
Passing a `TreeElement *` instead of its `TreeStoreElement *` to
`TSELEM_OPEN()` would seem to work but cause a bug. Add a type check
that will cause a compiler error if it fails.
2022-03-09 15:28:16 +01:00
8e3a58578a Outliner: Correct check for element culling
I don't see a reason to use 2x the element height for the "in-view"
checks. That seems incorrect (although shouldn't cause issues). So
remove that, I don't expect behavior changes.
2022-03-09 15:23:51 +01:00
c4d3d10401 Cleanup: Deduplicate Outliner item culling logic
For whatever reason the "in-view" check was using 2x the element height.
From what I can see this isn't needed, so I'll remove it in a follow-up
commit.
2022-03-09 15:23:51 +01:00
beaf2baeff Cleanup: fix wrong spelling of texture and indentation
Contributed by luzpaz.

Ref D14271, D14270
2022-03-09 15:07:38 +01:00
Ethan-Hall
ef3d76fbaa Fix wrong detection of alpha for grayscale images, after recent changes
Differential Revision: https://developer.blender.org/D14286
2022-03-09 14:53:07 +01:00
6be665926c LibOverride/Outliner: Restrict further operations over liboverrides.
Restrict a lot deletion/moving around of liboverride objects and
collections in the Outliner.

While some of those operations may be valid in some specific cases, in
the vast majority of cases they would just end up breaking override
hierarchies/relationships.

Part of T95708/T95707.
2022-03-09 12:50:04 +01:00
6a7066c2c1 LibOverride: Add a 'is hierarchy root' macro check. 2022-03-09 12:50:04 +01:00
4da282a161 Curves: rename initial brushes
The brushes that are still called "Test" still need to be changed
until they can get their correct name.

Ref T96259.
2022-03-09 11:33:33 +01:00
010ea688f1 Fix T96233: Crash with gpencil data with vertex groups
Blender crashes when a multi-user grease pencil object has vertex
groups and is modified by modifiers, layer transform or parenting.

The fix makes sure that we copy the vertex group names list.

Reviewed By: antoniov

Maniphest Tasks: T96233

Differential Revision: https://developer.blender.org/D14275
2022-03-09 11:22:51 +01:00
04e89c5b06 Fix T96165: Incorrect render of barcelone scene with BVH2
Fix T95462: Partly transparent objects appear to glow in the dark

The issue was caused by incorrect check for exceeded number
of transparent bounces: the same maximum distance was used
for picking up N closest intersections and counting overall
intersections count.

Now made it so intersection count is using ray distance which
matches the way how Embree and OptiX implementation works.

Benchmark result:
{F12907888}

There is no big time difference in the pabellon scene. The
Victor scene timing doesn't seem to be very reliable as the
variance in time across different benchmark runs is quite
high.

Differential Revision: https://developer.blender.org/D14280
2022-03-09 10:37:19 +01:00
801d7b4921 Fix T95738: wrong "Bottom" selection for cone without base
Original patch by @lone_noel with changes by me.

Differential Revision: https://developer.blender.org/D14102
2022-03-09 10:34:59 +01:00
1f9d85f56a Fix cursor drag failing to use click-start
Error in b8960267dd,
the flag was cleared before use.
2022-03-09 17:18:31 +11:00
9416004092 Cleanup: use doxygen comments & sections for animation files 2022-03-09 16:29:22 +11:00
136f0910ff Fix T96250: Invalid default for uv_relax_method
Correct the default & version existing files.
2022-03-09 16:10:19 +11:00
20f53f6984 Correct assert in 399ac1ff11
Pass NULL instead of an empty string.
2022-03-09 13:43:39 +11:00
399ac1ff11 Fix subtype & default for keying set operator properties
Error in 1a12c9edab,
also correct descriptions.
2022-03-09 13:23:00 +11:00
e55f4657f7 Fix T89560: Keymap editor no longer shows keying set dropdown
Include built-in keying sets when ANIM_keying_sets_enum_itemf is called
without a context to allow binding keys to built-in keying sets.
2022-03-09 13:02:29 +11:00
2146256563 Cleanup: use ELEM macro 2022-03-09 10:13:43 +11:00
626c844105 Cleanup: rename wmEvent.prev_click_* to prev_press_*
At the time of naming these members only some event types generated
click events so it made some sense to differentiate a click.

Now all buttons support click & drag it's more logical to use the
prefix "prev_press_" as any press event will set these values.

Also update doc-strings.
2022-03-09 09:25:14 +11:00
353376c783 Fix T92331: Duplicated Window Should Not Be Modal
Operator area_dupli_invoke should not create modal windows.

See D14253 for details.

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

Reviewed by Brecht Van Lommel
2022-03-08 13:57:35 -08:00
Aleksi Juvani
eb326c7b40 Attributes: Implement CustomData interpolation for boolean data type
This commit fixes an issue, where for instance, when merging vertices
with the "Merge by Distance" geometry node, the resulting vertices had
their boolean attributes set unpredictably.

Boolean attributes are implemented as custom data, and when welding
vertices, the custom data for the resulting vertices comes from
interpolating the custom data of the source vertices.

This commit implements the missing interpolation function for the
boolean custom data type. This interpolation function is implemented in
terms of the logical or operation, that is to say, if any of the source
vertices (with a weight greater than zero) have the boolean set, the
boolean will also be set on the resulting vertex.

This logic matches 95981c9876.

In geometry nodes, attribute interpolation generally does not use the
CustomData API for performance reasons, but other areas of Blender
still do.

Differential Revision: https://developer.blender.org/D14172
2022-03-08 15:51:53 -06:00
521d4190a0 Fix T96146: Subdivide curve node uninitialized dangling handles
Handles of non-cyclic bezier curves were not initialized.
Now properly copy the dangling handle positions and types
from the source curve.
2022-03-08 15:45:37 -06:00
b8960267dd Event System: drag events no longer default to the drag start location
This avoids transform jumping which is a problem when tweaking values a
small amount. A fix for T40549 was made box-select used the location
when the key was pressed.

While it's important for box-select or any operator where it's expected
the drag-start location is used, this is only needed in some cases.
Since the event stores the click location and the current location,
no longer overwrite the events real location. Operators that depend on
using the drag-start can use this location if they need.

In some cases the region relative cursor location (Event.mval) now needs
to be calculated based on the click location.

- Added `WM_event_drag_start_mval` for convenient access to the region
  relative drag-start location (for drag events).
- Added `WM_event_drag_start_xy` for window relative coordinates.
- Added Python property Event.mouse_prev_click_x/y

Resolves T93599.

Reviewed By: Severin

Ref D14213
2022-03-09 08:38:42 +11:00
Hallam Roberts
156e07232e Geometry Nodes: Tiny optimization to UV Sphere primitive
Prevents a few unneeded calls to `std::sin`, with an observed
performance improvement of about 1 percent.

Differential Revision: https://developer.blender.org/D14279
2022-03-08 14:39:58 -06:00
d09695b4dd Cleanup: Clang tidy 2022-03-08 13:28:22 -06:00
90c3147e05 Cleanup: Correct comment
Normals aren't stored in custom data anymore, nor are they stored in
MVert for comparisons.
2022-03-08 12:31:21 -06:00
c7ff99b100 Merge branch 'blender-v3.1-release' 2022-03-08 12:19:50 -06:00
c77597cd0e Fix T95843: Invalid mesh runtime data after sculpt undo
When the geometry of the sculpt mesh was replaced when restoring from
a full undo step, the runtime data was not cleared (including any
normals, triangulation data, or any other cached derived data).
In the report, only the invalid normals were observed.

The fix is to simply clear these caches. Later they will be reallocated
and recalculated if necessary. Since the whole mesh replaced here
anyway, this should be a safe fix.

Differential Revision: https://developer.blender.org/D14282
2022-03-08 12:16:42 -06:00
ffea47530d Merge branch 'blender-v3.1-release' 2022-03-08 18:46:23 +01:00
7add8163e4 Blender 3.1 - version bump -> release 2022-03-08 18:36:00 +01:00
b154b8c6f8 Merge branch 'blender-v3.1-release' 2022-03-08 18:34:09 +01:00
b217eb73f5 Licenses: Attribution document for Blender 3.1 2022-03-08 18:27:04 +01:00
50bd8bb175 Cleanup: Remove extra . at the end of RNA string
The strings must not end with point.
2022-03-08 16:55:29 +01:00
c305b88aac Docs: 3.1 release description for Linux appdata 2022-03-08 16:55:19 +01:00
944122d49f Cleanup: Use ELEM macro 2022-03-08 16:44:03 +01:00
62885637fb Cleanup: Make format 2022-03-08 16:41:30 +01:00
Marc Chéhab
e74838d0d0 GPencil: New "Additive" mode for build modifier
The new mode only builds the new strokes in each frame. 

The code is assuming somebody uses "additive" drawing, so that each frame is different only in its NEW strokes. Already existing strokes are skipped. 

I used a simple solution: Count the number of strokes in the previous frame and ignore this many strokes in the current frame.

Differential Revision: https://developer.blender.org/D14252
2022-03-08 16:40:27 +01:00
5791835678 Geometry Nodes: fix spline length node after recent refactor
Differential Revision: https://developer.blender.org/D14276
2022-03-08 16:09:44 +01:00
7bd3762b7c UI: Minor tweaks to IDTemplate operations. 2022-03-08 14:57:47 +01:00
bea7d2e22d LibOverride: Do not assert when root ID is not object/collection.
While uncommon, this is still a valid case...
2022-03-08 14:57:47 +01:00
178f4fa71e Cleanup: fix compiler warning 2022-03-08 13:58:50 +01:00
6f8e65cd7a Merge remote-tracking branch 'origin/blender-v3.1-release' 2022-03-08 13:48:47 +01:00
d5e4cab76c Fix T96224: GPU subdiv crash with smooth normals and tangents
Tangents are computed from UVs on the CPU side when using GPU subdivision
and require that the normals are available there as well (at least for smooth
shading, flat normals can be computed on the fly). This simply adds the missing
normals update call for the `MeshRenderData` setup for the subdivision case.

Differential Revision: https://developer.blender.org/D14278
2022-03-08 13:47:14 +01:00
3a672fe6fb GPU: disable compute shader for problematic drivers
Some drivers for legacy platforms seem to have issues with compute
shaders, as revealed by T94936. This disables compute shader for the
known drivers where this issue is present. It is not clear if the issue
is Windows only or not, so this disable them for all operating systems.

See T94936 for a list of configurations where the issue is reproducible
or not.

Differential Revision: https://developer.blender.org/D14264
2022-03-08 13:39:18 +01:00
64a5fd7a1d Fix wrong edge crease validity check in the Cycles Alembic procedural 2022-03-08 13:38:21 +01:00
3cb3167278 Simplify sound property handling
Sound properties like volume, pitch and muting are handled in
`BKE_sound_add_scene_sound()`. This is unnecessary, because in
properties are then set to real values in `SEQ_edit_update_muting()` and
`seq_update_seq_cb()`.

Alternatively, it may be better to remove all other updates leave them
in `BKE_sound_add_scene_sound()`. But I want to add muting per channel,
whhich is easier and probably cleaner to do with function
`SEQ_edit_update_muting()`.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D14269
2022-03-08 13:16:36 +01:00
73dc8c24e4 PyAPI: optimize depsgraph use in PyDrivers
Avoid re-creating & freeing the depsgraph for every driver evaluation.

Now the depsgraph is kept in the name-space (matching self),
only re-created when the value changes.

In a contrived test-case with many drivers this gave ~15% overall
speedup for animation playback.
2022-03-08 22:15:12 +11:00
f76f48be23 Fix (unreported) liboverride rules from linked data disapearing.
Code cleaning up no-more-needed override data during diffing process
would systematically remove override data from linked IDs.

While this is not a critical issue in theory, it has bad consequences at
the very least on user UI/UX, and potentially can cause bugs in some
corner-cases scenarii.
2022-03-08 12:08:21 +01:00
0df8c22c8a LibOverrides: Tweak to ensure no overrides can be created on linked data.
Was already mostly the case, but from RNA API there was no proper check.
2022-03-08 11:02:22 +01:00
1c1efe3ac6 Fix memory leak evaluating PyDrivers
Missed decref in 686ab4c940 caused every
driver evaluation to create the BPy_StructRNA depsgraph without freeing
the previously allocated depsgraph.
2022-03-08 20:47:43 +11:00
10c11bb897 Curves: add initial comb, grow and shrink brush
The exact behavior of the brushes is still being iterated on, but it
helps having a base implementation that we can work upon.
All of that is still hidden behind an experimental feature flag anyway.

The brushes will get a name in the ui soon.

Differential Revision: https://developer.blender.org/D14241
2022-03-08 10:41:52 +01:00
Jeroen Bakker
1d902a6367 Fix T96213: Crash when texture painting across multiple materials.
Issue only happens in release builds on windows. That said it was an
actual error in the code. This class is compiled inline in release
builds. When updating multiple textures it would reuse the same memory
to collect the changes. When the previous loaded tilenumber was exactly the
same but from a different image the tile buffer wasn't loaded.

Reviewed By: sergey

Maniphest Tasks: T96213

Differential Revision: https://developer.blender.org/D14274
2022-03-08 10:38:38 +01:00
94d2470c41 Curves: increase default viewport resolution for curves object
This part has to be refactored soon anyway, because more types
curves have to be drawn for the new Curves object.

For now, 3 is a better default than 2, because that matches the
actual resolution of the curve currently.
2022-03-08 10:36:46 +01:00
4b598739c5 Curves: disable stroke spacing for curve sculpt brushes
This makes the brushes more smooth, because the brush has an
effect after every mouse move, instead of only every x pixels.

For this to work well, the brushes have to look at the stroke
segments instead of at the mouse positions separately.

A more fine grained check might be added in the future.
2022-03-08 10:33:51 +01:00
b588c09eee Fix: add missing case in switch statement for curves 2022-03-08 10:23:38 +01:00
3d71a05a1d Merge branch 'blender-v3.1-release' 2022-03-08 09:52:47 +01:00
Pratik Borhade
2ddb53de54 Fix T96228: TypeError on use of Copy from Active Track operation
Issue was introduced after the python 3.10 switch
Explicit conversion to int will fix the issue.
Same issue is likely to happen with `MovieTrackingSettings.default_search_size`
So I did the same change over there.

Differential Revision: https://developer.blender.org/D14273
2022-03-08 09:52:17 +01:00
63ac1660c0 Fix T92861: Transform fails for multiple pose object sharing ob-data
Support transforming two pose objects at once even when they share
object data as this is per-object.
2022-03-08 15:13:53 +11:00
3c889fe2b0 Cleanup: pass const scene argument to UV selection functions 2022-03-08 14:45:33 +11:00
06d9c2c223 Cleanup: spelling in comments 2022-03-08 14:32:34 +11:00
c0c840cc31 Cleanup: prefer UNUSED_VARS_NDEBUG for debug only variables
Otherwise it's possible to accidentally use these variables
in debug builds, breaking release builds.
2022-03-08 14:15:34 +11:00
59c972b40a Event System: remove unused NDOF buttons
GHOST always converts NDOF keyboard buttons into keyboard events
so there is no need to expose their values for Blender event types.
2022-03-08 14:01:49 +11:00
88b2bbc649 Event System: support changing NDOF button shortcuts 2022-03-08 13:56:04 +11:00
b58e660828 Event System: click/click-drag support for NDOF buttons
Support this for completeness, as it's simpler to support click-drag
for all events types that support press/release instead of having to
document which kinds buttons support click-drag.
2022-03-08 13:48:40 +11:00
f052fb5646 Event System: add ISKEYBOARD_OR_BUTTON macro
This simplifies checking for event types that support press & release.
2022-03-08 13:48:34 +11:00
08d8eee006 Event System: refactor click detection into function
Also simplify modifier & keymodifier assignment.
2022-03-08 13:48:33 +11:00
08f88bba69 Event System: exclude cursor & NDOF motion from ISHOTKEY() macro
In practice this didn't cause a bug since assigning hot-keys was also
checking for "press" events (which NDOF_MOTION doesn't generate).

Add ISNDOF_BUTTON macro which is now used by ISHOTKEY to avoid
problems in the future.
2022-03-08 13:48:32 +11:00
7b66397664 Cleanup: spelling in comments, use C++ comments for disabled code 2022-03-08 13:48:31 +11:00
901a03725e Curves: Port mesh to curve node to new data-block
The main improvement is a code simplification, because attributes don't
have to be transferred separately for each curve, and all attributes can
be handled generically. Performance improves significantly when the
output contains many curves. Basic testing with a 2 million curve output
shows an approximate 10x performance improvement.
2022-03-07 19:06:40 -06:00
c238728105 Fix: Curves cyclic access function duplicates attribute
This was an oversight in 6594e802ab. First it must check if the
attribute exists before adding it.
2022-03-07 18:58:04 -06:00
b8f1ae5c38 Cleanup: Rename geometry set "curve" to "curves"
Similar to 245722866d, just another function I missed before.
2022-03-07 16:26:55 -06:00
dfd7832a0e Merge branch 'blender-v3.1-release' 2022-03-07 13:58:14 -06:00
2b3367cdf8 Fix T93573: Curve evaluated mesh selected in edit mode
This fixes the second part of T93573 that 8506f3d9fe didn't
properly address. Specifically, outlines of instances still had the
selected color in edit mode in wireframe view. This change is the
same as that commit, just in a different place.

Differential Revision: https://developer.blender.org/D14229
2022-03-07 13:54:49 -06:00
0597902bde Fix memory leak when reading ffmpeg video frames.
We had forgotten to unref packets after reading them.
This lead to a memory leak inside of ffmpeg.
2022-03-07 19:04:51 +01:00
Leon Schittek
1cb303242f UI: align labels of number fields and value sliders
Previously the labels and values in number fields and value sliders
used different padding for the text. This looks weird when they are
placed underneath each other in a column and, as noted by a comment
in the code of `widget_numslider`, they are actually meant to be
aligned.

This patch fixes that by using the same padding that is used for the
number field for the value slider, as well. This also has the benefit,
that the labels of the value sliders don't shift anymore when adjusting
the corner roundness.

Differential Revision: https://developer.blender.org/D14091
2022-03-07 18:32:47 +01:00
21d633f83b GPencil: Temporary fix to avoid crashes on startup
This quick fix will populate the runtime orig pointers to avoid
crashes when a grease pencil object uses layer transforms, parenting
or modifiers.
This will have to be revisited and fixed with a better solution.
2022-03-07 17:48:36 +01:00
Ethan-Hall
15186f4259 Shader Nodes: added alpha mode selector to Image Texture node
Enables image user nodes to display the file alpha mode, similar to the
colorspace setting.

Also removes image_has_alpha in favor of using BKE_image_has_alpha, because it
did not check if the image actually had an alpha channel, just if the file format
was capable of supporting an alpha channel.

Differential Revision: https://developer.blender.org/D14153
2022-03-07 17:39:27 +01:00
Ethan-Hall
5b4ab89663 Shader Nodes: add Alpha output to Object Info node
An alpha component can be specified for an object's color. This adds an alpha
socket to the object info shader node allowing for the alpha component of the
object's color to be accessed in the shader editor.

Differential Revision: https://developer.blender.org/D14141
2022-03-07 17:35:48 +01:00
76f9d83a19 Merge branch 'blender-v3.1-release' 2022-03-07 17:31:32 +01:00
Ethan-Hall
60481e4d99 Fix T96195: f-curve factorized polynomial generator broken UI
The polynomial parameters were not shown correctly.

Differential Revision: https://developer.blender.org/D14254
2022-03-07 17:30:30 +01:00
f130d4f211 Cleanup: fix various typos
Contributed by luzpaz.

Differential Revision: https://developer.blender.org/D14203
2022-03-07 17:28:39 +01:00
5bb2b4236d Cleanup: move asssertion-test-only variable into #ifndef NDEBUG block
Move `ToolSettings *ts` into an `#ifdef NDEBUG` block, as it's only used
for a `BLI_assert` call.
2022-03-07 17:10:13 +01:00
2d06b97d29 Fix T95256: Crash when creating off-screen pose asset
Fix crash when creating a pose asset for which the file list entry in
the asset browser is scrolled off-screen. Because of the
off-screen-ness, it wasn't loaded into memory, which eventually caused
an unexpected NULL pointer.

The solution was to use a different function (`filelist_file_find_id`)
that can reliably find the file list entry, after which the cache entry
can be created.

Reviewed by: Severin

Differential Revision: https://developer.blender.org/D14265
2022-03-07 17:07:20 +01:00
Leon Schittek
6b8dde93b0 Fix T95531: Draw y axis values in Driver Editor
When drawing the driver editor, only skip drawing the "scrubbing area"
and not the Y-axis values or the scroll bars.

The issue was introduced in rBb3431a88465db2433b46e1f6426c801125d0047d
to avoid drawing the playhead in the Driver Editor but also prevented
the text on the y axis from being drawn.

Reviewed by: Severin, sybren

Maniphest Tasks: T95531

Differential Revision: https://developer.blender.org/D14022
2022-03-07 17:07:20 +01:00
5dca3ee6a2 Fix T95256: Crash when creating off-screen pose asset
Fix crash when creating a pose asset for which the file list entry in
the asset browser is scrolled off-screen. Because of the
off-screen-ness, it wasn't loaded into memory, which eventually caused
an unexpected NULL pointer.

The solution was to use a different function (`filelist_file_find_id`)
that can reliably find the file list entry, after which the cache entry
can be created.

Reviewed by: Severin

Differential Revision: https://developer.blender.org/D14265
2022-03-07 17:04:10 +01:00
5ae26e410a Fix T94360: Assert on dragging keyframes
Fix an assert by commenting out the assert.

In normal situations all keyframes are sorted. However, while keys are
transformed, they may change order and then this assertion no longer
holds. The effect is that the drawing isn't perfect during the
transform; the "constant value" bars aren't updated until the
transformation is confirmed. Apart from that, the code runs fine, so it
seems like a workable workaround.
2022-03-07 16:48:44 +01:00
Leon Schittek
ea3b2e8736 Fix T95531: Draw y axis values in Driver Editor
When drawing the driver editor, only skip drawing the "scrubbing area"
and not the Y-axis values or the scroll bars.

The issue was introduced in rBb3431a88465db2433b46e1f6426c801125d0047d
to avoid drawing the playhead in the Driver Editor but also prevented
the text on the y axis from being drawn.

Reviewed by: Severin, sybren

Maniphest Tasks: T95531

Differential Revision: https://developer.blender.org/D14022
2022-03-07 16:24:17 +01:00
5b2d9c0cbe Merge branch 'blender-v3.1-release' 2022-03-07 15:19:05 +01:00
e908ebc094 Fix T96207: wrong default value of Principled BSDF specular tint
Contributed by MysteryPancake.

Differential Revision: https://developer.blender.org/D14256
2022-03-07 14:53:59 +01:00
7f57899823 Merge branch 'blender-v3.1-release' 2022-03-07 12:37:54 +01:00
00f6e4c990 Fix T96180: driver in node tree not updating in real time
Differential Revision: https://developer.blender.org/D14260
2022-03-07 12:37:13 +01:00
4ffe2fec16 Python: Add new annotation_pre & annotation_post handlers
Annotation tool is used as a general mark tool for many add-ons. To be able to detect when an annotation is done is very handy to integrate the annotation tool in add-ons and other studio workflows.

The  new callback names are:  `annotation_pre`  and `annotation_post`

Both callbacks are exposed via the Python module `bpy.app.handlers`

Example use:

```
import bpy

def annotation_starts(gpd):
    print("Annotation starts")

def annotation_done(gpd):
    print("Annotation done")

bpy.app.handlers.annotation_pre.clear()
bpy.app.handlers.annotation_pre.append(annotation_starts)
bpy.app.handlers.annotation_post.clear()
bpy.app.handlers.annotation_post.append(annotation_done)
```

Note: The handlers are called for any annotation tool, including eraser.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D14221
2022-03-07 12:36:47 +01:00
548eabbaa1 Revert "Revert "Fix Crash: Switching to wireframe mode.""
This reverts commit 25fc5876d3.

Committed this unintentionally, looking into an alternate fix.
2022-03-07 22:32:46 +11:00
638c0bd234 Merge branch 'blender-v3.1-release' 2022-03-07 21:52:24 +11:00
a61ee1dcae Cleanup: quiet warnings 2022-03-07 21:51:50 +11:00
0e51defcf4 Fix T95591: Crash on drawing with measure tool with tweak fallback tool
Using press to activate the Tweak tool doesn't work well when used a
fallback tool as the drag event is often used by the current tool -
making it impossible not to select when dragging (unless the fallback
tool is disabled entirely).
Resolve this by using CLICK events when the Tweak tool is used as a
fallback.

Even though this avoids the crash, check for null-pointer de-reference
since changes to the key-map shouldn't cause operators to crash.

Note that the ability for operators to access a gizmo before it's fully
initialized is a more general problem that should be addressed, but out
of scope for a bug-fix.

Reviewed By: zeddb, JulienKaspar, Severin

Maniphest Tasks: T95591

Ref D14231
2022-03-07 21:47:00 +11:00
Yann Lanthony
7ca13eef7c Improve multi-user gpencil data performance with modifiers
When a grease pencil data-block has multiple users and is subject
to modifiers, layer transforms or parenting, performance
(especially playback) is greatly affected.

This was caused by the grease pencil eval process which does per
instance full-copies of the original datablock in case those
kinds of transformations need to be applied.

This commit changes the behavior of the eval process to do shallow
copies (layers with empty frames) of the datablock instead
and duplicates only the visible strokes.

When we need to have a unique eval data
per instance, only copy the strokes of visible
frames to this copy.

Performance:
On a test file with 1350 frames 33k strokes and 480k points
in a single grease pencil object that was instanced 13 times:
 - master: 2.8 - 3.3 fps
 - patch: 42 - 52 fps

Co-authored by: @filedescriptor
This patch was contributed by The SPA Studios.

Reviewed By: #grease_pencil, pepeland

Differential Revision: https://developer.blender.org/D14238
2022-03-07 11:38:56 +01:00
57c5f2a503 Merge branch 'blender-v3.1-release' 2022-03-07 21:35:21 +11:00
72e20785e1 Fix T96205: Active shape key gets lost upon edit mode undo
Regression in d961adb866,
it's important that for the Mesh used for undo storage matches
the shape-key instead of using the coordinates of the Basis key.

Prior to bfdbc78466 a different method of
restoring the basis shape-key coordinates was used (restoring from the
input `Mesh.mvert` array). When undo wrote the edit-mesh into the mesh
this was always NULL so the basis shape keys coordinates were never
used.

Now a parameter has been added so undo can use the active shape for the
meshes vertex coordinates.

Reviewed By: sergey

Maniphest Tasks: T96205

Ref D14258
2022-03-07 21:31:48 +11:00
25fc5876d3 Revert "Fix Crash: Switching to wireframe mode."
This reverts commit cb986446e2.
2022-03-07 19:55:33 +11:00
Jeroen Bakker
073d2390f0 Fix T96163: Image editor doesn't refresh when undo/redo.
Undo would invalidate image owned GPU textures only. Textures
that are owned by the editor were not refreshed. This patch would
invalidate all the GPU textures by marking the whole image dirty.

This can be improved later as we could add partial updates of GPU
textures.

Reviewed By: mont29

Maniphest Tasks: T96163

Differential Revision: https://developer.blender.org/D14259
2022-03-07 08:43:50 +01:00
ad2948face Merge branch 'blender-v3.1-release' 2022-03-07 07:49:52 +01:00
4681987d92 Fix T96156: Snap to 3D cursor can't be undone
Caused by oversight in 2bcf93bbbe. Operator returns `OPERATOR_CANCELLED`
when it should return `OPERATOR_FINISHED`.

Reviewed By: mano-wii, campbellbarton

Differential Revision: https://developer.blender.org/D14243
2022-03-07 07:46:24 +01:00
Red Mser
8ec35c05b2 Curve: sync active material with selection
Changing active spline updates active material index.

Reviewed By: campbellbarton

Ref D14250
2022-03-07 12:06:33 +11:00
fae45a43fa Cleanup: use doxy-sections for pipeline, text_drag & effects
Also improve on the doc-string for RE_RenderFrame & RE_RenderAnim.
2022-03-07 10:51:22 +11:00
a5f972c018 Cleanup: use loops for key-map entries that map values to number keys
Also add __all__ referencing the only two members of the modules
that should be accessed externally.
2022-03-06 21:16:21 +11:00
887ccb8537 Fix T96152: Crash realizing curve instances
The "curve_type" was transferred to instances because it isn't a
built-in curve attribute. Then it was interpolated as a point
domain attribute from the instance domain in the realize
instances node.

The fix was just missing from 9ec12c26f1.
`curve_type` needs to be marked as a built-in attribute.
2022-03-04 22:28:57 -05:00
295d5c6ef5 Fix T96164: Crash with curve domain attributes
When converting from the new type to the old, the curve domain
attributes weren't properly resized, so their data was not properly
allocated.
2022-03-04 11:11:56 -05:00
45079b169d Fix T96160: freezing when using multiple Handle Type Selection nodes
Differential Revision: https://developer.blender.org/D14245
2022-03-04 15:21:18 +01:00
1763ffa0be Cleanup: Unused variable warnings 2022-03-04 07:59:07 -05:00
5eaeb9bd0d GPencil: Fix wrong parameters in gpencil_check_same_material_color
The stroke and fill parameters were flipped.
2022-03-04 08:44:23 +01:00
0212c423bf Cleanup: remove outdated references to tweak 2022-03-04 13:31:16 +11:00
0a4fdcbb5f Cleanup: unused Python variables & imports 2022-03-04 11:07:37 +11:00
6bca614fd8 Cleanup: use doxy-sections in outliner_draw.cc
Also remove outdated comment.
2022-03-04 10:53:06 +11:00
bfd43222c3 Cleanup: use doxy-sections for interface_dropboxes.cc 2022-03-04 10:35:22 +11:00
0a2d61f45c Sequencer: de-duplicate new-scene enum, include in generated docs 2022-03-04 10:31:11 +11:00
65e6bcdd9f Sequencer: disallow assigning scenes to non-seuencer strips 2022-03-04 10:31:11 +11:00
ccefcf46bf Cleanup: use doxy-sections in scene_edit.c 2022-03-04 10:31:11 +11:00
4837ea3ab6 Cleanup: warning & spelling from recent scene/sequencer operator
- Avoid the abbreviation "VSE" as the convention is to use "sequencer".
- Remove dead-code (second return statement).
- Remove unused argument.
2022-03-04 10:31:11 +11:00
8b06c524d2 Cleanup: spelling in comments, function name 2022-03-04 10:31:11 +11:00
Azeem Bande-Ali
fd2519e0b6 UI: Drag & Drop to Properties Materials Panel
Support drag/drop of materials to Properties Material Slots.

See D13549 for more details.

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

Reviewed by Julian Eisel
2022-03-03 15:28:48 -08:00
471f27d66b Curves: Port endpoint selection node to new data-block
The node should be faster than in 3.1, for a few reasons:
- It doesn't need to calculate and allocate the curve offsets.
- It doesn't need to de-reference a pointer for each curve.
- The inputs are accessed from the virual arrays fewer times.

On top of that, I added two other performance improvements:
- The node is multi-threaded when there are many curves.
- There are generated special cases for single value and span inputs.

**Performance**
With a set position node affecting 1 million splines with a selection
based on this node, on an Intel i5 8250U (times are approximate):
| Before | After | Speedup |
| 760 ms | 60 ms | 13x     |

Differential Revision: https://developer.blender.org/D14233
2022-03-03 11:55:31 -05:00
908ac7dce2 Merge branch 'blender-v3.1-release' 2022-03-03 17:47:34 +01:00
769ae5c866 Fix T96139: Cycles doesn't warn if the render is paused
Caused by 6ec83afb1d.

Technically, a regression since 3.0.

Differential Revision: https://developer.blender.org/D14239
2022-03-03 17:21:11 +01:00
d793d18413 BLI: Add functions to IndexRange to mirror Span
Adds functions for special cases of slicing and an `is_empty` method.
2022-03-03 11:14:44 -05:00
e8dc82311d Fix T96145: GPencil eval data not updated correctly
When removing a modifier, changing the layer transform or updating
 the parent of a grease pencil object that has a multi-user datablock
 and animation data, the eval data is not updated properly (after a
 frame change). This can also cause memory leaks.

 The fix makes sure that we free and reset any runtime copy
 (`ob->runtime.gpd_eval`) in `BKE_gpencil_prepare_eval_data`.

 Note: As far as we can tell, `ob->runtime.gpd_orig` is unused and could
 be removed. The assignment in `BKE_gpencil_prepare_eval_data`
 seemed to be unnecessary.

Co-authored-by: @yann-lty

Reviewed By: antoniov

Maniphest Tasks: T96145

Differential Revision: https://developer.blender.org/D14236
2022-03-03 16:01:23 +01:00
6e487228a5 File Browser UI: Allow dragging anywhere in a file preview tile to drag
Previously you'd have to be careful to drag the image itself. Dragging
anywhere else on the tile (e.g. between the preview and the text, or the
text itself) would trigger border select. This often conflicts with user
expectations and causes frustration when trying to work quick, I've seen
many people complain about this.

Note that the "hitbox" for dragging is a bit smaller than the tile, to
not make border select by dragging from in-between the tiles too hard.

Differential Revision: https://developer.blender.org/D14228
2022-03-03 15:17:23 +01:00
544bd0c353 Cleanup: Remove redundant drag image size parameters
Just use the image-buffer size and the already provided scale to
determine the size, not the button size (which would always have to
match the scaled image-buffer size or it would give unexpected results).
2022-03-03 15:04:45 +01:00
1b863041c9 i18n: Fix more potential contextual issues with "Back" UI label.
Add 'ID_ACTION' context to some animation curve interpolation enums.

Related to T95506/T43295.
2022-03-03 14:52:45 +01:00
0f77933031 Merge branch 'blender-v3.1-release' 2022-03-03 13:49:08 +01:00
9c2e385509 Fix Cycles hang in classroom scene with upcomping AMD driver version 22.10
This is a workaround until there is a fix in the HIP compiler or driver.

Differential Revision: https://developer.blender.org/D14232
2022-03-03 13:42:58 +01:00
ffaaa0bcbf UV: Edge selection support
This patch adds edge selection support for UV editing (refer T76545).
Developed as a part of GSoC 2021 project - UV Editor Improvements.

Previously, selections in the UV editor always flushed down to vertices
and this caused multiple issues such as T76343, T78757 and T26676.
This patch fixes that by adding edge selection support for all UV
operators and adding support for flushing selections between vertices
and edges. Updating UV select modes is now done using a separate
operator, which also handles select mode flushing and undo for UV
select modes. Drawing edges (in UV edge mode) is also updated to match
the edit-mesh display in the 3D viewport.

Notes on technical changes made with this patch:
* MLOOPUV_EDGESEL flag is restored (was removed in rB9fa29fe7652a).
* Support for flushing selection between vertices and edges.
* Restored the BMLoopUV.select_edge boolean in the Python API.
* New operator to update UV select modes and flushing.
* UV select mode is now part of editmesh undo.

TODOs added with this patch:
* Edge support for shortest path operator (currently uses vertex path logic).
* Change default theme color instead of reducing contrast with edge-select.
* Proper UV element selections for Reveal Hidden operator.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D12028
2022-03-03 17:59:09 +05:30
76879e3702 Outliner: Display respective data-block icon in library overrides mode
Just showing the library override icon for every item doesn't add much
information, it's just redundant. Displaying the data-block type icon on
the other hand can be useful.

Differential Revision: https://developer.blender.org/D14208
2022-03-03 13:18:23 +01:00
9b12889a1a Fix T96140: Crash on color button drag & drop
Use-after-free in context store, which wasn't cleared correctly after
setting and querying.
2022-03-03 12:51:44 +01:00
2d24ba0210 VSE: Allow to create scene in strip properties
This patch adds a button in the scene to add a new one, but this does not change to the new created scene because this breaks the storyboarding workflow.

This is a common request for Storyboarding artists.

Reviewed By: mendio, brecht, ISS

Differential Revision: https://developer.blender.org/D14148
2022-03-03 12:37:48 +01:00
ce0d4ea41c Merge branch 'blender-v3.1-release' 2022-03-03 20:47:07 +11:00
d961adb866 Fix T96135: Mesh coordinates are set to the last edited shape-key
When exiting edit-mode set the vertex coordinates to the basis-shape when editing non-basis keys.

Regression in bfdbc78466.

Reviewed By: sergey

Ref D14234
2022-03-03 20:42:30 +11:00
d66b047ca3 WM: use pass-through for cursor placement operator
This is needed since 4d0f846b93
however change in the operator instead of the event handler is correct,
as accepting a press event should suppress drag events unless
the pass-through flag is set.

This is how select & tweak already works.
2022-03-03 20:35:14 +11:00
ec09ded792 Fix missing i18n context variable in UI py script.
Mistake in own rBdb3f5ae48ac, thanks to Ethan-Hall (@Ethan1080) for the
heads up.
2022-03-03 08:57:06 +01:00
a8df292264 Cleanup: comments in wm_event_system.c 2022-03-03 16:45:40 +11:00
4d0f846b93 Event System: use more thoroughly tested logic for click-drag events
No functional changes, largely restoring old logic & removing the need
for workarounds.

Reverts:
- 13b6cec039.
- aa71414dfc (partially).
2022-03-03 16:07:18 +11:00
9d529407da UI: only wrap cursor motion horizontally when dragging markers
It's not useful to wrap vertical motion when dragging markers.
It was too easy to accidentally wrap the cursor to the top of a region,
as markers need to be dragged from the bottom edge of the region.
2022-03-03 15:48:41 +11:00
d764448f73 Cleanup: use doxygen sections for anim_markers.c 2022-03-03 15:46:26 +11:00
08da699faa Cleanup: rename misleading variable for marker selection cycling
"marker_selected" was the marker after the selected marker
and is used for cycling the selection.
2022-03-03 15:46:15 +11:00
61c288cee5 Fix timeline marker click-drag arbitrary deselection
The logic to cycle selected markers wasn't cycling back to the beginning
of the list.

The marker after the selected marker at the cursor frame was also used
to check if a selection existed, causing dragging to transform all
selected markers to de-select all when when dragging the last marker.
2022-03-03 15:25:02 +11:00
ef431a8705 Cleanup: remove references to key-map modifier values denoting order
This feature was never exposed to users.
2022-03-03 13:57:44 +11:00
3c175caaa3 Cleanup: Rename set handle type node internally to match UI
I've had trouble finding this node a few times now,
it's simpler if the file name matches the name in the UI.
2022-03-02 17:58:17 -05:00
ddf956fb58 Curves: Port set resolution node to the new data-block
The node unnecessarily converted to the old data structure to check if
there were any poly splines. Instead, that warning is just removed,
because the node now still sets resolution values in that case, they
just aren't used (before the values weren't set at all). Either way, it
wasn't clear that looping though all of the curve types was worth
the performance cost here.
2022-03-02 17:50:25 -05:00
2600806c2e Fix: BLI math clamp doesn't work
Return type was wrong, output of std::clamp wasn't used.
2022-03-02 17:09:17 -05:00
ecba8c1243 Fix mistake in seeking cleanup
In `ffmpeg_read_video_frame` fix assignment used as truth value.
In `ffmpeg_seek_recover_stream_position` loop while return value is
greater or equal to 0.
2022-03-02 22:25:43 +01:00
f531dff9b3 Cleanup: Use rectangle for file browser tile drawing
Passing around coordinates for drawing can be quite confusing, it's
often not clear what they represent and where they are currently.
Instead pass around the tile rectangle for drawing and let all code draw
based on that, it's way more clear that way.

Changes shouldn't be user visible.
2022-03-02 19:25:18 +01:00
Nikhil Shringarpurey
721b705499 UI: Comments Misspellings of Vertex/Vertices
Correct misspellings in code comments of "vertex" and "vertices".

See D13932 for more details.

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

Reviewed by Harley Acheson
2022-03-02 10:05:15 -08:00
ca0b728529 Fix T96101: "Remove" button failure on Grease Pencil layer's relation to bone
As the channel was not found, the relation data was not updated.

Now, if the bone is removed, the relation is set.
2022-03-02 17:48:35 +01:00
34267a868a Merge branch 'blender-v3.1-release'
and resolve merge error (version string).
2022-03-02 17:35:09 +01:00
9789a6c6d9 Search: take word order into account in string search
Differential Revision: https://developer.blender.org/D14223
2022-03-02 17:25:39 +01:00
8506f3d9fe Blender 3.1 bcon4 - change release cycle to release candidate
This is still a rolling release candidate with new builds every day
as a preparation to the final release.
2022-03-02 17:17:38 +01:00
ac45540a34 Curves: add brush to add curves on surface
This adds a prototype for the first brush that can add new curves by
painting on a surface. Note that this can only be used when the curves
object has a surface object set in the properties panel.

The brush can take minimum distance into account. This allows
distributing curves with a somewhat consistent density.

Differential Revision: https://developer.blender.org/D14207
2022-03-02 17:15:44 +01:00
037e1ad140 Merge branch 'blender-v3.1-release' 2022-03-02 17:13:57 +01:00
2fb31f34af Fix T95692: incorrect interpolated children particle hair
Differential Revision: https://developer.blender.org/D14227
2022-03-02 17:12:56 +01:00
d86f80f42a Merge branch 'blender-v3.1-release' 2022-03-02 10:55:21 -05:00
216a215ba5 Fix T93573: Remove outline from instances in edit mode
This commit removes the outline from instances generated from an object
when in edit mode. This takes the change in aa13c4b386 a bit further,
with the idea that instance outlines are more like regular outlines.

Because evaluated object data that doesn't match the original object
type is treated as an instance internally, this fixes the way evaluated
meshes for curves objects have an outline, for example.

See the differential revision for a visual comparison.

Differential Revision: https://developer.blender.org/D14226
2022-03-02 10:49:48 -05:00
7935d3668a Fix T95479: geometry nodes crash with cage display
Differential Revision: https://developer.blender.org/D14225
2022-03-02 16:10:42 +01:00
Ethan Hall
1e1d1f15e8 UI: Enable the outliner to use the correct icon for each curve subtype
This patch enables enables the outliner to use the correct icon for each
of the curve subtypes (Curve/Surface/Font).

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

Reviewed by: Julian Eisel
2022-03-02 15:52:17 +01:00
13b6cec039 Fix/Workaround T96120: Crash dropping from the file browser
Since removal of tweak events 4986f71848,
box-select is activating while dragging files.

As far as I can tell this used to work because of differences
int the order tweak / click-drag events are handled.

Apply a workaround since dragging files doesn't prevent other parts
of the UI from activated (it's possible to open menus for e.g),
this is something we will likely want to limit which would resolve
this bug too.
2022-03-03 01:36:14 +11:00
3a0df7d37b Merge remote-tracking branch 'origin/blender-v3.1-release' 2022-03-02 15:22:19 +01:00
6883c47bb5 Fix T94729: GPU subdivision does not support meshes without polygons
There are two issues revealed in the bug report:
- the GPU subdivision does not support meshes with only loose geometry
- the loose geometry is not subdivided

For the first case, checks are added to ensure we still fill the
buffers with loose geometry even if no polygons are present.

For the second case, this adds
`BKE_subdiv_mesh_interpolate_position_on_edge` which encapsulates the
loose vertex interpolation mechanism previously found in
`subdiv_mesh_vertex_of_loose_edge`.

The subdivided loose geometry is stored in a new specific data structure
`DRWSubdivLooseGeom` so as to not pollute `MeshExtractLooseGeom`. These
structures store the corresponding coarse element data, which will be
used for filling GPU buffers appropriately.

Differential Revision: https://developer.blender.org/D14171
2022-03-02 15:19:55 +01:00
47396ea81e Fix T96123: Crash when click-dragging across the visibility icons
Partially revert aa71414dfc

This attempted have the click-drag event compatible with old tweak
events, but needs to be re-thought since it caused events to be handled
in unexpected situations.
2022-03-03 01:11:17 +11:00
4a95c3466f Fix T96085: repeated evaluation of geometry nodes when nothing changed
Differential Revision: https://developer.blender.org/D14216
2022-03-02 14:12:08 +01:00
c23ec04b4e BLI: add scoped-defer utility to add RAII-like behavior to C types
This utility is useful when using C types that own some resource in
a C++ file. It mainly helps in functions that have multiple return
statements, but also simplifies code by moving construction and
destruction closer together.

Differential Revision: https://developer.blender.org/D14215
2022-03-02 12:51:21 +01:00
721335553c Add Object Tool: use the drag-start location for initial placement 2022-03-02 22:29:40 +11:00
Henrik Dick
c2e8e68b65 Fix T95963: change thresholds in complex solidify
This fix contains two parts. There was one critical mistake where
order of two indices was wrong when removing constraint planes from
the array. The other changes are improvements to the used thresholds
to keep everything numerically stable.

Differential Revision: http://developer.blender.org/D14183
2022-03-02 12:14:22 +01:00
ccf4001458 Fix modal item open/close in the outliner since removing tweak events
Correct check for left-mouse event which assumed the alternative was
a tweak event.

Also remove print added by accident.
2022-03-02 22:04:39 +11:00
102644cb8c Fix releasing modifier keys suppressing drag events
Always use event.prev_click_type since this is never set on key-release,
which could still interrupt dragging (box selecting for example).
2022-03-02 21:47:49 +11:00
1747269ea5 Cleanup: misleading code from aa71414dfc
This branch was previously run when the action had been handled,
since action checks were removed it was running. This assignment
does nothing but shouldn't be kept.
2022-03-02 21:47:49 +11:00
51c5a4d85d Merge branch 'blender-v3.1-release' 2022-03-02 11:45:48 +01:00
Brecht Van Lommel
383a6ee78c Fix T94609: geometry nodes always re-evaluated with image texture nodes
previously_visible_components_mask was not preserved for Image ID nodes, which
meant it was always detected as newly visible and tagged to be updated, which
in turn caused the geometry nodes using it to be always updated also.

Reviewed By: sergey, JacquesLucke

Maniphest Tasks: T94609

Differential Revision: https://developer.blender.org/D14217
2022-03-02 11:45:17 +01:00
5086913b28 Fix T96116: Image editor not updated when adding new tile. 2022-03-02 11:42:23 +01:00
f8577db05d Docs: document the use_axis_view argumeht to view_roll_angle
Also remove event print left in by accident.
2022-03-02 18:28:15 +11:00
46a5a15d30 Cleanup: rename direction enum as it's part of the key-map item
Also improve doc-strings for key-map item constants.
2022-03-02 18:00:59 +11:00
7e4c031328 Cleanup: remove all tweak events from key-map presets 2022-03-02 17:29:27 +11:00
4986f71848 Event System: remove tweak events in favor of click-drag
Supporting two kinds of dragging is redundant, remove tweak events as
they only supported 3 mouse buttons and added complexity from using the
'value' to store directions.

Support only click-drag events (KM_CLICK_DRAG) which can be used with
any keyboard or mouse button.

Details:

- A "direction" member has been added to keymap items and events which
  can be used when the event value is set to KM_CLICK_DRAG.

- Keymap items are version patched.

- Loading older key-maps are also updated.

- Currently the key-maps stored in ./release/scripts/presets/keyconfig/
  still reference tweak events & need updating. For now they are updated
  on load.

Note that in general this wont impact add-ons as modal operators don't
receive tweak events.

Reviewed By: brecht

Ref D14214
2022-03-02 15:31:50 +11:00
426ff481a7 Event System: match click-drag & tweak event handling for transform 2022-03-02 14:53:15 +11:00
78372d8b9c Event System: support "Release Confirms" for click-drag events 2022-03-02 14:44:34 +11:00
aa71414dfc Fix click-drag events for dragging markers
Clicking and dragging markers accumulates flags from multiple operators
in a way that can't be interpreted when combine.

Follow tweak behavior for cancelling click-drag events.
2022-03-02 14:28:29 +11:00
cf428b2ebd Fix ignored click-drag events when operators pass-through & finished
Replacing tweak key-map items with click-drag caused selection
in the graph/sequencer/node editors to ignore drag events
(all uses of WM_generic_select_modal).

Operators that return OPERATOR_PASS_THROUGH | OPERATOR_FINISHED
result in the event loop considering the event as being handled.

This stopped WM_CLICK_DRAG events from being generated which is not the
case for tweak events.

As click-drag is intended to be compatible with tweak events,
accept drag events when WM_HANDLER_BREAK isn't set or when
wm_action_not_handled returns true.
2022-03-02 12:25:12 +11:00
aa500c4fca Cleanup: use back-slash for doxygen commands, color after parameters 2022-03-02 12:11:08 +11:00
eabdcdcd44 Merge remote-tracking branch 'origin/blender-v3.1-release' 2022-03-02 00:59:03 +01:00
4932269ec3 Fix T94952: normals maps don't render correctly with GPU subdivision
A simple case of missing the tangent VBO. The tangents are computed from
the coarse mesh, and interpolated on the GPU for the final mesh. Code for
initializing the tangents, and the vertex format for the VBO was
factored out of the coarse extraction routine, to be shared with the
subdivision routine.
2022-03-02 00:58:40 +01:00
e03b9f555c Cmake: Re-enable Amaranth add-on
This add-on now conforms to the distribution requirements, see: T95442.
2022-03-01 17:45:45 -05:00
a75e9863fe Cmake: Re-enable Amaranth add-on
This add-on now conforms to the distribution requirements, see: T95442.
2022-03-01 17:45:13 -05:00
10405b15ec Cleanup: Refactor seeking code
Improve readability and reduce indentation levels. No functional changes.

Reviewed By: zeddb

Differential Revision: https://developer.blender.org/D14075
2022-03-01 23:42:23 +01:00
4491c62260 Fix potential crash during proxy building
Last step of proxy building caused crash due to thread race contition
when acessing ed->seqbase.

Looking at code, it seems that calling IMB_close_anim_proxies on
original strips is unnecessary so this code was removed to resolve this
issue.

Locking seqbase data may be possible, but it's not very practical as
many functions access this data on demand which can easily cause
program to freeze.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D14210
2022-03-01 23:42:23 +01:00
bfe37b7255 Merge branch 'blender-v3.1-release' 2022-03-01 18:35:48 -03:00
9bd586a01e Fix T95608: Mac issues with drag drop on multi-monitor
Mousemove events are sent to windows.

In Windows OS, almost all mousemove events are sent to the window whose
mouse cursor is over.

On MacOS, the window with mousemove events is always the active window.
It doesn't matter if the mouse cursor is inside or outside the window.

So, in order for non-active windows to also have events,
`WM_window_find_under_cursor` is called to find those windows and send
the same events.

The problem is that to find the window, `WM_window_find_under_cursor`
only has the mouse coordinates available, it doesn't differentiate
which monitor these coordinates came from.

So the mouse on one monitor may incorrectly send events to a window on
another monitor.

The solution used is to use a native API on Mac to detect the window
under the cursor.

For Windows and Linux nothing has changed.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D14197
2022-03-01 18:25:12 -03:00
e1ec2d0251 Merge branch 'blender-v3.1-release' 2022-03-01 16:31:18 -03:00
8e88af9934 Fix wrong object mode checking in snap code
The value of `OB_MODE_OBJECT` is 0, this makes it unsuitable as a bitflag.

Issue pointed out at https://pvs-studio.com/en/blog/posts/cpp/0922/

Thanks to Andrey Karpov
2022-03-01 16:30:30 -03:00
8322a4f6b7 Fix T92980: missing Cycles video texture update with persistent data 2022-03-01 19:51:30 +01:00
Henrik Dick
6498688e27 GPencil: Improve subdivision modifier
The subdivision modifier for Grease Pencil handles closed strokes
correctly now and does converge to the same shape as the mesh
subdivision surface.

Differential Revision: http://developer.blender.org/D14218
2022-03-01 19:32:02 +01:00
444d57d440 Geometry Nodes: Port most curve primitives to new data-block
Create `Curves` directly, instead of using the conversion from
`CurveEval`. This means that the `tilt` and `radius` attributes
don't need to be allocated. The old behavior is kept by using the
right defaults in the conversion to `CurveEval` later on.

The Bezier segment primitive isn't ported yet, because functions
to provide easy access to built-in attributes used for Bezier curves
haven't been added yet.

Differential Revision: https://developer.blender.org/D14212
2022-03-01 12:06:29 -05:00
f085c2bab5 Cmake: Re-enable tiny cad add-on
This add-on now conforms to the distribution requirements, see: T95442.
2022-03-01 11:58:27 -05:00
89bf5d8ba9 Cmake: Re-enable tiny cad add-on
This add-on now conforms to the distribution requirements, see: T95442.
2022-03-01 11:57:13 -05:00
f98d74c80d Curves: Move curves primitive to object add code
Currently, any time a Curves data-block is created, the `curves_random`
function runs, filling it with 500 random curves, also adding a radius
attribute. This is just left over from the prototype in the initial
commit that added the type.

This commit moves the code that creates the random data to the curve
editors module, like the other primitives are organized.

Differential Revision: https://developer.blender.org/D14211
2022-03-01 11:40:25 -05:00
952a613d38 Cycles: Hide MetalRT checkbox for AMD GPUs
This patch hides the MetalRT checkbox for AMD GPUs, pending fixes for MetalRT argument encoding on AMD.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D14175
2022-03-01 16:05:47 +00:00
143bc9f8d4 Merge branch 'blender-v3.1-release' 2022-03-01 23:11:46 +11:00
d681d82d41 Fix T96035: Some tool settings do not work
Oversight in 74611e3555 missed updating
property access to use the tool identifier to lookup the property group.
2022-03-01 23:09:56 +11:00
f493e2f23a Merge branch 'blender-v3.1-release' 2022-03-01 11:46:53 +01:00
629f22f161 Fix T95997: Crash when entering edit mode
The issue was uncovered by the 0f89bcdbeb, but the root cause goes
into a much earlier design violation happened in the code: the modifier
evaluation function is modifying input mesh, which is not something
what is ever expected.

Bring code closer to the older state where such modification is only
done for the object in edit mode.

---

From own tests works seems to work fine, but extra eyes and testing
is needed.

Differential Revision: https://developer.blender.org/D14191
2022-03-01 11:46:38 +01:00
90ec634135 Fix incorrect drag-event threshold when releasing modifiers early
db4313610c added support for modifier
keys to be released while dragging.

The key release events set wmEvent.prev_type which is used select the
drag threshold, causing the wrong threshold to be used.

Add wmEvent.prev_click_type which is only set when the drag begins.
2022-03-01 21:41:08 +11:00
cde5e12c0b Fix T96097: Image editor tile drawing not working.
The image engine is depth aware when using tile drawing the depth is
only updated for the central image what lead to showing the background
on top of other areas.

Also makes sure that switching the tile drawing would lead to an update
of the texture slots.
2022-03-01 11:37:18 +01:00
4b9c77a19a Merge branch 'blender-v3.1-release' 2022-03-01 11:36:46 +01:00
9216cf9cb5 Fix: dangling internal links after removing sockets
This is a follow up for rBd5e73fa13dd275fb9c76b1e41142ab086dd2e6be.
The issue was found with the file in T95997.
2022-03-01 11:34:36 +01:00
476fe7d164 Fix T95979: Bake doesn't update Image editor. 2022-03-01 11:20:54 +01:00
eec1c16200 Fix T96030: Update Image editor after reload. 2022-03-01 11:04:09 +01:00
a5214212cf Fix T96030: ImageEditor not updated for generated images. 2022-03-01 10:51:07 +01:00
d743ef91df Fix 3d texture painting artifacts.
When dimension of images aren't a multifold of 256 parts of the gpu
textures are not updated. This patch will calculate the correct part of
the image that needs to be reuploaded.
2022-03-01 10:45:19 +01:00
4a4701b43c Fix painting on none 256 aligned images.
Internally the update tiles are 256x256. Due to some miscalculations
tiles were not generated correctly if the dimension of the image wasn't
a multifold of 256.
2022-03-01 09:32:58 +01:00
34f6a99433 Fix crash triggered by an introduced assert. 2022-03-01 08:56:58 +01:00
ead84d2ba6 Fix building error in previous commit. 2022-03-01 08:53:23 +01:00
5e9c1feb8a Image Engine: Performance 8 byte images.
Previously we used to cache a float image representation of the image in
rect_float. This adds some incorrect behavior as many areas only expect
one of these buffers to be used.

This patch stores float buffers inside the image engine. This is done per
instance. In the future we should consider making a global cache.
2022-03-01 08:41:25 +01:00
f0bfceb96d Cleanup: remove unused code 2022-03-01 17:22:35 +11:00
9b114d6214 Merge branch 'blender-v3.1-release' 2022-02-28 23:47:43 -05:00
91de337dc5 Cmake: Re-enable tissue add-on
This add-on now conforms to the distribution requirements, see: T95442.
2022-02-28 23:45:59 -05:00
a4e8b3a9a9 Cleanup: remove check_deprecated.py
This was temporarily added back as the build-bot was running it.
2022-03-01 14:09:03 +11:00
8a8424021c Cleanup: move Event.is_repeat & is_direction_inverted to flags
Use a flag for events to avoid adding struct members every time a new
kind of tag is needed - so events remain small.

This also simplifies copying settings as flags can be copied at once
with a mask.
2022-03-01 12:21:27 +11:00
eb0f8317e2 Cleanup: ED_view3d_win_to_delta & ED_view3d_calc_zfac usage
- Rename ED_view3d_win_to_delta `mval` argument to `xy_delta` as it
  as it was misleading since this is an screen-space offset not a region
  relative cursor position (typical use of the name `mval`).
  Also rename the variable passed to this function which also used the
  term `mval` in many places.
- Re-order the output argument of ED_view3d_win_to_delta last.
  use an r_ prefix for return arguments.
- Document how the `zfac` argument is intended to be used.
- Split ED_view3d_calc_zfac into two functions as the `r_flip` argument
  was only used in some special cases.
2022-03-01 11:18:17 +11:00
Leon Schittek
ae6400cfb4 UI: Fix multi input socket outline and highlight
Small fixes to the drawing of multi input sockets:
 - Make the outline thickness consistent with normal node sockets,
   independent from the screen DPI.
 - Only highlight multi input sockets when they are actually selected.
 - Skip selected multi inputs when drawing normal selected sockets.

Differential Revision: https://developer.blender.org/D14192
2022-02-28 18:05:30 -05:00
5777bd719b Cleanup: use doxygen comments, correct spelling
Also move eDupli_ID_Flags doc-string to it's declaration.
2022-03-01 09:36:25 +11:00
94a4dddb1b Fix: Don't tag curves component cache dirty for radius
Changing the radius does not invalidate a cache on
`CurvesGeometry`.
2022-02-28 17:28:54 -05:00
9ebb65323e Fix: Use correct default in Curves to CurveEval conversion
Currently the code expects the radius attribuet to always exist on the
input Curves. This won't be true in the future though, so the correct
default value of one should be used when creating the data on CurveEval,
where the data is not optional.
2022-02-28 17:27:38 -05:00
6594e802ab Curves: Add method to access cyclic attribute
Avoids the need to use the attribute API to access this commonly
used builtin attribute.
2022-02-28 17:20:37 -05:00
4c407f20a6 Cleanup: Move object_add.c to C++
This patch was tested on the buildbot first, it builds on all platforms.
2022-02-28 16:20:55 -05:00
Leon Schittek
75bb99fa40 Nodes: Improve readability of selected node links
This commit improves the drawing of selected node links:
 - Highlight the entire link to make it easier to spot where the link
   is going/coming from.
 - Always draw selected links on top, so they are always clearly
   visible.
 - Don't fade selected node links when the sockets they are connected
   to are out out view.
 - Dragged node links still get a partial highlight when they are only
   attached to one socket.

Differential Revision: https://developer.blender.org/D11930
2022-02-28 15:52:00 -05:00
Wannes Malfait
eeb0279e89 Geometry Nodes: Use std::move in dual mesh node
Add a std::move in some places to prevent arrays from being copied.
These cases were potentially optimized by the compiler, but this makes
it more explicit.

Differential Revision: https://developer.blender.org/D14129
2022-02-28 15:16:01 -05:00
611157057b Cleanup: Use bool instead of int 2022-02-28 15:10:20 -05:00
7c3a5da04b Merge branch 'blender-v3.1-release' 2022-02-28 14:38:41 -05:00
59a133b61f Cmake: Re-enable real snow add-on
This add-on now conforms to the distribution requirements, see: T95442.
2022-02-28 14:38:13 -05:00
96492903aa Merge branch 'blender-v3.1-release' 2022-02-28 19:18:22 +01:00
44b0c70919 Fix T92288, T96041: instancing of shared mesh objects without modifiers broken
New code from the vertex normal refactor cfa53e0fbe combined with older code
from 592759e3d6 that disabled instancing for custom normals and autosmooth
meant that instancing was always disabled.

However we do not need to disable instancing for custom normals and autosmooth
at all, this can be shared between instances just fine.
2022-02-28 18:32:27 +01:00
Henrik Dick
8c932ab43c Fix T96032: add null check to constraint operators
The constraint operators for delete, apply, copy and copy to selected
were missing null checks and could crash blender when called wrongly
from the python api.

Differential Revision: http://developer.blender.org/D14195
2022-02-28 18:26:58 +01:00
245722866d Cleanup: Rename geometry set "curve" functions to "curves"
Ref T95355
2022-02-28 10:53:30 -05:00
9ec12c26f1 Geometry Nodes: Begin conversion to new curves
This commit changes `CurveComponent` to store the new curve
type by adding conversions to and from `CurveEval` in most nodes.
This will temporarily make performance of curves in geometry nodes
much worse, but as functionality is implemented for the new type
and it is used in more places, performance will become better than
before.

We still use `CurveEval` for drawing curves, because the new `Curves`
data-block has no evaluated points yet. So the `Curve` ID is still
generated for rendering in the same way as before. It's also still
needed for drawing curve object edit mode overlays.

The old curve component isn't removed yet, because it is still used
to implement the conversions to and from `CurveEval`.

A few more attributes are added to make this possible:
- `nurbs_weight`: The weight for each control point on NURBS curves.
- `nurbs_order`: The order of the NURBS curve
- `knots_mode`: Necessary for conversion, not defined yet.
- `handle_type_{left/right}`: An 8 bit integer attribute.

Differential Revision: https://developer.blender.org/D14145
2022-02-28 10:46:34 -05:00
37d2c774c1 Fix T96073: Don't remove links when inserting reroute nodes
This was an oversight in rB06ac5992618a75c453e495e06af7c5faf30499a7.
2022-02-28 16:42:15 +01:00
81bb86c750 Cleanup: Remove duplicated comment
Something went wrong here in 61776befc3.
2022-02-28 16:33:34 +01:00
579f42ae52 Cleanup: Move mesh_validate.c to C++
This patch was tested on the build bots on all platforms.
2022-02-28 10:08:26 -05:00
f5159e078e Merge branch 'blender-v3.1-release' 2022-02-28 15:03:17 +01:00
413e87b6b7 Fix T96048: Crash on appending with driver variables loop in shapekeys.
The usual 'shape keys snowflake' nightmare again...
2022-02-28 15:02:17 +01:00
db3f5ae48a Fix T95506: Separate strings for "Back" (operator).
Add a new `EDITOR_VIEW3D` context to those view orientations.
2022-02-28 14:37:07 +01:00
1e848281f9 18n: Add new EDITOR_VIEW3D translation context. 2022-02-28 14:37:07 +01:00
8e940f31fd WM: Allow drop-box polls to use context from UI
The UI context was only set for the operator polls, but not for the
drop-box polls. Initially I thought this wouldn't be needed since the
drop-boxes should leave up context polls to the operator, but in
practice that may not be what API users expect. Plus the tooltip for the
drop-boxes will likely have to access context anyway, so they should be
able to check it beforehand.
2022-02-28 13:14:46 +01:00
Colin Marmont
1558b270e9 Animation: Sensible frame range for motion paths
Motion paths can now be initialised to more sensible frame ranges,
rather than simply 1-250:

- Scene Frame Range
- Selected Keyframes
- All Keyframes

The Motion Paths operators are now also added to the Object context menu
and the Dopesheet context menu.

The scene range operator was removed, because the operators now
automatically find the range when baking the motion paths.

The clear operator now appears separated in "Selected Only" and "All",
because it was not clear for the user what the button was doing.

Reviewed By: sybren, looch

Maniphest Tasks: T93047

Differential Revision: https://developer.blender.org/D13687
2022-02-28 12:28:19 +01:00
6f23401e98 Merge branch 'blender-v3.1-release' 2022-02-28 10:57:12 +01:00
6bbf63f251 Fix T96054: Switching vertex group does not update display
Caused by 0f89bcdbeb and was not fully addressed by 6f9828289f:
tagging an ID with flag 0 is to be seen as an explicit tag for copy
on write.

Would be nice to either consolidate code paths of flag 0 and explicit
component tag, or get rid of tagging with 0 flag, but that is above of
what we can do for the upcoming release.
2022-02-28 10:54:07 +01:00
307d612404 Fix compilation warning. 2022-02-28 09:45:52 +01:00
cb736d2f03 Fix T95298: Multiview images not displaying correctly.
Image users have a multi_index that wasn't updated in case it is a normal
image.
2022-02-28 09:23:45 +01:00
540fd10b4f Fix T95992: Crash Ancored strokes 2d texture painting.
When using ancored stroked the diameter of the stroke can be 0 what
leads to a division by zero that on certain platforms wrap to a large
negative number that cannot be looked up. This fix will clamp the size
of the brush to 1.
2022-02-28 09:03:47 +01:00
2a644deaa7 Fix T95981: Remove implicit conversion in texture paint shader.
This fixes a crash on selected platforms.
2022-02-28 08:40:59 +01:00
db4313610c Event System: drag events now use modifier state on drag start
Now drag & tweak can have modifier keys to be released while dragging.
without this, modifier keys needs to be held which is more noticeable
for tablet input or whenever the drag threshold is set to a large value.

Resolves T89989.
2022-02-28 15:31:01 +11:00
63891f9dad Fix: Crash in Duplicate Element
Return early if a curve has a domain size of 0.
T96060
2022-02-27 15:16:45 -06:00
4f2f3114b7 Fix: Incorrect assert in curves code
The attribute data might be null if the number of curves is zero.
While that is not common, an empty curves data-block is valid.
2022-02-26 17:33:45 -05:00
ee160630c6 Merge branch 'blender-v3.1-release' 2022-02-26 17:57:37 -03:00
4ee4b61dd8 Ghost/Event System: Support mapping more keys
This fixes T93051, T76405 and maybe others.

Characters like '²', '<' are not recognized in Blender's shortcut keys.
And sometimes simple buttons like {key .} and {key /} on the Windows
keyboard, although the symbol is "known", Blender also doesn't
detect for shortcuts.

For Windows, some of the symbols represented by `VK_OEM_[1-8]` values,
depending on the language, are not mapped by Blender.

On Mac there is a fallback reading the "actual character value of the
'remappable' keys". But sometimes the character is not mapped either.

On Windows, the solution now mimics the Mac and tries to read the button's
character as a fallback.

For unmapped characters ('²', '<', '\''), now another value is chosen as a
substitute.

More "substitutes" may be added over time.

Differential Revision: https://developer.blender.org/D14149
2022-02-26 17:56:17 -03:00
576853661c UI: Use title case for labels 2022-02-25 23:34:08 -05:00
d6b3723b08 Cleanup: typos in comments. 2022-02-26 02:15:22 +01:00
ac3f4db719 Cleanup: Mesh normal calculation comments and logic
Some logic and comments in the vertex normal calculation were
left over from when normals were stored in MVert, before
cfa53e0fbe. Normals are never allocated and freed
locally anymore.
2022-02-25 17:47:42 -05:00
1598ab9639 Merge branch 'blender-v3.1-release' 2022-02-25 17:23:14 -05:00
7aa0be4b32 Fix: Failing OBJ export tests due to mesh normals commit
In some cases, the normal edit modifier calculated the normals on one
mesh with the "ensure" functions, then copied the mesh and retrieved
the layers "for write" on the copy. Since 59343ee162, normal
layers are never copied, and normals are allocated with malloc instead
of calloc, so the mutable memory was uninitialized.

Fix by calculating normals on the correct mesh, and also add a warning
to the "for write" functions in the header.
2022-02-25 17:18:07 -05:00
a911f075d7 Fix T93123: viewport lags with custom attributes
The check to see if newly requested attributes are not already in the
cache was not taking into account the possibility that we do not have
new requested attributes (`num_requests == 0`). In this case, if
`attr_used` already had attributes, but `attr_requested` is empty, we
would consider the cache as dirty, and needlessly rebuild the attribute
VBOs.
2022-02-25 22:04:10 +01:00
72a286760f Fix compile warning from earlier commit. 2022-02-25 22:01:17 +01:00
bdf4e1596d Merge remote-tracking branch 'origin/blender-v3.1-release' 2022-02-25 21:36:09 +01:00
c8b4e0c0b5 Disable GPU subdivision if autosmooth or split normals are used
These features are complicated to support on GPU and hardly compatible
with subdivision in the first place. In the future, with T68891 and
T68893, subdivision and custom smooth shading will be separate workflows.
For now, and to better prepare for this future (although long term
plan), we should discourage workflows mixing subdivision and custom
smooth normals, and as such, this disables GPU subdivision when
autosmoothing or custom split normals are used.

This also adds a message in the modifier's UI to indicate that GPU
subdivision will be disabled if autosmooth or custom split normals are
used on the mesh.

Differential Revision: https://developer.blender.org/D14194
2022-02-25 21:28:13 +01:00
118a219e9d Fix different shading between CPU and GPU subdivision
Reuse the same vertex normals calculation as for the GPU code, by
weighing each vertex normals by the angle of the edges incident to the
vertex on the face.

Additionally, remove limit normals, as the CPU code does not use them
either, and would also cause different shading issues when limit surface
is used.

Fixes T95242: shade smooth artifacts with edge crease and limit surface
Fixes T94919: subdivision, different shading between CPU and GPU
2022-02-25 21:25:13 +01:00
4896e72a4d Fix T95977: Point Info node radius wrong under rotation 2022-02-25 20:51:22 +01:00
1a8db5b717 Fix: Only possible to create one 8 bit integer attribute
The custom data code checks for `LayerTypeInfo.defaultname` before
adding a second layer with a certain type. This was missed in
e7912dfa19. In practice, this default name
is not actually used.
2022-02-25 10:35:14 -05:00
0a6a74bac4 Fix T94396: USD errors opening saved scenes.
Added call to ensure that the USD plugins are registered
when opening a USD cache archive. This is to avoid USD
load errors due to missing USD file format plugins when
opening blender files that contain USD transform cache
constraints and mesh sequence cache modifilers.

Fixes T94396
2022-02-25 09:27:10 -05:00
06f5f29d17 Merge branch 'blender-v3.1-release' 2022-02-25 15:11:01 +01:00
e84b42bfcf Fix (unreported) Outliner 'liboverride create hierarchy' applied on several IDs.
This operation can only be applied on one ID at a time, so only apply it
to the active Outliner item, and not all the selected ones.

Also renamed `Make Library Override` menu entry to `Make Library Override
Single` to emphasis this is not the 'default expected' option for the
user.
2022-02-25 15:06:43 +01:00
6e11cfc56a Curves: add surface object pointer
Ref T95776.

Differential Revision: https://developer.blender.org/D14182
2022-02-25 13:22:42 +01:00
1a853a9e90 LibOverrides: fix handling of hierarchy root in complex cases.
This affects essentially the Outliner 'create hierarchy' tool currenlty.
Previously code did not handle properly hierarchy root in case overrides
where created from a non-root ID (e.g. an object inside of a linked
collection), and in case additional partial overrides were added to an
existing partially overrided hierarchy.

Also did some renaming on the go to avoid using 'reference' in override
context for anything else but the reference linked IDs.
2022-02-25 12:18:48 +01:00
5db32ab5fc Merge branch 'blender-v3.1-release' 2022-02-25 21:51:37 +11:00
0bac962fe5 CMake: exclude add-ons that don't confirm to key requirements
These add-ons don't have documentation on blender.org, see: T95442

These can be re-enabled once documentation has been relocated.
2022-02-25 21:50:00 +11:00
8ddeb71a55 Merge branch 'blender-v3.1-release' 2022-02-25 11:40:19 +01:00
66328db703 Fix T95636: Dragging Material from Asset Browser (Link mode) to Viewport empty space removes this material from all objects
Trust user count to actually delete or not the dragged ID when current
dragging is cancelled, since it may be already used by others.

NOTE: This is more a band-aid fix than anything else, cancelling drag
has a lot of other issues here (like never deleting any indirectly
linked/appended data, etc.). It needs a proper rethink in general.
2022-02-25 11:37:55 +01:00
4c9846eeae Cleanup: Modify comment 2022-02-25 11:24:45 +01:00
8f1ee85ff4 Merge branch 'blender-v3.1-release' 2022-02-25 11:22:17 +01:00
5186a28dec GPencil: Make Fill Dilate expand outside stroke
To keep consistency with the new contract option, the dilate now expand the shape beyond the internal closed area.

Note: This was committed only in master (3.2) by error.
2022-02-25 11:15:56 +01:00
5fd792c1f6 GPencil: Fill Dilate using negative values contract the fill area
This is requested by artist for some animation styles where is necessary to fill the area, but create a gap between fill and stroke.

Also some code cleanup and fix a bug in dilate for top area.

Reviewed By: pepeland, mendio

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

Note: This was committed only in master (3.2) by error.
2022-02-25 11:15:42 +01:00
ad0b3abf53 Cleanup: use flags for wmEvent modifier keys
Using flags makes checking multiple modifiers at once more convenient
and avoids macros/functions such as IS_EVENT_MOD & WM_event_modifier_flag
which have been removed. It also simplifies checking if modifier keys
have changed.
2022-02-25 17:58:22 +11:00
60af7a3496 Fix T95984: Use consistent shifting for persp and ortho cam.
Now always properly shifting camera for ortho and perspective.
2022-02-25 14:07:39 +08:00
e7cae51877 Fix T95984: Use consistent shifting for persp and ortho cam.
Now always properly shifting camera for ortho and perspective.
2022-02-25 13:57:27 +08:00
7d7dd66ba7 GPUTexture: Add support for texture view
This is an OpenGL 4.3 feature that enables creating a texture using a range
of the same data as another texture.
2022-02-24 22:51:19 +01:00
e59f754c16 GPUTexture: Use immutable storage
This means textures need to have the number of mipmap levels specified
upfront. It does not mean the data is immutable.

There is fallback code for OpenGL < 4.2.

Immutable storage will enables texture views in the future.
2022-02-24 22:51:19 +01:00
c23ee6d7b4 Cleanup: Simplify operating on multiple geometry components 2022-02-24 14:02:32 -05:00
5ccbbaed08 Cleanup: Sort include lines 2022-02-24 19:44:07 +01:00
3b3e519edd Nodes: Add include to avoid Windows compiler error
This line was added as request of @HooglyBoogly
2022-02-24 19:43:14 +01:00
9de720f31a Merge branch 'blender-v3.1-release' 2022-02-24 19:40:42 +01:00
8fb7c50aab Fix compiler error in Windows
In some compilers this file fails because the function `BKE_mesh_poly_normals_ensure`is not defined.
2022-02-24 19:38:16 +01:00
0781c22cee Fix T95969, T91856: bake AO to vertex color artifacts after ray offset removal
Without ray offsets intersections at neigbhoring triangles are found, as
the ray start is exactly at the vertex. There was a small offset towards
the center of the triangle, but not enough.

Now this offset computation is moved into Cycles and modified for better
results. It's still not perfect though like any offset approach, especially
with long thin triangles.

Additionaly, this uses the shadow terminate offset for AO rays now, which
helps remove some pre-existing artifacts.
2022-02-24 19:35:36 +01:00
6e396e21e6 Cleanup: remove unused ray offset function 2022-02-24 19:35:36 +01:00
4c66bd5da2 Curves: Use simpler "set" behavior for postion attribute
This is similar to f8fe0e831e, which made the change to the
handle position attributes. This commit removes the way that setting the
`position` attribute also changes the handle position attributes. Now,
the "Set Position" node still has this behavior, but changing the
attribute directly (with the modifier's output attributes) does not.

The previous behavior was a relic of the geometry nodes design
from before fields and the set position node existed.

This makes the transition to the new curves data structure simpler.
There is more room for optimizing the Bezier case of the set position
node in the future.
2022-02-24 12:22:26 -05:00
f4d80ecdfd Cleanup: Typo in comment 2022-02-24 12:01:22 -05:00
cc966c548d Merge branch 'blender-v3.1-release' 2022-02-24 11:57:53 -05:00
7b37d980b9 Fix: Crash switching between sculpt and edit mode
Also fix a couple other places where normals layers weren't properly
tagged dirty or reallocated when the mesh changes.

Caused by cfa53e0fbe. When the size of a mesh changes,
the normal layers need to be reallocated. There were a couple of places
that cleared other runtime data with `BKE_mesh_runtime_clear_geometry`
but didn't deal with normals properly. Clearing the runtime "geometry"
is different from clearing the normals, because sometimes the size of
the normal layers doesn't have to change, in which case simply tagging
them dirty is fine.
2022-02-24 11:56:32 -05:00
7c1b0dec00 Merge branch 'blender-v3.1-release' 2022-02-24 17:43:24 +01:00
f8507ca372 EEVEE: Fix crash when shadow caster count is reduced to 0.
The crash was catched by ASAN. It was caused by the buffer shrinking logic
being faulty.
2022-02-24 17:43:04 +01:00
17301a3163 Fix incorrect Outliner tree-display type returned
Reverts 6d97fdc37e. A function like this should not return a different
tree-display object than of the requested type. This may hide errors,
and leaves the Outliner in an undefined state (where the stored display
mode doesn't match the tree-display object). I rather don't hide the
fact that all display-modes should be handled here, and emit a clear
error if one isn't.
2022-02-24 17:10:19 +01:00
fc8aab755a Fix T96015: Calling wrong operator resulting in python error
Own mistake in rB86fc63c4ca9d36eae7512c5c3e640285d84415d1.
Forgot to change the call from `wm.url_open` to `wm.url_open_preset`.
2022-02-24 11:10:00 -05:00
8d83fc552a GPU: Fix compilation in debug mode
Fixes issue introduced in rB1685b1dba44e02ce1faace4a5de6d6cd0d98ef90
2022-02-24 15:55:22 +01:00
1685b1dba4 OCIO: Fix mip length in texture creation
Also add an assert to avoid reproducing the error in the future.
2022-02-24 15:48:54 +01:00
9be720d85e BLI: support accessing nth last element in Array/Span/Vector
This often helps to make the intend of code more clear compared
to computing the index manually in the caller.
2022-02-24 14:50:13 +01:00
7cab7eb3d6 Merge remote-tracking branch 'origin/blender-v3.1-release' 2022-02-24 14:34:15 +01:00
b7a954218b Fix T95976: on cage GPU subdivision breaks X-ray selection
When X-ray mode is active the selection is done using the mesh data to
select what is closest to the cursor. When GPU subdivision is active with
the "show on cage" modifier option, this fails as the mesh used for selection
is the unsubdivided one.

This creates a subdivision wrapper before running the selection routines to
ensure that subdivision is available on the CPU side as well.

Differential Revision: https://developer.blender.org/D14188
2022-02-24 14:33:48 +01:00
189c5bd9af Merge branch 'blender-v3.1-release' 2022-02-24 12:45:27 +01:00
17e0634902 Fix T95985: crash when assigning a name for an output attribute
This was a double free error which happened because `BM_mesh_bm_from_me`
was taking ownership of arrays that were still owned by the Mesh. Note that
this only happens when the mesh is empty but some custom data layers still
have a non-null data pointer. While usually the data pointer should be null in
this case for performance reasons, other functions should still be able to
handle this situation.

Differential Revision: https://developer.blender.org/D14181
2022-02-24 12:44:02 +01:00
d48e595c78 Fix wrong asset library displayed/loaded in asset view templates
Sometimes when switching asset libraries in the asset view templates
(like the pose library sidebar UI), the wrong library would end up being
shown.
2022-02-24 12:40:40 +01:00
b0eed6fb9a Merge branch 'blender-v3.1-release' 2022-02-24 18:01:53 +11:00
41d607976c Keymap: use 90 degree roll for NDOF roll shortcuts
3Dconnexion documentation states these buttons should roll 90 degrees.
2022-02-24 18:00:18 +11:00
13efaa8a09 3D View: keep the orthographic view when rolling 90 degrees
Support for maintaining orthographic view for view3d.view_roll for an
angle of 90/-90 degrees.
2022-02-24 18:00:17 +11:00
87c2b1988d Keymap: correct NDOF button roll assignment
NDOF ROLL CCW was used for both left & right roll.
2022-02-24 18:00:17 +11:00
e767a2d98b Keymap: correct NDOF button roll assignment
NDOF ROLL CCW was used for both left & right roll.
2022-02-24 17:51:19 +11:00
81df323df4 Tests: disable file output for bl_keymap_validate.py
Left on by accident but should only be used when debugging output.
2022-02-24 17:43:36 +11:00
fe4b53311a Merge branch 'blender-v3.1-release' 2022-02-24 15:25:38 +11:00
f80f7afbf0 Fix 2D view NDOF panning requiring both axes to be non-zero
Possible fix for T86592.
2022-02-24 15:24:09 +11:00
1a6b35157c Cleanup: code comments in vfont_to_curve 2022-02-24 13:20:33 +11:00
b45a3e8747 Cleanup: remove dead code in vfont_to_curve
Also replaces numbers with character literals for tab/space.
2022-02-24 13:14:33 +11:00
24450fa142 Merge remote-tracking branch 'origin/blender-v3.1-release' 2022-02-24 03:01:44 +01:00
d59f45fb15 Cleanup: remove dead code from text wrapping logic
Error from original commit in 2005,
97df61a7e5.
2022-02-24 12:53:11 +11:00
e83e7d49b6 Cleanup: use continue instead of goto for 3D text wrapping logic 2022-02-24 12:53:09 +11:00
ba274d20b4 Fix T95959: crash when exporting subdivision to Alembic
When exporting generated coordinates, the subdivision export code was
using the schema for the non-subdivision case, which is invalid as
non-initialized. This typo existed since the initial commit for the
feature (rBf9567f6c63e75feaf701fa7b78669b9a436f13dd).
2022-02-24 02:46:33 +01:00
affed12bb9 Merge branch 'blender-v3.1-release' 2022-02-24 12:19:17 +11:00
c9582b2752 Fix T95116: Scale to fit fails with a single word & non-zero Y-size
The scale-to-fit option did nothing for single words when
the text box had a height. This happened because it was expected that
text would be wrapped however single words never wrap.

Now the same behavior for zero-height text boxes is used when text
can't be wrapped onto multiple lines.
2022-02-24 12:18:39 +11:00
f8fe0e831e Curves: Use simpler "set" behavior for handle position attributes
The handle position attributes `handle_left` and `handle_right` had
rather complex behavior to get expected behavior when aligned or auto/
vector handles were used. In order to simplify the attribtue API and
make the transition to the new curves data structure simpler, this
commit moves that behavior from the attribute to the "Set Handle
Positions" node. When that node is used, the behavior should be the
same as before. However, if the modifier's output attributes were used
to set handle positions, the behavior may be different. That situation
is expected to be very rare though.
2022-02-23 15:44:55 -05:00
756f7fb23e Geometry Nodes: Face is Planar Node
This adds a node with a boolean field output which returns true if all of the
points of the evaluated face are on the same plane. A float field input allows
for the threshold of the face/point comparison to be adjusted on a per face basis.

One clear use case is to only triangulate faces that are not planar.

Differential Revision: https://developer.blender.org/D13906
2022-02-23 14:19:54 -06:00
86fc63c4ca Cleanup: Simplify manual url version handling
Recently we changed the build pipeline to always create a version
number in the url and point 'dev' to the latest version rather than creating the version number url once we release.

This makes the check to `bpy.app.version_cycle` unnecessary.
2022-02-23 15:00:16 -05:00
6ca85a8cf1 Fix: Build issue on windows
tbb/enumerable_thread_specific.h drags in windows.h
which will define min/max macro's unless you politely
ask it not to.

it's bit of an eyesore, but it is what it is
2022-02-23 12:27:02 -07:00
88712453f6 Fix error with SPDX-License-Identifier 2022-02-23 14:16:46 -05:00
572acba5d1 Merge branch 'blender-v3.1-release' 2022-02-23 14:12:48 -05:00
80be63e2a5 Update RNA to user manual mapping file 2022-02-23 14:10:52 -05:00
b93d4faba8 Fix for last commit: Define for Node numbering 2022-02-23 13:04:46 -06:00
81e89a444e Merge branch 'blender-v3.1-release' 2022-02-23 14:01:20 -05:00
99a6392fb5 Fix OSL trace() not being fully updated for ray offsetting removal
This was the last place still using the ray_offset() function.
2022-02-23 20:01:03 +01:00
dbef66c32f Fix T95952: Uninitialized value used in Bezier Segment node
0fd72a98ac called functions to set bezier handle positions
that used uninitialized memory. The fix is to define the handle positions
explicitly, like before.
2022-02-23 13:57:04 -05:00
7518adc5bb Fix: Attempt to fix build error on windows
`index_mask.cc` ends up including this header, but not much else,
the `<algorithm>` include is necessary on Windows for `std::max`.
2022-02-23 13:02:06 -05:00
226f0c4fef Curves: initial brush implementations for curves sculpt mode
The main goal here is to add the boilerplate code to make it possible
to add the actual sculpt tools more easily. Both brush implementations
added by this patch are meant to be prototypes which will be removed
or refined in the coming weeks.

Ref T95773.

Differential Revision: https://developer.blender.org/D14180
2022-02-23 16:56:27 +01:00
120f16fa1f Geometry Nodes: Duplicate Elements Node
This adds a node which copies part of a geometry a dynamic number
of times.

Different parts of the geometry can be copied differing amounts
of times, controlled by the amount input field. Geometry can also
be ignored by use of the selection input.

The output geometry contains only the copies created by the node.
if the amount input is set to zero, the output geometry will be
empty. The duplicate index output is an integer index with the copy
number of each duplicate.

Differential Revision: https://developer.blender.org/D13701
2022-02-23 09:08:16 -06:00
e32b676baf Merge branch 'blender-v3.1-release' 2022-02-23 09:58:41 -05:00
398538b914 Fix T95987: Data transfer modifier custom normals crash
59343ee162 missed one case of normals being
retrieved from polygon custom data instead of the normals API.
The fix is simple.
2022-02-23 09:49:25 -05:00
1361c6e604 Curves: Add methods to retrieve range for points or curves 2022-02-23 08:54:35 -05:00
b9ce036d6b Merge branch 'blender-v3.1-release' 2022-02-23 14:33:53 +01:00
867e50b886 Fix T95183: Cage gizmo axis unreliable
`orient_matrix` was not initialized.

Reviewed By: lichtwerk

Differential Revision: https://developer.blender.org/D14167
2022-02-23 14:25:00 +01:00
391c3848b1 NDOF: make camera view/pan behavior optional
User request since adding this option in:
51975b89ed

When disabled, use the previous behavior when orbiting a camera view.
2022-02-23 21:25:46 +11:00
3429444905 BLI: add index mask utilities
Sometimes it is useful to get the index ranges that are in an index mask.
That is because some algorithms can process index ranges more efficiently
than generic index masks.

Extracting ranges from an index mask is relatively efficient, because it is
cheap to check if a span of indices contains a contiguous range.
2022-02-23 11:14:07 +01:00
66c0fe5b23 Cleanup: correction to repeated word removal & correct spelling 2022-02-23 20:47:14 +11:00
7393cc1db7 Cleanup: Remove repeated word in comments 2022-02-23 18:24:37 +11:00
Alaska
165b030b19 Cleanup: Remove repeated word in comment
Differential Revision: https://developer.blender.org/D14178
2022-02-23 11:07:04 +05:30
3c0fd287cb Merge branch 'blender-v3.1-release' 2022-02-23 16:29:51 +11:00
74611e3555 Fix T93331: Gizmo tool options reset when switching tools
Drag Action was constantly resetting itself to "move".

Solve this by storing the tool settings per tool and no longer clear
gizmo properties when activating a new tool.
2022-02-23 16:27:26 +11:00
06bc20f61a Fix: Errors in previous cleanup commit
f3ef0763b4 introduced a file by mistake, and didn't add
a new enum type to many switch cases. Sorry for the noise.
2022-02-22 22:15:03 -05:00
f3ef0763b4 Cleanup: Use new curves type enum for CurveEval
Though this is less aesthetically pleasing, it makes the transition to the
new curves type (T95941) a bit simpler, and it has to be done anyway.
2022-02-22 21:52:48 -05:00
c6df7266c7 CMake: move cmake_consistency_check.py into source/tools/ repo
This isn't needed for building Blender so move this along side
other source checking scripts.
2022-02-23 12:31:46 +11:00
e1c33698e6 GNUmakefile: prefer "check_" prefix instead of "test_"
- Reserve "test" for tests & testing frameworks.
- Add "check_mypy" to "make help" text.
- Output to the standard output instead of redirecting to log-files,
  leave redirecting output log-files to the user running the command.
2022-02-23 12:31:46 +11:00
4c423ccbd6 CMake: include missing files
Also use SRC_ prefix for source variables so cmake_consistency_check.py
detects these files as being known to CMake.
2022-02-23 12:31:46 +11:00
4addc1f31e Tests: temporarily add back tests/check_deprecated.py
The build-bot directly referenced this file and doesn't
have publically available configuration.

Add an empty file until this can be removed by the build scripts.
2022-02-23 12:30:54 +11:00
5b4732f81c Cleanup: Use new enum for CurveEval handle types
This will make the transition to the new curves data structure
a bit simple, since the handle types can be copied directly between
the two. The change to CurveEval is simple because it is runtime-only.
2022-02-22 17:37:58 -05:00
0b9cc6725c XR: Use #ifdef for Vive Focus 3 extension
Helps with building against different OpenXR SDK versions (i.e. for
downstream builds that require specific versions), as the extension was
only defined since OpenXR 1.0.22.
2022-02-23 06:56:08 +09:00
d228f05814 Merge branch 'blender-v3.1-release' 2022-02-22 14:40:20 -05:00
2746238dde Python API Docs: Hide version swtich
This still needs some fixes to be ready for release.
2022-02-22 14:39:51 -05:00
529f891878 GPencil: Make Fill Dilate expand outside stroke
To keep consistency with the new contract option, the dilate now expand the shape beyond the internal closed area.
2022-02-22 20:03:34 +01:00
ad3ee84f4e Cleanup: Remove unused mesh dirty flags
These were only set in two places. One was related to "tessellated loop
normal", and the other derived corner normals. The values were never
checked though, after 59343ee162. The handling of dirty face
corner normals is clearly problematic, but in the future it should be
handled like the normal layers on the other domains instead.

Ref D14154, T95839
2022-02-22 13:13:13 -05:00
c7a9f76149 Merge branch 'blender-v3.1-release' 2022-02-22 12:47:05 -05:00
59343ee162 Fix T95839: Data race when lazily creating mesh normal layers
Currently, when normals are calculated for a const mesh, a custom data
layer might be added if it doesn't already exist. Adding a custom data
layer to a mesh is not thread-safe, so this can be a problem in some
situations.

This commit moves derived mesh normals for polygons and
vertices out of `CustomData` to `Mesh_Runtime`. Most of the
hard work for this was already done by rBcfa53e0fbeed7178.
Some changes to logic elsewhere are necessary/helpful:
- No need to call both `BKE_mesh_runtime_clear_cache` and
  `BKE_mesh_normals_tag_dirty`, since the former also does the latter.
- Cleanup/simplify mesh conversion and copying since normals are
  handled with other runtime data.

Storing these normals like other runtime data clarifies their status
as derived data, meaning custom data moves more towards storing
original/editable data. This means normals won't automatically benefit
from the planned copy-on-write refactor (T95845), so it will have to be
added manually like for the other runtime data.

Differential Revision: https://developer.blender.org/D14154
2022-02-22 12:44:15 -05:00
f3d97498c3 Merge branch 'blender-v3.1-release' 2022-02-22 18:03:27 +01:00
ee9949a85f Fix (unreported) LibOverride: missing copying flag member. 2022-02-22 18:01:52 +01:00
29696fb725 UI: ActionZone Swap Areas Between Windows
Allow SCREEN_OT_area_swap to operate between different Blender
windows, and other minor feedback improvements.

See D14135 for more details and demonstrations.

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

Reviewed by Campbell Barton
2022-02-22 08:58:42 -08:00
8ae77efe4e Merge branch 'blender-v3.1-release' 2022-02-22 17:34:07 +01:00
283a4cd40e Fix ffmpeg tests when using ffmpeg 5.0 2022-02-22 17:30:52 +01:00
2f951667c0 OCIO: Fix bool1 vs. bool comparison warning.
Fixes the following warning:
`'!=': unsafe mix of type 'bool1' and type 'bool' in operation`
2022-02-22 17:29:32 +01:00
353fe610ed Fix: Clear mesh runtime cache when adding elements
Currently the RNA functions to add mesh elements like vertices
don't clear the runtime cache of things like triangulation, BVH
trees, etc. This is important, since they might be accessed with
incorrect sizes. This is split from a fix for T95839.
2022-02-22 11:14:50 -05:00
8073c95fe9 Cleanup: Deduplicate logic in RNA_property_editable & co.
Fairly straight-forward, now all the logic for all those 'is editable'
complex checks is gathered into a single util function.
2022-02-22 16:38:04 +01:00
51c7193405 Cycles: Removed numaapi from standalone 2022-02-22 16:34:52 +01:00
b861d3e4c1 Merge branch 'blender-v3.1-release' 2022-02-22 16:08:38 +01:00
ca991e3012 Fix compilation error on certain platforms
Atomic operations performed by the C++ standard library might require
libatomic on platforms which do not have hardware support for those
operations.

This change makes it that such configurations are automatically detected
and -latomic is added when needed.

Differential Revision: https://developer.blender.org/D14106
2022-02-22 15:47:43 +01:00
37fb69e020 Fix (unreported) RNA_property_editable_index.
NOTE: This function is currently unused. However, it does use a callback
defined by a few RNA properties through
`RNA_def_property_editable_array_func`, so don't think it should be
removed without further thinking.

This function had two main issues:
* It was doing bitwise AND on potentially three sources of property
  flag, when actually used `RNA_property_editable` just use one source
  ever.
* It was completely ignoring liboverride cases.

TODO: Deduplicate code between `RNA_property_editable`,
`RNA_property_editable_info` and `RNA_property_editable_index`.
2022-02-22 15:33:52 +01:00
f449b89688 Cleanup: Make RNA_property_editable logic clearer.
Split code in smaller bits with early returns, instead of a giant single
set of checks.

No behavioral change expected here.
2022-02-22 15:18:08 +01:00
472ddc6e27 Merge branch 'blender-v3.1-release' 2022-02-22 15:13:27 +01:00
1d4037645f Cleanup: quiet warnings for FFMPEG before 5.0
Even though 5.0 has been released newer distributions wont include it,
so quiet warnings.
2022-02-22 15:11:35 +01:00
9d8af55eb8 GNUmakefile: missed removing docs for test_deprecated when renaming 2022-02-23 00:05:34 +11:00
66f3545a0b Cleanup: compiler warning 2022-02-22 14:03:11 +01:00
85b39b6be0 Fix subdivision surface modifier doing unnnecessary work
There was accidentally some displacement related code running even when not
using displacement.

Differential Revision: https://developer.blender.org/D14169
2022-02-22 14:03:11 +01:00
6bb4c0e498 GNUmakefile: rename test_depracted to check_deprecated
Also move this utility into the source/tools repo.
2022-02-23 00:00:32 +11:00
4a7559bbcb Cleanup: quiet warnings for FFMPEG before 5.0
Even though 5.0 has been released newer distributions wont include it,
so quiet warnings.
2022-02-23 00:00:32 +11:00
64293a277f Merge branch 'blender-v3.1-release' 2022-02-22 13:57:05 +01:00
4e78a7360e Fix T93784: text and curve objects have no motion blur
Previously, objects and geometries were mapped between frames
using different hash tables in a way that is incompatible with
geometry instances. That is because the geometry mapping happened
without looking at the `persistent_id` of instances, which is not possible
anymore. Now, there is just one mapping that identifies the same
object at multiple points in time.

There are also two new caches for duplicated vbos and textures used for
motion blur. This data has to be duplicated, otherwise it would be freed
when another time step is evaluated. This caching existed before, but is
now a bit more explicit and works for geometry instances as well.

Differential Revision: https://developer.blender.org/D13497
2022-02-22 13:52:15 +01:00
0b4c56b010 Cleanup: Replace eTexPaintMode with classes.
For an upcoming prototype we would introduced a new eTexPaintMode
option. That would add more cases and if statements. This change migrate
the eTexPaintMode to 3 classes. AbstractPaintMode contains a shared interface.
ImagePaintMode for 2d painting and ProjectionPaintMode for 3d painting.
2022-02-22 13:42:44 +01:00
683a77256d Fix compilation issue under windows. 2022-02-22 10:30:02 +01:00
4ba894cbb8 Fix compilation error on certain platforms.
Seems this isn't an issue on newer compilers.
2022-02-22 10:00:03 +01:00
1d4ed6ba29 Convert paint_image to cc. 2022-02-22 10:00:03 +01:00
1ec02b8695 Cleanup: Renamed PaintOperation.custom_paint to stroke_handle. 2022-02-22 10:00:03 +01:00
0cfcb261b1 Merge branch 'blender-v3.1-release' 2022-02-22 19:59:31 +11:00
0ad4d2694b Python: change behavior for CONSOLE_OT_indent_or_autocomplete
Checking only the previous character broke import auto-completion.
2022-02-22 19:57:36 +11:00
7657358447 Cleanup: use doxygen sections 2022-02-22 19:39:55 +11:00
27427f3447 Cleanup: Use switch-statement for eTexPaintMode. 2022-02-22 09:02:52 +01:00
2cd33955be Merge branch 'blender-v3.1-release' 2022-02-22 16:43:23 +11:00
c5b66560de Fix T93629: Reset to defaults undoes all steps when applied twice
Reset Defaults left the undo stack in an invalid state,
with the active undo step left at the previous state then it should
have been.

Now the buttons own undo logic is used to perform undo pushes.
2022-02-22 16:40:07 +11:00
2234bfbcdb GPencil: Simplify sample modifier improvements.
1. Now handles cyclic strokes correctly.

2.  Added a sharp threshold value to allow preservation of sharp corners.

Reviewed By: Antonio Vazquez (antoniov), Aleš Jelovčan (frogstomp)

Ref D14044
2022-02-22 12:54:35 +08:00
0f2e0a25e1 LineArt: Consistent backface culling behavior
1. Now will remove lines if both adjacent faces are back face.

2. Added a check to respect material back face culling setting.

3. Changed label in the modifier to "Force Backface Culling" (which reflect more accurately with what the checkbox does).

Reviewed By: Antonio Vazquez (antoniov), Aleš Jelovčan (frogstomp)

Ref D14041
2022-02-22 12:51:49 +08:00
2fefdaae93 Merge branch 'blender-v3.1-release' 2022-02-21 21:54:59 -03:00
75be58c63d Fix errors in 'gpu.state' documentation
`blend_depth_test_get` --> `depth_test_get`
`depth_mask_set_get` --> `depth_mask_get`

Thanks to @SBCV for pointing out these inconsistencies.
2022-02-21 21:48:17 -03:00
18d3d283ec Fix wrong method name in gpu documentation
`use_program_point_size` --> `program_point_size_set`.
2022-02-21 21:48:02 -03:00
Germano Cavalcante
c73bacc364 Camera: Simplify View Frame code
- No need for `normal_tx` array if we normalize the planes in `plane_tx`.
- No need to calculate the distance squared to a plane (with `dist_signed_squared_to_plane_v3`) if the plane is normalized. `plane_point_side_v3` gets the real distance, accurately, efficiently and also signed.

So normalize the planes of the member `CameraViewFrameData::plane_tx`.
2022-02-21 21:47:46 -03:00
459d9c1e3d Fix (unreported): Issues with 'SNAP_NOT_SELECTED' for pose and edit modes
This is a regression partially introduced in rB0a6f428be7f0.

Bones being transformed into edit mode were snapping to themselves.

And the bones of the pose mode weren't even snapping.

(Curious that this was not reported).
2022-02-21 21:47:24 -03:00
fcda858e32 Cleanup: remove Python 3.9 annotation workarounds 2022-02-22 10:28:01 +11:00
ca12696257 Merge branch 'blender-v3.1-release' 2022-02-22 10:18:15 +11:00
ec5bbebf3e Python: bump minimum version to 3.10
Since Python 3.10 is now supported on all platform,
bump the minimum version to reduce the number of Python versions that
need to be supported simultaneously.

Reviewed By: LazyDodo, sybren, mont29, brecht

Ref D13943
2022-02-22 10:16:25 +11:00
b13bf8556b Cleanup: clang-format 2022-02-22 10:08:38 +11:00
55a4ebc701 Merge branch 'blender-v3.1-release' 2022-02-22 10:08:24 +11:00
6ec57f9083 Merge branch 'blender-v3.1-release' 2022-02-22 10:08:20 +11:00
2a5df72d9b Revert "Cleanup: quiet const cast warning"
This reverts commit 626fb290eb.

This was an intentional change for FFMPEG v5.0,
removing the cast should be done in a version check instead.
2022-02-22 10:07:05 +11:00
bfdbc78466 Fix T44415: Shape keys get out of sync when using undo in edit-mode
This is an alternate fix for T35170 since it caused T44415.
Having the undo system manipulate the key-block coordinates is error
prone as (in the case of T44415) there are situations when it's
important to apply the difference with the original shape key.

This reverts dab0bd9de6, and instead
avoids the problem by not using the data in `Mesh.key` as a reference
for updating shape-keys when exiting edit-mode.

The assumption that the `Mesh.key` in edit-mode won't be modified
until leaving edit-mode isn't always true. Leading to synchronization
errors. (details noted in code-comments).

Resolve this by using shape-key data stored in the BMesh.

Resolving both T35170 & T44415.

Details:

- Remove use of the original vertices when exiting edit mode.
- Remove use of the original shape-key coordinates when exiting
  edit-mode (except as a last resort).
- Move shape-key synchronization into a separate function:
  `bm_to_mesh_key`.
- Split the synchronization loop into two branches,
  depending on the existence of BMesh shape-key coordinates.
- Always write shape-key values back to the BMesh CD_SHAPEKEY layers.
  This was only done in some cases but is now necessary for all
  shape-keys as these are used to calculate offsets where the `Mesh.key`
  was previously used.
- Report a warning when the shape-key layer isn't found as this uses an
  imperfect method of restoring coordinates which should only be used as
  a last resort.

Reviewed By: mont29

Ref D14127
2022-02-22 09:57:07 +11:00
c3d36b7127 Cleanup: clang-format 2022-02-22 09:56:43 +11:00
dde5cc6670 Cleanup: Use curves wrapper 2022-02-21 17:06:17 -05:00
24ddb4b1ad Merge branch 'blender-v3.1-release' 2022-02-21 14:04:38 -05:00
284cef473f Fix T95919: Apply Pose as Rest Pose Operator crashes
A simple mistake with a null mesh in rBcfa53e0fbeed.
2022-02-21 13:59:18 -05:00
48abcc91ae Merge branch 'blender-v3.1-release' 2022-02-21 19:51:50 +01:00
49ae0b5b3c Fix T95923: GPencil Array modifier constant offset works even disabled
The problem was when the Object Offset was enabled because the Constant Offset flag was not checked and the offset always was added to the transformation matrix.
2022-02-21 19:48:11 +01:00
9762dbe94e Merge branch 'blender-v3.1-release' 2022-02-21 13:07:14 -05:00
be6bcaa8c1 Fix T93873: Wrong limits for color socket exposed to modifier
Limit the min and max of the IDProperty for the node group input
from 0 to infinity, and the soft min and max between 0 and 1.

Thanks to @PratikPB2123 for investigation.
2022-02-21 13:01:37 -05:00
b7171d1b82 Cleanup: Use function to check if normals are dirty
This makes the fix for T95839 simpler.
Similar to 969c4a45ce.
2022-02-21 12:17:41 -05:00
a81cc5cbcb Fix: Avoid potential use of dirty normals
Instead of accessing the `CD_NORMAL` layer directly,
use the proper API for accessing mesh normals. Even if the
layer exists, the values might be incorrect due to a deformation.
Related to ef0e21f0ae, 969c4a45ce, and T95839.
2022-02-21 11:40:59 -05:00
869dd2e699 Fix T95154 Eevee AO node: the "only local" option applies "inside" instead
The `custom2` was not being used as a bitflag as it should.
2022-02-21 17:18:45 +01:00
68a2dc58de Weight Proximity: do flag split versioning both in 3.1 and 3.2
The flags overlapped ever since normalize was added, so this
requires versioning to copy the flag value. This needs to be
done both in Blender 3.1 and 3.2.

Differential Revision: https://developer.blender.org/D14165
2022-02-21 18:15:17 +03:00
1234a7ada0 Merge branch 'blender-v3.1-release' 2022-02-21 18:14:41 +03:00
82ff0fa586 Weight Proximity: fix value overlap between Normalize and Invert VGroup.
The flags overlapped ever since normalize was added, so this requires
versioning to copy the flag value.

Differential Revision: https://developer.blender.org/D14165
2022-02-21 18:08:53 +03:00
ed9f763034 Paint: pass operator to stroke update function
This allows accessing properties of the operator that the
stroke belongs to.
2022-02-21 16:07:59 +01:00
38ae311706 Weight Modifiers: use the correct flags for the mask invert property.
The code was using the same flag value for different modifiers,
resulting in matching the toggle to random overlapping flags.

Differential Revision: https://developer.blender.org/D14165
2022-02-21 18:07:08 +03:00
Henrik Dick
68586d2c18 Complex Solidify: improve constraints solver
The constraints solver is now able to handle more cases correctly.
Also the behavior of the boundary fixes is slightly changed if
the constraints thickness mode is used.

Differential Revision: https://developer.blender.org/D14143
2022-02-21 14:13:55 +01:00
fa715a158a Vertex Weight Mix: support Minimum and Maximum mix modes.
The modifier supports arithmetic operations, like Add or Multiply,
but for some reason omits Minimum and Maximum. They are similarly
simple and useful math functions and should be supported.

Differential Revision: https://developer.blender.org/D14164
2022-02-21 16:01:39 +03:00
0f242981ec Workbench: Fix missing world_data ubo during opaque prepass 2022-02-21 13:30:20 +01:00
5c11ca10c0 Merge branch 'blender-v3.1-release' 2022-02-21 23:15:50 +11:00
829812f180 Fix T92467: Path Selection broken when Drag is set to Tweak
When RMB-select uses "Select Tweak" as a fallback tool,
ignore all bindings mapped to the Control key as these are
used for path selection.

This was fixed in 2a2d873124
however that caused shift-select to fail (T93100).
2022-02-21 23:09:34 +11:00
d076e9468c Merge remote-tracking branch 'origin/blender-v3.1-release' 2022-02-21 13:06:28 +01:00
132f9a2e31 Fix T95596: Crash in versioning of node animation
The node animation versioning code passes `nullptr` to the `oldName` and
`newName` parameters, but those weren't `NULL`-safe. I added an extra
check for this.

No functional changes, just a crash fix.
2022-02-21 13:02:23 +01:00
e2ffe88983 Curves: use paint cursor in curves sculpt mode
Also adds radius and strength control to the tool settings in the ui.
2022-02-21 12:49:36 +01:00
fcb84e32e0 Cleanup: use namespace and code sections 2022-02-21 12:01:30 +01:00
7f2beb79c6 Cleanup: move curves sculpt mode toggle operator to sculpt/paint module
This is necessary, because the operator will have to use functions that
are currently private within this module. E.g. `paint_cursor_start`.
2022-02-21 11:57:43 +01:00
141d5851d7 Paint: decouple op->customdata from PaintStroke
Previously, all operators using `PaintStroke` would have to store
the stroke in `op->customdata`. That made it impossible to store
other operator specific data in `op->customdata` that was unrelated
to the stroke.

This patch changes it so that the `PaintStroke` is passed to api
functions as a separate argument, which allows storing the stroke
as a subfield of some other struct in `op->customdata`.
2022-02-21 11:52:46 +01:00
5be74160c0 macOS/ blender_icons_update.py: prioritise environment variables
Also fix binary name for mac

Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D14161
2022-02-21 15:19:19 +05:30
bce810f057 Fix T95871: Non-float textures report as float.
Althought the float buffers are only used as cache, current code paths
don't look at the flags to identify which kind of image it is. Actual
fix would be to check flags, but that wouldn't be something to add one
week before release.

This commit fixes it by removing the buffers after use in the image
engine.
2022-02-21 07:48:49 +01:00
9189191c5b Fix errors in 'gpu.state' documentation
`blend_depth_test_get` --> `depth_test_get`
`depth_mask_set_get` --> `depth_mask_get`

Thanks to @SBCV for pointing out these inconsistencies.
2022-02-20 23:31:08 -03:00
813895f713 Cleanup: use strict type checking for bl_keymap_validate 2022-02-21 12:21:47 +11:00
167c4c6962 Tests: add duplicate key-map test, also test multiple configurations
Duplicate key-map items (while harmless in most cases) may cause
unexpected behavior or point to mistakes in the key-map,
so best avoid these.
2022-02-21 12:03:56 +11:00
16da9c944c Cleanup: remove duplicate key-map items 2022-02-21 12:01:32 +11:00
1884f6e729 BLI_array: add BLI_array_trim utility to re-allocate the current size
Use this in BKE_view_layer_array_* functions.
2022-02-21 12:01:32 +11:00
7b11c71729 RNA: modify debug mode logic for setting invalid unset values
The previous behavior called RNA_enum_item_add a second time,
filled it's contents with invalid values then subtracted totitem,
this caused an unusual reallocation pattern where MEM_recallocN
would run in order to create the dummy item, then again when adding
another itme (reallocating an array of the same size).

Simply memset the array to 0xff instead.
2022-02-21 12:01:32 +11:00
2554ef986a readfile: free & reallocate arrays in oldnewmap_clear
Even though the size of the map was set back to DEFAULT_SIZE_EXP,
the underlying arrays were left unchained. In some cases this caused
further expansions to result in an unusual reallocation pattern
where MEM_reallocN would run expand the entries into an array
that was in fact the same size.
2022-02-21 12:01:32 +11:00
e93a8c4f74 Cleanup: avoid reallocating arrays at the same size 2022-02-21 12:01:32 +11:00
626fb290eb Cleanup: quiet const cast warning 2022-02-21 12:01:32 +11:00
36d7adf85c Merge branch 'blender-v3.1-release' 2022-02-20 23:15:39 +01:00
1a0a22f95a Fix T95413: Blur node size input crash
Bug was introduced in D12167.

Reading input size from an input socket is not possible in tiled compositor before execution is initialized. A similar change was done for the base class, see BlurBaseOperation::init_data().

Reviewed by: Jeroen Bakker

Differential Revision: https://developer.blender.org/D14067
2022-02-20 23:00:44 +01:00
de886884c0 Fix T95470: LineArt GPU subdiv fix.
Use evaluated mesh instead of ob->data.

Reviewed by: Antonio Vazquez (antoniov)

Differential Revision: https://developer.blender.org/D14040
2022-02-20 19:40:44 +08:00
Aaron Carlisle
1f79132287 UI: Do not include the text stating an enum item is the default
This adds maintence overhead and it is not that useful when we have reset to default.

If this is something that we want it should be added dynamically.

Reviewed By: HooglyBoogly, Severin, #user_interface

Differential Revision: https://developer.blender.org/D14151
2022-02-19 21:31:53 -05:00
991781c8ea LineArt: GPU subdiv fix.
Use evaluated mesh instead of ob->data.

Reviewed by: Antonio Vazquez (antoniov)

Differential Revision: https://developer.blender.org/D14040
2022-02-19 22:35:22 +08:00
385d9488e6 Fix incorrect copying of XR action paths
After using MEM_dupallocN() on the original item/binding, the
user/component path ListBase for the new item/binding needs to be
cleared and each path copied separately.
2022-02-19 15:23:34 +09:00
16d5658365 OCIO: Port shader creation logic to use GPUShaderCreateInfo
This commit should suffice to make the shader API agnostic now (given that
all users of it use the GPU API).

This makes the shaders not trigger a false positive error anymore since
the binding slots are now garanteed by the backend and not changed at
after compilation.

This also bundles all uniforms into UBOs. Making them extendable without
limitations of push constants. The generated uniforms from OCIO are not
densely packed in the UBO to avoid complexity. Another approach would be to
use GPU_uniformbuf_create_from_list but this requires converting uniforms
to GPUInputs which is too complex for what it is.

Reviewed by: brecht, jbakker

Differential Revision: https://developer.blender.org/D14123
2022-02-18 22:30:45 +01:00
e81dda4f38 Merge branch 'blender-v3.1-release'
# Conflicts:
#	intern/opencolorio/ocio_shader_shared.hh
2022-02-18 22:29:31 +01:00
93cc892470 Revert "OCIO: Port shader creation logic to use GPUShaderCreateInfo"
This reverts commit 7f7c614ecd.
2022-02-18 22:28:05 +01:00
32660382f5 Revert "OCIO: Fix gpu include file"
This reverts commit 3cebfadb27.
2022-02-18 22:28:01 +01:00
7f68185d34 Merge branch 'blender-v3.1-release' 2022-02-18 15:17:01 -06:00
3cebfadb27 OCIO: Fix gpu include file
Was the cause by ef0e21f0ae
2022-02-18 21:52:29 +01:00
eba3ffc31a GL: Fix possible shift by -1
This can happen when the attribute has been optimized out by the compiler.
2022-02-18 21:33:47 +01:00
7f7c614ecd OCIO: Port shader creation logic to use GPUShaderCreateInfo
This commit should suffice to make the shader API agnostic now (given that
all users of it use the GPU API).

This makes the shaders not trigger a false positive error anymore since
the binding slots are now garanteed by the backend and not changed at
after compilation.

This also bundles all uniforms into UBOs. Making them extendable without
limitations of push constants. The generated uniforms from OCIO are not
densely packed in the UBO to avoid complexity. Another approach would be to
use GPU_uniformbuf_create_from_list but this requires converting uniforms
to GPUInputs which is too complex for what it is.

Reviewed by: brecht, jbakker

Differential Revision: https://developer.blender.org/D14123
2022-02-18 21:33:47 +01:00
ef0e21f0ae Cleanup: Remove unused argument to mesh tessellation
This removes manual handling of normals that was hard-coded
to false in the one place the function was called. This change
will help to make a fix to T95839 simpler.
2022-02-18 13:39:16 -06:00
969c4a45ce Cleanup: Use functions for accessing mesh normal dirty state
It's better not to expose the details of where the dirty flags are
stored to every place that wants to know if the normals are dirty.
Some of these places are relics from before vertex normals were
computed lazily anyway, so this is more of an incrememtal cleanup.
This will make part of the fix for T95839 simpler.
2022-02-18 13:21:36 -06:00
eaa4aa8644 Fix part of T95848: missing updates editing light object nodes
Make relation match material and world nodes. Does not address the reported
issue regarding muted nodes, but another missing update found investigating.
2022-02-18 19:50:53 +01:00
b04d42022f Fix T95338: missing image editor refresh after render compositing
This was an old issue, but recent image partial update changes made this more
likely to happen in some cases. Now ensure that whenever the rendered scene
switches the image is updated.
2022-02-18 19:50:53 +01:00
Dominik Fill
d9d97db018 Fix T87829, T95331: Issues when nodes too close together
This patch aims to fix the issues presented in T87829 and T95331,
namely precision issues while connecting two nodes when being too
close together in the node editor editors, in a few cases even
resulting in the complete inability to connect nodes.

Sockets are found by intersecting a padded rect around the cursor
with the nodes' sockets' location. That creates ambiguities, as it's
possible for the padded rect to intersect with the wrong node,
as the distance between two nodes is smaller than the rect is padded.

The fix in this patch is checking against an unpadded rectangle in
visible_node().

Differential Revision: https://developer.blender.org/D14122
2022-02-18 12:22:51 -06:00
07fbf3108b Merge branch 'blender-v3.1-release' 2022-02-18 11:40:55 -06:00
Wannes Malfait
82fc68ed90 Fix T95542: Dual Mesh crashes with some non-manifold vertices
The problem was that the code for sorting polygons around a vertex
assumed that it was a manifold or boundary vertex. However in some cases
the vertex could still be nonmanifold causing the crash. The cases where
the sorting fails are now detected and these vertices are then marked as
nonmanifold.

Differential Revision: https://developer.blender.org/D14065
2022-02-18 11:35:08 -06:00
Leon Schittek
ddc52f2e1d Fix: Curve to Mesh node creates caps when curve is cyclic
The "Fill Caps" option on the Curve to Mesh node introduced in
rBbc2f4dd8b408ee makes it possible to fill the open ends of the sweep
to create a manifold mesh.

This patch fixes an edge case, where caps were created even when the
rail curve (the curve used in the "Curve" input socket) was cyclic
making the resulting mesh non-manifold.

Differential Revision: https://developer.blender.org/D14124
2022-02-18 11:27:28 -06:00
c2016feadc Merge branch 'blender-v3.1-release' 2022-02-18 18:25:31 +01:00
af6a1b08e3 VSE: Refactor our code to be compatible with ffmpeg 5.0
In ffmpeg 5.0, several variables were made const to try to prevent bad API usage.
Removed some dead code that wasn't used anymore as well.

Reviewed By: Richard Antalik

Differential Revision: http://developer.blender.org/D14063
2022-02-18 18:24:16 +01:00
16ab6111f7 UI: Speedup preview icon loading from hard drive
Significantly improves loading speed of preview images from disk, e.g. custom
previews loaded using `bpy.utils.previews.ImagePreviewCollection.load()`.

See D14144 for details & comparison videos.

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

Reviewed by: Bastien Montagne
2022-02-18 18:13:06 +01:00
1850a0b2ab Mesh: Avoid creating incorrect original index layers
Currently, whenever any BMesh is converted to a Mesh (except for edit
mode switching), original index (`CD_ORIGINDEX`) layers are added.
This is incorrect, because many operations just convert some Mesh into
a BMesh and then back, but they shouldn't make any assumption about
where their input mesh came from. It might even come from a primitive
in geometry nodes, where there are no original indices at all.

Conceptually, mesh original indices should be filled by the modifier
stack when first creating the evaluated mesh. So that's where they're
moved in this patch. A separate function now fills the indices with their
default (0,1,2,3...) values. The way the mesh wrapper system defers
the BMesh to Mesh conversion makes this a bit less obvious though.

The old behavior is incorrect, but it's also slower, because three
arrays the size of the mesh's vertices, edges, and faces had to be
allocated and filled during the BMesh to Mesh conversion, which just
ends up putting more pressure on the cache. In the many cases where
original indices aren't used, I measured an **8% speedup** for the
conversion (from 76.5ms to 70.7ms).

Generally there is an assumption that BMesh is "original" and Mesh is
"evaluated". After this patch, that assumption isn't quite as strong,
but it still exists for two reasons. First, original indices are added
whenever converting a BMesh "wrapper" to a Mesh. Second, original
indices are not added to the BMesh at the beginning of evaluation,
which assumes that every BMesh in the viewport is original and doesn't
need the mapping.

Differential Revision: https://developer.blender.org/D14018
2022-02-18 10:51:00 -06:00
a08c5c7149 Merge branch 'blender-v3.1-release' 2022-02-18 10:35:11 -06:00
82c3bef765 Fix T94495: Split edges node leads to a crash in edit mode
If original indices exist on the input mesh, also copy them to
the BMesh used for the edge split operation so they aren't lost.

Part of D14018
2022-02-18 10:34:00 -06:00
ddf189892c Cleanup: Rename original curve object type enum
This commit renames enums related the "Curve" object type and ID type
to add `_LEGACY` to the end. The idea is to make our aspirations clearer
in the code and to avoid ambiguities between `CURVE` and `CURVES`.

Ref T95355

To summarize for the record, the plans are:
- In the short/medium term, replace the `Curve` object data type with
 `Curves`
- In the longer term (no immediate plans), use a proper data block for
  3D text and surfaces.

Differential Revision: https://developer.blender.org/D14114
2022-02-18 09:50:29 -06:00
48b17da1d9 Merge remote-tracking branch 'origin/blender-v3.1-release' 2022-02-18 16:36:45 +01:00
1b47d07d76 Fix T95724: boundary error in BLI_str_unescape_ex
Fix boundary error in `BLI_str_unescape_ex`. The `dst_maxncpy` parameter
indicates the maximum buffer size, not the maximum number of characters.

As these are strings, the loop has to stop one byte early to allow space
for the trailing zero byte.

Thanks @mano-wii for the patch!
2022-02-18 16:34:00 +01:00
734c6a4405 Nodes: Update dependency graph when removing some nodes
When removing a node that has a dependence on an ID, like the object
info node, the dependency graph relations weren't updated. This can
cause unexpected performance issues if a complex node tree continues
to depend on an ID that it doesn't actually use anymore. To fix this case,
tag relations for an update if the node has a data-block socket.

Fixes part of T88332

Differential Revision: https://developer.blender.org/D14121
2022-02-18 09:25:13 -06:00
Sayed Amin
ceea3d0f80 Fix T95135: improve error filtering non-existant anim data
If there is no animation at all, or it's all hidden, the Euler Filter
operators poll now fails with a message that explains this a bit more,
instead of just the generic "context is wrong" error.

Reviewed By: sybren

Maniphest Tasks: T95135

Differential Revision: https://developer.blender.org/D13967
2022-02-18 16:24:48 +01:00
aab1561690 LibOverride: Fix resync sometimes deleting root ID of other liboverrides.
While this should not happen in theory, very bad/broken/dirty files can
lead to such situations.

So we need to re-ensure valid root IDs after resync (for now, done after
each 'library indirect level' pass of resync, this may not be 100%
bulletproof though, time will say).

Found while investigating Blender studio issues in Snow parkour short.
2022-02-18 16:08:43 +01:00
d9fe565c85 LibOverride: Fix potential broken cases re ShapeKeys when finding hierarchy root ID.
In some cases broken files could lead to selecting a shapekey as
hierarchy root ID, which is not allowed.

Found while investigating Blender studio issues in Snow parkour short.
2022-02-18 16:06:15 +01:00
303b566b10 Merge branch 'blender-v3.1-release' 2022-02-18 15:32:24 +01:00
e4b7d52fe4 Fix graphics interop resources leak in Cycles
When new display driver is given to the PathTrace ensure that there are
no GPU resources used from it by the work. This solves graphics interop
descriptors leak.

This aqlso fixes Invalid graphics context in cuGraphicsUnregisterResource
error when doing final render on the display GPU.

Fixes T95837: Regression: GPU memory accumulation in Cycles render
Fixes T95733: Cycles Cuda/Optix error message with multi GPU devices. (Invalid graphics context in cuGraphicsUnregisterResource)
Fixes T95651: GPU error (Invalid graphics context in cuGraphicsUnregisterResource)
Fixes T95631: VRAM is not being freed when rendering (Invalid graphics context in cuGraphicsUnregisterResource)
Fixes T89747: Cycles Render - Textures Disappear then Crashes the Render

Maniphest Tasks: T95837, T95733, T95651, T95631, T89747

Differential Revision: https://developer.blender.org/D14146
2022-02-18 15:26:15 +01:00
40cddcd917 Cleanup: Fix incompatible pointer types warnings 2022-02-18 23:21:53 +09:00
af308049bc Merge branch 'blender-v3.1-release' 2022-02-18 14:55:54 +01:00
02f4d63dcc Fix broken shapekeys: check for 'NULL' from pointer too.
Add check for `NULL` `from` pointer to `BLO_main_validate_shapekeys`,
and delete these shapekeys, as they are fully invalid and impossible to
recover.

Found in a studio production file (`animation
test/snow_parkour/shots/0040/0040.lighting.blend`, svn rev `1111`).
Would be nice to know how this was generated too...
2022-02-18 12:29:27 +01:00
5f16e24cc9 Curves: add initial edit mode support
This adds initial support for edit mode for the experimental new curves
object. For now we can only toggle in and out of the mode, no real
interraction is possible.

This patch also adds empty menus in edit mode. Those were added mainly
to quiet warnings as the menus are programmatically added to the edit
mode based on the object type and context.

Ref T95769

Reviewed By: JacquesLucke, HooglyBoogly

Maniphest Tasks: T95769

Differential Revision: https://developer.blender.org/D14136
2022-02-18 11:31:13 +01:00
8b4da9a191 Fix strict compilation warnings 2022-02-18 10:14:34 +01:00
61aaeb3745 Curves: initial brush system integration for curves sculpt mode
This adds the boilerplate code that is necessary to use the tool/brush/paint
systems in the new sculpt curves mode.

Two temporary dummy tools are part of this patch. They do nothing and
only serve to test the boilerplate. When the first actual tool is added,
those dummy tools will be removed.

Differential Revision: https://developer.blender.org/D14117
2022-02-18 09:14:54 +01:00
964d3a38fa XR: Enable Vive Focus 3 controller extension
Allows controller-specific action bindings for the HTC Vive Focus 3
controller. Currently not supported by any OpenXR runtimes (save for
the dedicated Focus 3 runtime in developer early-access:
https://forum.vive.com/topic/11354-openxr-support-for-focus-3-early-access-application-form),
but useful to have for the future.
2022-02-18 17:00:43 +09:00
4ad4d8a59c Cleanup: Use compact license header.
New file introduced in blender-v3.1-release branch.
2022-02-18 08:30:10 +01:00
5c6eefa850 Merge branch 'blender-v3.1-release' 2022-02-18 08:29:32 +01:00
fe26d18889 Fix T95809: Check color space changes to refresh image engine.
Previous commit fixed the compositor node, this commit is related to the
shader tree. Also checks if the color space or alpha mode have changed.
2022-02-18 08:22:18 +01:00
400e57b64a Fix T95809: Compositor Node not directly updated in image editor.
Image wasn't tagged to be dirty.
2022-02-18 08:11:51 +01:00
6efdfeb886 Image Engine: Store image usage to identity changes.
Previous implementation had a copy of the image user, which doesn't
contain all the data to identify changes. This patch introduces a new
struct to store the data and can be extended with other data as well
(color spaces, alpha settings).
2022-02-18 07:55:36 +01:00
ca1f879c02 Cleanup: simplify viewmove_apply
Check for a camera-view before checking if the view is locked
to the cursor/object since the camera-view takes priority,
it reads better to check that first.

Also reuse the event offset variable.
2022-02-18 17:24:10 +11:00
51975b89ed 3D View: Add camera view pan/zoom support for NDOF
NDOF navigation in a camera view now behaves like orthographic pan/zoom.

Note that NDOF orbiting out of the camera view has been disabled,
see code comment for details.

Resolves T93666.
2022-02-18 17:09:49 +11:00
f33e6e0d8c Cleanup: move camera-view pan/zoom into utility functions 2022-02-18 16:48:27 +11:00
ae9dd0cbf9 Merge branch 'blender-v3.1-release' 2022-02-17 23:44:47 -06:00
Pratik Borhade
1d0d810331 Fix T93526: Missing tooltip for attribute search button
For the attribute search button, the tooltip was missing
if the input socket type has attribute toggle activated.

Differential Revision: https://developer.blender.org/D14142
2022-02-17 23:44:16 -06:00
59aaf2036e Fix wrong method name in gpu documentation
`use_program_point_size` --> `program_point_size_set`.
2022-02-17 22:11:08 -03:00
9153bf24cb Merge branch 'blender-v3.1-release' 2022-02-17 20:30:45 +01:00
3cdbeb32d3 Fix build error on some compilers after recent bugfix 2022-02-17 20:30:19 +01:00
ad2577e0cd Merge branch 'blender-v3.1-release' 2022-02-17 19:52:46 +01:00
da6b534274 Fix T95368: wrong white point adaptation for Linear ACES color space
This affected loading of EXR files with set to Linear ACES colorspace, as
well as the sky texture for in some custom OpenColorIO configurations.

Use the builtin OpenColorIO transform from ACES AP0 to XYZ D65 to fix this.
2022-02-17 19:51:43 +01:00
48432c1c92 Fix: Debug build error with vector type division
The idea is to keep `is_any_zero` in the `blender::math` namespace,
so instead of trying to be clever, just move it there and expand the
function where it was used in the class.
2022-02-17 12:36:41 -06:00
b6fe1b0c65 Merge branch 'blender-v3.1-release' 2022-02-17 18:44:18 +01:00
a04300c436 Cleanup: Move more cmake library variables to be advanced
I noticed that there were a few variables that should not be visible per default.
It seems to me to simply be an oversight, so I went ahead and cleaned them up.

Reviewed By: Sybren, Ray molenkamp

Differential Revision: http://developer.blender.org/D14132
2022-02-17 18:42:06 +01:00
8355ac97b4 GPU: Remove runtime sampler texture slot assignment
This avoid potential shader recompilation and is more in line
with vulkan design.
2022-02-17 18:15:31 +01:00
37fa1bc254 OCIO: Port shader creation logic to use GPUShaderCreateInfo
This commit should suffice to make the shader API agnostic now (given that
all users of it use the GPU API).

This makes the shaders not trigger a false positive error anymore since
the binding slots are now garanteed by the backend and not changed at
after compilation.

This also bundles all uniforms into UBOs. Making them extendable without
limitations of push constants. The generated uniforms from OCIO are not
densely packed in the UBO to avoid complexity. Another approach would be to
use GPU_uniformbuf_create_from_list but this requires converting uniforms
to GPUInputs which is too complex for what it is.

Reviewed by: brecht, jbakker

Differential Revision: https://developer.blender.org/D14123
2022-02-17 18:15:31 +01:00
9281ba5812 Fix part of T95654: Cycles crash with text objects in excluded view layers
This is a bug on the Blender side, where the depsgraph does not have proper
relations for text object duplis and fails to include the required materials
in the dependency graph. But at least Cycles should not crash.
2022-02-17 17:30:40 +01:00
b5e3700b79 Cleanup: Replace direct id.lib pointer checks with ID_IS_LINKED macro usages. 2022-02-17 17:08:00 +01:00
c99d1d5d0d Fix build errors on Linux/clang after recent changes 2022-02-17 16:19:26 +01:00
114cc47b78 Fix: Memory leak in recently added curves copy function
Specify that the destination curve must be initialized, and free the
existing attributes (which `CustomData_copy` doesn't do).
2022-02-17 09:05:08 -06:00
Germano Cavalcante
e240c8c5db Camera: Simplify View Frame code
- No need for `normal_tx` array if we normalize the planes in `plane_tx`.
- No need to calculate the distance squared to a plane (with `dist_signed_squared_to_plane_v3`) if the plane is normalized. `plane_point_side_v3` gets the real distance, accurately, efficiently and also signed.

So normalize the planes of the member `CameraViewFrameData::plane_tx`.
2022-02-17 11:51:45 -03:00
a4c800ed02 Merge branch 'blender-v3.1-release' 2022-02-17 15:24:29 +01:00
e5100ca3ad Build: update CMake to support OpenImageIO 2.3.4
FindOpenImageIO was updated to link to separate OpenImageIO_Util for new
versions, where it is required. For older versions, we can not link to it
because there will be duplicated symbols.

Ref D14128
2022-02-17 15:21:09 +01:00
2c9931699e Build: update CMake to support OpenEXR 3
FindOpenEXR was updated to find new lib names and separate Imath. It's all
added to the list of OpenEXR include dirs and libs.

This keeps it compatible with both version 2 and 3 for now, and doesn't
require changes outside the find module.

Ref D14128
2022-02-17 15:21:09 +01:00
cd7550cfe7 Images: update code to support OpenEXR 3
Compatibility with OpenEXR 2 is preserved, since Blender releases and Linux
distribution packages can be on different versions.

Ref D14128
2022-02-17 15:21:09 +01:00
6a283b7a7f Merge remote-tracking branch 'origin/blender-v3.1-release' 2022-02-17 15:16:31 +01:00
4541249360 Fix compile error on MSVC
`uint` is POSIX type, use `GLuint` like for the rest of the code.
2022-02-17 15:15:46 +01:00
68a09bf5fd Cleanup/fix comment. 2022-02-17 14:36:03 +01:00
433fad50d8 Merge remote-tracking branch 'origin/blender-v3.1-release' 2022-02-17 13:14:47 +01:00
c5dcfb63d9 Fix T94881: GPU subdivision fails with high polycount coarse meshes
Coarse meshes with high polycount would show as corrupted when GPU
subdivision is used with AMD cards This was caused by the OpenSubdiv
library not taking `GL_MAX_COMPUTE_WORK_GROUP_COUNT` into account when
dispatching computes. AMD drivers tend to set the limit lower than
NVidia ones (2^16 for the former, and 2^32 for the latter, at least
on my machine).

This moves the `GLComputeEvaluator` from the OpenSubdiv library into
`intern/opensubdiv` and modifies it to compute a dispatch size in a
similar way as for the draw code: we split the dispatch size into a 2
dimensional value based on `GL_MAX_COMPUTE_WORK_GROUP_COUNT` and
manually compute an index in the shader.

We could have patched the OpenSubdiv library and sent the fix upstream
(which can still be done), however, moving it to our side allows us to
better control the `GLComputeEvaluator` and in the future remove some
redundant work that it does compared to Blender (see T94644) and
probably prepare the ground for Vulkan support. As a matter of fact,
this patch also removes the OpenGL initialization that OpenSubdiv would
do here. This removal is not related to the bug fix, but necessary to not
have to copy more files/code over.

Differential Revision: https://developer.blender.org/D14131
2022-02-17 13:14:19 +01:00
43b40f7bde Merge remote-tracking branch 'origin/blender-v3.1-release' 2022-02-17 08:41:01 +01:00
be3047c500 Fix T95827: vertex groups do not display correctly with GPU subdivision
Issue caused by 993839ce85 which modified
the coarse face flags update function, but forgot the case where we have
a mapped extraction with no BMesh.
2022-02-17 08:40:38 +01:00
401383f245 Fix vertex groups not rendering properly with GPU subdivision
This was missing the BMesh case. Issue found while investigating T95827.
2022-02-17 08:38:12 +01:00
6a8709ba13 XR: Allow variable count of action map subactions
Previously, the number of action map subactions was limited to two per
action (identified by user_path0, user_path1), however for devices with
more than two user paths (e.g. Vive Tracker) it will be useful to
support a variable amount instead.

For example, a single pose action could then be used to query the
positions of all connected trackers, with each tracker having its own
subaction tracking space.

NOTE: This introduces breaking changes for the XR Python API as follows:
- XrActionMapItem: The new `user_paths` collection property
replaces the `user_path0`/`user_path1` properties.
- XrActionMapBinding: The new `component_paths` collection property
replaces the `component_path0`/`component_path1` properties.

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D13949
2022-02-17 15:51:16 +09:00
7d4d8a13ce Merge branch 'blender-v3.1-release' 2022-02-17 15:39:31 +09:00
dd6fd06c15 Fix T76082: VR Scene Inspection: It shows me only a pink screen
This fixes VR pink screen issues when using the DirectX backend, caused
by `wglDXRegisterObjectNV()` failing to register the shared
OpenGL-DirectX render buffer. The issue is mainly present on AMD
graphics, however, there have been reports on NVIDIA as well.

A limited workaround for the SteamVR runtime (AMD only) was provided
in rB82ab2c167844, however this patch provides a more complete solution
that should apply to all OpenXR runtimes. For example, with this patch,
the Windows Mixed Reality runtime that exclusively uses DirectX can now
be used with AMD graphics cards.

Implementation-wise, a `GL_TEXTURE_2D` render target is used as a
fallback for the shared OpenGL-DirectX resource in the case that
registering a render buffer (`GL_RENDERBUFFER`) fails. While using a
texture render target may be less optimal than a render buffer, it
enables proper display in VR using the OpenGL/DirectX interop (tested
on AMD Vega 64).

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D14100
2022-02-17 15:28:29 +09:00
8c8d84fbc5 Cleanup: compiler warning, typo in comment 2022-02-17 16:50:44 +11:00
bdde8c7207 License headers: use SPDX identifiers 2022-02-17 16:47:37 +11:00
Christoph Lendenfeld
b626edd751 fix: RNA property not set for Graph editor breakdown op
After running the breakdown operator for the graph editor,
the factor property in the redo panel didn't reflect the value you chose

to mitigate that issue down the line there is a
new helper function to get the factor value, and
store it at the same time

Reviewed by: Sybren A. Stüvel
Differential Revision: https://developer.blender.org/D14105
Ref: D14105
2022-02-16 21:55:42 +01:00
8c96ee8903 Cleanup: Deduplicate functions for creating attributes 2022-02-16 14:10:21 -06:00
6862caea5e macOS/bpy module: install text files correctly
Instead of Blender.app (despite building bpy), install license etc in
`Resources/text` of bpy install location. Part of D14111
2022-02-17 01:31:03 +05:30
71545e542c macOS/bpy module: install scripts relative to bpy.so
Brew's Python framework's site-packages is a symlink so the assumption
that Resources and site-packages would be in the same directory
doesn't hold. So install scripts etc relative to bpy.so. Part of D14111
2022-02-17 01:31:03 +05:30
57013e2a44 Merge branch 'blender-v3.1-release' 2022-02-16 19:51:58 +01:00
05697470ab Cleanup: Remove deprecated StringGrid from our openvdb code
StringGrid has been deprecated in openvdb 9.0.0 and will be removed soon

Reviewed By: Brecht

Differential Revision: http://developer.blender.org/D14133
2022-02-16 19:49:58 +01:00
f38c2fbef9 Merge branch 'blender-v3.1-release' 2022-02-16 19:03:00 +01:00
0622d2ec61 Fix T95815: missing null check when computing dupli dimensions
Some instances might be "empty" and therefore have no dimensions.
Those should be ignored here.
2022-02-16 18:58:01 +01:00
c324cf1539 Curves: Further implementation of new curves data structure
The general idea here is to wrap the `CurvesGeometry` DNA struct
with a C++ class that can do most of the heavy lifting for the curve
geometry. Using a C++ class allows easier ways to group methods, easier
const correctness, and code that's more readable and faster to write.
This way, it works much more like a version of `CurveEval` that uses
more efficient attribute storage.

This commit adds the structure of some yet-to-be-implemented code,
the largest thing being mutexes and vectors meant to hold lazily
calculated evaluated positions, tangents, and normals. That part might
change slightly, but it's helpful to be able to see the direction this
commit is aiming in. In particular, the inherently single-threaded
accumulated lengths and Bezier evaluated point offsets might be cached.

Ref T95355

Differential Revision: https://developer.blender.org/D14054
2022-02-16 11:32:37 -06:00
5b73017ddb BLI: Generalize short algorithm for finding bounds
Finding the greatest and/or smallest element in an array is a common
need. This commit refactors the point cloud bounds code added in
6d7dbdbb44 to a more general header in blenlib.
This will allow reusing the algorithm for curves without duplicating it.

Differential Revision: https://developer.blender.org/D14053
2022-02-16 10:53:58 -06:00
399168f3c1 BLI: Implement templated math functions for basic types
This is meant to complement the `blender::math` functions recently
added by D13791. It's sometimes desired to template an operation to work
on vector types, but also basic types like `float` and `int`. This patch
adds that ability with a new `BLI_math_base.hh` header.

The existing vector math header is changed to use the `vec_base` type
more explicitly, to allow the compiler's generic function overload resolution
to determine which implementation of each math function to use.
This is a relatively large change, but it also makes the file significantly
easier to understand by reducing the use of macros.

Differential Revision: https://developer.blender.org/D14113
2022-02-16 10:28:26 -06:00
5b3a415a59 Merge branch 'blender-v3.1-release' 2022-02-16 15:59:06 +01:00
257ba175fa Fix: removing anonymous attributes before adding mesh to bmain
This was an issue when e.g. `bpy.data.meshes.new_from_object` was
used on an object that uses geometry nodes.
2022-02-16 15:58:27 +01:00
03ff58b67d Cleanup: Use const qualifier in modifier data copy
Fix possible overflow of Modifier UUID

The code prior this change was re-generating modifier's session UUID
prior to copying this id from the source. This approach has a higher
risk of modifiers session UUID to overflow and start colliding with
existing modifiers.

This change makes it so that modifier copy does not re-generated the
session UUID unless it is needed.

Differential Revision: https://developer.blender.org/D14125
2022-02-16 15:40:03 +01:00
7e312f89d9 Cleanup: Use const qualifier in modifier data copy 2022-02-16 15:40:03 +01:00
259f4e50ef Merge branch 'blender-v3.1-release' 2022-02-16 15:35:18 +01:00
f059bdc823 Cycles: restore basic standalone GUI, now using SDL
GLUT does not support offscreen contexts, which is required for the new
display driver. So we use SDL instead. Note that this requires using a
system SDL package, the Blender precompiled SDL does not include the video
subsystem.

There is currently no text display support, instead info is printed to
the terminal. This would require adding an embedded font and GLSL shaders,
or using GUI library.

Another improvement to be made is supporting OpenColorIO display transforms,
right now we assume Rec.709 scene linear and display.

All OpenGL, GLEW and SDL code was move out of core cycles and into
app/opengl. This serves as a template for apps that want to integrate
Cycles interactive rendering, with a simple OpenGLDisplayDriver example.
In general this would be adapted to the graphics API and color management
used by the app.

Ref T91846
2022-02-16 15:30:43 +01:00
a6267f1167 BLI: Fix compilation error caused by rBa9f023e22638
Explicitly referencing the typename fixes the issue.
2022-02-16 14:40:14 +01:00
3f0e63fcca Merge branch 'blender-v3.1-release' 2022-02-16 11:16:22 +01:00
54972123f7 Fix Image GPU texture.
Due to recent changes there have been reports of incorrect loading of
GPU textures. This fix reverts a part of {D13238} that might be the
source of the issue.
2022-02-16 10:45:46 +01:00
86762e8371 Merge branch 'blender-v3.1-release' 2022-02-16 08:41:40 +01:00
232d5d3f13 Fix T95787: Texture paint: Apply Camera Image crash for certain images
This does not happen with **any** image, but with images that have ID
properties.

ID properties are used to store view projection matrices (e.g. for
reprojection with `Image from View` or `Quick Edit` -- these are the
ones we are interested in), but of course they can be used for anything
else, too. The images in the file from the report have ID properties from
an Addon for example.

So the crash can reliably be reproduced with **any** image doing the
following:
```
bpy.data.images['myImage']['myIDprop'] = "foo"
```
This would lead code in `texture_paint_camera_project_exec` to think the
needed `view_data` is on the image (but in reality it was just some
other IDprop).

Solution is simple: just check `view_data` is really valid after getting
it from the IDprops.

Maniphest Tasks: T95787

Differential Revision: https://developer.blender.org/D14116
2022-02-16 08:35:15 +01:00
18d18b5a98 UV: move sticky selection from image space into tool settings
Having this setting stored in the image space caused low level selection
logic to have to pass around the image space (which could be NULL
in some cases). Use the tool-settings instead since there doesn't seem
to be much/any advantage in having this setting per-space.
2022-02-16 13:46:00 +11:00
a0ad8c57ef License headers: use SPDX identifiers 2022-02-16 13:04:20 +11:00
81223ae164 Cleanup: spelling in comments 2022-02-16 13:04:20 +11:00
37821143dd Cleanup: clang-format, use static sets, sort struct declarations 2022-02-16 13:04:20 +11:00
d3b1cce400 GPUTexture: Add dimensions getter
Pretty straight forward. Returns the texture dimensions count. This is
different from the size.
2022-02-15 22:20:49 +01:00
cbdd578640 Fix: Build error in debug build
Error in a9f023e226
2022-02-15 13:57:17 -06:00
e272bdc171 Merge remote-tracking branch 'origin/blender-v3.1-release' 2022-02-15 20:41:39 +01:00
53fe4f62fe Fix T95806: subdivision missing in Cycles when using autosmooth
Although rB56407432a6a did fix missing subdivision in some cases, in
other cases it did not return the mesh wrapper (like when using
autosmooth, which requires a copy of the mesh), so the non-subdivided
mesh was still returned.
2022-02-15 20:40:58 +01:00
4782713390 Fix T94994: Anim Player Stops working In Video Sequence Editor
Port from upstream: variable was unitialized when device initialization
failed when the WASAPI mixing thread is started.
2022-02-15 20:04:42 +01:00
1efb8e215e Merge remote-tracking branch 'origin/blender-v3.1-release' 2022-02-15 17:53:51 +01:00
48b26d9c2e Fix T95697: GPU subdivision ignores custom normals
Similarly to the CPU subdivision, we interpolate custom loop normals
from the coarse mesh, and this for the final normals.
2022-02-15 17:53:22 +01:00
430ced76d5 GPU subdiv: fix custom data interpolation for N-gons
Not all coarse vertices were used to compute the center value (off by
one), and the interpolation for the current would always start at the
base corner for the base face instead of the base corner for the current
patch.
2022-02-15 17:53:12 +01:00
a9f023e226 BLI: Change dependencies in vector math files
This patch reverses the dependency between `BLI_math_vec_types.hh` and
`BLI_math_vector.hh`. Now the higher level `blender::math` functions
depend on the header that defines the types they work with, rather than
the other way around.

The initial goal was to allow defining an `enable_if` in the types header
and using it in the math header. But I also think this operations to types
dependency is more natural anyway.

This required changing the includes some files used from the type
header to the math implementation header. I took that change a bit
further removing the C vector math header from the C++ header;
I think that helps to make the transition between the two systems
clearer.

Differential Revision: https://developer.blender.org/D14112
2022-02-15 10:27:03 -06:00
3ed3ee253b Cleanup: Rename file used for calculating mesh edges
This commit renames `mesh_validate.cc` to `mesh_calc_edges.cc`.
I would like to move `mesh_validate.c` to C++, but it makes sense to
keep this specific algorithm in a smaller file.
2022-02-15 09:29:22 -06:00
Michael
b22db23aee Define CLANG_FORMAT_VERSION in install_deps.sh
When running `./blender/build_files/build_environment/install_deps.sh` on Ubuntu 20.04.3 LTS the following error can be seen:
```
./blender/build_files/build_environment/install_deps.sh: line 1266: [: too many arguments
```
This error results from the call:
```
  check_package_version_ge_DEB $CLANG_FORMAT $CLANG_FORMAT_VERSION
```
with `CLANG_FORMAT_VERSION` being undefined.
Also as `clang-format` 13 is already released and hopefully didn't break anything `CLANG_FORMAT_VERSION_MEX` could use version bump.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D13924
2022-02-15 14:12:21 +01:00
07032dd218 Curves: add initial sculpt mode
This adds a new sculpt mode to the experimental new curves object.
Currently, this mode can only be entered and exited, nothing else.
The main initial purpose of this node will be to use it for hair grooming.

The patch also adds the `editors/curves/` directory for the new curves
object, which will be necessary for many other things as well.

I added a completely new mode (`OB_MODE_SCULPT_CURVES`), because
`OB_MODE_SCULPT` seems to be rather specific to meshes, and reusing
it doesn't seem worth the trouble. The tools/brushes used in mesh vs.
curves sculpt mode are quite distinct as well.

I had to add DNA_userdef_enums.h to make the patch compile with C++
(forward declaration of enums isn't allowed). This follows the same
pattern that we use for other enums in dna.

Differential Revision: https://developer.blender.org/D14107
2022-02-15 12:32:15 +01:00
07ed869b94 RNA: add RNA_collection_is_empty & RNA_property_collection_is_empty
Some collections needed to be iterated over to count their length.
Provide a function to check if the collection is empty to avoid this.
2022-02-15 20:13:00 +11:00
4637e83990 Merge branch 'blender-v3.1-release' 2022-02-15 19:51:43 +11:00
597edd299f Merge branch 'blender-v3.1-release' 2022-02-15 19:51:40 +11:00
92a3732ff1 Fix T95791: Unable to switch between multiviews.
Root cause is copy pasting buggy code.
2022-02-15 19:51:30 +11:00
7083ea36e2 Fix T94085: Crash with empty stroke list 2022-02-15 19:49:02 +11:00
d1c7a252eb Fix T95791: Unable to switch between multiviews.
Root cause is copy pasting buggy code.
2022-02-15 09:41:10 +01:00
14dd207b75 License headers: use SPDX for remaining files in Cycles 2022-02-15 17:52:38 +11:00
88b6e5571e License headers: use SPDX for remaining CMake find modules & gtests 2022-02-15 17:45:39 +11:00
fcac0b6fea Fix playing image-sequences with frames containing 9 or more numbers
The path calculation method for animation players: frame-cycler, rv &
mplayer would fail when the number of digits exceeded the range of a
32bit int causing RenderData.frame_path() to raise a ValueError.

Use a simpler method of extracting the range that uses the sign to
detect the beginning of the number.
2022-02-15 17:21:21 +11:00
fa7bd4c069 Cleanup: move utility to create a frame path into a static method
Add PlayRenderedAnim._frame_path_with_number_char since mixing
this logic inline made the code harder to follow.
2022-02-15 17:16:26 +11:00
c146d75808 readme.html: replace IRC with blender.chat, fix typo
- Replace IRC links and channels with blender.chat ones.
- Fix mismatch in text vs link of "GIT and Bug Tracker".
- http -> https for blender links
2022-02-15 11:09:40 +05:30
14d98d0388 CMake: create readme.html with configure_file
Since the output file stays unmodified for most developer builds,
install step installed it redundantly.

Create readme.html using `configure_file`:
- Now it's modified only if final output changes (handled by CMake).
- If input file (from git) or blender version changes,
  it //will// be modified.

Also don't re-implement what CMake can do.

Reviewed By: campbellbarton, LazyDodo
Differential Revision: https://developer.blender.org/D13863
2022-02-15 10:14:35 +05:30
9d01358a68 Cleanup: unused argument warnings 2022-02-15 13:04:31 +11:00
e3a18a890d Cleanup: minor changes to Python argument parsing loop
- Increment the argument index at the end of the loop.
  Otherwise using the index after incrementing required subtracting 1.
- Move error prefix creation into a function: `pyrna_func_error_prefix`
  so it's possible to create an error prefix without duplicate code.

This simplifies further changes for argument parsing from D14047.
2022-02-15 12:57:59 +11:00
a9a05d5597 Merge branch 'blender-v3.1-release' 2022-02-15 01:05:47 +01:00
facd9d8268 Cleanup: clang-format 2022-02-15 01:05:25 +01:00
3d1e978257 Merge branch 'blender-v3.1-release' 2022-02-14 18:01:52 -06:00
1f7f7ca14e Fix T95720: Spreadsheet missing volume grid info
The cell drawing code in 474adc6f88 was missing an
implementation for virtual arrays of strings.
2022-02-14 18:00:45 -06:00
d7d827789b GLShaderInterface: Fix undefined behavior when attributes are optimized away.
Optimized out attributes returns an invalid location `-1` resulting in
an undefined behavior shift.
2022-02-15 00:48:18 +01:00
89b47c1214 Merge branch 'blender-v3.1-release' 2022-02-15 00:11:23 +01:00
302c74e596 GLCompute: Apply state before dispatch 2022-02-15 00:10:50 +01:00
b744081f83 GLDebug: Fix severity check
The check was reversed, leading to less errors being reported.
2022-02-15 00:02:31 +01:00
19b21563d6 GPUTexture: Fix missing enum cases in to_component_len()
This might have caused undersized buffer if using the wrong formats with
`GPU_texture_read()`.
2022-02-15 00:01:04 +01:00
ad1f8a50b0 Cleanup: Use C++ math functions
Use functions from the `math` and `std` namespaces instead
of from `BLI_math_vector.h`.
2022-02-14 15:48:46 -06:00
761274fc19 Merge branch 'blender-v3.1-release' 2022-02-14 12:35:33 -06:00
33d5ecd5b5 Fix T95252: Move duplicate node doesn't do edge-panning
Set "view2d_edge_pan" to true for the NODE_OT_translate_attach operator,
which is used by the duplication operator. This is done in the keymap so
that it's not hard-coded.

Differential Revision: https://developer.blender.org/D13934
2022-02-14 12:34:54 -06:00
7773393d35 Cleanup: Pass const Scene to mesh evaluation 2022-02-14 12:05:54 -06:00
e26194e80d Merge branch 'blender-v3.1-release' 2022-02-14 18:31:19 +01:00
6ae08da5c8 Fix T95756: Crash inserting geometry node after linking modifier
The root issue was caused by a mistake in modifier copy data which was
wrongly re-generating source modifier data identifier.

The c8cca88851 simply exposed a bug in code which always was there
since the modifiers session UUID was introduced.

Shows an importance of const qualifier :)
2022-02-14 18:19:13 +01:00
19403fc852 Merge branch 'blender-v3.1-release' 2022-02-14 17:48:52 +01:00
a5edff4b73 Fix T95778, the macOS minimum versions have been increased for Metal. 2022-02-14 17:47:35 +01:00
d8e2f612ec Cleaunp: Modify comment 2022-02-14 16:39:06 +01:00
56407432a6 Fix T94479: GPU Subdivision surface modifier does not apply to Cycles renders
Since now we delegate the evaluation of the last subsurf modifier in the stack
to the draw code, Cycles does not get a subdivided mesh anymore. This is because
the subdivision wrapper for generating a CPU side subdivision is never created
as it is only ever created via `BKE_object_get_evaluated_mesh` which Cycles does
not call (rather, it accesses the Mesh either via `object.data()`, or via
`object.to_mesh()`).

This ensures that a subdivision wrapper is created when accessing the object data
or converting an Object to a Mesh via the RNA/Python API.

Reviewed by: brecht

Differential Revision: https://developer.blender.org/D14048
2022-02-14 16:36:32 +01:00
3b14224881 GPencil: Fill Dilate using negative values contract the fill area
This is requested by artist for some animation styles where is necessary to fill the area, but create a gap between fill and stroke.

Also some code cleanup and fix a bug in dilate for top area.

Reviewed By: pepeland, mendio

Differential Revision: https://developer.blender.org/D14082
2022-02-14 16:30:09 +01:00
0999a01b03 Fix T95320: CacheFile templates crash when used through Python
The crash is caused as we did not check that the RNA pointer is null
before trying to use it. This moves the existing checks from the
modifier panels into the template functions so the logic is a bit
centralized.
2022-02-14 16:13:25 +01:00
65d4c58060 Fix Cycles assert in debug mode after recent changes
We sometimes call start() on already started renders, just do nothing then.

Ref D14086
2022-02-14 15:45:11 +01:00
15141ec19a Merge remote-tracking branch 'origin/blender-v3.1-release' 2022-02-14 14:49:11 +01:00
993839ce85 Fix T95177: GPU subdiv crashes mirror modifier in edit-mode
The issue has two causes: on one hand origin indices were not handled
properly, on the other hand the extraction type (Mesh, BMesh, or mapped)
was not detected correctly.

For the second case reuse the MeshRenderData creation from the coarse
code path so that we make the same decisions. Loose geometry extraction
had to be updated to properly handle the BMesh cases.

For the origin indices, in some cases (for edges and faces), the arrays
used by the subdivision code already have the origin indices baked into
them, so mapping them a second time through the origin index layer is
wrong, and could cause out of bounds accesses.

For vertices especially, we would use two arrays: one for mapping
subdivision vertices to coarse vertices, and another one to map coarse
vertices to subdivision loops used for the selection index buffer. The
second one is now removed (which saves a bit of memory) as it is did not
have the proper data setup for use with the origin indices and we can
easily compute it using the first array anyway.
2022-02-14 14:48:44 +01:00
06a492cfdc Fix (studio reported) crash in new resync code.
We do not always resync/replace the root ID of a hierarchy now that we
do partial resync.
2022-02-14 13:26:42 +01:00
c32d3a175d Merge branch 'blender-v3.1-release' 2022-02-14 12:07:59 +01:00
3a9a37d6dc Fix T95601: Missing handling of keyingsets ID pointers in lib_query/foreach_id code.
This will have to be backported to 2.93 and possibly 2.83 if possible.
2022-02-14 12:05:11 +01:00
777953f36b Merge remote-tracking branch 'origin/blender-v3.1-release' 2022-02-14 11:09:34 +01:00
e0fd31f083 Fix segfault calling id_properties_ui("prop").update()
Fix segfault when calling `some_id.id_properties_ui("propname").update()`,
i.e. call the `update()` function without any keyword arguments. In such
a case, Python passes `kwargs = NULL`, but `PyDict_Contains()` is not
`NULL`-safe.
2022-02-14 11:08:53 +01:00
48e2bf3638 Merge branch 'blender-v3.1-release' 2022-02-14 11:00:30 +01:00
1236d2aea8 Cleanup use c style comments. 2022-02-14 10:58:45 +01:00
d23cf42ba7 Fix T95725: Changing render slot doesn't update displayed image.
Fixed by checking the requested pass, layer and view against the
previous used one.
2022-02-14 10:54:21 +01:00
ab71d833c7 Phase out IMA_GPU_REFRESH.
IMA_GPU_REFRESH is replaced by
BKE_image_partial_update_mark_full_update and should not be used
anymore.
2022-02-14 10:33:56 +01:00
efac4db166 Merge branch 'blender-v3.1-release' 2022-02-14 09:42:03 +01:00
f0e32ef4ff Fix T95699: Compostior backdrop not updated.
The Viewer marked the gpu texture to be out of date. But it should have used
the mark_full_update as the gpu textures
are only used by the render/draw engines.

The image/node editor uses the image engine that have its own GPU textures.
2022-02-14 09:21:05 +01:00
f663a1dc09 Image Engine: Remove region_uv_bounds.
They have been replaced by clipping_uv_bounds. Using region_uv_bounds
could lead to problems when drawing the compositor backdrop.
2022-02-14 09:21:04 +01:00
fe9b3dd5f9 Image Engine: Limit the number of interal textures.
Currently one a single texture slot is used to update the screen.
Current design is implemented to use multiple textures.
for now limit the number of texture slots to 1.
2022-02-14 09:21:04 +01:00
08882ddfc2 Merge branch 'blender-v3.1-release' 2022-02-14 09:09:37 +01:00
33dde170ce Fix T95749: missing update when normal node changes
This node is a bit of a weird case, because it uses the value stored in an
output socket as an input. So when we want to determine if the Dot
changed, we also have to check if the Normal output changed.

A cleaner solution would be to refactor this by either storing the normal
on the node directly (instead of in an output socket), or by exposing it
by a separate input. This refactor should be done separately though.
2022-02-14 09:08:54 +01:00
31be5ce8b9 GNUmakefile: update arguments for 'doc_man' target
Add '--verbose' argument to the script so the destination is printed.
Otherwise there is no hint to where the man page was written.
2022-02-14 16:20:16 +11:00
47b783bbe9 GNUmakefile: remove package targets that no longer exist 2022-02-14 16:12:14 +11:00
963ca15ba4 GNUmakefile: don't echo output for checking utilities & docs
When running checkers, showing commands to activate them adds noise.
2022-02-14 16:09:05 +11:00
0fd66b4f07 GNUmakefile: use PYTHON variable instead of python3
Also update the Python3 binary on macOS.
2022-02-14 16:04:31 +11:00
7d5f6c330f Cleanup: Clang tidy
Use using instead of typedef, remove redundant string init,
use "empty", address qualified auto, use nullptr.
2022-02-13 13:15:53 -06:00
7413c2feed Cleanup: Optimize gl query code path
Currently whenever gl queries are performed for the viewport, a large
1024 byte array is allocated to store the query results (256 of them).

Unfortunately, if any gizmo using a `draw_select` callback is active
(e.g. the transform gizmos), these queries (and allocations) will occur
during every mouse move event.

Change the vector to allow for up to 16 query results before making an
allocation. This provides enough space for every built-in gizmo except
Scale Cage (which needs 27 queries). It also removes unnecessary
allocations from two other related vectors used during query processing.

Differential Revision: https://developer.blender.org/D13784
2022-02-12 21:52:24 -08:00
52be063012 Fix (unreported): Issues with 'SNAP_NOT_SELECTED' for pose and edit modes
This is a regression partially introduced in rB0a6f428be7f0.

Bones being transformed into edit mode were snapping to themselves.

And the bones of the pose mode weren't even snapping.

(Curious that this was not reported).
2022-02-12 16:13:28 -03:00
824f514f8f Fix T94860: GPencil - Avoid drift in Sculpt when mouse/pen is not moved
This fix avoid the drif checking if the previous position is equals to new one, in this case, the pen has not moved and can be canceled.

Differential Revision: https://developer.blender.org/D13870
2022-02-12 10:50:39 +01:00
cf6546863e Merge branch 'blender-v3.1-release' 2022-02-11 20:57:18 -05:00
517afcc858 Fix T91423: View Animation not working with stereoscopic animations
The animation playback did not take into account individual stereoscopic views.

This patch fixes this by playing back the active view render.

Reviewed By: campbellbarton

Maniphest Tasks: T91423

Differential Revision: https://developer.blender.org/D14070
2022-02-11 20:56:51 -05:00
35c261dfcf Merge branch 'blender-v3.1-release' 2022-02-11 23:58:41 +01:00
27d3140b13 Cycles: Fix Metal kernel compilation for AMD GPUs
Workaround for a compilation issue preventing kernels compiling for AMD GPUs: Avoid problematic use of templates on Metal by making `gpu_parallel_active_index_array` a wrapper macro, and moving `blocksize` to be a macro parameter.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D14081
2022-02-11 22:52:48 +00:00
Stefan Werner
f3c58c6505 Cycles: Removed redundant/buggy code in multiscatter BSDF
A zero length vector was normalized and the resulting NaN used in further calculations.
This caused trouble on some compilers when using fast math.

Reviewed By: brecht, sergey

Differential Revision: https://developer.blender.org/D14058
2022-02-11 22:41:17 +01:00
ad53cb0b9d Merge branch 'blender-v3.1-release' 2022-02-11 19:44:27 +01:00
40fce61a6a Cycles: enable Metal on AMD GPUs, set macOS minimum versions
* Apple Silicon support enabled on macOS 12.2+
* AMD support enabled on macOS 12.3+

This patch also fixes a device enumeration crash on certain AMD configs which
was caused by over-release of MTLDevice objects.

Differential Revision: https://developer.blender.org/D14090
2022-02-11 19:22:16 +01:00
Leon Schittek
ed4b032155 UI: Improve node drop shadow
Improve the nodes' drop shadow by making it scale with the view
and replace the loop for the alpha calculation with something more
explicit.

The amount of drop shadow softness was scaled with the zoom level
and therefore had a fixed screen space size. DPI and UI scale
weren't taken into account either. This patch fixes both issues by
basing the shadow softness on the `widget_unit` that scales correctly
in zoomable views and takes UI scale etc. into account.

Differential Revision: https://developer.blender.org/D13356
2022-02-11 11:52:56 -06:00
c070e0864c Fix missing license file from last commit 2022-02-11 18:08:32 +01:00
8fb2926a53 Cycles: show Metal device in preferences also on Intel Macs
In anticipation of enabling AMD Metal support.

Ref D14090, T92212
2022-02-11 17:51:55 +01:00
9cfc7967dd Cycles: use SPDX license headers
* Replace license text in headers with SPDX identifiers.
* Remove specific license info from outdated readme.txt, instead leave details
  to the source files.
* Add list of SPDX license identifiers used, and corresponding license texts.
* Update copyright dates while we're at it.

Ref D14069, T95597
2022-02-11 17:47:34 +01:00
7434b83948 Fix (studio-reported) liboverrides potential infinite loop in hierarchy root doversion.
Drivers make it way too easy to create dependenciy loops between IDs, so
need to use the same trick as in other dependency-following code in this
file to prevent those infinite loops.

hard to predict for sure how bad of a hierarchy root this can end up
producing, but in general cases think this should be OK.
2022-02-11 16:12:28 +01:00
41ef1ac2da Merge branch 'blender-v3.1-release' 2022-02-11 15:36:05 +01:00
9ac1735205 Fix Cycles compilation on 32bit ARM platform
The rbit instruction is only available starting with ARMv6T2 and
the register prefix is different from what AARCH64 uses.

Separate the 32 and 64 bit ARM branches, add missing ISA checks.

Made sure the code works as intended on macMini with Apple silicon,
and on Raspberry Pi 4 B running 32bit Raspbian OS.

Differential Revision: https://developer.blender.org/D14056
2022-02-11 15:27:29 +01:00
Bastien Montagne
1695d38989 LibOverride: Add partial resync.
Reduce compute effort of liboverrides resync process by only re-syncing
the parts of the override hierarchy that actually need it.

The main change compared to existing code (which was systematically resyncing
a whole override hierarchy), is that resyncing now operates over several
sub-hierarchies at once, each defined by their own 'resync root' ID.
This ensures that we do not get several new overrides for the same data inside
of the same hierarchy.

Implements T95682.

Differential Revision: https://developer.blender.org/D14079
2022-02-11 15:18:32 +01:00
e6f3bb984b Merge branch 'blender-v3.1-release' 2022-02-11 14:55:42 +01:00
Jeroen Bakker
a71a513def Remap multiple items in referenced data.
This patch increases the performance when remapping data.
{D13615} introduced a mechanism to remap multiple items in a single go.
This patch uses the same mechanism when remapping data inside ID datablocks.

Benchmark results when loading the village scene of sprite fright on AMD Ryzen 7 3800X 8-Core Processor
Before this patch 115 seconds
When patch applied less than 43 seconds

There is still some room for improvement by porting relink code.

Reviewed By: mont29

Maniphest Tasks: T95279

Differential Revision: https://developer.blender.org/D14043
2022-02-11 14:53:33 +01:00
811cbb6c0a Helper functions for IDRemapper.
Adds helper functions to debug IDRemapper data structure.

`BKE_id_remapper_result_string` converst a given IDRemapperApplyResult
to a readable form for logging purposes.
`BKE_id_remapper_print` prints out the rules inside a IDRemapper struct.
2022-02-11 14:49:47 +01:00
f691d4553b Docs: add license text files for all SPDX identifiers 2022-02-11 14:48:32 +01:00
6ec83afb1d Cycles: refactor to keep session thread alive for duration of session
Instead of creating and destroying threads when starting and stopping renders,
keep a single thread alive for the duration of the session. This makes it so all
display driver OpenGL resource allocation and destruction can happen in the same
thread.

This was implemented as part of trying to solve another bug, but it did not
help. Still I prefer this behavior, to eliminate potential future issues wit
graphics drivers or with future Cycles display driver implementations.

Differential Revision: https://developer.blender.org/D14086
2022-02-11 14:35:10 +01:00
e2728a0056 Fix T95420: Cycles crash with stereo render and tiles
For reasons unclear, destroying and then recreating a vertex buffer in the
render OpenGL context is affecting the immediate mode vertex buffer in the
draw manager OpenGL context.

Instead just create a single vertex buffer and use it for the lifetime of
the render OpenGL context. There's not really any need to have a separate
one per tile as far as I can tell.

Differential Revision: https://developer.blender.org/D14084
2022-02-11 14:35:10 +01:00
6175c569f9 Tests: enable full Cycles Metal device regression tests on buildbot
Now that all tests are passing. This does add about 5 minutes to the macOS
builds on buildbot.

Ref T92212
2022-02-11 14:35:10 +01:00
fcec55796e Cycles: support rendering attributes for Curves objects
This adds support for exporting attributes from a Blender Curves object to Cycles.
The implementation follows that of the Mesh object. This also creates motion blur
data if the "velocity" attribute is present on the Curves.

Ref T94193

Reviewed By: brecht

Maniphest Tasks: T94193

Differential Revision: https://developer.blender.org/D14088
2022-02-11 13:49:00 +01:00
cc6ddfbf68 Merge remote-tracking branch 'origin/blender-v3.1-release' 2022-02-11 13:48:09 +01:00
2496a94384 Fix T95698: deadlock with GPU subdivision
Multithreaded tasks have to be isolated when holding a mutex, which was
missing for the generation of the subdivision wrapper.
2022-02-11 13:45:12 +01:00
a816eaa1ce Cleanup: add descriptions to the IDRemapperApplyOptions. 2022-02-11 12:54:49 +01:00
2d231f837a Merge branch 'blender-v3.1-release' 2022-02-11 20:51:27 +09:00
675f38aca7 Fix excessive re-creation of VR viewport textures
Due to the freeing and re-creation of textures performed when binding
offscreen viewports, VR viewport textures would be needlessly
re-created every drawing iteration, leading to a negative impact on VR
frame rate.

This was brought to light by 6738ecb64e, which introduced an
additional texture clear operation on initialization and was
prohibitively costly on some systems when performed every frame.

Now, the textures for VR viewports will not be always re-created
during offscreen binding, but only when necessary using a pre-drawing
step (`wm_xr_session_surface_offscreen_ensure()`).

Reviewed By: jbakker, fclem

Differential Revision: https://developer.blender.org/D14059
2022-02-11 20:46:55 +09:00
2cad80cbc4 Fix incompatible swapchain format for Quest 2
When using a RGBA16 (`GL_RGBA16`, `DXGI_FORMAT_R16G16B16A16_UNORM`)
swapchain format with Quest 2, no image is presented to the headset.
This can occur when using the SteamVR runtime with an AMD graphics card
(ex. T95374).

Workaround is to move this format after the Quest 2-compatible RGBA16F
formats in the candidates list so that the RGBA16F formats are chosen
instead.

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D14024
2022-02-11 20:46:38 +09:00
4fbd00e04c Fix T94268: Closing SteamVR and restarting VR Session crashes Blender
Crash was caused since the function pointers
`s_xrGetOpenGLGraphicsRequirementsKHR_fn`/
`s_xrGetD3D11GraphicsRequirementsKHR_fn` were static and were not
updated with the correct proc address after being set the first time.

As stated in the OpenXR spec: "function pointers returned by
xrGetInstanceProcAddr using one XrInstance may not be valid when used
with objects related to a different XrInstance".

Although it would seem reasonable that the proc address would not
change if the instance was the same (hence the `static XrInstance s_instance;`),
in testing, repeated calls to `xrGetInstanceProcAddress()`
with the same instance still can result in changes (at least for the
SteamVR runtime) so the workaround is to simply set the function pointers
every time, essentially trivializing their `static` designations.

Reviewed By: Severin

Maniphest Tasks: T94268

Differential Revision: https://developer.blender.org/D14023
2022-02-11 20:46:26 +09:00
fd98241cb8 Merge branch 'blender-v3.1-release' 2022-02-11 12:26:33 +01:00
b38f40e904 Geometry Nodes: show indicator when realize instances node is in legacy mode
For the majority of node groups created in Blender 3.0 the behavior does not change.
So far we only found a single file where this setting has an effect.

Differential Revision: https://developer.blender.org/D14078
2022-02-11 12:24:07 +01:00
f19585656f Fix compile warnings.
We should change the API of ntree so we can check with a const. I added
this as a todo for now and used a const cast.
2022-02-11 10:28:59 +01:00
Jeroen Bakker
bccdb143db Refactoring of BKE_library_id_can_use_idtype to use filter_id.
For an upcoming project we would want to match multiple id types in a
single go. To not replicate the implementation using other types we
introduce `BKE_library_id_can_use_filter_id` that returns all supported
types as a filter.

Not all ID types have a filter_id (ID_LI, ID_KE, ID_SCR) These
exceptions are not available in the filter_id function.

Reviewed By: mont29

Maniphest Tasks: T95279

Differential Revision: https://developer.blender.org/D14061
2022-02-11 08:24:33 +01:00
9118cdfff3 File headers: use SPDX license for key-maps 2022-02-11 16:55:49 +11:00
cec0c65c0f License: add GPL-3.0-or-later identifier
Some add-ons use this.
2022-02-11 16:27:17 +11:00
fe55789b6f File headers: manually convert files to use SPDX headers
Also add BSD-2-Clause to SPDX license list.
2022-02-11 15:15:49 +11:00
281ba8a063 File headers: add missing copyright, add MIT to SPDX licenses 2022-02-11 14:56:03 +11:00
f7bbec290d File headers: add license to Python scripts 2022-02-11 14:30:21 +11:00
1df8a5f8fb File headers: use SPDX license for CMake files 2022-02-11 14:23:56 +11:00
9802d50c6b File headers: use SPDX for Zlib license 2022-02-11 14:23:55 +11:00
bff0cf1030 Cleanup: remove white-space before headers 2022-02-11 14:23:54 +11:00
7946f34d64 GNUmakefile: add check_licenses target
This reports files that don't include SPDX headers.
Optionally showing unique headers which is useful to see
irregular/nonstandard headers.
2022-02-11 14:22:27 +11:00
0247dcde65 Cleanup: Remove unused mesh mask definitions
Maintaining and understanding these can be a burden,
so the fewer we have, the better. These particular masks
haven't been used for years.
2022-02-10 21:03:59 -06:00
467c16eab1 Remove New from new obj exporter menu. 2022-02-10 19:32:30 -05:00
355dc28f72 Merge branch 'blender-v3.1-release' 2022-02-10 19:24:43 -05:00
4d29ec42bc Revert "Split Python OBJ importer and exporter, enabling only the importer."
This reverts commit ff9dc1986e.
2022-02-10 19:21:32 -05:00
0263c8238b Remove 'New' from new Obj exporter menu entry. 2022-02-10 19:00:40 -05:00
f39698de77 Revert "Split Python OBJ importer and exporter, enabling only the importer."
This reverts commit ff9dc1986e.
2022-02-10 18:29:29 -05:00
c434782e3a File headers: SPDX License migration
Use a shorter/simpler license convention, stops the header taking so
much space.

Follow the SPDX license specification: https://spdx.org/licenses

- C/C++/objc/objc++
- Python
- Shell Scripts
- CMake, GNUmakefile

While most of the source tree has been included

- `./extern/` was left out.
- `./intern/cycles` & `./intern/atomic` are also excluded because they
  use different header conventions.

doc/license/SPDX-license-identifiers.txt has been added to list SPDX all
used identifiers.

See P2788 for the script that automated these edits.

Reviewed By: brecht, mont29, sergey

Ref D14069
2022-02-11 09:14:36 +11:00
1a705fa139 Cleanup: clang-format 2022-02-11 09:14:35 +11:00
2cc4747443 Cleanup: Clang tidy
Mismatched parameter names and else after return.
2022-02-10 15:53:37 -06:00
40e8b9775d Fix: Missing changes in recent "Curves" rename
More missing changes in fe1816f67f. This will hopefully fix a
Python API docs build error, and fixes the "Object Types Visibility"
popover.
2022-02-10 15:51:26 -06:00
75bcc096a1 License: add Apache-2.0 to doc/license
Include this as it's used the source/ directory.
2022-02-11 08:50:46 +11:00
Henrik Dick
6804ab2381 Merge branch 'blender-v3.1-release' 2022-02-10 22:39:38 +01:00
Henrik Dick
39bac58cdf Fix: Enable edge bevel weight in solidify if needed
Complex Solidify creates edge bevel weights on the rim if the
according vertex has some vertex bevel weight. If there are no
edge bevel weights, they were left disabled even if vertex bevel
weights are used.
2022-02-10 22:29:10 +01:00
Henrik Dick
5cac5a1a69 Fix: Bevel vertex didn't use weights in some cases
Bevel Vertices did not use vertex/bevel weights if the Width Type
was set to Width or Depth.
2022-02-10 22:14:02 +01:00
516781da80 Fix: Incorrect size used for reading curves data
Copy and paste mistake in fe1816f67f
2022-02-10 11:45:15 -06:00
29674d5e78 Merge branch 'blender-v3.1-release' 2022-02-10 11:34:20 -06:00
88ff5e5fb9 Fix T95458: Line art ignores curve objects with no evaluated mesh
Some curve objects don't have an evaluated mesh at all, but line art
currently assumes that all curve objects have one before converting
it to a mesh internally. Fix this by checking if the curve object has an
evaluated mesh before skipping it.

The remaining problem is that evalauted from non-mesh objects or
evaluated curves from non-curve objects, etc. will be ignored if
"Allow Duplicates" is off. That's a different problem though.

Differential Revision: https://developer.blender.org/D14036
2022-02-10 11:33:36 -06:00
a44366a642 Cycles: Expose "Use MetalRT" checkbox
For curve-heavy scenes, memory consumption regressed when we switched from MetalRT to bvh2. Allow users to opt in to MetalRT to workaround this.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D14071
2022-02-10 17:32:46 +00:00
35dedc11d5 Fix T95477: Report error instead of crashing when Metal texture size limits exceeded.
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D14074
2022-02-10 17:06:29 +00:00
3d12dd59ce Cycles: Workaround for failing "bake" unit tests in Metal
Allocate "RenderBuffers" with MTLResourceStorageModeShared.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D14073
2022-02-10 17:05:13 +00:00
410e4e7ce1 Workaround for T94142: Cycles Metal crash with simultaneous viewport and final render
Disable binary archives on Apple Silicon (issue stems from instancing multiple PSOs from the same binary archive). Pipeline creation still filters through the OS shader cache, mitigating any impact on setup times after the initial render.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D14072
2022-02-10 17:04:08 +00:00
25c4000796 Fix T95613: remove anonymous attributes when converting object
This is the same behavior as when applying a geometry nodes modifier
that adds anonymous attributes.
2022-02-10 18:03:37 +01:00
22c60ac8b1 Cleanup: Remove defenition for unused flag 2022-02-10 11:00:47 -06:00
7682d7de04 Refactor: Move PBVH update tag out of MVert
This is part of the project of converting `MVert` into `float3`.
(more details in T93602), The pbvh update flag is removed and
replaced with a bitmap stored in the PBVH structure. This
patch is similar to D13878. This is mainly setup for an eventual
performance improvement by removing the extra data from
mesh vertices, but if it's consistent with testing in the other patch
doing the same thing for another "temp tag", then it may actually
increase the speed of sculpt code slightly, since less memory needs
to be loaded when checking/changing the flags.

Differential Revision: https://developer.blender.org/D14000
2022-02-10 10:59:20 -06:00
2cd1472f86 Merge branch 'blender-v3.1-release' 2022-02-10 17:32:16 +01:00
720d653b41 Fix T95624: video texture not refreshing when changing offset in node
The main issue is that the image and image user is not updated correctly
in `rna_ImageUser_update`. `BKE_image_user_frame_calc` does not set the
correct frame, because the image is null. Also `IMA_GPU_REFRESH` is not
set for the same reason.

When gpu materials are first created, it is expected that the frame is set
correctly, and the flag is set if necessary. Therefore, somewhere during
depsgraph evaluation, those have to be updated. The depsgraph node
to do the update existed already. Now there is a new relation so that it is
executed when the node tree changed, not only when the frame changed.
2022-02-10 17:31:25 +01:00
9a2b206639 Minor cleanup: Use ID_IS_LINKED. 2022-02-10 17:30:07 +01:00
64dd6877aa Merge branch 'blender-v3.1-release' 2022-02-10 10:25:20 -06:00
c0674aa145 Fix T95334: Crash with no vertex normals in multires bake
This is partially caused by a stupid mistake in cfa53e0fbe
where I missed initializing the `vert_normals` pointer in
`MResolvePixelData`. It's also caused by questionable assumptions
from DerivedMesh code that vertex normals would be valid.

The fix used here is to create a temporary mesh with the data necessary
to compute vertex normals, and ensure them here. This is used because
normal calculation is only implemented for `Mesh` and edit mesh, not
`DerivedMesh`. While this might not be great for performance, it's
potentially aligned with future refactoring of this code to remove
`DerivedMesh` completely. Since this is one of the last places the data
structure is used, that would be a great improvement.

Differential Revision: https://developer.blender.org/D13960
2022-02-10 10:10:45 -06:00
d5a88f9bf4 Fix (unreported) over-resync from RNA detection code in linked cases.
While applying liboverrides on linked data, RNA code (in
`rna_property_override_check_resync`) would detect a lot of false positive
regarding IDs needing resync, because the temporary ID used to apply
overrides was always local, breaking the libraries comparison check.

NOTE: that whole 'apply liboverrides' code could use some refreshment,
it did not change much from initila version several years ago, we now
have better tools and control over non-main data.

But for now the 'trick' in that commit should do the job, ultimately
those temps IDs should never be put in Main at all.
2022-02-10 16:58:22 +01:00
ad77b52abc Correction to previous Clang strict warning commit
Need to only pop diagnostic if it was really pushed.

Pointed out by Aras Pranckevicius, thanks!
2022-02-10 16:05:11 +01:00
b73c265974 Merge branch 'blender-v3.1-release' 2022-02-10 16:04:50 +01:00
94f0230230 Fix T95666: Crash when attempting multires linear subdivide
The crash was happening when the mesh had loose edges.

Loose edges are not part of OpenSubdiv topology and hence should not be
communicated to the refiner. Pass ta boolean flag indicating whether an
edge is loose or not in the mesh foreach routines, which seems to be
the easiest way.
2022-02-10 15:51:19 +01:00
e9c9a2183d LibOverride: Fix/improve handling of hierarchy root in tagged creation.
Decouple the reference (linked) root ID and the hierarchy (override) root ID.
Previous code was assuming that the reference ID was always also tagged
for override creation, which is true in current master, but cannot be
assumed in general (and won't be true with partial resync anymore).

Also add asserts to validate conditions that the reference/hierarchy_root
variables must meet.
2022-02-10 14:55:12 +01:00
d16e5babaf Merge branch 'blender-v3.1-release' 2022-02-10 14:12:35 +01:00
04d55038ee Fix size_t -> int -> size_t round trip in Cycles
There are two things achieved by this change:

- No possible downcast of size_t to int when calculating motion steps.
- Disambiguate call to `min()` which was for some reason considered
  ambiguous on 32bit platforms `min(int, unsigned int)`.
- Do the same for the `max()` call to keep them symmetrical.

On an implementation side the `min()` is defined for a fixed width
integer type to disambiguate uint from size_t on 32bit platforms,
and yet be able to use it for 32bit operands on 64bit platforms without
upcast.

This ended up in a bit bigger change as the conditional compile-in of
functions is easiest if the functions is templated. Making the functions
templated required to remove the other source of ambiguity which is
`algorithm.h` which was pulling min/max from std.

Now it is the `math.h` which is the source of truth for min/max.
It was only one place which was relying on `algorithm.h` for these
functions, hence the choice of `math.h` as the safest and least
intrusive.

Fixes 32bit platforms (such as i386) in Debian package build system.

Differential Revision: https://developer.blender.org/D14062
2022-02-10 12:39:41 +01:00
87d2de88fd Fix T95664: missing update after changing active output node 2022-02-10 12:07:48 +01:00
e2befa425a GPencil: Update-on-write using update cache
This implements the update cache described in T95401.

The cache is currently only used for drawing strokes and
sculpting (using the push brush).
**Note: Making use of the cache throughout grease pencil will
have to be done incrementally in other patches. **

The update cache stores what elements have changed in the
original data-block since the last time the eval object
was updated. Additionally, the update cache can store multiple
updates to the data and minimizes the number of elements
that need to be copied.

Elements can be tagged using `BKE_gpencil_tag_full_update` and
`BKE_gpencil_tag_light_update`. A full update means that the element
itself will be copied but also all of the content inside. E.g. when a
layer is tagged for a full update, the layer, all the frames inside the
layer and all the strokes inside the frames will be copied.
A light update means that only the properties of the element are copied
without any of the content. E.g. if a layer is tagged with a light
update, it will copy the layer name, opacity, transform, etc.

When the update cache is in use (e.g. elements have been tagged) then
the depsgraph will not trigger a copy-on-write, but an update-on-write.
This means that the update cache will be used to determine what elements
have changed and then only those elements will be copied over to the
eval object.

If the update cache is empty or the data block was tagged with a full
update, we always fall back to a copy-on-write.

Currently, the update cache is only used by the active depsgraph. This
is because we need to free the update cache after an update-on-write so
it's reset and we need to make sure it is not freed or read by other
depsgraphs.

Co-authored-by: @yann-lty
This patch was contributed by The SPA Studios.

Reviewed By: sergey, antoniov, #dependency_graph, pepeland, mendio

Maniphest Tasks: T95401

Differential Revision: https://developer.blender.org/D13984
2022-02-10 11:35:56 +01:00
84f30ac3a2 Deps: upgrade OpenXR 1.0.17 -> 1.0.22
Simple upgrade of OpenXR to 1.0.22, following the steps from
https://wiki.blender.org/wiki/Source/OpenXR_SDK_Dependency and
rBb69ab42982a1. No changes to Blender code were necessary, only a version
bump.

The primary motivation for this upgrade is to utilize the
`XR_HTCX_vive_tracker_interaction` extension introduced in ver. 1.0.20.
However, the latest release (1.0.22) also adds a number of potentially
useful extensions such as:
- `XR_FB_render_model`
- `XR_HTC_facial_expression`
- `XR_HTC_vive_focus3_controller_interaction`

Ref T95206

Reviewed By: LazyDodo, sybren, mont29

Maniphest Tasks: T95206

Differential Revision: https://developer.blender.org/D13950
2022-02-10 19:15:29 +09:00
Brad Clark
26740aaf51 Fix T84486: NLA, disable "Sync Length" after split
Turn off "Sync Length" when splitting an NLA strip.

The NLA Strip-Action Clip has a setting called "Sync Length" that is on
by default and helps to update the length of the clip to the current
actions keyframes so the strip shows the entire actions stored
animation.

When you split one of these strip-action clips in the NLA to trim it
shorter or to move it somewhere else in the NLA tracks to blend or work
with, the "Sync Length" setting stays checked on.  You can have many
strips in the NLA that all look to the same action, if you split one
strip , you now have two strips showing or linked to the same action.

To see or edit keyframes on a strip, you enter tweak mode. When you exit
tweak mode, if "Sync Length" is active on the strip-action clip
settings, the strip length is changed/reset to match the action keys.
When you have many clips, this causes all of them to evaluate and update
no matter where they are in the NLA.  This destroys/undoes all the user
work to trim down and place the clips in the NLA.

**Description of the proposed solution:**

This patch/change would turn off, the "Sync Length" setting when the
split tool was used on a strip/action clip to help protect the users
choice to trim and keep the clip that length. It doesn't change the
ability to turn the setting back on or off, it just makes sure that the
user doesn't accidentally or unknowingly loose work.

The same process happens when an action is created that has a "manual
range" set that is different than the length of the actions start-end
keyframes. It makes sense to do the same thing for the split tool.

**Alternative solutions:**

While the user could know this and turn off this setting by hand, it is
easy to forget and or the user might think that it only happened to the
one clip they were editing and not realize it happened to all the
trimmed versions, changing the users choice without the user knowing it
happened.

**Limitations of the proposed solution:**

It only fixes the split tool, if another tool was created and some how
impacted the clip length we would need to have that tool also take the
sync length into account.

Reviewed By: sybren

Maniphest Tasks: T84486

Differential Revision: https://developer.blender.org/D10168
2022-02-10 11:08:00 +01:00
9e9355190c Fix compilation with strict Clang flags
There is no `-Wformat-truncation` warning in Clang, so tweak checks
around diagnostics pragma accordingly.
2022-02-10 10:55:50 +01:00
8c18b16829 Merge branch 'blender-v3.1-release' 2022-02-10 10:48:06 +01:00
5312cf50a1 Fix strict warning initializing texture result in compositor
From a strict language point of view the code required a braces around
`trgba` initialization. But it is easier to rely on the fact that fields
which are not specified are zero-initialized.
2022-02-10 10:46:06 +01:00
507a4deef1 Fix invalid creation of partial image updater 2022-02-10 10:42:25 +01:00
e6ad11f06d Cleanup: quiet warnings including RE_pipeline.h directly 2022-02-10 16:45:54 +11:00
c824c06f38 Cleanup: Clang tidy, unused variabel warnings 2022-02-09 23:07:48 -06:00
2887df119c Fix: Complete curves renaming missed in previous commit
This made cycles not render curves. Missed in fe1816f67f
2022-02-09 17:56:19 -06:00
fe80ff446f Cleanup: copyright in headers, spelling in comments
- Order year consistently.
- Minor consistency (case, double-spacing).
- Correct typos.
2022-02-10 10:25:06 +11:00
58761eb11a GNUmakefile: move editor settings to .editorconfig
Remove inline vim/emacs editor configuration,
add makefile to editorconfig instead.
2022-02-10 09:20:34 +11:00
7b0174ef81 Cleanup: remove overly detailed contact info, correct md5 copyright
Also remove copyright text with no assignment.
2022-02-10 09:05:40 +11:00
e420514892 Merge branch 'blender-v3.1-release' 2022-02-09 11:06:34 -06:00
d1202bd641 Fix T95620: Crash When Entering Edit Mode on a Curve
Under some circumstances, simply adding a curve object and going
to edit mode would cause a crash. This is because the evaluated
`CurveEval` was accessed but also freed by the dependency graph.

The fix reverts the part of b76918717d that uses the
`CurveEval` for the curve object bounds. While this isn't ideal,
it was the previous behavior, and some unexpected behavior
with object bounds is much better than a crash. Plus, given the plans
of using the new "Curves" data-block for evaluated curves, this
situation will change relatively soon anyway.
2022-02-09 11:06:10 -06:00
6e14be858c Merge branch 'blender-v3.1-release' 2022-02-09 16:16:34 +01:00
c69ee218d7 Revert "Fix size_t -> int -> size_t round trip in Cycles"
This reverts commit d74bb7be19.

Need to re-iterate to have a proper support of all platforms.
2022-02-09 16:16:21 +01:00
3e67831d3f VSE: Fix sound strip not aligned with movie strip
Strip aligning wasn't done when length of 2 strip is equal, but since
these strips are aligned according to position in stream this can
produce offset.
2022-02-09 16:06:56 +01:00
e098a29606 Merge branch 'blender-v3.1-release' 2022-02-09 15:54:41 +01:00
7313a84c5a Fix T95612: only overwrite existing attributes with matching domain and type
Also fixes T95611 and T95610.

Differential Revision: https://developer.blender.org/D14051
2022-02-09 15:50:03 +01:00
669d3bbad6 Merge branch 'blender-v3.1-release' 2022-02-09 14:46:00 +01:00
d74bb7be19 Fix size_t -> int -> size_t round trip in Cycles
There are two things achieved by this change:

- No possible downcast of size_t to int when calculating motion steps.
- Disambiguate call to min() which was for some reason considered
  ambiguous on 32bit platforms `min(int, unsigned int)`.

On an implementation side the `min()` is defined for a fixed width
integer type to disambiguate uint from size_t on 32bit platforms,
and yet be able to use it for 32bit operands on 64bit platforms without
upcast.

Fixes 32bit platforms (such as i386) in Debian package build system.

Differential Revision: https://developer.blender.org/D13992
2022-02-09 14:45:39 +01:00
3577ccc9c0 Cleanup: Add newline in error message.
Increases readability during debugging.
2022-02-09 14:09:04 +01:00
6345032a49 Cleanup: non-standard license formatting, minor changes 2022-02-09 23:57:12 +11:00
312d6925c4 Cleanup: make file headers more consistent
Also some descriptive text into doc-strings.
2022-02-09 23:47:34 +11:00
b4700a13c6 VSE: Use float for transformation offset
When image position is animated, float makes movement look smoother.
2022-02-09 13:42:58 +01:00
7c10e364b2 BLI: wrap parallel_invoke from tbb 2022-02-09 13:08:04 +01:00
3f061ef050 Merge branch 'blender-v3.1-release' 2022-02-09 12:38:08 +01:00
d82384f7e1 Fix T95640: missing null check in previous commit 2022-02-09 12:36:49 +01:00
312c8fdaf9 Cleanup: Better naming in lib_remap.
Renames is_never_null to violates_never_null.
2022-02-09 11:44:14 +01:00
Alaska
fd6506626b Adjust "Show Backface" tool tip to be more accurate
Reviewed By: fclem

Differential Revision: https://developer.blender.org/D13849
2022-02-09 11:28:39 +01:00
Alaska
d3d9e2abbf Fix small grammatical mistake in Refraction Depth tooltip
Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D13850
2022-02-09 11:26:21 +01:00
bfacb22a93 Merge branch 'blender-v3.1-release' 2022-02-09 11:20:51 +01:00
06ac599261 Fix T91840: do not create invalid links when inserting a node
Differential Revision: https://developer.blender.org/D14050
2022-02-09 11:19:23 +01:00
Colin Basnett
6f01758b47 Added a "Sharpen Less" kernel for the Filter Compositor node
Added a new "Sharpen Less" kernel to the filter compositor node. The intent here is to provide a much less aggressive sharpening filter that can't simply be solved by toning down the factor on the existing sharpen filter.

The existing "Sharpen" filter uses a "box" kernel:

```
-1 -1 -1
-1  9 -1
-1 -1 -1
```

The new "Sharpen Less" filter uses a "diamond" kernel:

```
 0 -1  0
-1  5 -1
 0 -1  0
```

The difference between the two is clear to see in the following side-by-side:

{F12847431}

Below shows the difference between the filtering kernels as applied to a B&W render of Suzanne with the UV grid as a texture. The left side of the render using the existing "Sharpen" filter, and the right side showing the new "Sharpen Less" filter. Notice that the left side is more aggressive in accentuating localized contrasts across the image. This can lead to what appears to be aliasing or striations in the resulting image:

{F12847429}

https://developer.blender.org/T95275
https://blender.community/c/rightclickselect/57Kq/?sorting=hot
{F12847428}

Reviewed By: #compositing, jbakker

Differential Revision: https://developer.blender.org/D14019
2022-02-09 10:28:00 +01:00
81da638c44 Cleanup: move file descriptions into doxygen file section
Continuation of 19100aa57d.
2022-02-09 18:33:29 +11:00
19100aa57d Cleanup: move file descriptions into doxygen file section
Also other minor corrections & reformat particle system copyright.
2022-02-09 18:10:43 +11:00
2c7f2a0ba4 Cleanup: simplify copyright headers for sequence & imbuf 2022-02-09 16:47:15 +11:00
68a21697be Cleanup: remove "The Original Code is: ..." from code comments
This is almost always meaningless as most code has changed
since the comment was added. Besides this, version control can be used
to check if/when a file was modified.

Some cases of this were kept when they contain details
about the original copyright holder.
2022-02-09 16:04:31 +11:00
59a7095f79 Cleanup: use consistent copyright location, move descriptions
Order copyright immediately after the license block,
this was done almost everywhere with a few exceptions.

Remove authors from a few files (we had already removed "Contributors"
section however with old patches being applied this gets added back in).

Also move descriptive text into the doxygen comment block under \file.
In some cases remove the text as it was accidentally copied.
2022-02-09 16:00:16 +11:00
Shrey Aggarwal
f021d46752 Cleanup: GHOST_ISystem::toggleConsole API
GHOST_ISystem::toggleConsole had a somewhat misleading name
it could be fed 4 different values, so it was not as much a
toggle as a set console window state.

This change renames `toggleConsole` to a more appropriately
named `setConsoleWindowState` and replaces the integer it had
to an enum so it's easy to tell what is being asked of it at
the call site.

Reviewed By: LazyDodo
Differential Revision: https://developer.blender.org/D14020
2022-02-08 17:40:48 -07:00
Paolo Acampora
452a7f6731 Fix T91871: Symmetrize Armature on custom bone shape
Symmetrize Armature now also symmetrizes the transform of custom bone
shapes.

Adds a new property to `bpy.ops.armature.symmetrize`:

//Parameters//:

- **direction **(enum in ['NEGATIVE_X', 'POSITIVE_X'], (optional)) –
  **Direction**, Which sides to copy from and to (when both are selected)

- **custom_shape **(enum in ['SYMMETRIZE_SAME', 'SYMMETRIZE_ALL',
  'SYMMETRIZE_NONE'], (optional)) – **Custom Shapes**, Wether to
  symmetrize non symmetric custom bone shapes, all custom shapes, or
  none at all

//Rationale//:

Reviewed By: #animation_rigging, Mets, sybren

Maniphest Tasks: T91871

Differential Revision: https://developer.blender.org/D13416
2022-02-08 18:09:48 +01:00
55c90df316 BLF: Enable Filtering of woff and woff2 Fonts
Add files with extension ".woff" and ".woff2" to FILE_TYPE_FTFONT
file type. Allows selecting and using these types of font files.

See D13822 for more details.

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

Reviewed by Campbell Barton
2022-02-08 08:43:01 -08:00
5d9d2565d2 Cleanup: simplify DNA genfile casting
Avoid using the uint64_t as an intermediate cast since it complicates
behavior for signed types (which first need to be cast to an int64_t).

Assign both old_value_i & old_value_f from the original value to avoid
the need for different handling of signed/unsigned types.

Reviewed By: JacquesLucke

Ref D14039
2022-02-08 22:52:46 +11:00
460d1a4cb3 Eevee: support the no-op Bump node optimization like in Cycles.
A Bump node without a Height input is meaningless and does nothing.
As such, it is available as an old workaround that allows making Node
Group inputs that default to normal when not connected, by routing
via a no-op Bump node before doing math.

Cycles specifically recognizes this use case and either bypasses
the node, or converts it into a Geometry Normal node, but Eevee
was still evaluating it as usual. That incurred performance cost,
and also normalized the vector unlike Cycles.

This implements the same bypass logic for Eevee. Since I'm not
sure if it's possible to totally remove the node at this stage,
it emits a no-op function call to copy the input vector.

Differential Revision: https://developer.blender.org/D14045
2022-02-08 14:37:25 +03:00
3267c91b4d Fix T91253: Slow pose bone selection with many bones
Viewport cull bones during selection to avoid depth-picking
reading the depth buffer for bones that aren't in the viewport.

Files with thousands of bones could hang blender for seconds while
selecting. The issue could still happen with overlapping bones or when
zoomed out so all bones are under the cursor, however in practice this
rarely happens.

Now files with many bones select quickly.

Related changes include:

- Split `BKE_pchan_minmax` out of `BKE_pose_minmax`.
- Add `mat3_to_size_max_axis` to return the length of the largest
  axis (used for scaling the radius).

Reviewed By: sybren

Maniphest Tasks: T91253

Ref D13990
2022-02-08 22:16:51 +11:00
530be35516 Merge branch 'blender-v3.1-release' 2022-02-08 12:13:24 +01:00
de71860555 Fix T95570: missing task isolation when computing normals 2022-02-08 12:12:49 +01:00
923ccf6b10 LibOverride: Use new 'hierarchy root' info in relevant override code.
This new info simplifies greatly the handling of resync and deleting
liboverride hierarchies, and makes those operations more robust to
complex dependencies cases between different hierarchies.

Related to T95283.
2022-02-08 11:22:56 +01:00
98c242affd LibOverride: Add 'hierarchy root ID' info.
This change will make handling of liboverrides hierarchies (especially
resyncing) much easier and efficient. It should also make it more
resilient to 'degenerate' cases, and allow proper support of things like
parenting an override to another override of the same linked data (e.g.
a override character parented to another override of the same
character).

NOTE: this commit only implements minimal changes to add that data and
generate it for existing files on load. Actual refactor of resync code
to take advantage of this new info will happen separately.
2022-02-08 10:51:31 +01:00
32278b79a8 LibOverride: Add 'hierarchy root ID' info.
This change will make handling of liboverrides hierarchies (especially
resyncing) much easier and efficient. It should also make it more
resilient to 'degenerate' cases, and allow proper support of things like
parenting an override to another override of the same linked data (e.g.
a override character parented to another override of the same
character).

NOTE: this commit only implements minimal changes to add that data and
generate it for existing files on load. Actual refactor of resync code
to take advantage of this new info will happen separately.
2022-02-08 10:50:39 +01:00
0617efd51b Merge branch 'blender-v3.1-release' 2022-02-08 10:26:42 +01:00
1995aae6e3 Fix T94415: Nodes: poor selection behavior inside frame nodes
Previously, node selection made no distinction between a frame node and
other nodes. So a frame node would be selected by their whole rect or
center (depending on box/lasso/circle select). As a consequence of this,
box and lasso could not pratically be started inside a frame node (with
the intention to select a subset of contained child nodes) because the
frame would be selected immediately and tweak-transforming started.
Circle selecting would always contain the frame node as well (making
transforming a subset of nodes without also transforming the whole frame
impossible).

Now change selection behavior so that for all selection modes only the
border [the margin area that is automatically added around all nodes,
see note below] of a frame node is considered in selection. This makes
for a much more intuitive experience when arranging nodes inside frames.

note: to make the area of interest for selection/moving more obvious,
the cursor changes when hovering over (as is done for resizing).
note: this also makes the resize margin consistent with other nodes.
note: this also fixes right resize border (was exclusive instead of
inclusive as every other border)

Also fixes T46540.
2022-02-08 10:14:14 +01:00
67c12ed765 Cleanup: remove useless statement.
Layouts are active by default when created, no need to set this
explicitely. Leftover from proxy removal.
2022-02-08 09:16:49 +01:00
8abd8865d2 Mesh: add option to select vertices by similar vertex crease
This adds an option to the "Select Similar" operator in edit mode to
select vertices based on vertex crease similarity. The implementation
follows that of the edge crease, with a 1-dimensional KD-tree used to
store and retrieve vertex indices base on crease values.

To maintain compatibility with old files (scripts), the `SIMEDGE_CREASE`
enumeration identifier remains `CREASE`, while the one for the new
`SIMVERT_CREASE` is `VCREASE` to follow the naming convention of other
enum values.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D14037
2022-02-08 06:10:22 +01:00
Dominik Fill
7047bd41c6 UI: Change computation of node socket position to align with label
This Diff changes the computation of the input and output socket
position to being always aligned with its corresponding label.

Reviewed By: campbellbarton

Ref D14025
2022-02-08 14:55:02 +11:00
667b4bc0e4 Cleanup: clang-format 2022-02-08 14:25:31 +11:00
9d674d9852 Fix dna_genfile error converting signed int types to floating point
Regression in 51befa4108
caused negative values to overflow into a uint64_t.

Resolve by casting to a signed int from originally signed types.

This caused D14033 not to work properly.
2022-02-08 11:54:44 +11:00
7df651367f Cleanup: use an intermediate value for cast_primitive_type
Assign the actual value before casting to large uint64_t/double types.

This improves readability, especially in cases where both pointer
and integer casts were used in one expression, to make matters worse
clang-format treated these casts as a multiplication.

This also made debugging/printing the values more of a hassle.

No functional changes (GCC produced identical output).
2022-02-08 11:54:44 +11:00
e5fc579073 Merge branch 'blender-v3.1-release' 2022-02-07 18:42:58 -06:00
b76918717d Fix T95573: Incorrect bounding box of evaluated curve
Account for `CurveEval`, which stores the proper deformed and
procedurally created data, unlike the `nurb` list, which has always
just meant a copy of the original curve.

Also account for the case when the curve is empty by using a -1, 1,
fallback bounding box in that case, just like mesh objects.
2022-02-07 18:42:31 -06:00
770793e545 Merge branch 'blender-v3.1-release' 2022-02-07 16:11:21 -06:00
Wannes Malfait
229d0ace02 Fix T95532: Merge node deletes everything for empty selections
The problem was that nullptr was returned which is a valid value for
Mesh * and hence the returned optional was treated as having some value.
There was no check for point clouds so that was fixed as well.

Differential Revision: https://developer.blender.org/D14026
2022-02-07 16:08:36 -06:00
11d785edea Fix T95502: macOS app has both python 3.9 and 3.10 executables 2022-02-07 20:51:03 +01:00
674e4640f6 Merge branch 'blender-v3.1-release' 2022-02-07 14:29:26 -05:00
Myles Walcott
880e85fc80 Cleanup: Grammar in doc/python_api
* Its -> It's
* Scripts -> Script's
* then -> than

Several phrasing grammar fixes.

Reviewed By: Blendify

Differential Revision: https://developer.blender.org/D14021
2022-02-07 14:28:12 -05:00
fe1816f67f Curves: Rename "Hair" types, variables, and functions to "Curves"
Based on discussions from T95355 and T94193, the plan is to use
the name "Curves" to describe the data-block container for multiple
curves. Eventually this will replace the existing "Curve" data-block.
However, it will be a while before the curve data-block can be replaced
so in order to distinguish the two curve types in the UI, "Hair Curves"
will be used, but eventually changed back to "Curves".

This patch renames "hair-related" files, functions, types, and variable
names to this convention. A deep rename is preferred to keep code
consistent and to avoid any "hair" terminology from leaking, since the
new data-block is meant for all curve types, not just hair use cases.

The downside of this naming is that the difference between "Curve"
and "Curves" has become important. That was considered during
design discussons and deemed acceptable, especially given the
non-permanent nature of the somewhat common conflict.

Some points of interest:
- All DNA compatibility is lost, just like rBf59767ff9729.
- I renamed `ID_HA` to `ID_CV` so there is no complete mismatch.
- `hair_curves` is used where necessary to distinguish from the
  existing "curves" plural.
- I didn't rename any of the cycles/rendering code function names,
  since that is also used by the old hair particle system.

Differential Revision: https://developer.blender.org/D14007
2022-02-07 11:56:48 -06:00
b8c764c5d1 Merge branch 'blender-v3.1-release' 2022-02-07 18:45:24 +01:00
65d287a14a Fix T95543: incorrect handling of implicit field inputs in ui 2022-02-07 18:44:30 +01:00
d3e9d74a5f Merge branch 'blender-v3.1-release' 2022-02-07 18:17:29 +01:00
eb071e3d3c Fix: missing null check
This fixes https://github.com/JacquesLucke/animation_nodes/issues/1827.
2022-02-07 18:16:35 +01:00
2f7aecb6ce Merge branch 'blender-v3.1-release' 2022-02-07 17:57:01 +01:00
2f868e5647 Fix T95578: missing update when linking selected nodes
This removes a "narrow" update in `snode_autoconnect` in favor
of the more general update in `node_make_link_exec`.
2022-02-07 17:56:25 +01:00
Charlie Jolly
fe4e85a924 Nodes: Dynamic node class for Map Range node
This patch makes it possible to set the UI color of a node's
header bar and override the default from the node's typeinfo.

Currently the color is taken from the `.nclass`
member of the node's bNodeType->TypeInfo struct.
This is created once when registering the node.
The TypeInfo is used for both UI and non-UI functionality.
Since the TypeInfo is shared, the header bar for the node
can't be changed without changing all nodes of that type.

The Map Range node is shown as a `Converter` or blue color by default.
This patch allows this to be changed dynamically to `Vector` or purple.

This is done by adding a `ui_class` callback to node typeinfo struct.

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D13936
2022-02-07 15:39:39 +00:00
a7b5982030 Fix missing removal of proxy references in py scripts.
Reported by studio (Hjalti), thanks.
2022-02-07 16:23:26 +01:00
Shrey Aggarwal
a5dd1bc53d Fix T90868: Console window flash when exiting
If the console was hidden on windows, it would
be made visible during shutdown in an effort
not hide a potentially active interactive console
session. This however did not take in account
if blender was actually launched from an interactive
console causing the console window to briefly flash
during shutdown even when launched from the new
launcher, the brief flash concerned some users.

This change adjusts the behaviour to restore the
console only when blender was started from the
console.

Reviewed By: LazyDodo
Differential Revision: https://developer.blender.org/D14016
2022-02-07 08:20:12 -07:00
b3bb51dd83 Fix asset-view template ignoring "Asset Indexing" debug option
If the "Asset Indexing" option was disabled in Preferences > Experimental
> Debugging, the asset-view template (used by pose libraries for
example) would still use the indexing.
2022-02-07 12:18:15 +01:00
d9b1bd01f7 Merge branch 'blender-v3.1-release' 2022-02-07 11:13:06 +01:00
3cd686cae8 Fix UI messages (typos etc.). 2022-02-07 11:12:37 +01:00
Dimitry Kaplin
1c5f2e49b7 VSE: Add filter method to strip transform
Previously, nearest interpolation filter was used for preview, because
it offered good performance and bilinear was used for rendering. This
is not always desirable behavior, so filter method can now be chosen by
user. Chosen method will be used for preview and for rendering.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D12807
2022-02-07 10:41:26 +01:00
6766699530 UV: use grey on black for dashed-line display
Dashed line display was changed since 2.7x, using white on black
instead of grey on black.

This made selection difficult to see as white is brighter
than the default selected color.

Match the grey used in 2.7x.
2022-02-07 15:50:42 +11:00
2b14aa0a39 Cleanup: spelling in comments 2022-02-07 15:33:10 +11:00
7e6066c9c3 Cleanup: clang-format 2022-02-07 15:32:34 +11:00
Henrik Dick
94866ef84f Fix Bevel intersection continuity.
This patch from Henrik Dick improves the continuity between the
grid forming corners and the edge polyons on multisegment bevels.
For details, see patch D13867.
2022-02-06 16:01:57 -05:00
f199f03994 Merge branch 'blender-v3.1-release' 2022-02-06 15:00:21 -05:00
Aras Pranckevicius
1d59a7aa77 Fix T95384: new obj exporter inaccurate roughness value in new exporter.
Fixes T95384. New exporter was missing a fix for T94516 that recently got applied to the python exporter.

Also changed the obj export tests code so that when save_failing_test_output is requested and MTL result is different from the golden expectation, it is saved as well, similar to how it's done for the OBJ file result.
2022-02-06 14:53:07 -05:00
Aras Pranckevicius
9261bc9476 Further speedup of new obj exporter.
This change from Aras further parallelizes wihin large meshes (the previous one
just parallelized over objects).

Some stats: on A Windows machine, AMD Ryzen (32 threads):

(one mesh) Monkey subdivided to level 6: 4.9s -> 1.2s (blender 3.1 was 6.3s; 3.0 was 49.4s).
(one mesh) "Rungholt" minecraft level: 8.5s -> 2.9s (3.1 was 10.5s; 3.0 was 73.7s).
(lots of meshes) Blender 3 splash: 6.2s -> 5.2s (3.1 was 48.9s; 3.0 was 392.3s).

On a Linux machine (Threadripper, 48 threads, writing to SSD):
Monkey - 5.08s -> 1.18s (4.2x speedup)
Rungholt - 9.52s -> 3.22s (2.95x speedup)
Blender 3 splash - 5.91s -> 4.61s (1.28x speedup)

For details see patch D14028.
2022-02-06 14:28:22 -05:00
96cda4da28 GLDebug: Wrap glDispatch function into our debug wrappers 2022-02-06 17:03:05 +01:00
e440691e89 Merge branch 'blender-v3.1-release' 2022-02-06 12:39:56 +01:00
8be20fcc61 GPU: Fix assert when running without --debug-gpu option on older GL
This was caused by rB3a90f93507a344d2b6eb3ae631371348ff977047
2022-02-06 12:39:17 +01:00
48fbf0baea DRW: Add preprocessor error if including common_view_lib.glsl without draw_view
This avoid making include mistake and potentially detect areas that do
not really need common_view_lib.glsl.
2022-02-06 01:25:46 +01:00
085a3662dd GPUShaderCreateInfo: Add duplication error checking of dependency merging
As of now we do not allow additional infos duplication. We could in the future
but for now assert that this is not the case.
2022-02-06 01:25:46 +01:00
153f2c20b2 Merge branch 'blender-v3.1-release' 2022-02-05 17:52:31 -06:00
59a8bdd48c Fix: Displaying any point cloud in the viewport causes crash
Caused by rBf75449b5f2b04b79, which was missing a null check when
attempting to extract a `CustomData` pointer from an mesh that might
be null if the object isn't a mesh object. The commit added null checks
elsewhere, so simply adding them here is a straightforward fix.

Fixes T95526, T95539
2022-02-05 17:52:04 -06:00
94c0a59f95 Merge branch 'blender-v3.1-release'
Also fixed conflicts due to the change in file writing in the new obj exporter
in master, and fixed one of the tests that was added in master but not 3.1.
2022-02-05 18:04:30 -05:00
Aras Pranckevicius
c24b2cdebf Fix T95360, new 3.1 obj exporter losing nurbs curve "endpoint".
The new wavefront .obj exporter in 3.1 was producing slightly invalid parm line syntax (missing u), and was not setting first/last N params to zeroes and ones for curves with "endpoint" flag properly.
2022-02-05 17:51:03 -05:00
bfe6e792c7 Merge branch 'blender-v3.1-release' 2022-02-05 23:09:09 +01:00
3a90f93507 GPU: Debug: Avoid double printing of compilation issues
To avoid that, we simply filter using a debug group.
2022-02-05 23:08:49 +01:00
26b70fce8a GPU: move gpu_shader_shared_utils.h to the public section of the module
This is then easier to include in other modules.
2022-02-05 22:42:34 +01:00
2ee81bf285 Merge branch 'blender-v3.1-release' 2022-02-05 22:18:51 +01:00
f2087dfc69 GPUTexture: Fix missing/wrong cases in to_data_format() 2022-02-05 19:29:45 +01:00
edc0e77afe GPU: Enable CLOG for gpu when --debug-gpu option is set
This is because all of the debug printing is done through CLog now. Without
it the is little point in this option.
2022-02-05 19:27:21 +01:00
7bdfce687b GL: Fix compute shader label error 2022-02-05 19:27:09 +01:00
cbd23a7304 DRW: Fix memory leak in UniformArrayBuffer 2022-02-05 13:59:46 +01:00
e5af6a0d0f GLShaderInterface: Fix SSBO using the ubo mask
This might head lead to a crash when a shader uses both ubo and ssbo.
2022-02-05 13:28:41 +01:00
835dd95046 BLF: Cleanup blf_glyph_cache_find & blf_font_size
Removes unnecessary calls to blf_glyph_cache_find, simplifies
blf_font_size, and reduces calls to it. blf_glyph_cache_new
and blf_glyph_cache_find made static.

See D13374 for more details.

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

Reviewed by Campbell Barton
2022-02-04 18:32:32 -08:00
b1cee36190 BLF: Default Size as Float
Allowing setting and storing of the default font size as float.

See D13230 for more details.

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

Reviewed by Campbell Barton
2022-02-04 18:05:25 -08:00
141da5dc03 Partially pevert "Fix error in b1b1a74af15b4eaa0757ad88acfbcac73b9a64fe"
This partially reverts commit 81d2eda2bf.

That commit introduced unrelated changes.
2022-02-04 23:00:43 -03:00
fbd5b85456 BLF: Removal of blf_font_draw_ascii Declaration
Removal of declaration of unused blf_font_draw_ascii

See D13624 for more details.

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

Reviewed by Campbell Barton
2022-02-04 17:55:50 -08:00
bb3bcf744c BLF: Save fixed_width value in cache
Cache the font size's ideal fixed width column size in the glyph cache
rather than the font itself to improve performance.

See D13226 for more details.

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

Reviewed by Campbell Barton
2022-02-04 17:49:21 -08:00
2a967d444f BLF: blf_glyph_cache_free Made Static
blf_glyph_cache_free does not need to be public.

See D13395 for more details.

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

Reviewed by Campbell Barton
2022-02-04 17:37:23 -08:00
81d2eda2bf Fix error in b1b1a74af1
`op` --> `op->customdata`
2022-02-04 22:12:07 -03:00
b1b1a74af1 Cleanup: set 'op->customdata' out of 'viewops_data_create'
Setting the `op->customdata` out of `viewops_data_create` makes the usage of the function clearer thus making the code easier to read.
2022-02-04 20:38:53 -03:00
ec9f237a9e Cleanup: merge functions with similar usage
`viewops_data_alloc` allocates and stores some pointers in
`ViewOpsData` while `viewops_data_create` reuses already stored
pointers and also stores others in `ViewOpsData`.

The similar names and usages can confuse and in this case it also
creates a dependency on the order in which these functions are called.

Merging these functions simplifies usage and deduplicates code.
2022-02-04 20:16:36 -03:00
f79c8e25f1 Cleanup: Grammar in comments and tooltips
- "own" -> "its own"
- "it's" -> "its"
- Use proper plural
2022-02-04 14:52:52 -06:00
0b4cf2984f Fix: Remove incorrect assert in mesh modifier evaluation
Since we have a node that sets a mesh's auto smooth angle
(unfortunately, in retrospect), we generally can't assume at all
that value is the same as whatever input mesh. Similar asserts
were removed previously in 8216b759e9. While the attempt
at assertions to clarify assumptions is noble, this one doesn't
make sense anymore.

I found this while investigating T95479.

Differential Revision: https://developer.blender.org/D14009
2022-02-04 14:19:04 -06:00
a5be935966 Fix uninitialized value in Cycles BVH after recent changes
Found by asan, unknown if it actually caused an issue.
2022-02-04 20:27:49 +01:00
dc85776b8b GLShader: Fix several low importance issues
- Fix image.format conversion to string
- Fix warnings about ARB_conservative_depth not found even if GL > 4.2
- Add `array(type)` define for portable array definition
2022-02-04 20:21:41 +01:00
c017820692 GPUShader: Improve error/warning logging experience
Thanks to the new `ShaderCreateInfo` we now include source files without
any modification. This let us query which are the source files passed to the
`print_log` function. The log will now include a file with row and column
number which is interpreted as a link in most IDE.

DEBUG_CONTEXT_LINES will add more lines around the error lines for more
context. This is also useful if the error line is imprecise (because of
driver bugs) and the reported line is not sufficient to know the location
of the error.

The DEBUG_DEPENDENCIES option will display the list of included files in
the shader sources. Note that it will not print generated source.

This commit also fixes some issues with unhelpful logs, bogus row & column
numbers, other error format, and bug if row was 0.
2022-02-04 20:21:41 +01:00
671fb286ab GPUShader: Cleanup dependency system to not remove string allocation
Source files are now only referenced and listed for the driver to ingest.
Shader sources now includes generated data if any.
Also cleans up gpu_shader_dependency_get_builtins casts.
2022-02-04 20:21:41 +01:00
ae50527c23 GL: Add all image types in binding setup. 2022-02-04 20:21:41 +01:00
25c50ddd09 GPUFramebuffer: Bump max attachment count to 8
This is needed by eevee-rewrite
2022-02-04 20:21:41 +01:00
77d005ea36 GPUShaderCreateInfo: Merge changes from eevee-rewrite
This includes multiple commits:
- Fix crash when using std::cerr for error output
- Add auto_resource_location which overrides all resources location (not vert input)
- Improve codestyle of error reporting.
- Add type conversion to string and to `eGPUType`
- Add comparison operator (will be used for hash collision resolution).
- Add members related to generated code (codegen)
2022-02-04 20:21:41 +01:00
03fbb3de24 GPUState: Add more barrier types
This will be useful when compute shader will be used more.

Refer to the opengl documentation for their meaning.
https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glMemoryBarrier.xhtml
2022-02-04 20:21:41 +01:00
66e9ee1a2f Cleanup: Remove unused "init" node tree flag
The value of this flag was set, but not used anywhere.

Differential Revision: https://developer.blender.org/D13519
2022-02-04 12:51:03 -06:00
afc2cc393d Merge branch 'blender-v3.1-release' 2022-02-04 19:35:35 +01:00
260e6fd46b Workbench: Fix unreported heavily quantized mesh due to driver issue
Detected on `amdgpu-pro` libGL implementation. The workaround is to not
use explicit location for vertex attributes. This is not a real problem
as we don't rely on them for now.
2022-02-04 19:34:48 +01:00
0446c9c875 Fix: Incorrect default distance for merge by distance node
This was an oversight in the patch that added this node,
the default merge distance is meant to be the same as the weld
modifier, 0.001m, meaning by in most situations it removes
vertices generally at the same location.
2022-02-04 12:21:27 -06:00
b61cb67e6d Fix T94410: stopping Cycles render in 3D viewport quad view keeps using CPU
Only one of the four renders was being stopped.
2022-02-04 18:55:07 +01:00
a5e9f9b346 DRW: Fix a comment 2022-02-04 18:54:32 +01:00
4a1979b55d Cleanup: Overlay: Remove uneeded UBO binds 2022-02-04 18:54:32 +01:00
7b88a206b2 DRW: Add DRW_UNUSED_RESOURCE_TRACKING for ubo and ssbo
When uncommented, this option will make any call binding a resource that is
not present in the shader produce a warning message with its origin.
2022-02-04 18:54:32 +01:00
9aa25ff53d DRW: Add compute_ref calls, barriers calls, and vertex_buffer_ref
- Compute ref let the size of dispatch be modified just before drawing.
- Barrier call makes it possible to chain multiple compute passes in one pass.
- DRW_shgroup_vertex_buffer_ref is the analog of DRW_shgroup_uniform_block_ref.
2022-02-04 18:54:32 +01:00
665997f1cd DRW: Fix bug in cubemap creation in draw::Texture
The order of if clause made impossible to create a cubemap.
2022-02-04 18:54:32 +01:00
edb0e7ca30 Fix T95471: baking normals wrong after recent MVert normals refactor 2022-02-04 18:15:39 +01:00
0f40855a09 Fix T93851: Cycles wrong glossy indirect pass with volumes 2022-02-04 17:53:39 +01:00
b2f5540a02 Fix: Remove incorrect assert in mesh modifier evaluation
Since we have a node that sets a mesh's auto smooth angle
(unfortunately, in retrospect), we generally can't assume at all
that value is the same as whatever input mesh. Similar asserts
were removed previously in 8216b759e9. While the attempt
at assertions to clarify assumptions is noble, this one doesn't
make sense anymore.

I found this while investigating T95479.

Differential Revision: https://developer.blender.org/D14009
2022-02-04 10:32:21 -06:00
e7912dfa19 Attributes: Infrastructure for generic 8-bit integer data type
This commit adds infrastructure for 8 bit signed integer attributes.
This can be useful given the discussion in T94193, where we want to
store spline type, Bezier handle type, and other small enums as
attributes.

This is only exposed in the interface in the attribute lists, so it
shouldn't be an option in geometry nodes, at least for now.
I expect that this type won't be used directly very often, it
should mostly be cast to an enum type. However, with support
for 8 bit integers, it also makes sense to add things like mixing
implementations for consistency.

Differential Revision: https://developer.blender.org/D13721
2022-02-04 10:29:11 -06:00
b2e43a4a9d deps_builder: Update to freetype 2.11.1
Required to solve a crash on windows (T95367)

Mostly an uneventful update, except for FreeType
giving its cmake options a rename.

Reviewed By: brecht, sybren
Differential Revision: https://developer.blender.org/D13968
2022-02-04 09:19:10 -07:00
b4563ab2df Cleanup: avoid generating some functions in all translation units
Every translation unit that included the modified headers generated
some extra code, even though it was not used. This adds unnecessary
compile time overhead and is annoying when investigating the
generated assembly.
2022-02-04 17:18:56 +01:00
4aeb6add6e Guarded allocator: Document non-obvious initialization with MEM_new()
Initialization with `MEM_new()` depends a lot on the initialization rules
of C++, which are not obvious. Calling it with no arguments to be passed
to the constructor may cause the resulting object to be implicitly 0
initialized (or parts of it). This can have an impact on performance
sensitive code, so it's something to document.

Alternatively we could enforce default initialization (as opposed to the
value initalization that happens now), but this could cause
uninitialized memory in a way that isn't obvious either. This is a
possible source of bugs, so Jacques and I decided against it.
2022-02-04 16:57:46 +01:00
RedMser
150f42e6d3 NLA: shortcut to rename active strip
Use the global F2 rename panel for the NLA editor to rename NLA strips.

Reviewed By: sybren, RiggingDojo

Differential Revision: https://developer.blender.org/D12300
2022-02-04 16:39:00 +01:00
7331c86dbf macOS: support building blender-thumbnailer
It was missing framework flags added in `setup_platform_linker_flags`.
Keep it off until QuickLook Thumbnailing is implemented.

Differential Revision: https://developer.blender.org/D13997
2022-02-04 20:57:30 +05:30
b2abcea950 Merge branch 'blender-v3.1-release' 2022-02-04 15:54:37 +01:00
f75449b5f2 Fix T95467: Textures disappear when going to Edit Mesh on Solid Texture mode
The check for existence of custom data layers did not take wrapper nature of
mesh into account.

Quickest and safest for 3.1 solution is to take care of branching of checks
in the draw manager.

Ideally both wrapper and mesh access will happen via the same public API
without branching in the "user" code. That is something outside of the fix
for the coming release though.

Differential Revision: https://developer.blender.org/D14013
2022-02-04 15:54:25 +01:00
7b686970ef Merge branch 'blender-v3.1-release'
# Conflicts:
#	source/blender/draw/engines/workbench/workbench_effect_cavity.c
2022-02-04 15:40:29 +01:00
0b0f4829e1 Cleanup: Removed Object type specific 'make_local' callback.
This callback was only needed to allow specific handling of proxies, now
that theses have been removed the generic
`BKE_lib_id_make_local_generic` code works for objects as well.
2022-02-04 15:35:51 +01:00
2e766ff762 Image Editor: Fix slowdown with 8b colormanaged images.
Byte images are converted to float. Due to an issue how VSE cache is
freeing its images we cannot store these float buffers what leads
to recalculating it for each change in the image editor.

This fix will reduce the slowdown to areas that have the root cause of
the memory leak, so the buffers can be reused between refreshes.

NOTE: The root cause should still be fixed.

Thanks for reporting Sybren!
2022-02-04 15:32:28 +01:00
4eb10e414b Fix wrong use of region size without pixel-size applied
Didn't cause visible issues, because the layout uses spacers to
right-align text, which happens to use the region size with pixel-size
applied for calculations.
2022-02-04 15:29:52 +01:00
3d973d01fa View3D: move some of the early returns from operators to the poll function
Some navigation operators check flags like `RV3D_LOCK_ROTATION` in the
invoke function to see if the operation can be performed.

As the comment indicates, these checks should be in the poll function.

This avoids redundant initialization.

Note that this brings functional changes as now operators with context
`EXEC_DEFAULT`  will also be affected by the flag.
(There doesn't seem to be a problem with the current code).

Differential Revision: https://developer.blender.org/D14005
2022-02-04 11:21:20 -03:00
7099d5b661 Fix: Missing translations from operator descriptions
The strings in the `get_description` functions for operators need
translation, they are not found by the translation system automatically,
and there is no translation applied afterwards either (as far as I could
tell). Some used `N_` before, but most did nothing.

Differential Revision: https://developer.blender.org/D14011
2022-02-04 07:31:53 -06:00
623ff64a27 Fix T81541: Symmetrize Transform Constraint, Y rotational axis unexpected results
The case where Y rotation is mapped to Y rotation was not handled.
This is now fixed.

Also added an automated test to make sure that the symmetrize operator
functions as intended.

Reviewed By: Sybren

Differential Revision: http://developer.blender.org/D9214
2022-02-04 14:21:20 +01:00
0dd3e77d71 Cleanup: Workbench: Remove unused resources in cavity shaders
This avoid uneeded resource binds.
2022-02-04 14:08:27 +01:00
71fff31990 Fix T95427: Crash during dragging a link in a node editor
This was caused by macros interpreted as recursive. Workaround by
not using macros at all and just define local variables which
hopefully will be optimized.
2022-02-04 14:08:27 +01:00
e7b8871d3d Fix T95284 Workbench: "World" Cavity Type Doesn't Render Anything
This was caused by a faulty UBO bind (not updated after renaming).
2022-02-04 14:08:27 +01:00
3adcfbf63c Merge branch 'blender-v3.1-release' 2022-02-04 14:07:06 +01:00
080dd18cdf Fix T95427: Crash during dragging a link in a node editor
This was caused by macros interpreted as recursive. Workaround by
not using macros at all and just define local variables which
hopefully will be optimized.
2022-02-04 14:05:17 +01:00
8e0763827e Fix T95284 Workbench: "World" Cavity Type Doesn't Render Anything
This was caused by a faulty UBO bind (not updated after renaming).
2022-02-04 14:05:17 +01:00
cb986446e2 Fix Crash: Switching to wireframe mode.
Crash introduced by {rB0cb5eae}.

When switching to between drawing modes the region.draw_buffer could be
uninitialized when the gizmo depth test is performed. When the mouse is
placed on top of a gizmo part that could be highlighted would crash.

This fix adds a early exit when depth testing is requested, but there
isn't a draw_buffer. Not sure this is an root cause fix.

Reported by multiple animators in Blender Studio.
2022-02-04 14:00:06 +01:00
f9aab6717b Merge branch 'blender-v3.1-release' 2022-02-04 13:11:18 +01:00
b8a634cb1d Fix T95489: support writing to vertex groups with geometry nodes again
Technically, this can't be relied upon in the long term. It worked more or
less accidentally before. It was broken by a previous fix accidentally. I mainly
bring it back because rBa985f558a6eb16cd6f0 was not expected to have
this side effect.

Note, this change can result in slower performance. Writing to a vertex
groups is less efficient than using a generic attribute.
2022-02-04 13:10:02 +01:00
e6f9a72884 Cleanup: remove unused LOG declaration
No functional changes.
2022-02-04 11:26:06 +01:00
Aras Pranckevicius
a20cfb9eff BLI: use methods specialized for finding a single char in StringRef
Previously, these methods used the more generic substring-finding
algorithm, which is more complex and slower.

Using the more specialized methods results in a noticable speedup
in the obj importer (D13958).

Differential Revision: https://developer.blender.org/D14012
2022-02-04 10:38:05 +01:00
5088d907e5 Compositor: Backdrop mode changes node grid.
When viewing backdrop on top of the node grid, the grid would be
rendered black when the mode wasn't set to RGBA. This fix fixes this by
reverting the previous fix of drawing the backdrop and implement a
different one that recomputes the UV coordinates on the screen edges.
2022-02-04 09:51:25 +01:00
2d429bfdf8 Fix T93425: makesdna crashes during build with LTO on s390x Linux
DNAstr was assumed to be 4-byte aligned which is not necessarily
the case for byte-arrays.

Use a compiler attribute to ensure this is the case.

Thanks to @mtasaka for investigating and providing a patch.
2022-02-04 19:48:00 +11:00
Bastien Montagne
e9fc25835f Remove internal proxy code, and deprecate related DNA data.
Part of T91671.

Not much else to say, this is mainly a massive deletion of code.

Note that a few cleanups possible after this proxy removal were kept out
of this commit to try to reduce a bit its size.

Reviewed By: sergey, brecht

Maniphest Tasks: T91671

Differential Revision: https://developer.blender.org/D13995
2022-02-04 09:30:44 +01:00
5a4eadc2e7 Cleanup: spelling in comments
Also update viewport comments.
2022-02-04 16:07:24 +11:00
39a1b51efd Cleanup: cage3d gizmo used two margin scale values
Replace this with a single margin.
2022-02-04 15:41:31 +11:00
ef951825a5 Merge branch 'blender-v3.1-release' 2022-02-04 15:38:30 +11:00
lictex_
f7a6e8db04 Fix T88579: scale cage doesn't work well for small/large objects
Apply proper view scale for cage 3d's draw_select,
same as draw.

Reviewed By: campbellbarton

Ref D13956
2022-02-04 15:37:07 +11:00
7803312476 Cleanup: halve calls to BLI_str_utf8_size_safe in the text editor
Syntax highlighted text was calculating the utf8 character
size twice per character.
2022-02-04 14:02:53 +11:00
d730f79e0e Cleanup: use mono-space font drawing for single character display
This doesn't make a user visible difference since it's only used for
brackets at the moment, this is more for general correctness as the
width calculation for mono-spaced text drawing is different
(as it uses BLI_wcwidth).
2022-02-04 14:02:53 +11:00
28656293c6 Cleanup: Clang tidy, use braces
Braces missed in b73d3b80fd
2022-02-03 18:27:42 -06:00
3ddc39bec9 Merge branch 'blender-v3.1-release' 2022-02-04 11:17:49 +11:00
ef2685afea Fix assertion snapping to selected in mesh edit-mode
ED_transverts_create_from_obedit expected an evaluated object.

Add flag to request TX_VERT_USE_MAPLOC to be set, which avoids having to
calculate this data when it's not used as well as the requirement
that the input object be evaluated from the depsgraph.
2022-02-04 11:08:34 +11:00
b73d3b80fd Fix T94334: Area close operator crash in 3D view menu
This fixes the crash by removing the `do_view3d_header_buttons` handler.
The code can work at a higher level here, using the operator for setting
the select mode, which makes this patch a cleanup as well.

The operator now has a description callback to add the custom
description used for the behavior in its invoke method.

Differential Revision: https://developer.blender.org/D13660
2022-02-03 17:36:05 -06:00
af426c8508 Cleanup: Add file names back to node header
These were removed in rBbe3f3812dc4b, but it's preferred to keep them.
I had to do a bit of reorganizing, and I corrected the file type too.
2022-02-03 15:34:01 -06:00
3e0ffe5a39 Cleanup: Add comment about unsed custom data type
Since f59767ff97, these hair layer types are unused. Since DNA
compatibility was broken with any files that would contain them, the
indices can be reused to avoid growing custom data's typemap.
2022-02-03 14:35:51 -06:00
c832f4f7d1 Merge branch 'blender-v3.1-release' 2022-02-03 15:22:27 -05:00
a0c1306e8c Py Docs: Fix error is version switch
Slile parameter of 4 was looking for the language in the URL but the API docs do not have a language in the URL.
2022-02-03 15:21:44 -05:00
fd66733ca7 Merge branch 'blender-v3.1-release' 2022-02-03 15:06:31 -05:00
bda210d74a Py Docs: Fix json URL
In the future when we have a docs staging area it will be
important to change where this JSON is pulled from.
For now, always pull from the "Production" versions
2022-02-03 15:06:11 -05:00
56e5b4cc27 Merge branch 'blender-v3.1-release' 2022-02-03 14:38:26 -05:00
e7f74a7d6a Py Docs: Fix typo in previous commit
- Correct spacing
- Add missing comma
2022-02-03 14:37:55 -05:00
c4ffc3355f Merge branch 'blender-v3.1-release' 2022-02-03 14:25:57 -05:00
6a2fc3230f Py Docs: Implement version switch to switch between versions on the website
This commit adds a version switch similar to the one on the user manual,
in the future it would be nice to refactor both of these into a more generic
code that works for both. Maybe develop this into a sphinx extension.

As part of this change I had to change how the blender hash is displayed.
Instead of the version hash in the top left it has been moved to the page footer.

This change will also be backported to 2.93 LTS, 2.93 LTS, and 3.0.
2022-02-03 14:25:26 -05:00
c8dee942be Merge branch 'blender-v3.1-release' 2022-02-03 17:51:56 +01:00
f59767ff97 Curves: Changes to the new curves data-block
This patch refactors the "Hair" data-block, which will soon be renamed
to "Curves". The larger change is switching from an array of `HairCurve`
to find indices in the points array to simply storing an array of offsets.
Using a single integer instead of two halves the amount of memory for that
particular array.

Besides that, there are some other changes in this patch:
- Split the data-structure to a separate `CurveGeometry`
  DNA struct so it is usable for grease pencil too.
- Update naming to be more aligned with newer code and the style guide.
- Add direct access to some arrays in RNA
-- Radius is now retrieved as a regular attribute in Cycles.
-- `HairPoint` has been renamed to `CurvePoint`
-- `HairCurve` has been renamed to `CurveSlice`
- Add comments to the struct in DNA.

The next steps are renaming `Hair` -> `Curves`, and adding support
for other curve types: Bezier, Poly, and NURBS.

Ref T95355

Differential Revision: https://developer.blender.org/D13987
2022-02-03 10:49:51 -06:00
2f591adc1a Fix T95334: Crash with no vertex normals in multires bake
This is partially caused by a stupid mistake in cfa53e0fbe
where I missed initializing the `vert_normals` pointer in
`MResolvePixelData`. It's also caused by questionable assumptions
from DerivedMesh code that vertex normals would be valid.

The fix used here is to create a temporary mesh with the data necessary
to compute vertex normals, and ensure them here. This is used because
normal calculation is only implemented for `Mesh` and edit mesh, not
`DerivedMesh`. While this might not be great for performance, it's
potentially aligned with future refactoring of this code to remove
`DerivedMesh` completely. Since this is one of the last places the data
structure is used, that would be a great improvement.

Differential Revision: https://developer.blender.org/D13960
2022-02-03 10:35:50 -06:00
71cd9f9fbb Fix (unreported) broken logic in proxy to liboverride conversion.
Iterating over scene's objects while we modify those (through proxy to
override conversion code) is call for problems (use after free etc.).

Instead, all proxy objects need to be gathered first in a temporary
list, and processed all at once in a second loop.
2022-02-03 17:19:04 +01:00
7476eb761b Merge branch 'blender-v3.1-release' 2022-02-03 16:59:26 +01:00
4be87e97f4 Fix T94435: remove anonymous attributes when applying modifier
Differential Revision: https://developer.blender.org/D13994
2022-02-03 16:52:16 +01:00
bcded0a158 Merge branch 'blender-v3.1-release' 2022-02-03 15:38:51 +01:00
946c70e6a7 Fix (unreported) broken do_version of hidden layers from pre-2.8 files.
`BKE_collection_object_add` ensures given object is added to an editable
collection, and not e.g. a linked or override one.

However, some processes like do_version manipulate collections also from
libraries, i.e. linked collections, in those cases we need a version of
the code that unconditionnally adds the given object to the given
colleciton.
2022-02-03 15:37:05 +01:00
3bcbbf8992 Split Python OBJ importer and exporter, enabling only the importer.
This is from patch D13988. It removes the "- New" from the menu of the
new obj exporter, changes the default addon to just io_import_obj,
and does the right versioning thing.
Also disables the python tests for the old python exporter.
2022-02-03 09:30:55 -05:00
5920de9247 Merge branch 'blender-v3.1-release' 2022-02-03 14:54:39 +01:00
e4c179f1d8 Cleanup: clang-format 2022-02-03 14:54:03 +01:00
Sebastian Herholz
01f1b51a2e Fix T93565: revert Cycles to old normal behavior for point lights
This patch reverts the normal behavior of the spotlights. In the last fix,
the returned normal of a spot light was equal to its direction. This broke
some texturing methods used by artists.

Differential Revision: https://developer.blender.org/D13991
2022-02-03 14:50:06 +01:00
b4e06bd7d4 Cleanup: Rename 'TRACKBALLSIZE' to 'V3D_OP_TRACKBALLSIZE' 2022-02-03 10:06:09 -03:00
Germano Cavalcante
1963ad52ce Cleanup: Split View3D navigation code into specific compilation units
The view3d_edit.c file is already getting big (5436 lines) and mixes
operators of different uses.

Splitting the code makes it easier to read and simplifies the
implementation of new features.

Differential Revision: https://developer.blender.org/D13976
2022-02-03 10:06:09 -03:00
e5a110719f Fix T91254: Some editing operation indirectly delete objects from override collections.
Those cases are fairly hard to track down... Added some more checks,
also at lower levels, more generic levels of object editing, and fixed
core check in liboverride (previously code was assuming that an override
of a collection only could have overrides of objects or linked objects,
but this is not necessarily true).
2022-02-03 14:00:12 +01:00
ff9dc1986e Split Python OBJ importer and exporter, enabling only the importer.
This is from patch D13988. It removes the "- New" from the menu of the
new obj exporter, changes the default addon to just io_import_obj,
and does the right versioning thing.
Also disables the python tests for the old python exporter.
2022-02-03 07:56:55 -05:00
3bf2a6e3c9 Cleanup: use NULL items for the default sample enum
Using this enum quiets a warning when exporting key-maps.
2022-02-03 23:02:00 +11:00
60a09bc1be Merge branch 'blender-v3.1-release' 2022-02-03 22:59:09 +11:00
6c6556c5bd Docs: correct weight paint sample description 2022-02-03 22:57:24 +11:00
5a2101f754 Merge branch 'blender-v3.1-release' 2022-02-03 22:42:48 +11:00
59b777eedd Fix T95137: Spline calc_length not working with just 1 NURB point
The NURB case did not properly handle a curve with only 1 point.

Ref D13904
2022-02-03 22:40:32 +11:00
9b42620ef2 Merge branch 'blender-v3.1-release' 2022-02-03 21:39:26 +11:00
35aedd87e7 Fix T66913: undo after frame-change doesn't refresh properly
Use the ID.recalc flag to detect when updates after frame-change is
needed. Since comparing the last calculated frame doesn't take undo into
account (see code-comment for details).

`ID_RECALC_AUDIO_SEEK` has been renamed to `ID_RECALC_FRAME_CHANGE`
since this is not only related to audio however internally this flag is
still categorized in `NodeType::AUDIO`.

Reviewed By: sergey

Ref D13942
2022-02-03 21:37:42 +11:00
98cc3c6009 Cleanup: clang-format 2022-02-03 21:32:31 +11:00
b9483ea380 Merge branch 'blender-v3.1-release' 2022-02-03 10:02:36 +01:00
c8cca88851 Fix assert in original modifiers pointer update function
The issue was happening with a specific file where the ID management
code was not fully copying all modifiers because of the extra check
in the `BKE_object_support_modifier_type_check()`.

While it is arguable that copy-on-write should be a 1:1 copy there is
no real need to maintain the per-modifier pointer to its original.
Use its SessionUUID to perform lookup in the original datablock.

Downside of this approach is that it is a linear lookup instead of
direct pointer access, but the upside is that there is less pointers
to manage and that the file with unsupported modifiers does behave
correct without any asserts.

Differential Revision: https://developer.blender.org/D13993
2022-02-03 10:02:20 +01:00
45d5773519 Cleanup: Use utility function to access original modifier in RNA 2022-02-03 10:02:20 +01:00
c80411ce3b Despgraph: Remove asserts from object modifier backup
The modifiers are mapped between original and evaluated objects based on
their session IDs. The pointer to original modifier is no longer needed
for the backup: it remained from the initial implementation which was
rewritten at some point.

This is a preparation for removal of the pointer to original modifier.
2022-02-03 10:02:20 +01:00
e468abc360 Merge branch 'blender-v3.1-release' 2022-02-03 09:59:22 +01:00
c379223053 Fix wrong function call in Cycles acceleration UI poll.
Thanks to Sergey for spotting this mistake.
2022-02-03 09:57:24 +01:00
26fe2c1885 Merge branch 'blender-v3.1-release' 2022-02-03 17:20:47 +11:00
b0847eff2a Fix T93625: fallback tools don't work with RMB select
c9d9bfa84a caused a regression in when
the right-mouse select action was set to "Select & Tweak" (default).

Now the fallback tool works with RMB select as it did before.
2022-02-03 17:14:07 +11:00
eb0e0a3b75 LibOverride: Move proxy conversion code in its own file.
This will allow to keep the access to deprecated DNA proxy data in that
specific file, instead of allowing deprecated accesses in the whole
override kernel code.

Part of T91671.
2022-02-02 17:22:12 +01:00
a83fff7c63 Remove operators to manually convert proxies to liboverrides.
Now that proxy conversions if enforced, those operations are not useful
anymore.

Part of T91671.
2022-02-02 16:56:23 +01:00
f0cfa94d94 Fix T95397: Grease Pencil Icons do not match in Outliner vs Dope Sheet Editor
There was an inconsistency between icons.
2022-02-02 16:33:29 +01:00
04a93b795c Merge branch 'blender-v3.1-release' 2022-02-02 16:30:12 +01:00
43b0ff3054 Fix (unreported) bug in liboverride resync code.
Part of the resynching code would access collections' objects base
cache, which can be invalid at that point (due to previous ID remapping
and/or deletion). Use a custom recursive iterator over collections'
objects instead, since those 'raw' data like collection's objects list,
and collection's children lists, should always be valid.

Found while investigating a studio production file.
2022-02-02 16:25:41 +01:00
40b84ffc50 Draw Manager: Marked work around code.
Mark the work around that was added for the VSE memory leak.
2022-02-02 15:05:06 +01:00
fd35aa48d1 Workaround for VSE memory leak.
This is a temp fix for a memory leak where the VSE isn't aware that a
float representation of the image could exist. The VSE somehow doens't
clears it (refcounter is still 1).

The work around is just to let the image engine clean up all the data it
created. Potential this would add more overhead when buffers are needed
more than once.
2022-02-02 14:20:18 +01:00
e54fba5591 Merge branch 'blender-v3.1-release' 2022-02-02 13:12:12 +01:00
bf8597febe BLI: fix memory leak in VectorSet
The leak happened when the vector set had to grow when it
was empty but it had allocated the keys array already.
2022-02-02 13:11:33 +01:00
4dcaac6d33 Cleanup: comment printing when loading XML
This printed text when the theme was changes from the quick setup.
Also use a context manager for opening a file.
2022-02-02 21:06:38 +11:00
d81c3bcfbb Merge branch 'blender-v3.1-release' 2022-02-02 10:56:00 +01:00
a985f558a6 Fix T95084: evaluate all output attributes before changing geometry
This refactors how output attributes are computed in the geometry
nodes modifier. Previously, all output attributes were computed one
after the other. Every attribute was stored on the geometry directly
after computing it. The issue was that other output attributes might
depend on the already overwritten attributes, leading to unexpected
behavior.

The solution is to compute all output attributes first before changing the
geometry. Under specific circumstances, this refactor can result in a speedup,
because output attributes on the same domain are evaluated together now.
Overwriting existing might have become a bit slower, because we write the
attribute into  new buffer instead of using the existing one.

Differential Revision: https://developer.blender.org/D13983
2022-02-02 10:54:54 +01:00
ff4e04a293 Merge branch 'blender-v3.1-release' 2022-02-02 10:38:24 +01:00
71b451bb62 Fix T95288: Shrinkwrap selection broken in edit mode
Mistake in the 974981a637: f the edit data is not present then the
origindex codepath is to be used. Added a brief note about it on the
top of the file.

More ideally would be to remove edit mesh from non-bmesh-wrappers
but this would require changes in the draw manager to make a proper
decision about drawing edit mode overlays.
2022-02-02 10:35:32 +01:00
829d93ff06 Remove option to not auto-convert proxies on file load.
Now all proxies will always be converted to library overrides. If
conversion fails, they are simply 'disabled'.

This should be the last 'user-visible' step of proxies removal.
Remaining upcoming commits will remove internal ID management, depsgraph
and evaluation code related to proxies.

Also bump the blendfile subversion.

Part of T91671.
2022-02-02 09:47:10 +01:00
049df7ef94 Proxies Removal: Handle conversion to liboverrides also for linked data.
So far linked proxies were just kept as-is, this is no longer an option.

Attempt to convert them into liboverrides as much as possible, though
some cases won't be supported:
- Appending proxies is broken since a long time, so conversion will fail
  here as well.
- When linking data, some cases will fail to convert properly. in
  particular, if the linked proxy object is not instanced in a scene
  (e.g. when linking a collection containing a proxy as an
  epty-instanced collection instead of a view-layer-instanced collection).

NOTE: converion when linking/appending is done unconditionnaly, option
to not convert on file load will be removed in next commit anyway.

Part of T91671.
2022-02-02 09:47:10 +01:00
286fcb3a60 LibOverride: Add 'owner library' info to some liboverride code.
This will help when dealing with liboverrides from other library files,
e.g for resync or proxies conversion.

This commit only affects proxy conversion.

Part of T91671.
2022-02-02 09:47:10 +01:00
4927919613 Cleanup: Use correct identifier for ShaderParameters.
Code use struct and class, but should only have used struct.
2022-02-02 08:32:32 +01:00
e8b3bd15e8 Cleanup: skip redundant steps when the selection buffer is cached
The viewport theme loaded and virtual modifiers allocated unnecessary.
2022-02-02 18:12:53 +11:00
da5e72eb01 Cleanup: exclude bone names & axes from selection drawing
These aren't used for picking bones so there is no need to draw them.
2022-02-02 18:06:51 +11:00
cabc9506f9 Fix crash in recent pose-bone transform cleanup
ff5e8e6d53 dereferenced a NULL pointer
when dragging a bone with a connected parent in pose-mode.
2022-02-02 18:02:13 +11:00
709f67cbf0 Docs: note that Bone.xwidth & zwidth are doubled 2022-02-02 17:31:06 +11:00
9b779993f0 Docs: add doc-string for RNA_property_is_set_ex use_ghost argument 2022-02-02 13:53:46 +11:00
d82372aee3 Cleanup: spelling in comments 2022-02-02 13:53:46 +11:00
811606a064 Cleanup: shadow warning, remove unused flags 2022-02-02 13:53:36 +11:00
9cc4861e6f Compositor: Combine and Separate XYZ Node
We have this node for shader and geometry nodes. Compositor can also
work with vectors, and this can help with that.

Reviewed By: manzanilla

Maniphest Tasks: T95385

Differential Revision: https://developer.blender.org/D12919
2022-02-01 18:18:51 -05:00
c9b578eac8 Geometry Nodes: Remove object transform dependency in some cases
The geometry nodes modifier currently always adds a dependency
relation from the evaluated geometry to the object transform. However,
that can be avoided unless there is a collection or object info node in
"Relative" mode.

In order to avoid requiring dependency graph relations updates often
when editing a node tree, this patch doesn't check if the node is muted
or if the data-block sockets are empty before adding the dependency.

Fixes T95265

Differential Revision: https://developer.blender.org/D13973
2022-02-01 16:27:29 -06:00
b91ae8b14c Merge branch 'blender-v3.1-release' 2022-02-01 22:54:23 +01:00
95fcb41841 Fix T95378: Seek problems when timecodes are used
Function `IMB_indexer_get_seek_pos()` can return non 0 seek position for
frame index 0. This causes seeking to incorrect GOP and scanning ends
with failiure.

Hard-code first frame index seek position to 0.

Differential Revision: https://developer.blender.org/D13974
2022-02-01 22:53:24 +01:00
6b914a43ad Fix error in ff5e8e6d53
And silence unused variable warning.
2022-02-01 18:50:10 -03:00
b127654816 Fix build error
The return value of this function was removed in ff5e8e6d53
2022-02-01 15:46:07 -06:00
a12265f048 Fix T95353: Crash with proxy auto building
Proxy building data were freed before process was started.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D13972
2022-02-01 22:46:04 +01:00
03e580c98c Cleanup: Use C++ types 2022-02-01 15:42:04 -06:00
ff5e8e6d53 Cleanup: restructure 'transform_convert_pose_transflags_update'
Move the bones count and `has_translate_rotate` parameter out of the
function as they are not required in some places.
2022-02-01 18:38:26 -03:00
Yevgeny Makarov
7aec5b0622 UI: Adjust Layout on Quick Setup Screen
Some items on the Quick Setup screen can be truncated with some
languages and/or with High DPI monitors. This patch adjusts column
sizes and turns off the expand on Spacebar options, making everything
fit a bit better.

See D9853 for more details.

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

Reviewed by Julian Eisel
2022-02-01 11:17:57 -08:00
2b01964e6c Merge branch 'blender-v3.1-release' 2022-02-01 19:25:36 +01:00
83b6c8f2b1 Fix T95278: Crash on startup because of GLSL recursion
Bypassing the defines which are only there for error checking.
2022-02-01 19:22:50 +01:00
f39ade9e00 GPUShader: Rename createInfo storage Qualifiers
Using opt-in instead of opt-out to make code easier to read.
Add combined flag enum.
Making restrict an inverse flag option because it is so rare to
use it.
2022-02-01 19:05:22 +01:00
9505af72d4 GPUShader: Add support for gpu_BaryCoord and fallback
This adds the possibility to use the `gpu_BaryCoord[NoPersp]`
builtin to support barycentric coordinates without geometry shader.

The `BuiltinBits::LAYER` builtin needs to be manually added
to the `GPUShaderCreateInfo` in order to use this feature.
Note: This is only available for shaders using `GPUShaderCreateInfo`.

A geometry shader fallback is generated if the extension
`AMD_shader_explicit_vertex_parameter` is not available.

`NV_fragment_shader_barycentric` was not considered because it is not
present inside the `glew.h` with use and seems to only be available
with vulkan.
2022-02-01 19:05:22 +01:00
9e42b9827a GPUShader: Add support for vertex shader gl_Layer and fallback
This adds the possibility to use the `gpu_Layer` builtin to
support layered rendering without geometry shader.

The `BuiltinBits::LAYER` builtin needs to be manually added
to the `GPUShaderCreateInfo` in order to use this feature.
Note: This is only available for shaders using `GPUShaderCreateInfo`.

A geometry shader fallback is generated if the extension
`AMD_shader_explicit_vertex_parameter` is not available.
2022-02-01 19:05:22 +01:00
9bbfade772 GPUShader: Improve builtins support in GPUShaderCreateInfo
- Scan all static shaders for builtins on startup.
- Add possibility to manually add builtins.
- `ShaderCreateInfo.builtins_` contain builtins from all stages.
2022-02-01 19:05:22 +01:00
7475f7b0de GPUShader: Expose create_info getter
This allows to check if a create_info extists based on its name.
2022-02-01 19:05:22 +01:00
Falk David
ffb0ecb498 Fix T91463: Separate points makes gap on cyclic stroke
If an entire cyclic stroke was selected, calling "Separate by Points"
would leave a gap in the new object (making the new stroke non-cyclic).

The patch makes sure that if we separate by points and all points are
selected, we fall back to separate by stroke.

Reviewed By: antoniov

Maniphest Tasks: T91463

Differential Revision: https://developer.blender.org/D12527
2022-02-01 18:09:34 +01:00
2110e271f5 Merge branch 'blender-v3.1-release' 2022-02-01 17:53:19 +01:00
2bd71b49e7 Fix T95395: dangling parent pointer when creating node group
Differential Revision: https://developer.blender.org/D13981
2022-02-01 17:48:44 +01:00
Falk David
e9150ac317 Fix T89514: GP draw mode not saved when scene is not the active one
This patch fixes the error that pops up
(`Error: Unable to execute '... Mode Toggle', error changing modes`)
when trying to switch to e.g. draw mode from a grease pencil object
that was saved in draw mode in an inactive scene when the file was loaded.

Note that this does not fix the bigger issue described in T91243.

The fix makes sure that we reset all the mode flags on the grease pencil
data when we set the mode to object mode.

Reviewed By: antoniov

Maniphest Tasks: T89514

Differential Revision: https://developer.blender.org/D12419
2022-02-01 16:02:03 +01:00
32b33e91eb Asset Browser: Use directory name as default when adding asset libraries
When adding an asset library in the Preferences, set the name of the new
library to the chosen directory's name by default. That avoids having to
set it manually which can be annoying. Previously I thought it would be
nice to show the name button in red then, making the user aware that
they have to give it a name, but that appears to be more annoying than
useful/practical after all.
2022-02-01 14:59:11 +01:00
b03fb70eff Silence draw manager warning.
This message isn't useful for users so silenced it.
2022-02-01 13:50:19 +01:00
f8713aae5e Cleanup: Remove unused datatoc definitions. 2022-02-01 12:14:52 +01:00
217e0a2ce6 Fix T95262: instances ignored in Frame Selected operator
The issue was that the code only looked at `dob->ob`
instead of `dob->ob_data` which is necessary since
rB5a9a16334c573c4566dc9b2a314cf0d0ccdcb54f.

This now uses the same pattern that is used in other places
where `BKE_object_replace_data_on_shallow_copy` is used.
2022-02-01 11:58:53 +01:00
84dab8b597 Fix T95314: constant values not shown in spreadsheet 2022-02-01 11:43:48 +01:00
34449ba9a6 Merge branch 'blender-v3.1-release' 2022-02-01 11:04:38 +01:00
6f9828289f Fix T95356: Crash in armature edit mode and certain condition
Blender would have crashed when renaming bone in Edit Mode, Saving, and
than selecting/deselecting.

Caused by a mistake in the 0f89bcdbeb: can not "short-circuit" the
CoW update if it was explicitly requested.

Safest for now solution seems to be to store whether the CoW component
has been explicitly tagged, so that the following configuration can be
supported:

    DEG_id_tag_update(id, ID_RECALC_GEOMETRY);
    DEG_id_tag_update(id, ID_RECALC_COPY_ON_WRITE);

Differential Revision: https://developer.blender.org/D13966
2022-02-01 11:04:19 +01:00
396413dedf Partial Fix: Showing Compositor Backdrop in node editor.
Since splitting the depth and the color shader in the image engine the
backdrop wasn't visible anymore. The reson is that the min max uv
coordinates were never working for the node editor backdrop that uses
its own coordinate space.

This partial fix will ignore the depth test when drawing the color part
of the backdrop. This will still have artifacts that are visible when
showing other options as RGBA.

Proper fix would be to calculate the the uv vbo in uv space and not in
image space.
2022-02-01 10:49:28 +01:00
146618fb22 Fix T95376: Fix crash when switching to UV workspace.
Can also happen in other places when the overlay engine is active. Some
parts of the overlay engine uses builtin shaders, but disable the color
space conversion to the target texture.

Currently there the overlay engine has its own set of libraries it could
include and defined a macro to pass-throught the color space conversion.

The library include mechanism currently fails when it couldn't find the
builtin library in the libraries of the overlay engine. This only
happened in debug mode.

This change will not fail, but warns the developer if a library could
not be included. In the future this should be replaced by a different
mechanism that can disable the builtin library. See {T95382}.
2022-02-01 08:38:34 +01:00
120deaac5b Merge branch 'blender-v3.1-release' 2022-02-01 15:37:14 +11:00
64264a496d Merge branch 'blender-v3.1-release' 2022-02-01 15:37:10 +11:00
c8814fb610 Fix T95185: Invalid normals after undo in sculpt mode
Since d9c6ceb3b8 partial updates to
normals in sculpt-mode were accumulating into the current normal
instead of a zeroed value.

Zero vertex normal values tagged for calculation before accumulation.

Reviewed By: HooglyBoogly

Ref D13975
2022-02-01 15:35:08 +11:00
9ce1135440 Cleanup: remove duplicate vertex normal array in SculptSession
From investigating T95185, it's important the normal returned by
SCULPT_vertex_normal_get always match the PBVH normal array.

Since this is always initialized in the PBVH, there is no advantage
in storing the normal array in two places, it only adds the possibility
that changes in the future causing different meshes normals to be used.

Split out from D13975.
2022-02-01 13:39:19 +11:00
f21f1279fa Merge branch 'blender-v3.1-release' 2022-02-01 13:34:43 +11:00
2e4a1a70da Fix building with audaspace disabled 2022-02-01 13:33:50 +11:00
95005bbe02 Merge branch 'blender-v3.1-release' 2022-02-01 00:10:47 +01:00
f420118335 Fix T93856: VP9 lossless render missing alpha
Since 0ea0ccc4ff, `AV_PIX_FMT_YUV444P` pixel format was used for
lossless renders, which did override `AV_PIX_FMT_YUVA420P` format when
"RGBA" output is chosen. VP9 encoder doesn't seem to support
`AV_PIX_FMT_YUVA444P` pixel format, so use `AV_PIX_FMT_YUVA420P` for
lossless RGBA ouput instead.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D13947
2022-02-01 00:00:29 +01:00
1d1859c3c4 Fix compile error with audaspace disabled
Argument was removed in a recent commit.
2022-01-31 23:48:43 +01:00
bff83ecee5 Cleanup: Add missing breaks in previous commit
I missed compile warnings for these. Sorry for the noise.
Also combine assignments with null checks to save a few lines.
2022-01-31 15:43:23 -06:00
71c76d596c Merge branch 'blender-v3.1-release' 2022-01-31 22:32:08 +01:00
2053fc849e Cleanup: Return early, use switch, rename function 2022-01-31 15:27:35 -06:00
68c2650b03 Fix T94287: gaps between strips when adding movies
Currently, audio and video strips are synchronized based on data from
media stream, which is nice, but this causes gaps between strips.
This synchronization was implemented by moving movie strip position
relative to sound, which doesn't make much sense for user which is
mostly interested in editing video.

Code was bit hard to read, so it has been simplified. Ideally video
stream time would be easily accessible so synchronization could be done
at any time, but this is not necessary at this point.

Reviewed By: zeddb

Differential Revision: https://developer.blender.org/D13948
2022-01-31 22:22:36 +01:00
c3a41a8002 Merge branch 'blender-v3.1-release' 2022-01-31 21:00:28 +01:00
c8c9965df2 Fix crash with non-closed meshes in recent bugfix for texture margin
Ref T95249, D13935
2022-01-31 20:59:25 +01:00
5fabbedb04 Fix Cycles assert in light sampling
There is no object transform on lights.
2022-01-31 20:45:12 +01:00
c4f159cfcd Cleanup: Add back comment removed in recent commit
23775f3914 removed this comment, but it's
preferred to keep it instead.
2022-01-31 12:00:45 -06:00
81ee46da1a Fix: Unutilized curve mapping in vector shader node
This could result in a shading errors is some cases such as undo.

Follow up to rB1405787142d1f87f18631114167675ed145f6d75
2022-01-31 12:59:54 -05:00
716d8436f0 Fix: Unutilized curve mapping in vector shader node
This could result in a shading errors is some cases such as undo.

Follow up to rB1405787142d1f87f18631114167675ed145f6d75
2022-01-31 12:56:40 -05:00
64359f8998 Cleanup: Better name for new Outliner tree element type
The name `type` was confusing, since we usually use that in other ways.

Also updated the relating comments.
2022-01-31 18:36:55 +01:00
fc5ef2452d Cleanup: Namespace alias for internal outliner header
Long namespace qualifiers add visual noice and make code harder to read.
2022-01-31 18:36:55 +01:00
2bd30272ea Merge branch 'blender-v3.1-release' 2022-01-31 12:32:31 -05:00
Leon Schittek
5edb924e57 UI Papercut: Fix gap in node outline
Correct corner radius of the node outline to prevent a noticeable gap in
some cases.

---

Currently we make a small mistake in the creation of the node outline:
We offset the rectangle describing the outline by the outline thickness,
but we don't adjust the corner radius accordingly.
Therefore the rounded corner of the outline and the node body are not
concentric which can sometimes lead to a visible gap at the corner.
How noticeable it is depends on the theme, the screen's dpi and the
line thickness set in the preferences.

Simply adjusting the corner radius for the outline to also be increased
by the outline thickness fixes this small issue.

| display, line thickness | **patch** | **master** |
| --- | --- | --- |
| 1080p, default/thin  | {F12835304} | {F12835305} |
| retina, thin | {F12835306} | {F12835307} |

The issue was mentioned by @hitrpr

Reviewed By: Blendify

Differential Revision: https://developer.blender.org/D13955
2022-01-31 12:31:54 -05:00
Martijn Versteegh
8ad5241778 Fix T95250: bake margin adjacent faces uses stale UV map in edit mode
Use the evaluated mesh to generate the Adjacent Faces margin.

Baking used the evaluated mesh, but generating the margin used the base
mesh. This would lead to generating the margin from a stale UV map when the
UV editor was open and the UV map was changed. Fix it by passing the same
mesh as used for baking through to the margin generation.

Differential Revision: https://developer.blender.org/D13938
2022-01-31 18:18:05 +01:00
Martijn Versteegh
83fa6a1b2a Fix T95249: bake margin adjacent faces fails in some directions
The new adjacent faces method border lookup fails in some directions around
45 degrees

* Use 8 Dijkstra directions (also diagonally) to determine which polygon is the
  closest to each pixel. Using only Manhattan distance lead to large parts of
  the texture which were matched with the wrong polygon.

* Use neighbroing polygons for edge search. The Adjacent Faces algorithm needs
  to determine the closest edge, in UV space, each pixel. To speed this up
  first as map is built which finds the closest polygon for each pixel along
  horizontal, vertical and diagonal steps. Because this can sometimes be one
  edge off we first look in the polygon from the map, if that fails also
  check the edges of its neighbouring UV polygons.

Differential Revision: https://developer.blender.org/D13935
2022-01-31 18:18:04 +01:00
Martijn Versteegh
c626301f19 Cleanup: remove wrong assert
Was accidentally left in after refactoring.

Fixes T95347

Differential Revision: https://developer.blender.org/D13963
2022-01-31 18:18:02 +01:00
64ca0f44cb Merge branch 'blender-v3.1-release' 2022-01-31 17:43:43 +01:00
5257257539 Fix T95205: remove attribute only once
The bug was caused by a typo.
2022-01-31 17:40:55 +01:00
9578fe3068 Fix T95341: BGL renders incorrect color
Missing include statements of the gpu_shader_colorspace_lib.glsl in
various shaders ignored the target texture color space.
2022-01-31 15:43:13 +01:00
2216699c64 Cleanup: Change NULL to nullptr. 2022-01-31 15:43:13 +01:00
8cc6623c18 Merge branch 'blender-v3.1-release' 2022-01-31 15:29:02 +01:00
180a68c1dc Fix (studio-reported) missing RNA path for EEVEE render passes.
For those EEVEE passes a bit of trickery with pointer offsets allows to
get the owning viewlayer, so path generation is not too bad.

Also moved ViewLayer path generation itself into a public utils, to
avoid duplicating code.

NOTE: Doing the same for AOV would be needed, but since pointer offsets
won't help us here to find the owning viewlayer, not sure how to do it
nicely yet (only solution I think is to loop over all AOVs of all
ViewLayer of the scene to find it :( ).

Reported by Beau Gerbrands (@Beaug), thanks.
2022-01-31 15:16:36 +01:00
46abc6ce25 Fix T95238: BPY Documentation for Tablet Pressure is Incorrect
Set an appropriate range and default value for the property.
2022-01-31 10:20:34 -03:00
caaec3e0c5 Merge branch 'blender-v3.1-release' 2022-02-01 00:02:08 +11:00
a31859c754 Merge branch 'blender-v3.1-release' 2022-02-01 00:02:05 +11:00
8b4f1e41ea Merge branch 'blender-v3.1-release' 2022-02-01 00:02:02 +11:00
cf871ab967 Merge branch 'blender-v3.1-release' 2022-02-01 00:01:58 +11:00
9badd27fb7 Merge branch 'blender-v3.1-release' 2022-02-01 00:01:54 +11:00
b9718899fa Python: default to version to 3.10 for Linux
This doesn't bump the minimum version, see D13943.
2022-01-31 23:57:10 +11:00
deb90557ea Fix T95332: Crash loading older files.
Image buffer was visible but buffer wasn't available. In the case
the color only overlay of the render result was displayed the image
buffer was not check to be valid.

This patch adds a null pointer check to check in `IMB_alpha_affects_rgb`
to solve this crash.
2022-01-31 12:25:18 +01:00
869180548c Image editor: Fix drawing artifacts with render results.
Use the input depth texture to determine if the color of the texture
should be shown.
2022-01-31 11:59:16 +01:00
75576a3001 Fix (unreported) install_deps: wrong order of actions in python handling.
We need to get installed version of python *after* we actually install/update
the package.
2022-01-31 11:08:14 +01:00
Michael
e43ccfb702 Fix: Specify exact Python version for python3-dev on Debian&Ubuntu
This commit specifies the exact Python version which is included in the
package name, thereby allowing `install_deps.sh` to suggest
"`-D PYTHON_VERSION=3.10`" correctly.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D13925
2022-01-31 10:59:38 +01:00
dfc959eed6 Fix T95299: Empty render results show transparency checkerboard.
When an image buffer cannot be read the checkerboard should not be
drawn.
2022-01-31 10:51:25 +01:00
cfa235b89d Image Editor: Fix background drawing of empty tiles.
Empty (UDIM) tiles where drawn with a transparency checkerboard. They
should be rendered with a border background. The cause is that the image
engine would select a single area that contained all tiles and draw them
as being part of an image.

The fix is to separate the color and depth part of the image engine
shader and only draw the depths of tiles that are enabled.
2022-01-31 09:57:51 +01:00
a727692af7 XR: Print OpenXR SDK version in --debug-xr mode
Helps with version validation when updating the OpenXR dependency.
2022-01-31 16:09:17 +09:00
ed80c887b7 Fix wmTimer.ntime becoming NAN with a zero time-step
While this didn't cause any user visible bugs, this wouldn't
have behaved as intended since the timer would never run again once
wmTimer.ntime was set to NAN.
2022-01-31 14:36:37 +11:00
97dbe235a2 Cleanup: comments and minor changes to GPU_select code
- Remove outdated references to glReadPixels & OpenGL.
- Rename GPUPickState.{gl => gpu}
- Add doc-string for MAXPICKELEMS.
- Use doxygen comments & other minor doc-string improvements.
2022-01-31 14:10:38 +11:00
8815f2f116 Cleanup: use struct for GPU the select buffer
GPU_select originally used GL_SELECT which defined the format for
storing the selection result.

Now this is no longer the case, define our own struct - making the code
easier to follow:

- Avoid having to deal with arrays in both `uint*` and `uint(*)[4]`
  multiplying offsets by 4 in some cases & not others.

- No magic numbers for the offsets of depth & selection-ID.

- No need to allocate unused members to match GL_SELECT
  (halving the buffer size).
2022-01-31 14:10:08 +11:00
9ccdad8a21 Cleanup: use enum type for selection mode & internal algorithm enum 2022-01-31 13:06:56 +11:00
57f6aa4d83 Cleanup: Remove unused "_ex" version of function 2022-01-30 18:15:38 -06:00
79032a8513 Cleanup: Remove unused DerivedMesh flag
The value of this flag was never used.
2022-01-30 18:11:20 -06:00
23775f3914 Cleanup: Remove unused DerivedMesh functions
Remove functions and function pointers that were never set or never
used at all. The "tessface" original index handling in `subsurf_ccg.c`
can be removed because the data was never used.
2022-01-30 18:06:47 -06:00
ac3324f197 Cleanup: spelling in comments 2022-01-31 10:51:33 +11:00
012e41fc8b Cleanup: use our own conventions for tags in comments 2022-01-31 10:49:59 +11:00
14427f5aaa Cleanup: Remove unused DerivedMesh normal handling
This function and flags weren't used outside of DerivedMesh
code, and since the plan is to remove the data structure, it makes
sense to remove complexity where possible.
2022-01-30 17:01:03 -06:00
a04d0de039 Fix T95336: Wrong tooltip for Show Only on Keyframed checkbox
The "Paint" mode is wrong, must be "Draw"
2022-01-30 23:12:23 +01:00
Aras Pranckevicius
1f7013fb90 Speed up the new OBJ exporter via bigger write buffer and parallelization.
This is a patch from Aras Pranckevicius, D13927. See that patch for full
details. On Windows, the many small fprintfs were taking up a large amount
of time and significant speedup comes from using snprintf into chained buffers,
and writing them all out later.
On both Windows and Linux, parallelizing the processing by Object can also lead
to a significant increase in speed.
The 3.0 splash screen scene exports 8 times faster than the current C++ exporter
on a Windows machine with 32 threads, and 5.8 times faster on a Linux machine
with 48 threads.

There is admittedly more memory usage for this, but it is still using 25 times
less memory than the old python exporter on the 3.0 splash screen scene, so
this seems an acceptable tradeoff. If use cases come up for exporting obj files
that exceed the memory size of users, a flag could be added to not parallelize
and write the buffers out every so often.
2022-01-30 15:03:31 -05:00
b315678fea Merge branch 'blender-v3.1-release' 2022-01-30 13:57:45 -05:00
Aras Pranckevicius
07514def19 Fix T95328, new obj exporter not exporting custom normals.
Previously, the new obj exporter was only exporting per-vertex normals for faces
marked as "smooth". But a face can have custom normals, as soon as the normals
data layer exists. This change makes it follow the behavior of USD & Collada
exporters and the old Python one, which also export per-vertex normals as soon
as the layer is there. (From Patch D13957.)
2022-01-30 13:48:03 -05:00
4fcc651435 Revert "UI: Do not translate "Blender""
See rB0c5a9a0e776eeb724f7266694153f98721e34fde for the issue with this.

This reverts commit 0c5a9a0e77.
2022-01-30 12:19:38 -05:00
a58592885c Cleanup: Remove modifier type hair callback
This is similar to e032ca2e25 which removed the
callback for volumes. Now that we have geometry sets, there is
no need to define a callback for every data type, and this wasn't
used. Procedural curves/hair editing will use nodes rather than new
modifier types anyway.
2022-01-30 00:07:07 -06:00
0c5a9a0e77 UI: Do not translate "Blender"
Blender is the name of the software, it does not make sense to
translate into a language's term for the kitchen appliance.
2022-01-29 21:00:12 -05:00
f18172b023 Cleanup: Pass cursor position as a single array to eyedropper functions
Since `event->xy` is now an array these functions can be
simplified to accept the sample point as an array.

Clarifications were also made to variable names:
- `eye->last_x/y` --> `eye->cursor_last`
- `mx/my` --> `cursor`

Differential Revision: https://developer.blender.org/D13671
2022-01-29 20:45:03 -05:00
f8b8727873 Merge remote-tracking branch 'origin/blender-v3.1-release' 2022-01-30 01:07:38 +01:00
2cf3ed13da Fix T95315: "Override Layers" panel open crash with null CacheFile 2022-01-30 01:06:56 +01:00
e951e81b0f Cleanup: Cmake: remove unnecessary definitions for internationalization
Previously, macros were ifdefed using the cmake option `WITH_INTERNATIONAL`
However, the is unnecessary as withen the functions themselves have checks for building without internationalization.
This also means that many `add_definitions(-DWITH_INTERNATIONAL)` are also unnecessary.

Reviewed By: mont29, LazyDodo

Differential Revision: https://developer.blender.org/D13929
2022-01-29 17:40:27 -05:00
ec2e9a4352 Merge branch 'blender-v3.1-release' 2022-01-29 13:14:45 -05:00
c9d35ee07c Fix: Eevee: Float Curve node causes issues with compiled shader
This fixes a regression from rBa0edee712a79239133ff840f911f6416d4c41855.
Issue being the curve map not being initialized in the GPU shader function.

Fixes T95221
2022-01-29 13:14:26 -05:00
1405787142 Fix: Eevee: Float Curve node causes issues with compiled shader
This fixes a regression from rBa0edee712a79239133ff840f911f6416d4c41855.
Issue being the curve map not being initialized in the GPU shader function.

Fixes T95221
2022-01-29 13:11:06 -05:00
90a23dec46 Cleanup: Remove mesh vertex "temp tag" flag
As part of the project of converting `MVert` into `float3`
(more details in T93602), this is an easy step, since it
is only locally used runtime data. In the six places it was
used, the flag was replaced by a local bitmap.

By itself this change has no benefits other than making some
code slightly simpler. It only really matters when the other
flags are removed and it can be removed from `MVert`
along with the bevel weight.

Differential Revision: https://developer.blender.org/D13878
2022-01-28 22:40:13 -06:00
0b2864382a Merge branch 'blender-v3.1-release' 2022-01-29 01:42:04 +01:00
544a0f2880 Fix memory leak when adding movie strips
Introduced by b45e71e22c.
2022-01-29 01:31:53 +01:00
d29a079cb6 Merge branch 'blender-v3.1-release' 2022-01-28 17:47:38 -06:00
03b57d3973 Fix T94476: Threading/performance issue with curve to points node
For every spline, *all* of the normals and tangents in the output
were normalized. The node is multithreaded, so sometimes a thread
overwrote the normalized result from another thread.

Fixing this problem also made the node orders of magnitude
faster when there are many splines.
2022-01-28 17:47:14 -06:00
fd1078e105 Fix T62651: Win32 Multiple Adapters Warning
Show a more instructive error message for users who have plugged
multiple monitors into multiple display adapters. And do not exit
if unable to open a child window when in this state.

See D13885 for more details

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

Reviewed by Ray Molenkamp
2022-01-28 15:20:07 -08:00
3435c9a2c1 Merge branch 'blender-v3.1-release' 2022-01-28 23:51:50 +01:00
afdc35b636 Fix typos in rB0a8fa07735cdb89081b652c032c73863e34f8ff1 2022-01-28 23:50:49 +01:00
fe80b6ceac Merge branch 'blender-v3.1-release' 2022-01-28 23:32:51 +01:00
0a8fa07735 Fix T95278: Crash on startup because of GLSL compiler bug
The GLSL defines used to make the uniform names unusable for local variable
is being interpreted as recursive on some implementation.

This avoids it by create a second macro avoiding the recursion.
2022-01-28 23:28:53 +01:00
6b7756279f Fix T93626: Win IME Chinese Numpad Decimal
Allow Windows IME Pinyin, when in Chinese mode, to use numpad decimal
key to enter decimal point.

See D13902 for more details.

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

Reviewed by Brecht Van Lommel
2022-01-28 13:32:46 -08:00
4311a32bc2 Win IME: Ideographic Full Stop to Decimal Point
Convert Ideographic Full Stop, used in Simplified Chinese and Japanese,
to Decimal Point when entering numbers into numerical inputs.

See D13903 for more details

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

Reviewed by Brecht Van Lommel
2022-01-28 13:11:56 -08:00
ace1b6a73a UI: Add OneDrive to System List for Windows
This patch adds a "OneDrive" icon to the File Manager System list for
Windows (only!).

See D11133 for more details.

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

Reviewed by Julian Eisel
2022-01-28 12:22:42 -08:00
26e608d820 Win32: Initialize GHOST_WindowWin32 Members
Initialize m_Bar, m_dropTarget, & m_hWnd members of GHOST_WindowWin32
in constructor's member initializer list. This ensures they are are
set or NULL in destructor if constructor does not complete.

See D13886 for more details.

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

Reviewed by Jesse Yurkovich
2022-01-28 12:03:20 -08:00
82ad1631e4 Fix Cycles assert in light sampling
There is no object transform on lights.
2022-01-28 17:32:18 +01:00
dd4a89e78d Merge branch 'blender-v3.1-release' 2022-01-28 10:06:04 -06:00
cb09485ff2 UI: Use property split in new operator popup
This attribute conversion operator was just added.
The UI looks more consistent with property split.
2022-01-28 10:03:07 -06:00
92d747b0c4 Drag & drop: Support using context of hovered button when dropping
Buttons can hold context and it's very useful to use this as a way to
let buttons provide context for drop operators.
For example, with this D13549 can make the material slot list set the
material-slot pointer for each row, and the drop operator can just query
that.
2022-01-28 16:53:37 +01:00
391bb6e9ba Cleanup: Clang-tidy warning gl_shader.cc 2022-01-28 16:35:05 +01:00
b6f640b953 Cleanup: Clang-tidy warnings.
Silence Clang-tidy warnings in gpu module.
2022-01-28 16:18:13 +01:00
4e93918b35 Merge branch 'blender-v3.1-release' 2022-01-28 15:09:35 +01:00
3b2a1ff716 Image Engine: Remove unused shader parameter Color.
This change removes an unused shader parameter that also collided when a
local varialble with the same name was used on different platforms.
2022-01-28 15:03:45 +01:00
75e61e5a6d Image Engine: Use GPUShaderCreateInfo.
Ported the image engine shaders to use the GPUShaderCreateInfo struct.
No functional changes.
2022-01-28 15:03:45 +01:00
c40d6ebceb Merge branch 'blender-v3.1-release' 2022-01-28 14:46:16 +01:00
430f71fce2 Fix insufficient CPU flags checks for Cycles OIDN
Sometime throughout development some checks got lost during refactor.
This change makes it so that if OIDN is not supported on the current
CPU Cycles will report an error and stop rendering. This behavior is
similar to when an OptiX denoiser is requested and there is no OptiX
compatible device available.

The easiest way to verify this change is to force return false from
the `openimagedenoise_supported()`.

Fixes Cycles part of the T94127.

Differential Revision: https://developer.blender.org/D13944
2022-01-28 14:28:04 +01:00
29a1d8b1d3 Fix compilation error in previous commit. 2022-01-28 14:01:25 +01:00
cdcbdf8ce4 Remove compilation warnings TexResult. 2022-01-28 13:28:31 +01:00
5d74fa314b Fix overread warning in screen operator
Fixes a `stringop-overread` warning, other people are working on fixing
some more :)
2022-01-28 12:40:44 +01:00
7c48196056 Silent compilation warning in space_graph. 2022-01-28 11:48:47 +01:00
be921a04f2 Image engine: Remove unused parameter.
Parameter was used to still be compatible with the previous drawing mode.
The previous mode isn't available anymore so the parameter can should be
removed.
2022-01-28 11:48:47 +01:00
dcb7b3f9f7 Image Engine: Fix issue show alpha flag not reset.
After showing the alpha in the image editor the setting was not reset
so all images in the editor showed as being transparent.

This commit fixes this by resetting the flag before updating.
2022-01-28 11:48:47 +01:00
379814a118 Draw: Remove unused code in image engine shader. 2022-01-28 11:48:47 +01:00
60bd6804db Revert "3.1 splashscreen"
This reverts commit 3aa56608f7.
2022-01-28 11:34:51 +01:00
1a15461612 Merge branch 'blender-v3.1-release' 2022-01-28 11:34:31 +01:00
3aa56608f7 3.1 splashscreen
Credit: Lorenzo Aiello - https://orencloud.artstation.com/
2022-01-28 11:32:12 +01:00
f4031f2be2 Revert "Update pipeline config and point to 3.1 branches."
This reverts commit 5d4583683b.
2022-01-28 11:19:29 +01:00
66e4fdab68 Revert "Blender 3.1 bcon3 (beta)"
This reverts commit d45098024e.
2022-01-28 11:19:10 +01:00
cfe18c3b94 Merge remote-tracking branch 'origin/blender-v3.1-release' 2022-01-28 11:11:51 +01:00
f756dc4812 Blender 3.1 Beta- subversion bump 2022-01-28 11:11:11 +01:00
5d4583683b Update pipeline config and point to 3.1 branches. 2022-01-28 11:01:11 +01:00
d45098024e Blender 3.1 bcon3 (beta) 2022-01-28 10:55:28 +01:00
c37b837244 Fix T95060: Outliner: Broken 'make override hierarchy' in indirect linked casae.
In Outliner, 'Make Override Hierarchy' on an indirectly linked data would
fail in case some items higher up in the hierarchy also needed to be
overridden was also indirectly linked.
2022-01-28 10:53:53 +01:00
c0225aa573 Blender 3.2 bcon1 - alpha
Bump the version number for the new release cycle.
2022-01-28 10:48:27 +01:00
49b9b0251b Draw: Remove unused shader.
tile images aren't a special case anymore for the image engine.
2022-01-28 10:47:52 +01:00
78647fbcc0 Fix T95060: Outliner: Broken 'make override hierarchy' in indirect linked casae.
In Outliner, 'Make Override Hierarchy' on an indirectly linked data would
fail in case some items higher up in the hierarchy also needed to be
overridden was also indirectly linked.
2022-01-28 10:24:07 +01:00
e1be275878 Fix typo in comment. 2022-01-28 09:24:11 +01:00
Jeroen Bakker
bdd74e1e93 DrawManager: Image engine support huge images.
Adding better support for drawing huge images in the image/uv editor. Also solved tearing artifacts.
The approach is that for each image/uv editor a screen space gpu texture is created that only contains
the visible pixels. When zooming or panning the gpu texture is rebuild.

Although the solution isn't memory intensive other parts of blender memory usage scales together with
the image size.

* Due to complexity we didn't implement partial updates when drawing images tiled (wrap repeat).
  This could be added, but is complicated as a change in the source could mean many different
  changes on the GPU texture. The work around for now is to tag all gpu textures to be dirty when
  changes are detected.

Original plan was to have 4 screen space images to support panning without gpu texture creation.
For now we don't see the need to implement it as the solution is already fast. Especially when
GPU memory is shared with CPU ram.

Reviewed By: fclem

Maniphest Tasks: T92525, T92903

Differential Revision: https://developer.blender.org/D13424
2022-01-28 08:37:45 +01:00
0a32ac02e9 Image: Partial Update Redesign.
This patch reimplements the image partial updates. Biggest design motivation for the redesign
is that currently GPUTextures must be owned by the image. This reduces flexibility and adds
complexity to a single component especially when we want to have different structures.

The new design is not limited to GPUTextures and can also be used by reducing overhead in image
operations like scaling. Or partial image updating in Cycles.

The usecase in hand is that we want to support virtual images in the image editor so we can
work with images that don't fit in a single GPUTexture.

Using `BKE_image_partial_update_mark_region` or `BKE_image_partial_update_mark_full_update`
a part of an image can be marked as dirty. These regions are stored per ImageTile (UDIM).

When a part of the code wants to receive partial changes it needs to construct a `PartialUpdateUser`
by calling `BKE_image_partial_update_create`. As long as this instance is kept alive the changes can
be received.

When a user wants to update its own data it will call `BKE_image_partial_update_collect_changes`
This will collect the changes since the last time the user called this function. When the partial changes
are available the partial change can be read by calling `BKE_image_partial_update_get_next_change`

It can happen that the introduced mechanism doesn't have the data anymore to construct the
changes since the last time a PartialUpdateUser requested it. In this case it will get a request
to perform a full update.

Maniphest Tasks: T92613

Differential Revision: https://developer.blender.org/D13238
2022-01-28 08:06:19 +01:00
1e0758333d Cleanup: add compiler attributes to BLI_path functions 2022-01-28 15:06:29 +11:00
9523b1478e BLI_path: assert passing relative paths to BLI_path_cmp_normalized
Assert when "//" prefixed relative paths are passed to
BLI_path_cmp_normalized as this can't be expanded
and it's possible the paths come from different blend files.
2022-01-28 15:05:21 +11:00
ebd0e76088 Cleanup: indentation for CMake files
Also minor white-space & case changes.
2022-01-28 14:52:47 +11:00
9f6b19526d Cleanup: spelling in comments
Also minor wording improvements.
2022-01-28 14:52:47 +11:00
7475012e24 Cleanup: rename BLI_paths_equal to BLI_path_cmp_normalized
Changes to recent addition: c85c52f2ce.

Having both BLI_paths_equal and BLI_path_cmp made it ambiguous
which should be used, as `BLI_paths_equal` wasn't the equivalent to
`BLI_path_cmp(..) == 0` as it is for string equals macro `STREQ(..)`.
It's also a more specialized function which is not used for path
comparison throughout Blender's internal path handling logic.

Instead rename this `BLI_path_cmp_normalized` and return the result of
`BLI_path_cmp` to make it clear paths are modified before comparison.

Also add comments about the conventions for Blender's path comparison
as well as a possible equivalent to Python's `os.path.samefile`
for checking if two paths point to the same location on the file-system.
2022-01-28 14:50:16 +11:00
f2b24272dd Fix T93328: Movie seeking doesn't work.
Caused by integer overflow in `steps_per_frame` calculation.
2022-01-27 23:21:45 +01:00
da848b7440 GPUShader: Abort in case of dependency issues.
This is to avoid being flooded with compilation errors that are not helpful.
2022-01-27 22:57:02 +01:00
423bbbbaae BLI_float4x4: Add operator[]
This makes porting existing code using `float[4][4]` easier.
2022-01-27 21:35:43 +01:00
Germano Cavalcante
3775615aea Outliner: avoid creating unnecessary undo steps
The `OUTLINER_OT_item_activate` operator, although it detects when
something changes, always returns `OPERATOR_FINISHED` and thus induces
the creation of undo steps.

So return `OPERATOR_CANCELLED` when nothing changes.

Ref T94080

Reviewed By: Severin

Maniphest Tasks: T94080

Differential Revision: https://developer.blender.org/D13638
2022-01-27 15:41:40 -03:00
a21f1e81e0 DRW: Fix some issues with DRW_gpu_wrapper.hh
- Fix assert on size.
- Fix void * casting.
- Pass extent by values.
- Add swap function to avoid letting the types copyable.
- Add back the GPUTexture * operator on TextureFromPool.
2022-01-27 18:46:01 +01:00
87c13ac68c UX: Prevent click-through panels and used header area
Does two main changes:
* Handle regions in the order as visible on screen. Practically this
  just means handling overlapping regions before non-overlapping ones.
* Don't handle any other regions after having found one containing the
  mouse pointer.

Fixes: T94016, T91538, T91579, T71899 (and a whole bunch of duplicates)
Addresses: T92364

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

Reviewed by: Campbell Barton
2022-01-27 18:40:54 +01:00
4710f3346a Event System: Add debug sanity check "always pass" events
Asserts that such events actually always lead to a handler return value
that actually keeps the event passing.

Reviewed by Campbell Barton as part of
https://developer.blender.org/D13539.
2022-01-27 18:40:54 +01:00
74d68e50d3 Revert "Cleanup: Remove unused variables in winstuff.c"
This reverts commit 32a96b80a3.

this needed an ifdef, not a removal, will land a proper fix later
2022-01-27 10:21:35 -07:00
89dbad9085 Fix T95202: Curve to mesh node inconsistent edge vertex order
Though the edge vertices aren't really meant to have an order,
it can make a difference in operations when there isn't any other
information to make decisions from, like etruding a circle of
loose edges (the situation in the report). This commit changes
the order of the vertices in the final cyclic edge to go in the
same direction as all of the other edges.
2022-01-27 11:21:07 -06:00
834b966b41 Fix T95212: Mirror modifier normals crash
The vertex and face normals from the input mesh
were used to calculate the normals on the result,
which could cause a crash because the result should
be about twice as large.

Also remove an unnecessary dirty tag, since it is handled
automatically when creating a new mesh or in the case
of the mirror modifier, when calculating the new custom
face corner normals.
2022-01-27 11:02:10 -06:00
d7ac659e02 Cleanup: Clang tidy
Use nullptr, use named parameters, fix deprecated header
2022-01-27 10:53:53 -06:00
9c341153a2 Fix T95062: Outliner Library Overrides not refreshed when removing overrides.
Those operations were missing the necessary notification for the
Outliner. This was also affecting RNA API of liboverrides.
2022-01-27 17:52:09 +01:00
279a73e429 Fix: Complete transfer attribute input renaming
Complete the renaming from 6a16a9e661
to include variable names and warning messages.
2022-01-27 10:41:41 -06:00
32a96b80a3 Cleanup: Remove unused variables in winstuff.c
This clears up 4 unused variable warnings coming
from BLI_windows_register_blend_extension
2022-01-27 09:37:11 -07:00
25ac6aa5e4 Fix T85233: Transfer Weights tooltip is wrong.
Swap "active" and "selected" in the tooltip if the `use_reverse_transfer`
option is activated.

Reviewed By: mont29

Maniphest Tasks: T85233

Differential Revision: https://developer.blender.org/D13499
2022-01-27 17:21:01 +01:00
658ae5d63f DRW: Fix DRW_gpu_wrapper.hh
The UBYTE datatype is not supported by the clear fallback. Also fix vector
types headers.
2022-01-27 17:05:02 +01:00
Yevgeny Makarov
58e0aa36ea Fix T93766: 'New Collection' entry in 'Move to collection' menu is not translated.
Also fixes similar issues regarding some liboverride menu entries.

Reviewed By: mont29

Maniphest Tasks: T93766

Differential Revision: https://developer.blender.org/D13513
2022-01-27 16:51:14 +01:00
99ffe1153a install_deps: Downgrade python-ztandard to 0.16.0.
Higher version requires a new version of the ztandard library itself.

Ref. T93161/D13922.
2022-01-27 16:16:14 +01:00
6c483479b8 GLFramebuffer: Add assert to check if framebuffer has the expected data
It came to light that there is no error checking when trying to read
a framebuffer plane without anything attached to it.
2022-01-27 16:13:49 +01:00
Michael Kowalski
c85c52f2ce USD Preview Surface material export.
Add `USD Preview Surface From Nodes` export option, to convert a
Principled BSDF material node network to an approximate USD Preview
Surface shader representation. If this option is disabled, the original
material export behavior is maintained, where viewport setting are saved
to the Preview Surface shader.

Also added the following options for texture export.

  - `Export Textures`: If converting Preview Surface, export textures
    referenced by shader nodes to a 'textures' directory which is a
    sibling of the USD file.
  - `Overwrite Textures`: Allow overwriting existing texture files when
    exporting textures (this option is off by default).
  - `Relative Texture Paths`:  Make texture asset paths relative to the
    USD.

The entry point for the new functionality is
`create_usd_preview_surface_material()`, called from
`USDAbstractWriter::ensure_usd_material()`.  The material conversion
currently handles a small subset of Blender shading nodes,
`BSDF_DIFFUSE`, `BSDF_PRINCIPLED`, `TEX_IMAGE` and `UVMAP`.

Texture export is handled by copying texture files from their original
location to a `textures` folder in the same directory as the USD.
In-memory and packed textures are saved directly to the textures folder.

This patch is based, in part, on code in Tangent Animation's USD
exporter branch.

Reviewed By: sybren, HooglyBoogly

Differential Revision: https://developer.blender.org/D13647
2022-01-27 15:51:50 +01:00
d518550c46 Fix crash on older platform due to unsupported clear command
Clearing using GPU_texture_create_2d for unorm texture needs to use
GPU_DATA_FLOAT to match the conversion requirements.
2022-01-27 15:50:38 +01:00
aa2164da33 Cleanup: Fix const correctness warning 2022-01-27 15:26:43 +01:00
5730668dea Downgrade Python zstandard module to 0.16.0
Downgrade the Python zstandard from 0.17.0 to 0.16.0. The Python package
should be linked against the exact same version of libzstd as Blender is,
otherwise it will refuse to load from within the Blender executable.

Python zstandard 0.17.0 links to 1.5.1, whereas we need 1.5.0.
2022-01-27 15:10:05 +01:00
8a20aec403 CMake/Linux/Python:copy either chardet or charset_normalizer
`chardet` was replaced by `charset_normalizer` for modern `requests`.
With this change, `{make,ninja} install` will also copy the latter into
Blender's install directory.
2022-01-27 15:10:05 +01:00
5400018106 Build: enable Python 3.10 on macOS 2022-01-27 15:03:11 +01:00
6f1ab97c53 Cleanup: Add more const correctness to some functions
These are functions that are used by eevee-rewrite which has more strict
const correctness.
2022-01-27 14:59:37 +01:00
78f29c0467 cmake/windows: Enable Python 3.10 2022-01-27 06:57:25 -07:00
0379ddac7d GPUShaderCreateInfo: Add optionnal check for optimized out resources
This opt-in functionnality enabled developper keep track of unused
resources present in the `GPUShaderCreateInfo` descriptors of their
shaders.

The output is pretty noisy at the moment so we do not enforce its usage.
2022-01-27 10:30:06 +01:00
cf31c4ba18 install_deps: Update OSL to 1.11.17.0 for llvm13 compatibility.
While install_deps tries to stay as close as possible from official
Blender versions of the libraries, it also strives to use as many distro
packages as possible.

OSL 1.11.16.0 is the minimal version that builds with llvm13, which is
the default llvm/clang version in e.g. Debian testing.
2022-01-27 09:06:50 +01:00
a99e43b2b7 install_deps: Update python and deps versions as per T93161/D13922. 2022-01-27 09:06:50 +01:00
5abab0a41a GPUShaderCreateInfo: Remove push_constant indexing
This is too much impractical and offers no real benefit.
2022-01-27 08:54:24 +01:00
a7f7b0b77e Deps builder: Python 3.10.2
Also included:

IDNA 3.2 -> 3.2
Charset Normalizer 2.0.6 -> 2.0.10
UrlLib3 1.26.7 -> 1.26.8
Requests 2.26.0 -> 2.27.1
Cython 0.29.24 -> 0.29.26
ZStandard 0.15.2 -> 0.17.0
Numpy 1.12.2 -> 1.22.0

Reviewed by: brecht
Differential Revision: https://developer.blender.org/D13922
2022-01-26 18:09:50 -07:00
1edf520439 Windows: Retire MSVC 2017 support
The lower bar for building blender
is now MSVC 2019 16.9.16.
2022-01-26 17:56:38 -07:00
0e86c60c28 Geometry Nodes: String to Curves Line/Pivot Point
Adds two new attribute outputs:
"Line" outputs the line number of the character.
"Pivot Point" outputs the selected pivot point position per char.
Some refactoring of the text layout code.

Differential Revision: https://developer.blender.org/D13694
2022-01-26 22:12:50 +01:00
bb1e2a80e4 Cleanup: Workbench: Remove extern shader strings
This is not needed anymore with the new dependency system.
2022-01-26 22:04:49 +01:00
710e46cb2d Cleanup: Move specific node tree execution functions into respective module
`node_exec` had some code that was specific to texture/shader nodes.
These functions  arent used outside there module so limit there declarations.

Also make a function static that is only used in `node_exec.c`

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D13899
2022-01-26 15:29:31 -05:00
cab1f1d9a2 Geometry Nodes: Add or improve various socket descriptions 2022-01-26 14:22:23 -06:00
7b615ca186 Cleanup: Remove RNA data from TreeElement, get via type specific class
The `TreeElement.rnaptr` was only needed for RNA tree-elements. Now it
can be gotten through the new type specific classes, e.g.
`TreeElementRNAProperty.getPointerRNA()`.
2022-01-26 19:15:57 +01:00
9dc0379dc0 Cleanup: Improve function name, introduced in own recent commit
I prefer it this way around now, especially since I'm adding a
`getPointerRNA()` too. Good to keep it match the actual struct names.
2022-01-26 19:15:57 +01:00
f6296e502a Cleanup: Small improvements to Outliner RNA path build function
Smaller cleanups to improve readability of a complex function.
2022-01-26 19:15:57 +01:00
fdd84d36ce Fix incorrect index-key in RNA path built from Outliner
Bug introduced in 7cbcfb7f49.
2022-01-26 19:15:57 +01:00
b57db4b79e Cleanup: Reduce void * reliance of new RNA C++ Outliner elements
Continuation of the previous commit, this time addressing the same for
RNA tree-elements.
2022-01-26 19:15:57 +01:00
fc0dd5583c Cleanup: Reduce void * reliance of new sequencer C++ Outliner elements
Plan is to remove things like `TreeElement.directdata` and to instead
expose specific queries in the new type specific tree-element classes.
e.g. like here: `TreeElementSequence.getSequence()`

For now uses `tree_element_cast<>()` to get the new type specific
tree-element, later these should replace `TreeElement` all together.
2022-01-26 19:15:57 +01:00
08e2885796 Outliner: Function to "cast" C-style TreeElement to typed C++ pendant
Add function to safely request the type-specific C++ element from a
C-style `TreeElement`. Looks like this:
```
TreeElementFoo *te_foo = tree_element_cast<TreeElementFoo>(te);
```
The "cast" will return null if the tree-element doesn't match the
requested type.

This is useful for the transition from the C-style type to the new ones.
2022-01-26 19:15:57 +01:00
da1b6c4c02 Outliner: Port sequencer elements to new tree-element design
Continuation of work started in 2e221de4ce and 249e4df110.

Adds new tree-element classes for sequences, strips and strip
duplicates.
2022-01-26 19:15:57 +01:00
d74c2b5c1f Outliner: Add missing sanity checks for RNA tree-elements
Forgot to add these in 9bce134e56. Also tweaked assert to print a
message that was previously communicated via a comment only.
2022-01-26 19:15:57 +01:00
57dfec79f4 DRW: Fix builtin uniform name mismatch
This lead to severe unreported regression, like volume rendering broken
in workbench.
2022-01-26 19:09:05 +01:00
13f2df3c28 Fix/workaround failing Cycles tests on macOS after ray offset changes
Temporarily blacklist a few tests with overlapping objects as they seem to
give different results on this platform.
2022-01-26 18:52:56 +01:00
489b484b7b Cleanup: GPUShaderShared: Complete vector support
Move some declaration from `GPU_shader_shared.h` to the main
common file and add missing vector declarations.
2022-01-26 18:10:59 +01:00
b42adab3a2 GPUShader: Add GLSL source modification pass to support enums
This uses a light parser / string modification pass to convert
C++ enum declaration syntax to GLSL compatible one.

GLSL having no support for enums, we are forced to convert the
enum values to a series of constant uints.

The parser (not really one by the way), being stupidly simple,
will not change anything to the values and thus make some C++
syntax (like omitting the values) not work.

The string replacement happens on all GLSL files on startup.
I did not measure significant changes in blender startup speed.
There is plans to do all of this at compile time.

We limit the scope of the search to `.h` and `.hh` files to prevent
confusing syntax in `.glsl` files.

There is basic error reporting with file, line and char logging
for easy debuggabiliy.

The requirements to use this enum sharing system are already listed in
`gpu_shader_shared_utils.h` and repeated on top of the preprocessor
function.
2022-01-26 18:10:59 +01:00
e729abb0e2 BLI_string_ref: Add back missing rfind()
Must have been removed in a bad merge or something.
2022-01-26 18:10:59 +01:00
William Leeson
74afc86d4b Cycles: remove ray offsetting
Remove small ray offsets that were used to avoid self intersection, and leave
that to the newly added primitive object/prim comparison. These changes together
significantly reduce artifacts on small, large or far away objects.

The balance here is that overlapping primitives are not handled well and should
be avoided (though this was already an issue). The upside is that this is
something a user has control over, whereas the other artifacts had no good
manual solution in many cases.

There is a known issue where the Blender particle system generates overlapping
objects and in turn leads to render differences between CPU and GPU. This will
be addressed separately.

Differential Revision: https://developer.blender.org/D12954
2022-01-26 17:51:05 +01:00
William Leeson
ae44070341 Cycles: explicitly skip self-intersection
Remember the last intersected primitive and skip any intersections with the
same primitive.

Ref D12954
2022-01-26 17:51:05 +01:00
William Leeson
a9bb460766 Cycles: compute triangle location from barycentric instead of re-intersecting
This is a bit more efficient than what we did before.

Ref D12954
2022-01-26 17:51:05 +01:00
974981a637 Fix T95222: Crash selecting vertices with modifier applied on cage
Caused by 0f89bcdbeb where it was needed for cage and evaluated mesh
to have same behavior in respect of having edit_mesh pointer assigned.
This change makes it so that edit_data is not implied to exist when the
edit_mesh pointer is not null. This was already the case in some other
code.
2022-01-26 17:48:45 +01:00
79927e730e LibOverride: Resync: Do not process overrides that should already have been resynced.
Those cases are almost always synptoms of either bug in code, or broken
files. Re-doin resync on them only costs time and causes extra trash
data as a result, without really helping in any way.
2022-01-26 16:20:08 +01:00
990ed109f2 Fix (unreported) missing 'override-exclusion' flag on new RNA mesh data accessors.
Both new normals (from rBb7fe27314b25) and vpaint (from rBf7bbc7cdbb6c)
RNA arrays were missing the `PROPOVERRIDE_IGNORE`. Those huge blobs of
geometry data should never be processed by liboverride code.
2022-01-26 16:20:08 +01:00
37848d1c8e Assets: enable node group assets
This enables support for node group assets. Previously, node group
assets only worked when the "extended asset browser" experimental
features is enabled.

Differential Revision: https://developer.blender.org/D13748
2022-01-26 15:22:15 +01:00
12b26d21b0 Assets: allow creating preview image by rendering active object
For node groups there is no good default preview generation.
Nevertheless, t would be useful to generate a preview image for a
node group by rendering an object in some cases.

This commit adds a new operator that allows updating the preview
image for the active asset by rendering the active object.
Note, the operator can also be used for other asset types, not just
node groups.

The operator can be found in a menu right below the refresh-preview
button. Currently it is the only operator in that menu. In the future,
more operators to create previews may be added.

Differential Revision: https://developer.blender.org/D13747
2022-01-26 15:10:49 +01:00
6738ecb64e Fix T94900: Fix drawing artifacts sequencer+node editor.
The VSE and node editor only uses an overlay buffer to draw to the screen. The
GPUViewport assumes that platforms clears all textures during creation, but
they do not on selected platforms. What would lead to drawing from
uncleared memory.

This patch fixes this by clearing all viewport textures during creation.
2022-01-26 14:48:28 +01:00
5b299e5999 D13910: Workbench: Port shaders to use GPUShaderCreateInfo
Also adds a few things to GPUShader for easily create shaders.
Heavy usage of macros to compose the createInfo and avoid
duplications and copy paste bugs.
This makes the link between the shader request functions
(in workbench_shader.cc) and the actual createInfo a bit
obscure since the names are composed and not searchable.

Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D13910
2022-01-26 12:46:37 +01:00
9bce134e56 Outliner: Port RNA elements to new tree-element design
Continuation of work started in 2e221de4ce and 249e4df110.

Adds new tree-element classes for RNA structs, properties and array
elements. This isn't exactly a copy and paste, even though logic should
effectively be the same. Further cleanups are included to share code in
a nice way, improve code with simple C++ features, etc.
2022-01-26 11:44:58 +01:00
1bf6a880ab ID: Fix failing test cases.
This fixes failing test cases when using `make test`.
See {D13615} for more information.

The fix will perform the id remapping one item at a time. Although not
really nice, this isn't a bottleneck.

The failing test cases is because space_node stores pointers multiple
times and didn't update all pointers. It was not clear why it didn't do
it, but changing the behavior more to the previous behavior fixes the
issue at hand.

I prefer to remove the double storage of the node tree pointers (in
snode and path) to reduce pointer management complexity.
2022-01-26 11:12:52 +01:00
Jeroen Bakker
a21bca0e20 Performance: Remap multiple items in UI
During sprite fright loading of complex scenes would spend a long time in remapping ID's
The remapping process is done on a per ID instance that resulted in a very time consuming
process that goes over every possible ID reference to find out if it needs to be updated.

If there are N of references to ID blocks and there are M ID blocks that needed to be remapped
it would take N*M checks. These checks are scattered around the place and memory.
Each reference would only be updated at most once, but most of the time no update is needed at all.

Idea: By grouping the changes together will reduce the number of checks resulting in improved performance.
This would only require N checks. Additional benefits is improved data locality as data is only loaded once
in the L2 cache.

It has be implemented for the resyncing process and UI editors.
On an Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz 16Gig the resyncing process went
from 170 seconds to 145 seconds (during hotspot recording).

After this patch has been applied we could add similar approach
to references (references between data blocks) and functionality (tagged deletion).
In my understanding this could reduce the resyncing process to less than a second.
Opening the village production file between 10 and 20 seconds.

Flame graphs showing that UI remapping isn't visible anymore (`WM_main_remap_editor_id_reference`)
* Master {F12769210 size=full}
* This patch {F12769211 size=full}

Reviewed By: mont29

Maniphest Tasks: T94185

Differential Revision: https://developer.blender.org/D13615
2022-01-26 11:12:35 +01:00
b3bf46b78d Revert "CMake: include BROTLI_LIBRARIES in FREETYPE_LIBRARIES on UNIX"
This reverts commit 086f191169.

There was apparently a problem using APPEND which wasn't referenced
in the commit log.

Added comment noting the reason for the discrepancy.
2022-01-26 20:51:04 +11:00
0cb5eae9d0 Gizmo: optimize intersection tests, fix selection bias
Use more efficient logic for detecting when gizmos are under the cursor.
Even though this isn't a bottleneck, it runs on cursor motion in the
3D viewport, so avoiding any lag here is beneficial.

The common case for cursor motion without any gizmos was always
drawing two passes (one small, then again if nothing was found).

Now a single draw call at the larger size is used.

In isolation this gives around 1.2x-1.4x speedup.

When there are multiple gizmos a depth-buffer picking is used
(similar to object / bone selection) which is more involved but
still only performs 2x draw calls since the result is cached for reuse.

See note in gizmo_find_intersected_3d for a more detailed explanation.

Also restore the depth values in the selection result as they're
needed for gizmos to use selection bias.
Broken since support for GL_SELECT was removed.
2022-01-26 17:24:21 +11:00
1758dcd423 Fix T94794: Gizmo selection doesn't pick the front-most gizmo
Early on in 2.8x development gizmo-depth used GL_SELECT,
which has been removed. Bind the depth buffer so occlusion queries
use the front-most gizmo.

While this report only mentions face-maps, gizmo depth was ignored in
all cases. This wasn't noticeable in most cases though since the
transform gizmo for example was placed so gizmos didn't overlap.
2022-01-26 17:21:10 +11:00
9338126ecc Fix error using GPU selection cache for selection picking
When calling GPU_select_cache_begin, checking the selection mode used
the last used selection mode, not the one about to be used.

Using border select, then picking would not use the selection cache.

This wasn't noticeable by users as failing to use cache just completes
the selection without it (drawing the depth buffer unnecessarily).
2022-01-26 17:21:10 +11:00
46ae083113 Fix: OSL not recognizing UVTILE images
The OSL image compilation step needed to be taught about the new UVTILE
format for UDIM textures.

A small missing feature from OIIO[1] means this is a bit uglier than it
needs to be. Once we update to a version of OIIO with the fix we can
remove the string replace part.

[1] 35cb6a83e2

Differential Revision: https://developer.blender.org/D13912
2022-01-25 22:00:23 -08:00
b06fff4737 Cleanup: spelling in comments 2022-01-26 16:06:22 +11:00
94d2a611ec Cleanup: unused variable warning, formatting 2022-01-26 16:01:34 +11:00
37e555d2fe CMake: mark all BROTLI libraries as advanced 2022-01-26 16:01:00 +11:00
086f191169 CMake: include BROTLI_LIBRARIES in FREETYPE_LIBRARIES on UNIX
This was already done for APPLE & WIN32, which would
reference these libraries twice.

Now append BROTLI_LIBRARIES to FREETYPE_LIBRARIES when they're
required for linking.

No functional changes as all references to FREETYPE_LIBRARIES also
used BROTLI_LIBRARIES.
2022-01-26 16:00:55 +11:00
4c951bfa82 CMake: add WITH_SYSTEM_FREETYPE to link against the systems freetype 2022-01-26 15:31:30 +11:00
4530449317 CMake: resolve issues using pre-compiled & system libraries for Unix
When LIBDIR existed, searching for system libraries would always
first search 'LIBDIR'.

This meant "WITH_SYSTEM_*" would still prefer LIBDIR versions of
libraries if they exist.

The presence of LIBDIR also ignored the setting for WITH_STATIC_LIBS
which is now restored to the cached value once pre-compiled libraries
have been handled.
2022-01-26 15:20:32 +11:00
c4bedeb018 GLShader: Fix crash caused by redundant uniform declaration
This slipped through during a rebase.
2022-01-26 00:03:27 +01:00
83094d9a0d Fix T94149: Incorrect sound strip length
Fix formula in function `SEQ_sound_update_length`.

Formula for sound strip length was changed in commit ded68fb102, when
strip is added to timeline, but it was not changed in function
mentioned above.
2022-01-25 23:59:50 +01:00
c1b5cea63a Cleanup: Remove useless comments 2022-01-25 16:54:36 -06:00
b45e71e22c VSE: Build proxies only for slow movies
This change applies only for automatic proxy building, when strip
is added to timeline. Manual building process is not affected.

Don't build proxy file if movie is already fast enough to seek.
To determine seek performance, check if whole GOP can be decoded
in 100 milliseconds.

To consider some variation in GOP size, large number of packets are
read, assuming that each packet will produce 1 frame. While this is not
technically correct, it does give quite accurate estimate of maximum GOP
size.

This test will ensure consistent performance on wide array of machines.
Check should be done in order of few milliseconds.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D11671
2022-01-25 22:06:46 +01:00
597eaeaa11 Deps builder: add VS2019, remove 2013/2015 support
This will allow building most deps with VS2019
SDL has some linker issues that are resolved in
a newer version, but that would be better handled
in a separate change.

VS2013 and VS2015 support which was broken has
been removed.
2022-01-25 13:55:18 -07:00
52b2769b9c Fix T95169: Assert in weld modifier code
Return early before accessing the array when all edges are merged.
2022-01-25 13:56:00 -06:00
c847122096 Cleanup: Remove leftover hair fade code in Cycles
Missed in rB1687903fb813f6656453fbc7c49237b06437370c
2022-01-25 14:14:39 -05:00
1687903fb8 Cleanup: Remove leftover hair fade code in Cycles. 2022-01-25 19:46:10 +01:00
c89d6b0953 Workbench: Use GPU_ARB_gpu_shader5 instead of GL variant
This is to be able to turn off the extension usage on demand.
2022-01-25 18:51:31 +01:00
2637f94358 GLShader: Fix buffer overflow caused by workaround uniform
In order to use a workaround builtin uniform, we need to count it
just like other uniforms and give it some space in the name buffer.

This also fixes extensions being added after the uniform declaration.
All `#extension` directives are now part of the gl backend.
2022-01-25 18:48:58 +01:00
3e2591c83e Cleanup: Remove unused variable
Mistake in a18bd403bf
2022-01-25 11:08:34 -06:00
0ec94d5359 Geometry Nodes: Port weld modifier to the merge by distance node
This commit moves the weld modifier code to the geometry module
so that it can be used in the "Merge by Distance" geometry node
from ec1b0c2014. The "All" mode is exposed in the node
for now, though we could expose the "Connected" mode in the future.

The modifier itself is responsible for creating the selections from
the vertex group. The "All" mode takes an `IndexMask` for the
selection, and the "Connected" mode takes a boolean array,
since it actually iterates over all edges.

Some disabled code for a BVH mode has not been copied over,
it's still accessible through the patches and git history anyway,
and it made the port slightly simpler.

Differential Revision: https://developer.blender.org/D13907
2022-01-25 11:07:31 -06:00
932d8dba52 Point Cloud: expose in Python API for release, now that Cycles uses it
Previously it was only part of experimental features in beta, however now
renderers can render point clouds generated by geometry nodes. Adding or
converting a point cloud object directly is still hidden by default, since
there is no good way to edit it.
2022-01-25 18:03:52 +01:00
ec1b0c2014 Geometry Nodes: Initial merge by distance node
This implements a merge by distance operation for point clouds.
Besides the geometry input, there are two others-- a selection
input to limit the operation to certain points, and the merge
distance. While it would be a reasonable feature, the distance
does not support a field currently, since that would make
the algorithm significantly more complex.

All attributes are merged to the merged points, with the values
mixed together. This same generic method is used for all attributes,
including `position`. The `id` attribute uses the value from the
first merged index for each point.

For the implementation, most of the effort goes into creating a
merge map to speed up attribute mixing. Some parts are inherently
single-threaded, like finding the final indices accounting for the
merged points. By far most of the time is spend balancing the
KD tree.

Mesh support will be added in the next commit.

Differential Revision: https://developer.blender.org/D13649
2022-01-25 10:51:52 -06:00
97a023a0d5 Cycles: Reorganize Acceleration Structure UI panel.
Only show options that are valid for the used device (CPU, GPU, Multi).

Note: The panel isn't shown for OPTIX anymore, unless Multi device is used.

Reference: https://developer.blender.org/D13592
2022-01-25 17:33:41 +01:00
e2a36a6e45 Cycles: Make Embree compact BVH optional
Make the Embree RTC_SCENE_FLAG_COMPACT flag optional and enabled per default.
Disabling it makes CPU rendering a bit faster in some scenes at the cost of a higher memory usage.

Barbershop renders about 3% faster, victor about 4% on CPU with compact BVH disabled.

Differential Revision: https://developer.blender.org/D13592
2022-01-25 17:22:08 +01:00
f26c36c96b make.bat: unify python detection
Several sub commands tried on their own
to locate python, given I wanted to look
in several locations for a broader libdir
compatibility this is best done in a
central location.

Python 3.9 is still preferred, but if
3.10-3.12 are available that be accepted
as well.

note: this is about the python version
make.bat uses to run various python helper
scripts, this change has no influence on
the python version blender itself uses.
2022-01-25 09:19:03 -07:00
c813a1b358 Cycles: add Point Info node
With (center) position, radius and random value outputs.

Eevee does not yet support rendering point clouds, but an untested
implementation of this node was added for when it does.

Ref T92573
2022-01-25 17:14:20 +01:00
eab066cbf2 VSE: Use timecodes by default
Movies with variable frame rate can cause mismatch of displayed frame
when proxies are used. Since proxies are not used for rendering, this
means, that output may be different than expected. This problem can be
avoided when timecodes are used.

Set used timecode to Record Run. Timecodes are built with proxies at
the same time, therefore if proxies are built and used this will
resolve possible mismatch of output.

Record run is chosen, because it will show frames based on time they
were encoded by encoder and should match behavior as if movie was
played back at normal speed. This change is done only for new strips
in order to not overwrite user defined settings.

Other minor changes:
- When proxies are enabled, size 25% is no longer set by default. It was mostly annoying anyway.
- Silence warning when timecode file is not present. This was introduced in 4adbe31e2f.
  Previously use of timecodes was hard-coded in sequencer and this error would spam console if timecodes would be
  enabled by default and proxies would be never built.

ref: T95093

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D13905
2022-01-25 17:07:11 +01:00
Michael
2ed73fc97e Fix T94237: Glitch when copying unaligned ffmpeg buffer
Using a negative linesize to flip an image vertically is supported in
ffmpeg but not for every function.

This method treats frames that need and those that do not need alignment
the same. An RGBA frame buffer with alignment that ffmpeg decides is
optimal for the CPU and build options is allocated by ffmpeg.
The `sws_scale` does the colorspace transformation into this RGBA frame
buffer without flipping. Now the image is upside down and aligned.
The combined unaligning and vertical flipping is then done by
`av_image_copy_to_buffer` which seems to handle negative linesize
correctly.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D13908
2022-01-25 17:07:11 +01:00
a18bd403bf Nodes: Improve link-drag search support for boolean math node
List the operations in the search instead of the "Boolean" socket names.
2022-01-25 09:51:20 -06:00
96667e3391 Fix T93058: Crash on opening old pre-2.80 .blend files.
Layer resync code would not yet fully properly deal with all possible
invalid status of ViewLayer comming from those older files.

Now put 2.80-doversion specific fixes into their own dedicated
function, so that they do not affect actual regular layer resync code
anymore. Also added some sanity-checks in main
`BKE_layer_collection_sync` code.
2022-01-25 16:44:55 +01:00
6c25aabddf GLShader: Fix fallback to gl_BaseInstance
All `#entension` directives needs to be first before any other
token. Add missing `;` after uniform declaration.
2022-01-25 16:23:54 +01:00
0477ca75f0 CMake/Linux: only link to brotli when using static precompiled libraries
The Brotli library only needs to be explicitly linked when using the
statically linked libraries. When using system libs they're shared, and
the .so loading mechanism takes care of dependencies.
2022-01-25 16:18:59 +01:00
Hallam Roberts
14f6afb090 Geometry Nodes: Expand the Boolean Math node
Currently the Boolean Math node only has 3 basic logic gates:
AND, OR, and NOT. This commit adds 6 additional logic gates
for convenience and ease of use.

- **Not And (NAND)** returns true when at least one input is false.
- **Nor (NOR)** returns true when both inputs are false.
- **Equal (XNOR)** returns true when both inputs are equal.
- **Not Equal (XOR)** returns true when both inputs are different.
- **Imply (IMPLY)** returns true unless the first input is true and
  the second is false.
- **Subtract (NIMPLY)** returns true when the first input is true and
  the second is false.

Differential Revision: https://developer.blender.org/D13774
2022-01-25 09:09:39 -06:00
368bfa80f9 Fix: Build issue with MSVC + Python 3.10
ssize_t is a posix type pyconfig.h previously
supplied for MSVC, it appears to have stopped
doing this in the python 3.10 headers.

Py_ssize_t is the type of the field this macro
actually returns, so best to to use that in our
code as well.
2022-01-25 07:54:28 -07:00
460e0a1347 Revert "Performance: Remap multiple items in UI"
This reverts commit 948211679f.
This commit introduced some regressions in the test suite.
As this change is a core part of blender Bastien and I decided to revert
it as the solution isn't clear and needs more investigation.

The following tests FAILED:
	 62 - blendfile_liblink (SEGFAULT)
	 63 - blendfile_library_overrides (SEGFAULT)

It fails in (id_us_ensure_real)
2022-01-25 15:31:46 +01:00
33ba298b5d GPUShader: Add optionnal single shader stage interface for in and out
This makes optionnal the use of a different interface for the geometry
shader stage output. When the vertex and geometry interface instance name
matches, a `_in` and `_out` suffix is added to the end of the instance name.

This makes it easier to have optional geometry shader stages.

# Conflicts:
#	source/blender/gpu/intern/gpu_shader_create_info.hh
2022-01-25 15:08:11 +01:00
Jeroen Bakker
948211679f Performance: Remap multiple items in UI
During sprite fright loading of complex scenes would spend a long time in remapping ID's
The remapping process is done on a per ID instance that resulted in a very time consuming
process that goes over every possible ID reference to find out if it needs to be updated.

If there are N of references to ID blocks and there are M ID blocks that needed to be remapped
it would take N*M checks. These checks are scattered around the place and memory.
Each reference would only be updated at most once, but most of the time no update is needed at all.

Idea: By grouping the changes together will reduce the number of checks resulting in improved performance.
This would only require N checks. Additional benefits is improved data locality as data is only loaded once
in the L2 cache.

It has be implemented for the resyncing process and UI editors.
On an Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz 16Gig the resyncing process went
from 170 seconds to 145 seconds (during hotspot recording).

After this patch has been applied we could add similar approach
to references (references between data blocks) and functionality (tagged deletion).
In my understanding this could reduce the resyncing process to less than a second.
Opening the village production file between 10 and 20 seconds.

Flame graphs showing that UI remapping isn't visible anymore (`WM_main_remap_editor_id_reference`)
* Master {F12769210 size=full}
* This patch {F12769211 size=full}

Reviewed By: mont29

Maniphest Tasks: T94185

Differential Revision: https://developer.blender.org/D13615
2022-01-25 14:51:44 +01:00
Jeroen Bakker
3f42417cd4 Draw: Migrate hair refine compute shader to use create info.
This patch migrates the draw manager hair refine compute shader to use
GPUShaderCreateInfo.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D13915
2022-01-25 14:46:45 +01:00
196da819ba Python: Expose crazyspace correction functionality via RNA
Allows to perform correction of coordinate delta/displacement in a
similar way of how sculpt mode handles sculpting on a deformed mesh.
An example of usecase of this is allowing riggers and sciprters to
improve corrective shapekey workflow.

The usage consists of pre-processing and access. For example:

  object.crazyspace_eval(depsgraph, scene)

  # When we have a difference between two vertices and want to convert
  # it to a space to be stored, say, in shapekey:
  delta_in_orig_space = rigged_ob.crazyspace_displacement_to_original(
      vertex_index=i, displacement=delta)

  # The reverse of above.
  delta_in_deformed_space = rigged_ob.crazyspace_displacement_to_deformed(
      vertex_index=i, displacement=delta)

  object.crazyspace_eval_clear()

Fuller explanation with actual usecases and studio examples are written in
the comment:

  https://developer.blender.org/D13892#368898

Differential Revision: https://developer.blender.org/D13892
2022-01-25 14:43:44 +01:00
31296f6f9d CMake/Linux: Fix Brotli library finding on standard distros.
Brotli seems to add a custom postfix to its static libraries by default,
but in Debian at least libraries are just named the same for both shared
and static versions, as usual.

So add standard name after static-specific ones.

Follow-up to rB4c617c06e9cb and rBa000de7c2a4d.
2022-01-25 14:34:33 +01:00
0f89bcdbeb Fix depsgraphs sharing IDs via evaluated edit mesh
The evaluated mesh is a result of evaluated modifiers, and referencing
other evaluated IDs such as materials.
It can not be stored in the EditMesh structure which is intended to be
re-used by many areas. Such sharing was causing ownership errors causing
bugs like

  T93855: Cycles crash with edit mode and simultaneous viewport and final render

The proposed solution is to store the evaluated edit mesh and its cage in
the object's runtime field. The motivation goes as following:

- It allows to avoid ownership problems like the ones in the linked report.
- Object level is chosen over mesh level is because the evaluated mesh
  is affected by modifiers, which are on the object level.

This patch allows to have modifier stack of an object which shares mesh with
an object which is in edit mode to be properly taken into account (before
the change the modifier stack from the active object will be used for all
objects which share the mesh).

There is a change in the way how copy-on-write is handled in the edit mode to
allow proper state update when changing active scene (or having two windows
with different scenes). Previously, the copt-on-write would have been ignored
by skipping tagging CoW component. Now it is ignored from within the CoW
operation callback. This allows to update edit pointers for objects which are
not from the current depsgraph and where the edit_mesh was never assigned in
the case when the depsgraph was evaluated prior the active depsgraph.

There is no user level changes changes expected with the CoW handling changes:
should not affect on neither performance, nor memory consumption.

Tested scenarios:

- Various modifiers configurations of objects sharing mesh and be part of the
  same scene.

- Steps from the reports: T93855, T82952, T77359

This also fixes T76609, T72733 and perhaps other reports.

Differential Revision: https://developer.blender.org/D13824
2022-01-25 14:32:23 +01:00
c5980ada4f GPU: Add GPU_shader_create_from_info_name
This function will be used as the way to build shaders from
create_infos. The previous used method was using a private function.
2022-01-25 14:22:44 +01:00
Kevin C. Burke
17b0c06946 Animation: Equalize Handle Operator
The Equalize Handles operator allows users to make selected handle
lengths uniform: either respecting their original angle from the key
control point or by flattening their angle (removing the overshoot
sometimes produced by certain handle types).

Design: T94172

Reviewed by: sybren

Differential Revision: https://developer.blender.org/D13702
2022-01-25 11:41:40 +01:00
a000de7c2a CMake/Linux: find Brotli library the proper way
Use a `FindBrotli.cmake` module instead of manually appending library
paths.

This is just for Linux; Windows and macOS will be reviewed separately.
2022-01-25 11:34:13 +01:00
a54142f3f1 Cleanup: Replace reinterp cast with static cast.
Conversion of void* should not use the unsafe reinterp cast.
2022-01-25 10:18:32 +01:00
1b1693d43f Fix (unreported) RNA setter for TextEditor's text ID pointer not ensuring real user. 2022-01-25 09:12:13 +01:00
2e9b8689e4 Fix T95037: Allow making local IDs that are not used by anything.
Some IDs (like text ones) can be linked and only kept around thanks to
editors, allow making such IDs local in `BKE_lib_id_make_local_generic`.

Also refactor logic checking whether ID should be made directly local or
copied into its own util function, so that we can remain sure all
special-cases 'make local' code still uses the same logic here.
2022-01-25 09:12:13 +01:00
a2301b1d91 Geometry Nodes: Add description to curve handle input node
The "Relative" input isn't immediately obvious unless one is familar
with that naming pattern, so an explicit description may be helpful.
2022-01-25 00:04:33 -06:00
114b06b3cb Cleanup: Remove unused pixel buffer in read_render_tile
A left over remnant from rB1a134c4c30a643ada1b9a7a037040b5f5c173a28

Differential Revision: https://developer.blender.org/D13901
2022-01-24 20:53:19 -08:00
2bf519d211 Cleanup: Correct location of node function declarations
Currently there are many function declarations in `BKE_node.h` that
don't actually have implementations in blenkernel. This commit moves
the declarations to `NOD_composite.h`, `NOD_texture.h`, and
`NOD_shader.h` instead. This helps to clarify the purpose of the
different modules.

Differential Revision: https://developer.blender.org/D13869
2022-01-24 16:18:30 -06:00
4d799db72f LShaderInterface: Fix interface binding with UBO containing arrays
To avoid the issue we search using the name in the `name_buffer_` which
already have the array suffix stripped out.
2022-01-24 21:25:53 +01:00
5a0c5912a4 Tests: Enable new tests for geometry nodes extrude node
rB95981c9876483256b28
2022-01-24 13:55:32 -06:00
083de503ce GLShaderInterface: Fix interface from createInfo not setting bindings
This is because the `glUniform1i` calls were not preceeded by `glUseProgram`
which made parameters not stick.
2022-01-24 20:26:33 +01:00
04c3b08518 Fix T94355: Cycles wrong GPU bake with adaptive sampling 2022-01-24 19:18:11 +01:00
263f862ba5 Add workaround for broken interface query functions on Intel HD Graphics 4400 and 4600
Fixes T93680

For current drivers of Intel HD Graphics 4400 and 4600, various Program Introspection functions appear broken and return incorrect values, causing crashes in the current handling of SSBOs. Disable use of this feature on those devices. Add checks to features that use SSBOs (Hair and Subdivision Modifier).

Reviewed By: fclem, jbakker

Maniphest Tasks: T93680

Differential Revision: https://developer.blender.org/D13806
2022-01-24 18:48:16 +01:00
e2337b5342 GPU subdiv: reduce memory usage for point IBO
The point IBO should only have data for coarse vertices (or in general,
the vertices in the original mesh). As it used for displaying the
vertices for selection in edit mode, and as it indexes into the VBOs for
the positions and edit data, it is itself only indexed by coarse/
original vertex index.

For the subdivision case, this would allocate space for the final
subdivision vertex and reallocate to make room for loose geometry,
although only the first coarse vertex count amount of data would be.

Now just allocate for the required memory. Also reuse index buffer APIs
instead of doing manual work.
2022-01-24 18:42:37 +01:00
90d61600fc GPU subdiv: fix unitialized data 2022-01-24 18:27:05 +01:00
Jens Ehrhardt
e673cfc2d7 Fix T95099: Have launcher wait for Blender exit
unity launches blender in background mode to do some
file conversions, ever since the launcher got introduced
this process broke.

The root cause here is: Unity looks up the default program
to launch .blend files with, which is now the launcher, then
launches it in background mode with a script to export the data.

The launcher however was designed to exit as quickly as
possible so there would not be an extra background process
lingering. It does not wait for blender to exit and does not
pass back any error codes.

This broke unity's workflow since it assumed if the process
exits and succeeds the data *must* be ready for reading which
no longer holds true.

This change keeps the launcher design as was previously,
*except* when launching in background mode, then it
waits and passes back any error codes, thus restoring
unity's workflow.

Differential Revision: https://developer.blender.org/D13894
Reviewed by: LazyDodo, Brecht
2022-01-24 08:43:38 -07:00
25fa5792e6 Cleanup: Move the "toggle smooth brush" functionality to functions
This is so it will be easier to keep the logic to toggle on/off in sync
because they are declared close to eachother.
2022-01-24 16:00:01 +01:00
a215d7e230 Hook up invert and smooth mode to weight and vertex paint
Previously weight paint wasn't hooked up to the "Smooth" and "Invert" modes.
With this patch it is not possible to use the "Smooth" and "Invert"
modifiers for the draw keybindings.

Reviewed By: Campbell Barton

Differential Revision: http://developer.blender.org/D13857
2022-01-24 16:00:01 +01:00
0928fe8710 Fix T94651: Cycles error with pointcloud vector attribute 2022-01-24 15:58:32 +01:00
4c617c06e9 Linux/CMake: link libbbrotli*.a along with new FreeType
Add `libbrotlidec-static.a` and `libbrotlicommon-static.a` to the CMake
`$FREETYPE_LIBRARIES` variable; they'll be required when the Linux libs
for the FreeType upgrade lands (D13448).

The order of libraries is different compared to the similar lines in the
Windows and Apple CMake files, to prevent linker errors on Linux.
2022-01-24 15:44:03 +01:00
796ef560b4 Fix Image.gl_touch not loading image.
Same fix as for {rBc09f61a9157ddee0e186db52fb7ac0f4cdae09da}
2022-01-24 15:32:04 +01:00
578baf95e0 Cleanup: Remove unused enum
The `SCULPT_TRANSFORM_DISPLACEMENT_INCREMENTAL` value is not actually
being used.

Keeping it in the code only complicates its readability.
2022-01-24 10:18:34 -03:00
e774f2c901 GPUShaderCreateInfo: Add manual validation of bindpoints
Some drivers/glsl compilers will not warn about multiple resources using
the same binding, creating silent errors.

This patch checks for this case and outputs a descriptive error message if
a particular createInfo merge error is founds.

Other validation can be added later.
2022-01-24 13:28:33 +01:00
7708a848c9 Cleanup: sort cmake file lists 2022-01-24 21:23:30 +11:00
4b1f243e4d Cleanup: sort struct forward declarations 2022-01-24 21:16:06 +11:00
f9b6a257bd Cleanup: clang-format 2022-01-24 21:15:25 +11:00
95981c9876 Geometry Nodes: Extrude Mesh Node
This patch introduces an extrude node with three modes. The vertex mode
is quite simple, and just attaches new edges to the selected vertices.
The edge mode attaches new faces to the selected edges. The faces mode
extrudes patches of selected faces, or each selected face individually,
depending on the "Individual" boolean input.

The default value of the "Offset" input is the mesh's normals, which
can be scaled with the "Offset Scale" input.

**Attribute Propagation**
Attributes are transferred to the new elements with specific rules.
Attributes will never change domains for interpolations. Generally
boolean attributes are propagated with "or", meaning any connected
"true" value that is mixed in for other types will cause the new value
to be "true" as well. The `"id"` attribute does not have any special
handling currently.

Vertex Mode
 - Vertex: Copied values of selected vertices.
 - Edge: Averaged values of selected edges. For booleans, edges are
   selected if any connected edges are selected.
Edge Mode
 - Vertex: Copied values of extruded vertices.
 - Connecting edges (vertical): Average values of connected extruded
   edges. For booleans, the edges are selected if any connected
   extruded edges are selected.
 - Duplicate edges: Copied values of selected edges.
 - Face: Averaged values of all faces connected to the selected edge.
   For booleans, faces are selected if any connected original faces
   are selected.
 - Corner: Averaged values of corresponding corners in all faces
   connected to selected edges. For booleans, corners are selected
   if one of those corners are selected.
Face Mode
 - Vertex: Copied values of extruded vertices.
 - Connecting edges (vertical): Average values of connected selected
   edges, not including the edges "on top" of extruded regions.
   For booleans, edges are selected when any connected extruded edges
   were selected.
 - Duplicate edges: Copied values of extruded edges.
 - Face: Copied values of the corresponding selected faces.
 - Corner: Copied values of corresponding corners in selected faces.
Individual Face Mode
 - Vertex: Copied values of extruded vertices.
 - Connecting edges (vertical): Average values of the two neighboring
   edges on each extruded face. For booleans, edges are selected
   when at least one neighbor on the extruded face was selected.
 - Duplicate edges: Copied values of extruded edges.
 - Face: Copied values of the corresponding selected faces.
 - Corner: Copied values of corresponding corners in selected faces.

**Differences from edit mode**
In face mode (non-individual), the behavior can be different than the
extrude tools in edit mode-- this node doesn't handle keeping the back-
faces around in the cases that the edit mode tools do. The planned
"Solidify" node will handle that use case instead. Keeping this node
simpler and faster is preferable at this point, especially because that
sort of "smart" behavior is not that predictable and makes less sense
in a procedural context.

In the future, an "Even Offset" option could be added to this node
hopefully fairly simply. For now it is left out in order to keep
the patch simpler.

**Implementation**
For the implementation, the `Mesh` data structure is used directly
rather than converting to `BMesh` and back like D12224. This optimizes
for large extrusion operations rather than many sequential extrusions.
While this is potentially more verbose, it has some important benefits:
First, there is no conversion to and from `BMesh`. The code only has
to fill arrays and it can do that all at once, making each component of
the algorithm much easier to optimize. It also makes the attribute
interpolation more explicit, and likely faster. Only limited topology
maps must be created in most cases.

While there are some necessary loops and allocations with the size of
the entire mesh, I tried to keep everything I could on the order of the
size of the selection rather than the size of the mesh. In that respect,
the individual faces mode is the best, since there is no topology
information necessary, and the amount of work just depends on the size
of the selection.

Modifying an existing mesh instead of generating a new one was a bit
of a toss-up, but has a few potential benefits:
 - Avoids manually copying over attribute data for original elements.
 - Avoids some overhead of creating a new mesh.
 - Can potentially take advantage of future ammortized mesh growth.
This could be changed easily if it turns out to be the wrong choice.

Differential Revision: https://developer.blender.org/D13709
2022-01-23 22:42:49 -06:00
46475b8e11 Cleanup: Grammar: its self vs. itself 2022-01-23 22:34:56 -06:00
43e3a33082 Cleanup: spelling in comments 2022-01-24 14:35:23 +11:00
c69a581c0b Cleanup: avoid positional struct initialization
When moving to C++ field for initialization was removed.
Favor assignments to field names as it reads better and avoids bugs if
files are ever re-arranged as well as mistakes (see T94784).

Note that the generated optimized output is identical with GCC11.
2022-01-24 14:27:16 +11:00
abf30007ab Geometry Nodes: Triangulate Node - Add Selection Input
This adds a selection field input to the node, faces that are selected and
meet the minimum vertex count threshold will be triangulated.

Differential Revision: https://developer.blender.org/D13804
2022-01-23 13:27:53 -06:00
38c7378949 Geometry Nodes: Relative Handle Position Mode
Add a boolean option to have the Curve Handle Position input node return the
position of the handle relative to each point position.

Differential Revision: https://developer.blender.org/D12947
2022-01-23 12:29:37 -06:00
807c58aae4 Cleanup: separate function for Alembic edge crease reading 2022-01-23 16:35:11 +01:00
889712927f Fix Cycles crash collecting render stats 2022-01-23 16:30:57 +01:00
5c4a5fd40d Cleanup: Improvements to mesh to bmesh conversion
- Use `Array` and `Span` instead of raw pointers.
- Declare variables in smaller scope.
- Use references instead of pointers.
2022-01-22 18:09:30 -06:00
6cd977b903 Fix T94760: Crash building BMesh when opening file
A large polygon in the file from the report caused `alloca`
to exceed the maximum stack size, causing a crash.  Instead
of using `alloca`, use `blender::Array` with an inline buffer.

Based on a patch by Germano Cavalcante (@mano-wii).

Differential Revision: https://developer.blender.org/D13898
2022-01-22 13:06:15 -06:00
dde997086c LineArt: Option to keep contour when using face mark filtering.
When enabled, it will keep contour around the object instead of hide them by rule of face mark,
so the object can always have full contour while filtering out some of the feature lines inside certain regions.

Reviewed By: Antonio Vazquez (antoniov), Aleš Jelovčan (frogstomp)

Differential Revision: https://developer.blender.org/D13847
2022-01-22 16:57:25 +08:00
579e8ebe79 LineArt: Back face culling
Option to discard back faced triangles, this speeds up calculation especially for when you only want to show visible feature lines.

Reviewed By: Antonio Vazquez (antoniov), Aleš Jelovčan (frogstomp)

Differential Revision: https://developer.blender.org/D13848
2022-01-22 16:41:08 +08:00
5ae76fae90 LineArt: Noise tolerant chaining.
Instead of splitting it at each occlusion change, it tolerates short segments of "zig-zag" occlusion incoherence and doesn't split the chain at these points, thus creating a much smoother result.

Reviewed By: Antonio Vazquez (antoniov), Aleš Jelovčan (frogstomp)

Differential Revision: https://developer.blender.org/D13851
2022-01-22 16:13:44 +08:00
e88d966737 BMesh: merge normal and tessellation calculation on undo
This gives a modest speedup as calculating tessellation and face
normals at the same time can be more efficiently multi-threaded.

Also avoids calculating face normals twice,
oversight in d590e223da.
2022-01-22 18:02:12 +11:00
25c99e72cd Fix linking in debug mode
b7878a4d45 seems to have caused linking
issues building debug mode on Linux.

Using extern "C" resolves.
2022-01-22 17:59:09 +11:00
b7878a4d45 Cleanup: Move bmesh_mesh_convert.c to C++
Useful for a simpler bug fix, code clarity,
and easier possible optimizations in the future.
2022-01-21 23:53:15 -06:00
Aras Pranckevicius
9350005d8b Fix T13879 new OBJ exporter not saving files with Unicode characters.
Need to use BLI_fopen instead of fopen.
2022-01-21 20:14:01 -05:00
1f026a3db9 Cleanup: Use references, const variables 2022-01-21 18:20:07 -06:00
Laurynas Duburas
45d038181a Curves: Improve accuracy and clarity of NURBS knots calculation
This commit improves NURBS knot generation by adding proper support
for the combination of the Bezier and cyclic options. In other cases
the resulting knot doesn't change. This cyclic Bezier knot is used to
create accurate accurate "Nurbs Circle", "Nurbs Cylinder" primitives.
"Nurbs Sphere" and "Nurbs Torus" primitives are also improved by
tweaking the spin operator.

The knot vector in 3rd order NURBS curve with Bezier option turned on
(without cyclic) is changed in comparison to previous calculations,
although it doesn't change the curve shape itself.

The accuracy of the of NURBS circle is fixed, which can be checked by
comparing with mesh circle. Tessellation spacing differences in
circular NURBS is also fixed, which is observable with the NURBS
cylinder and sphere primitives. These were causing seam-like effects.

This commit contains comments from Piotr Makal (@pmakal).

Differential Revision: https://developer.blender.org/D11664
2022-01-21 16:40:49 -06:00
d590e223da Fix T94974: Invalid normals in edit mode
Normal layers currently aren't stored in the undo step
mesh storage, since they are not stored in files at all.
However, the edit mesh expects normals to be fully
calculated, and does not keep track of a dirty state.
This patch updates the normals in the BMesh created
by loading an undo step.

Another option would be calculating the normals on
the undo mesh first, which might be better if Mesh
normal calculation is faster than BMesh calculation,
but the preferred method to access vertex normals fails
in this case, because the mesh runtime mutexes are not
initialized for undo-state meshes.

Differential Revision: https://developer.blender.org/D13859
2022-01-21 16:14:00 -06:00
68aa35ae74 Fix T94967: Sculpt mode crashes with missing normals
From an error in rBcfa53e0fbeed, the vertex normals in `SculptSession`
seem to be used, but in the case when no "pbvh" is used, the value of
the pointer is never assigned.

Normals were not generally dirty before this "ensure" function with
regular sculpting operations, so this addition shouldn't have any cost.

Differential Revision: https://developer.blender.org/D13854
2022-01-21 16:12:12 -06:00
294ab84909 Fix T95097: Attribute Capture node UI inconsistency
All other nodes with data type and domain choices have the domain
below the data type. Generally that order makes sense, because it's
consistent with nodes that have no domain drop-down.
2022-01-21 16:08:21 -06:00
1c23a06706 Fix: Applying object transform can create normal layers
Because this operator is used on original objects, it's best to tag
the normals dirty instead of explicitly calculating them, to avoid
unnecessarily storing normal layers on an original object (since
they might have to be recalculated during evaluation anyway).
There may be other places this change is helpful, but being
conservative is likely better for now.

Related to T95125
2022-01-21 16:04:16 -06:00
e07b217669 Build: update macOS for FreeType library with woff2 support
Ref D13448, T93161
2022-01-21 21:36:00 +01:00
32ceb0b807 Fix std::optional value() build error on older macOS SDK
No longer happens on the buildbot, but for users building with an older
Xcode we still need to avoid using value().
2022-01-21 21:36:00 +01:00
4f9be46526 Distribute Points on Faces: Fix missing minimum value for density socket
Negative number density is not a part of this reality.
2022-01-21 15:31:51 -05:00
54d69a2fd1 Fix new OBJ exporter to handle instancing.
The new OBJ exporter did not handle object instances.
The fix is to use a dependency graph iterator, asking for instances.
Unfortunately that iterator makes a temporary copy of instance objects
that does not persist past the iteration, but we need to save all the
objects and meshes to write later, so the Object has to be copied now.

This changed some unit tests. Even though the tests don't have instancing,
the iterator also picks up some Text objects as Mesh ones (which is a good
thing), resulting in two more objects in the all_objects.obj file output.
2022-01-21 14:37:33 -05:00
9d274a609c cmake/win: Platform update for freetype 2.11.0
freetype now depends on brotli
2022-01-21 11:40:53 -07:00
58f8eb54a3 deps/win: fix typo in brotli.cmake
it was harvesting to the zstd folder which
is not where these libs ought to be.
2022-01-21 11:36:56 -07:00
RUben
5b90c046d5 Fix: Object selection delay with many objects
With object collection properties open there was a huge delay when
switching active objects in a large scene, (~10k objects, ~5m vertices).
This is due to a non-optimal function to query all the collections the object is in.

To solve this the code can be simplified by using `bpy.types.Object.users_collection`
This returns all the collections the object is in removing the need to compute this in python.
2022-01-21 13:13:04 -05:00
c20f209b1c Cmake/Deps: Freetype 2.11.0 / brotli 1.0.9
The UI team requested adding woff2 support to freetype.
this required a new dependency brotli.

This changes adds brotili to the builder and bumps
freetype to version 2.11.0

As freetype now depends on other libraries, for consistency
all use of ${FREETYPE_LIBRARY} in cmake has been updated to
use ${FREETYPE_LIBRARIES} adjustments have been made in the
windows platform file, all other platforms use cmake's
FindFreeType.cmake which already sets this variable.

reviewed by: brecht

Differential Revision: https://developer.blender.org/D13448
2022-01-21 10:26:05 -07:00
59fc95bf97 UI: Clarify Active Movie Clip tooltip
See T92299
2022-01-21 12:02:34 -05:00
d034b85f33 Geometry Nodes: new Scale Elements nodes
This node can scale individual edges and faces. When multiple selected
faces/edges share the same vertices, they are scaled together.
The center and scaling factor is averaged in this case.

For some examples see D13757.

Differential Revision: https://developer.blender.org/D13757
2022-01-21 17:34:47 +01:00
Alan Babu
c39d514a4e Geometry Nodes: Flip Faces Node
Currently there is no way to flip normals in geometry nodes. This node
makes that possible by flipping the winding order of selected faces.
The node is purposely not called "Flip Normals", because normals are
derived data, changing them is only a side effect. The real change is
that the vertex and edge indices in the face corners of every selected
polygon are reversed, and face corner attribute data is reversed.

While there are existing utilities to flip a polygon and its custom
data, this node aims to process an attribute's data together instead
of processing all attributes separately for each index.

Differential Revision: https://developer.blender.org/D13809
2022-01-21 09:26:40 -06:00
4251455dcd Geometry Nodes: Mesh Island Node - Rename Index Socket
Rename 'Index' Socket to 'Island Index' to make it more consistent with
'Island Count'

Differential Revision: https://developer.blender.org/D13893
2022-01-21 09:01:18 -06:00
87c5423c5e Geometry Nodes: New Output for Number of Mesh Islands
Adds a second output to the Mesh Islands node that shows the total
number of islands as a field.

Differential Revision: https://developer.blender.org/D13700
2022-01-21 08:30:02 -06:00
Brecht Van Lommel
d68ce0e475 Cycles: add pointcloud implementation for Metal RT
This is not currently working, with an internal compiler error. However
we are currently using BVH2 instead of Metal RT. So this has no effect for
users, it's being committed to avoid the code getting outdated.

Ref T92573, T92212

Differential Revision: https://developer.blender.org/D13632
2022-01-21 14:42:27 +01:00
5e51a5e8a4 Fix error in previous commit. 2022-01-21 14:35:27 +01:00
93065a67c6 GPU: Disable create info for 2d image overlay merge.
This shader needs to use the same interface as the OCIO shader. On Linux
and Windows this seems to be the case. On MacOS however there is a
mismatch that makes the overlay texture to be completely black when
switching to workbench in the Shader workspace.

This is just a temporarily work-around as this should be solved. Due to
the poor GPU debugging facilities on Mac we haven't been able to
pin-point the root cause.
2022-01-21 14:24:30 +01:00
f6888b530a Attributes: add operator to convert generic attributes to other types
Editing of generic attributes on the original objects in edit modes is
still very limited. However, when applying a geometry nodes modifier
that generates new attributes. These attributes will show up in the
Attributes panel.

Currently, our exporters are not capable of exporting generic attributes.
Therefore, for the time being, a work around is to apply geometry nodes
and then convert a generic attribute to a task specific attribute like a
uv map, vertex group or vertex color layer. Once more parts of Blender
support generic attributes, this will become less important.

Currently, only meshes are supported by the operator. However, it would
be relatively easy to extend it to other geometry types.

Differential Revision: https://developer.blender.org/D13838
2022-01-21 12:47:35 +01:00
36c40760a5 .obj: simplify templates in FileHandler, add comments
- Remove redundant template from `FormattingSyntax`.
- Replace one enable_if with static assert for readability
- Add comments

No functional change expected.

Reviewed by: jacqueslucke
Differential Revision: https://developer.blender.org/D13882
2022-01-21 15:28:04 +05:30
23fa5bb723 GPU: Remove unused resources in shader create info.
When adding the shader create infos some additional resources where defined
that doesn't exist in the shader itself. This commit will remove them.
2022-01-21 09:58:58 +01:00
64196a6b29 Cleanup: struct/class mismatch. 2022-01-21 07:52:10 +01:00
872dc1038c UI: exclude "Undo History" from menu search
Undo history was showing in menu search since converting undo history to
a menu from a popup, see: 0e1bb232e6.
2022-01-21 16:30:11 +11:00
53923f502d Fix T95078: Setting digits as modifier in keymap doesn't work
Allow any non-modifier keyboard events to be used.

Note that the existing check for >= EVT_AKEY allowed NDOF and other
non-keyboard events (including modifiers, which didn't work).
2022-01-21 15:20:02 +11:00
20655128c9 Cleanup: event type values & defines
- Use defines instead of magic numbers for F-Key & NDOF range checks.
- Use explicit values for NDOF event types.
- Minor clarification to doc-strings.
- Use doxy-sections.
2022-01-21 15:19:00 +11:00
5fca280c80 Fix: Node link drag search doesn't list shader sockets
Shader sockets were only available when dragging from inputs.
2022-01-20 16:26:43 -06:00
1ac2d2dcb6 Fix T93711: Cycles diffuse/glossy baking does not write alpha
With the change to use render passes internally the alpha channel got lost.
Add support for these render passes to output an alpha channel for baking.
2022-01-20 22:32:35 +01:00
14d261d23a Cleanup: Resolve unused variable warning, make function static 2022-01-20 15:10:56 -06:00
9ca1052226 Fix Python API docs build error
There is probably a better solution that's possible, but the few other
things I tried didn't work, and the build error should be resolved for
the buildbots. This is similar to the "breaks" in the namespace for
functions declared in `ED_node.h`.
2022-01-20 15:10:28 -06:00
4369c5817a Fix T94457: random result using sky texture in light object
Still not well defined, but should not longer use uninitialized values that
gave different results between CPU/GPU and subsequent renders.
2022-01-20 21:28:41 +01:00
22a8e934e4 Fix T94698: artifacts in light passes with mixed volumes and surfaces 2022-01-20 20:55:43 +01:00
e1ae95f6b2 Fix T93520: wrong subframe motion blur with rigid body physics
The code here was using velocity based interpolation copied from particles.
However there is no velocity cached in the rigid body point cache so the
results were non-sensical.
2022-01-20 20:40:55 +01:00
24e00c115c Fix T94712: Cycles missing colorspace transform on grayscale images 2022-01-20 20:40:55 +01:00
2559d79d2f Fix T94582: Cycles mapping shader node incorrectly skipped in Normal mode
Even if no rotation or scale is specified, we must still always normalize
the output.
2022-01-20 20:40:55 +01:00
Charlie Jolly
cc1a48e395 Geometry Nodes: Curve Primitive Arc
This adds a new curve primitive to generate arcs.

Radius mode (default): Generates a fixed radius arc on XY plane
with controls for Angle, Sweep and Invert.

Points mode: Generates a three point curve arc from Start to End
via Middle with an Angle Offset and option to invert the arc.
There are also outputs for arc center, radius and normal direction
relative to the Z-axis.

This patch is based on previous patches
D11713 and D13100 from @guitargeek. Thank you.

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D13640
2022-01-20 19:04:09 +00:00
6baccc36a0 Fix continuous stream of thumbnail notifiers after redo
This fixes a similar issue as the previous commit, but this time the
continuous notifiers would be sent after redoing. E.g. after moving an
object, and then modifying the transform in the "Adjust Last Operation"
panel.
2022-01-20 18:51:49 +01:00
d552b3c0c0 Fix file/asset thumbnails causing constant stream of notifiers
The thumbnail caching continuously sends `ND_SPACE_FILE_PREVIEW`
notifiers via a timer. But this timer was never ended properly after
thumbnails are fully loaded into the cache.
Wouldn't actually cause a refresh or redraw, send and process the
notifiers.

I already tried to avoid this for the asset view template, but
apparently that wasn't working correctly. For the File/Asset Browser I
never applied that fix to avoid possible regressions before the release.
2022-01-20 18:51:49 +01:00
902a103f80 Cleanup: Move node editor files to proper namespace
This commit moves code in all node editor files to the
`blender::ed::space_node` namespace, except for C API
functions defined in `ED_node.h`, which can only be moved
once all areas calling them are moved to C++.

The change is fairly straightforward, I just moved a couple
of "ED_" code blocks around to make the namespace more
contiguous, and there's the method for adding a pointer to
a struct in a C++ namespace in DNA.

Differential Revision: https://developer.blender.org/D13871
2022-01-20 10:36:56 -06:00
19622ffc5b Cleanup: Remove OpenCL workaround in volume_sample_channel(). 2022-01-20 17:02:20 +01:00
f6c8a78ac6 Cycles: Fix bvh2 gen on Apple Silicon and use it to speed up renders
This patch fixes a correctness issue discovered in the `int4 select(...)` function on Apple Silicon machines, which causes bad bvh2 builds. Although the generated bvh2s give correct renders, the resulting runtime performance is terrible. This fix allows us to switch over to bvh2 on Apple Silicon giving a significant performance uplift for many of the standard benchmarking assets. It also fixes some unit test failures stemming from the use of MetalRT, and trivially enables the new pointcloud primitive.

Ref T92212

Reviewed By: brecht

Maniphest Tasks: T92212

Differential Revision: https://developer.blender.org/D13877
2022-01-20 15:37:49 +00:00
9315215b20 Fix T94726: crash with GPU subdivision on a custom bone shape
Custom bones are drawn by instancing the GPUBatch of the base object. To
access the mesh and its GPUBatch, `BKE_object_get_evaluated_mesh` was
used. However, since GPU subdivision support, this will return a
subdivision wrapper which will never be drawn, and thus will have an
invalid batch, which caused the crash.

`BKE_object_get_evaluated_mesh_no_subsurf` should be used instead, to
return the mesh that will be drawn, and have the subdivision evaluated
on the GPU. Note that the rest of the draw code is already using this
function.
2022-01-20 15:28:08 +01:00
264fe10ddd Cleanup: Remove unused python helper function.
Branched Path has been removed with the Cycles X merge.
2022-01-20 14:34:20 +01:00
969a571e0f Revert "Sculpt: Multires Heal Brush"
This reverts commit ae349eb2d5.
2022-01-20 03:55:41 -08:00
4425e0cd64 Subdivision: add support for vertex creasing
This adds vertex creasing support for OpenSubDiv for modeling, rendering,
Alembic and USD I/O.

For modeling, vertex creasing follows the edge creasing implementation with an
operator accessible through the Vertex menu in Edit Mode, and some parameter in
the properties panel. The option in the Subsurf and Multires to use edge
creasing also affects vertex creasing.

The vertex crease data is stored as a CustomData layer, unlike edge creases
which for now are stored in `MEdge`, but will in the future also be moved to
a `CustomData` layer. See comments for details on the difference in behavior
for the `CD_CREASE` layer between egdes and vertices.

For Cycles this adds sockets on the Mesh node to hold data about which vertices
are creased (one socket for the indices, one for the weigths).

Viewport rendering of vertex creasing reuses the same color scheme as for edges
and creased vertices are drawn bigger than uncreased vertices.

For Alembic and USD, vertex crease support follows the edge crease
implementation, they are always read, but only exported if a `Subsurf` modifier
is present on the Mesh.

Reviewed By: brecht, fclem, sergey, sybren, campbellbarton

Differential Revision: https://developer.blender.org/D10145
2022-01-20 12:21:34 +01:00
9b4c017031 Cleanup: Remove incorrect comment 2022-01-19 23:56:27 -06:00
ae349eb2d5 Sculpt: Multires Heal Brush
This brush fixes the random spikes that
occasionally happen in multires models.
These spikes can be nearly impossible to
fix manually and can make working with
multires a nightmare.
2022-01-19 17:28:22 -08:00
eb3ff1d6f9 Cleanup: spelling in comments 2022-01-20 11:59:20 +11:00
1d536c21dd Cleanup: clang-format 2022-01-20 11:59:20 +11:00
e3f9d9b206 Cleanup: quiet ASAN warnings for divide by zero & NULL memcpy args
No functional changes as the inf value was never used &
memcpy args were only NULL when the size to copy was zero.
2022-01-20 11:59:20 +11:00
b7fe27314b Mesh RNA API: Expose contiguous normal arrays
Since vertex and face normals are now stored on the mesh when necessary,
we can expose them as contiguous arrays of vectors in the Python API.
This can give render engines and other addons easy access to they data
for fast access through a regular collection property.

While "Mesh Vertex" still has a "normal" property in RNA, that is only
maintained in order to avoid breaking the existing API, and accessing
it is less efficient than accessing the normals directly.

I made the normal arrays read-only, because modifying them could
put them in an invalid state. This is inline with how we treat the data
internally, and helps keep relationships between data clear.

Differential Revision: https://developer.blender.org/D13839
2022-01-19 18:43:05 -06:00
b47a1867e8 Cleanup doc comments for sculpt_intern.h 2022-01-19 16:21:14 -08:00
e7db1247b1 Fix: File Browser using asset indexer after Asset Browser was visible
When toggling to a File Browser from an Asset Browesr, the asset indexer
would be used to load files. I couldn't spot issues with that on a
quick look, but this should still be corrected.
2022-01-19 20:43:31 +01:00
293aab2253 Asset Browser: Add debug option to disable asset indexing
Adds an "Asset Indexing" option (enabled by default) to Preferences >
Experimental > Debugging. This is useful when working on the asset
library loading.
2022-01-19 20:12:53 +01:00
9a2d1cd5b7 PyAPI Docs: Prepare for Sphinx 4.5 2022-01-19 14:08:38 -05:00
cd0acba330 CMake: Support external callback in configuration
An external CMake script can be used to debug CMake code, modify/read
target properties, inter-target dependencies, non-cache variables etc.

Reviewed by: LazyDodo, brecht
Differential Revision: https://developer.blender.org/D13830
2022-01-20 00:15:09 +05:30
17cab47ed1 Cycles: Fix T94736: Crash when modifying strength of world environment texture
This patch fixes crash T94736 on Metal in which the launch_params were not being updated to reflect destruction of MetalMem objects.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D13875
2022-01-19 18:17:37 +00:00
596ce11556 CMake Cleanup: use set for filepath instead of option
See https://developer.blender.org/D13830#368219
2022-01-19 23:34:25 +05:30
f179637222 Fix T95042: Rendering high-res image in Cycles crashes
Integer overflow when the final frame is handled by the Blender's
output driver.

Thanks Jesse and Thomas for investigation!
2022-01-19 16:03:28 +01:00
ecf2f5ed01 Fix error in previous commit
While doing last minute cleanup in
e49bf4019b,  missed to rename function
in one place.
2022-01-19 14:32:11 +01:00
eddad4e9a1 VSE: Support copy-pasting strips with animation
When copying strips between 2 scenes, it wasn't possible to copy
animation curves along with strips.

In this patch curves are copied into clipboard `ListBase`. When pasted,
original curves are moved into temporary `ListBase` and curves in
clipboard are moved into scene action. This is because when strips from
clipboard have to be renamed, function `SEQ_ensure_unique_name()` does
fix RNA paths of curves, but this is done globally for all curves within
action. After strips are renamed, restore original curves from backup.

Note: This patch handles only fcurves. Drivers and actions are currently
not handled anywhere in VSE.

Fixes T77530

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D13845
2022-01-19 14:15:49 +01:00
e49bf4019b Cleanup: VSE animation handling
- Move functions that handle animation to own file - `animation.c`
- Refactor `SEQ_offset_animdata` and `SEQ_free_animdata` functions
- Add function `SEQ_fcurves_by_strip_get` to provide more granular
  and explicit way for operators to handle animation
- Remove function `SEQ_dupe_animdata`, do curve duplication explicitly
  in operator code, which makes more sense to do. Further this function
  was also used for renaming strips which makes no sense.
- Refactor usage of function `SEQ_free_animdata` and remove XXX comment.
  Now this functiuon is no longer called when `Sequence` data is freed
  implicitly, it is done explicitly in high level function
  `SEQ_edit_remove_flagged_sequences`

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D13852
2022-01-19 14:12:23 +01:00
1788298804 Cleanup: Strict compiler warning in Cycles
The ustring is not a trivially copyable object from the C++ standard
point of view, so using memcpy on it is strictly wrong. In practice,
however, this is OK since it is just a thin wrapper around char*.

For now use explicit cast to void* same as it was done in other places
of ccl::array implementation. But also localize the place where memory
copy happens to make it easier to support proper non-trivial C++
objects in the future.
2022-01-19 12:01:49 +01:00
8a23d91a50 GPUShaderCreateInfo: Rework geometry shader layout support
This merge the description into one struct only that can be more easily
copied during `finalize()`.

The in and out layout parameters are better named and extended with the
invocation count (with fallback support)
2022-01-19 11:59:57 +01:00
952a4fa456 Fix T94987: Dragged node links are invisible.
Route cause was data alignment mismatch between GPU and CPU. This
mismatch would not allow us to bind the UBO where data wasn't available
on the GPU.

Fixed by using float4 in stead of float2. This could eventually be
packed, but that would lead to less readable code.
2022-01-19 11:32:34 +01:00
71386c08f1 Fix T95039,T94998: Shaders compilation errors on Mac.
Cause was incorrect logic when generating the resource layout. It the
explicit_location_support setting was ignored and the binding were
generated for image, uniform buffers and storage buffers.
2022-01-19 10:28:19 +01:00
eb63646605 BMesh: add mesh debug information printing
- Add BM_mesh_debug_print & BM_mesh_debug_info.
- Report flags in Mesh.cd_flag in BKE_mesh_debug_print
- Move custom data printing into customdata.cc (noted as a TODO).

Note that the term "runtime" has been removed from
`BKE_mesh_runtime_debug_print` since these are useful for debugging any
kind of mesh data.
2022-01-19 17:16:00 +11:00
71879d665d BMesh: improve handling of custom-data flag (Mesh.cd_flag)
Code that handled merging & initializing custom-data from other
meshes sometimes missed checks for this flag, causing bevel weights to
lost when the mesh was converted to a BMesh.

The following changes are a more general fix for T94197.

- Add BM_mesh_copy_init_customdata_from_mesh_array which initializes
  custom-data from multiple meshes at once.
  As well as initializing custom-data layers from Mesh.cd_flag.

  This isn't essential for boolean, however it avoids the overhead of
  resizing custom-data layers.

- Loading mesh data into a BMesh now respects Mesh.cd_flag
  instead of only checking if the BMesh custom-data-layer exists.
  Without this, the order of meshes passed to BM_mesh_bm_from_me could
  give different (incorrect) results.

- Copying mesh data now copies `cd_flag` too. This is a precaution
  as in my tests evaluating modifiers these values always matched.
  Nevertheless it's correct to copy this value as custom-data it's
  self is being copied.
2022-01-19 14:30:10 +11:00
ee6507f2b1 Docs: notes on thumbnail sizes
The rationale for storing thumbnails at different sizes wasn't obvious.
2022-01-19 14:05:56 +11:00
7e3b1e2c8f Fix flipped order of items in the "Undo History" menu
Error in 0e1bb232e6.
2022-01-19 13:25:10 +11:00
2e5aecf557 Fix T94202: GPUFrameBuffer: wrong refcount in the buffer passed for read_color and read_depth
The buffer passed as an argument to `GPUFrameBuffer.read_color` is used
in the return of the function and therefore, if not used, its refcount is
decremented.

So be sure to increment the refcount of the already existing objects that
will be used in the return of a function.
2022-01-18 19:23:16 -03:00
221ff895d9 Cleanup: Use references, LISTBASE_FOREACH macro 2022-01-18 13:32:36 -06:00
a5610da1d5 Fix T93413: Nodes 'Make Links' fails for multi input socket
This was the case for multi input sockets that have a link already.

Since we have multi input sockets, the way we use `socket_is_available`
is not really giving the expected result on these.

When used for input sockets the intention is to find a free socket
(either for noodle **replacement**, then it is always available, or just
the next free available socket).
Now I would think without the intention to replace an existing link, a
multi input socket should still be available.
From the inside of the function, the `replace` argument turns [namewise]
to `allow_used`, which sounds a little different (so one might argue
that if `allow_used` is `False` this should also trigger for already
connected multi input sockets).
In the end, this is an issue with the variable naming though, cant think
of a usecase where the patch change would really go against intentions.

Maniphest Tasks: T93413

Differential Revision: https://developer.blender.org/D13866
2022-01-18 20:23:39 +01:00
9506dcf675 Fix T95029: Arrow gizmo always uses normal direction
Bug possibly introduced in {rBc57e4418bb85aec8bd3615fd775b990badb43d30}.

Interestingly, the orientation set before (NORMAL), even different from
the orientation that was actually used, was allowing the use of
"orient_matrix" ("orient_matrix_type" should have been NORMAL in that
case too).

In any case, make sure the "orient_matrix_type" and "orient_type" are the
same so that the "orient_matrix" is used.
2022-01-18 16:21:48 -03:00
977baeaa26 Cleanup: Make node editor functions private
These operations (sorting and selecting all nodes) should generally
be handled by the node editor and not outside code. They were not
called outside of the node editor, so they can be moved to the editor's
`intern` header.
2022-01-18 13:07:41 -06:00
09ecb089a5 Cleanup: Remove unused node editor toolbar file
This file was added nine years ago, and was unused then.
Now with active tools we use a different approach to create
toolbars, so the file is not relevant.
2022-01-18 12:31:14 -06:00
15657b7ccd Fix warning from rB9925606539. 2022-01-18 18:38:14 +03:00
b88a37a490 Geometry Nodes: new Field at Index node
This node allows accessing data of other elements in the context geometry.
It is similar to the Transfer Attribute node in Index mode. The main difference
is that this node does not require a geometry input, because the context
is used.

The node can e.g. be used to generalize what the Edge Vertices node is doing.
Instead of only being able to get the position of the vertices of an edge,
any field/attribute can be accessed on the vertices.

Differential Revision: https://developer.blender.org/D13825
2022-01-18 16:25:47 +01:00
4d5c08b938 Geometry Nodes: Add Signed Output to Edge Angle Node
Adds a second output to the edge angle node that shows the signed angle
between the two faces, where Convex angles are positive and Concave angles
are negative. This calculation is slower than the unsigned angle, so it
was best to leave both for times where the unsigned angle will suffice.

Differential Revision: https://developer.blender.org/D13796
2022-01-18 09:20:31 -06:00
796e9d442c Geometry Nodes: improve domain interpolation code
It's now easier than before to do the interpolation of attributes
only for the elements that are actually used in some cases.
This can result in a speedup because unnecessary computations
can be avoided. See the patch for a simple performance test.

Differential Revision: https://developer.blender.org/D13828
2022-01-18 16:14:00 +01:00
dfe22a53bb Fix T95003: Shader issue using voronoi noise.
Cause of the issue isn't that clear, but the NVIDIA GLSL compiler
complained that it couldn't find an overloaded function when the second
parameter is an interger. This change fixes it by using a float.
2022-01-18 14:32:26 +01:00
0d7b3ed39c RNA: display exact integer values without fraction if step is integer.
Display exact integer values of a floating point fields without
a fraction if the step is also an exact integer. This is intended
for cases when the value can technically be fractional, but most
commonly is supposed to be integer.

This handling is not applied if the field has any unit except frames,
because integer values aren't special for quantities like length.

The fraction is discarded in the normal display mode and when copying
the value to clipboard, but not when editing to remind the user that
the field allows fractions.

Differential Revision: https://developer.blender.org/D13753
2022-01-18 16:24:54 +03:00
6952228386 UI: fix a precision issue with float field step size.
Fix a precision issue when stepping down from 1 to 0 via the left
decrement button and step 100 results in a small nonzero value.

The reason is that 0.01 can't be precisely represented in binary
and converting to double before multiplication reveals this.

Ref D13753
2022-01-18 16:24:54 +03:00
6a8ad00bcc Cleanup: Avoid possible NULL pointer error
In normal conditions, `gpf` always has a value, but better move inside the NULL checking.
2022-01-18 13:44:41 +01:00
08d008a508 GPU: Create Info for GPU_SHADER_2D_IMAGE_MULTI_RECT_COLOR.
This patch converts GPU_SHADER_2D_IMAGE_MULTI_RECT_COLOR shader to use
the GPUShaderCreateInfo pattern. It can be used as a reference when
converting other shaders.

In this special case the flat uniform vector cannot be used anymore as it
doesn't fit as push constants. To solve this a uniform buffer is used.
2022-01-18 13:17:04 +01:00
2486346f6f Fix T94977: muted link is not ignored in eevee
Add a preprocessing step that removes all muted links from
the localized node tree.

Differential Revision: https://developer.blender.org/D13864
2022-01-18 13:06:49 +01:00
9f8ae130af Fix T95006: missing modifier update after frame change
The previous optimization did not work in general yet, unfortunately.
This change makes the code more correct, but also brings back
some unnecessary updates (e.g. when creating a node group).
2022-01-18 12:58:29 +01:00
5d7ac749c5 Fix T94197: Applying boolean with fast solver clears bevel weights
For boolean operations only one of the meshes was checked to determine
if bevel weights should be created.

Now initialize custom data from both meshes flag.
Note that this is a localized fix to be back-ported, further changes
will be made so edit-mode conversion accounts for this
without the caller needing explicit checks for custom-data flags.
2022-01-18 21:35:10 +11:00
fce0b824a7 Assets: Enabling Asset Indexing.
Asset indexing was disabled as ID property indexing wasn't supported.
Now that ID property support is added we can enable asset indexing.

Check {T91406} for more information about asset indexing.
2022-01-18 11:20:50 +01:00
Jeroen Bakker
36068487d0 AssetsBrowser: Add ID Properties to Asset Indexer
Object/collection asset workflow would need the bounding box for snapping.
The bounding box is stored using ID properties in the scene. Currently ID properties
aren't stored in the asset index, what would break object snapping. For this reason
Asset Indexing is turned off in mater. This patch will introduce the indexing of ID
properties what will allow the indexing to be turned on again.

## Data Mapping ##

For data mapping we store the internal structure of IDProperty to the indexer (including meta-data) to be able to deserialize it back.
```
[
  {
    "name":  ..,
    "value": ..,
    "type": ..,
    /* `subtype` and `length` are only available for IDP_ARRAYs. */
    "subtype": ..,
  },
]
```

| **DNA** | **Serialize type** | **Note** |
| IDProperty.name | StringValue| |
| IDProperty.type | StringValue| "IDP_STRING", "IDP_INT", "IDP_FLOAT", "IDP_ARRAY", "IDP_GROUP", "IDP_DOUBLE"|
| IDProperty.subtype | StringValue| "IDP_INT", "IDP_FLOAT", "IDP_GROUP", "IDP_DOUBLE" |
| IDProperty.value | StringValue | When type is IDP_STRING |
| IDProperty.value | IntValue | When type is IDP_INT |
| IDProperty.value | DoubleValue | When type is IDP_FLOAT/IDP_DOUBLE |
| IDProperty.value | ArrayValue | When type is IDP_GROUP. Recursively uses the same structure as described in this section. |
| IDProperty.value | ArrayValue | When type is IDP_ARRAY. Each element holds a single element as described in this section. |

NOTE: IDP_ID and IDP_IDARRAY aren't supported. The entry will not be added.

Example
```
[
  {
    "name": "MyIntValue,
    "type": "IDP_INT",
    "value": 6,
  },
  {
    "name": "myComplexArray",
    "type": "IDP_ARRAY",
    "subtype": "IDP_GROUP",
    "value": [
        [
          {
            "name": ..
            ....
          }
        ]
    ]
  }
]
```

## Considered alternatives ##

- Add conversion functions inside `asset_indexer`; makes generic code part of a specific solution.
- Add conversion functions inside `BLI_serialize`; would add data transformation responsibilities inside a unit that is currently only responsible for formatting.
- Use direct mapping between IDP properties and Values; leads to missing information and edge cases (empty primitive arrays) that could not be de-serialized.

Reviewed By: Severin, mont29, HooglyBoogly

Maniphest Tasks: T92306

Differential Revision: https://developer.blender.org/D12990
2022-01-18 11:18:11 +01:00
d7822981b1 Python API Docs: add non-invert Bone.convert_local_to_pose example.
This updates the example function to support assigning a subset of
bone matrices. The code was tested to work in real use by @gaiaclary.
2022-01-18 11:45:27 +03:00
542d15b1cd Allow overriding motion path settings.
Motion paths themselves aren't getting saved (not sure if they are
without overrides), but being able to override options makes them
usable even if it's necessary to regenerate every edit session.

Differential Revision: https://developer.blender.org/D13842
2022-01-18 11:45:27 +03:00
1b94631975 CMake: Fix using numpy variable for the zstandard path
Copy paste error in a5917175d8.
2022-01-18 17:23:19 +11:00
6dd89afa96 Fix obj exporter tests by deduping normals and printing with less precision.
Some new obj exporter tests were disabled because the normals were different
in the last decimal place on different platforms.
The old python exporter deduped normals with their coordinates rounded to
four decimal places. This change does the same in the new exporter.
On one test, this produced a file 25% smaller and even ran 10% faster.
2022-01-17 23:22:40 -05:00
db496a0b7d Cleanup: spelling in comments 2022-01-18 14:27:29 +11:00
20df402adc Cleanup: move docs to definition 2022-01-18 14:13:58 +11:00
7220897280 WM: batch rename support for volume & light object data
Also order items to match the "Add" menu.
2022-01-18 12:23:15 +11:00
75d84b1b64 WM: batch rename outliner support for various ID types
The outliner selection can now be used for renaming objects,
object-data & materials.
2022-01-18 12:12:05 +11:00
0fc9526178 Fix for batch rename operating on library collections & materials 2022-01-18 11:50:02 +11:00
84f6d86445 Fix batch renaming selected meta-strips 2022-01-18 11:13:05 +11:00
c11c2a4b91 WM: batch rename collections outside the outliner
Use selected objects collection instances to rename in the 3D view.
2022-01-18 10:47:12 +11:00
Red Mser
54fb1a75ee WM: batch rename collections
User must activate the operator from the outliner,
so that the selected collections can be determined.

Reviewed By: campbellbarton

Ref D13821
2022-01-18 10:26:20 +11:00
0fa36c81d9 Cleanup: quite old-style-declaration warning, strip trailing space 2022-01-18 10:26:18 +11:00
3bbb39ecc1 Cleanup: remove HWND from GHOST_Wintab constructor.
No change in behavior.
2022-01-17 14:07:08 -08:00
44ca984dc7 BLI: Add index_range method to VectorSet
This can simplify iterating through all of the indices in the vector,
which is fairly common, since one of the benefits of the data structure
is that all values are contiguous.
2022-01-17 15:10:52 -06:00
8c1ddee10c Geometry Nodes: Set Handle Type Node: Left and right by default
This node's UI uses a multi-select enum to allow adjusting the
type of both handle sides with the same node. Since usually the
user wants to affect both handles, and it's the multi-select behavior
isn't obvious, selecting both by default is an improvement.
2022-01-17 15:02:15 -06:00
b776c46d2f Fix T94715: multiple volumes using the same .vdb causes freeze
Needs more TBB task isolation, as even freeing an OpenVDB grid uses
multithreading.
2022-01-17 20:36:59 +01:00
Martijn Versteegh
449db0ab1e Baking: new method to generate margin, based on adjacent faces
This significantly reduces discontinuities on UV seams, by giving a better
match of the texture filtered colors on both sides of the seam. It works by
using pixels from adjacent faces across the UV seam.

This new option is called "Adjacent Faces" and is the default. The old option
is called "Extend", and extends border pixels outwards.

Differential Revision: https://developer.blender.org/D13303
2022-01-17 19:36:13 +01:00
8af22719d0 Cleanup: Remove now redundant performance workaround for asset previews
Not needed anymore after aa0ecd179. The removed function was identical
to `icon_draw_rect()` now.

Reverts ab7214ca2e.
2022-01-17 18:26:32 +01:00
fa1fef5081 Cleanup: Correct comments for immediate mode buffer draw functions 2022-01-17 18:26:10 +01:00
194979e929 Cleanup: Improve naming of immediate mode buffer draw functions
Followup to the previous commit. Jeroen and I agreed the old naming was
confusing.
2022-01-17 18:26:10 +01:00
aa0ecd1791 UI: Speed up icon scaling
Use GPU-side scaling to speed up the scaling itself, and to avoid having
to copy the image buffer using the CPU. Mipmapping is used to get decent
filtering when downscaling without ugly artifacts.
In my comparisons, there was barely any difference between the methods
for DPIs >= 1. Below that, the result looks a bit different due to the
different filtering method.

See D13144 for screen-recordings showing the difference.

Part of T92922.

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

Reviewed by: Jeroen Bakker
2022-01-17 18:26:10 +01:00
4d10a46e63 Cleanup: refactor BVH2 in preparation of self intersection skip
Move some logic out of triangle intersection functions and into BVH
traversal, so we can share logic between primitives.

Ref D12954
2022-01-17 17:35:23 +01:00
a25cfc5db2 Texture/Vertex Paint: Add secondary color to the tool header
Before we would only display the secondary color in the N-panel.
Now we also display it in the tool header.
2022-01-17 16:50:20 +01:00
be8f10a4e2 T94828: Appending collection with instancing links nested collections
See T94828 for details.

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

Reviewed by: Bastien Montagne
2022-01-17 16:32:50 +01:00
e3fd0b1d17 Fix compiler warning on Windows
The variable was `uint64_t` and needs `1ull`
2022-01-17 16:08:48 +01:00
7abdd82dfd Fix T94338: bpy.data.libraries.load does not return the right thing.
Typo in rB605cdc4346e5f82, both `eBlendfileLinkAppendForeachItemFlag`
flags had the same value, effectively preventing to filter out direct
vs. indirect appended items.
2022-01-17 15:22:22 +01:00
59fcbdd815 Cleanup: deduplicate condition in transform curve code
Checking `t->around` and `nu->pntsv` does not need to be done in 2 places.
2022-01-17 11:14:44 -03:00
0a08ac2528 Alembic: add support for reading override layers
Override layers are a standard feature of Alembic, where archives can override
data from other archives, provided that the hierarchies match.

This is useful for modifying a UV map, updating an animation, or even creating
some sort of LOD system where low resolution meshes are swapped by high resolution
versions.

It is possible to add UV maps and vertex colors using this system, however, they
will only appear in the spreadsheet editor when viewing evaluated data, as the UV
map and Vertex color UI only show data present on the original mesh.

Implementation wise, this adds a `CacheFileLayer` data structure to the `CacheFile`
DNA, as well as some operators and UI to present and manage the layers. For both
the Alembic importer and the Cycles procedural, the main change is creating an
archive from a list of filepaths, instead of a single one.

After importing the base file through the regular import operator, layers can be added
to or removed from the `CacheFile` via the UI list under the `Override Layers` panel
located in the Mesh Sequence Cache modifier. Layers can also be moved around or
hidden.

See differential page for tests files and demos.

Reviewed by: brecht, sybren

Differential Revision: https://developer.blender.org/D13603
2022-01-17 14:51:04 +01:00
9d3f35a0bf Revert "Revert "GPUShaderCreateInfo for interface abstraction""
This reverts commit edee5a947b.

Fixes compilation error (Missing file BLI_float2.hh)
2022-01-17 14:46:32 +01:00
edee5a947b Revert "GPUShaderCreateInfo for interface abstraction"
This reverts commit 8fb2ff458b.
Missing some files.
2022-01-17 14:34:28 +01:00
Jeroen Bakker
8fb2ff458b GPUShaderCreateInfo for interface abstraction
This is a first part of the Shader Create Info system could be.

A shader create info provides a way to define shader structure, resources
and interfaces. This makes for a quick way to provide backend agnostic
binding informations while also making shader variations easy to declare.

- Clear source input (only one file). Cleans up the GPU api since we can create a
  shader from one descriptor
- Resources and interfaces are generated by the backend (much simpler than parsing).
- Bindings are explicit from position in the array.
- GPUShaderInterface becomes a trivial translation of enums and string copy.
- No external dependency to third party lib.
- Cleaner code, less fragmentation of resources in several libs.
- Easy to modify / extend at runtime.
- no parser involve, very easy to code.
- Does not hold any data, can be static and kept on disc.
- Could hold precompiled bytecode for static shaders.

This also includes a new global dependency system.
GLSL shaders can include other sources by using #pragma BLENDER_REQUIRE(...).

This patch already migrated several builtin shaders. Other shaders should be migrated
one at a time, and could be done inside master.

There is a new compile directive `WITH_GPU_SHADER_BUILDER` this is an optional
directive for linting shaders to increase turn around time.

What is remaining:
- pyGPU API {T94975}
- Migration of other shaders. This could be a community effort.

Reviewed By: jbakker

Maniphest Tasks: T94975

Differential Revision: https://developer.blender.org/D13360
2022-01-17 14:32:28 +01:00
08822801ac Fix T94805: Library weak reference generates "path not found" reports.
No reason to handle those paths here, those are fully internal temp
data, user should not be exposed to it currently.
2022-01-17 14:22:59 +01:00
04feaa8bd0 Core: Library Remap test cases.
For an upcoming refactoring of library remapping we want to be able to test if the logic won't change.
It also increased my experience inside the remapping codebase and find out what exactly needed to
be refactored.

This patch adds test cases for the core functionality of `foreach_libblock_remap_callback`. The test cases
don't cover of all the branches. Also pre-, post-processing, referencing and proxies are not tested.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D13815
2022-01-17 12:45:37 +01:00
e15449623d InstallDeps: Increase 'MEX' version of llvm to 14.
llvm 13 is now default on debian testing, tried it quickly and it seems
to work fine, so raising exclusive maximum value for it to 14.
2022-01-17 10:34:34 +01:00
40c8e23d48 LineArt: Invert collection option.
Allows conveniently selecting an inverse of a collection.

Reviewed By: Antonio Vazquez (antoniov)

Differential Revision: https://developer.blender.org/D13846
2022-01-17 17:22:09 +08:00
e1e3043a51 CMake: resolve issue finding mold
The default installation path uses `libexec`, missed this as the
package for Arch replaces this with `lib`,
now both are checked.
2022-01-17 18:12:15 +11:00
Piotr Makal
a84621347d Geometry Nodes: Improve conversion from NURBS to Bezier
This patch improves conversion method from NURBS to Bezier curves,
resulting in exact shape between those two types when provided with
a 3rd degree NURBS curve. Part of T86086.

See the differential revision for more comparisons.

The node still cannot account properly for a NURBS "order" other
than 4 and it does not take into account control point weights.

Differential Revision: https://developer.blender.org/D13546
2022-01-16 22:52:18 -06:00
Alaska
34d424fd64 Fix T94526: Incorrect workspace ordering tooltip
Fix the description for WORKSPACE_OT_reorder_to_back to say "last" in
list rather than "first"

See D13696 for more details.

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

Reviewed by Aaron Carlisle
2022-01-16 15:26:08 -08:00
d914cfcb7a Cleanup: simplify parameters
Use a common `userdata` for the different snap callbacks.
2022-01-16 11:25:51 -03:00
608d51c9c8 Fix T94951: Crash when snapping
Missed in {rBd9c6ceb3b88b6db87490b08e0089f9a18e6c52d6}
2022-01-16 11:25:51 -03:00
bc66cd9868 Fix T94865: GPU subdiv crash switching to texpaint area
The crash is due to the fact that GPU subdivision extraction routines
for edit data (including UVs) only worked for BMesh. However, a Mesh
based version is still needed for texture painting. This adds the
missing components. This also ensures all data are properly initialized
(at least the ones revealed by the bug).
2022-01-16 08:40:38 +01:00
3574f2730d Cleanup: deduplicate GPU subdiv data extraction loops
This puts the loop over the final subdivision quads outside of the mesh
iteration callback. This can also allow for easier parallel execution in
the future if need be.
2022-01-16 07:31:26 +01:00
b87d87b1d3 macOS: fix llvm-ranlib invalid option error 2022-01-16 11:47:55 +05:30
e69020ad0f CMake: only ever enable one alternative linker for UNIX/GCC
Since the option to enable linkers are booleans,
it's possible to enable them all at once.

Now only the first enabled + available linker is used
(with priority given to link is with better performance).
2022-01-15 16:40:24 +11:00
18c5d4ccb3 CMake: use LINKER flags instead of CFLAGS for setting the linker
Set the linker using CMAKE_*_LINKER_FLAGS instead of {C/CXX}FLAGS.

There is no advantage in using the CFLAGS to set the linker, it has the
downside of triggering a full rebuild when changing the linker.

Tested building Blender and the bpy.so Python module.

Ref D13833

Reviewed by: sergey, brecht
2022-01-15 16:12:13 +11:00
9664cc91f3 Fix T94918: GPU subdivision uses viewport levels for final render
The resolution for the subdivision grid traversal was always based on
the viewport setting.
2022-01-15 01:36:18 +01:00
6a16a9e661 Geometry Nodes: Rename transfer attribute geometry input
Conceptually, this is the geometry that data is taken from,
not the target of an operation, so rename it from "Target"
to "Source". This was common user feedback and agreed
on in a recent sub-module meeting.
2022-01-14 16:42:04 -06:00
6e926e9b56 Fix T94852: Geometry Proximity crash when unsuccessful
Before rB644e6c7a3e99ae1d43ed, `fill` was used in the error
cases, but now `fill_indices` is used, which doesn't work when
the span is empty (when only one output is used). The fix is just
to check for that case.
2022-01-14 16:10:38 -06:00
2a095d8bfe Audaspace: port bugfixes from upstream.
Windows audio backend (WASAPI) now automatically switches to
the selected audio device in windows.
2022-01-14 22:51:35 +01:00
9fe704800e Nodes: Support link-drag search with compare node outputs
The search list only displayed the "Result" output socket in this
case, which is unexpected since dragging from an input gives the
operations in the list as well. Also use integer mode when
connecting to boolean sockets.
2022-01-14 14:38:49 -06:00
b7a27efd78 Cleanup: Remove unused subdiv functions
I noticed these when doing final cleanup on rBcfa53e0fbeed.
One use was removed in that commit, the others were unused
going further back a few years.

Differential Revision: https://developer.blender.org/D13834
2022-01-14 14:04:24 -06:00
bba95d1901 Fix possible build error with unity build
`NodeOperationBuilder::Link` could conflict with the list base macros.
To resolve this dont use `using Link`.
2022-01-14 13:46:31 -05:00
67517c7d5c Cleanup: Outliner function names, simplify struct initialization 2022-01-14 19:26:04 +01:00
41495707d2 Fix incorrect destruction of Outliner tree-elements
`TreeElement` isn't a trivial type anymore, so `MEM_delete()` should be
called, which calls the destructor.
AFAICS this would cause a memory leak, since the contained `unique_ptr`
is allocated but not destructed correctly - but it's not using the
guarded allocator so woudn't be reported.
2022-01-14 19:26:04 +01:00
82d5905e4b Cleanup: Use destructor to delete Outliner runtime data
Simplifies and makes things safer due to proper RAII usage.
2022-01-14 19:26:04 +01:00
ca9a749b21 Cleanup: Use smart pointers for Outliner tree display and element types
Smart pointers should be the default choice for C++ owning pointers,
since they let you manage memory using RAII.

Also moved type factory methods into static class functions.
2022-01-14 19:26:04 +01:00
e9a43a3b60 Cleanup: Remove Outliner C-API headers/wrappers
Basically this removes any C <-> C++ glue code. C++ types are accessed
directly via the public C++ APIs.
Contains some related changes like, moving functions that were
previously declared in a now removed header to a different file, whose
header is the more appropriate place (and the source file as well).
But generally I tried to avoid other changes.
2022-01-14 19:26:04 +01:00
9109ea0b96 Disable some failing new obj exporter tests.
The switch to how normals are kept has led to tiny differences in
the normal output values on different platforms. Disabling the failing
tests while working on a solution to this problem.
2022-01-14 12:34:07 -05:00
5703efab88 Fix T94784: Crop node gizmo doesn't work
Fix refactoring mistake in rBcbca71a7cff3
Not the min and max values are initialized properly.
2022-01-14 17:44:18 +01:00
d723fa3d31 blenlib Any tests: Fix unknown pragma warning on Windows.
Part of a5cb7c1e62 is reverted since it 
created unknown pragma warning on windows.
Use a trick to do self-assigning.
Reviewed by Jacques Lucke in chat.
2022-01-14 22:10:28 +05:30
780633ec4b Cleanup: Unused function 2022-01-14 17:37:14 +01:00
301bb5afa5 Cleanup: Remove unused functions 2022-01-14 17:06:16 +01:00
eb33ee566e Fix T: Crash in do-version of older pre-2.80 blender files.
`BKE_layer_collection_sync` was missing a specific handling for one of
those pre-master collection cases,

NOTE: It is a bit unfortunate to have to do 'do-version' code in BKE...
At some point might look into moving this into actual `do_version` file,
but this is not fully trivial not critical improvement for now.
2022-01-14 17:02:05 +01:00
85df7036f7 Fix T94827: Group Input/Output cannot connect to custom sockets
Caused by rBa5c59fb90ef9.

Since Group Input and Output sockets happen to be of type `SOCK_CUSTOM`
[and since rBa5c59fb90ef9 custom py defined sockets are too :)] a check
introduced in rB513066e8ad6f that prevents connections for `SOCK_CUSTOM`
triggered.

Now refine the check, so it specifically looks for NODE_GROUP_INPUT /
NODE_GROUP_OUTPUT, too (this keeps the intention intact to not connect
group inputs to group outputs and vice versa, but allows custom py
defined sockets to connect again) and put it in new utility function.

Maniphest Tasks: T94827

Differential Revision: https://developer.blender.org/D13817
2022-01-14 16:30:59 +01:00
e57365a70b Cleanup split foreach_libblock_remap_callback into smaller functions. 2022-01-14 15:50:42 +01:00
348631cffe Fix: Compilation error caused by missing target relation
bf_nodes/bf_nodes_composite depend on DNA headers
2022-01-14 07:46:00 -07:00
8ae6995e98 Tests: show more precise numbers in benchmark charts 2022-01-14 15:17:22 +01:00
c0d0e2788b Cleanup: compiler warnings with clang 2022-01-14 15:17:22 +01:00
ba48c1ee58 macOS: silence bundle identifier mismatch Xcode warning
Blender.xcodeproj User-supplied CFBundleIdentifier value
'org.blenderfoundation.blender' in the Info.plist must be the same as
the PRODUCT_BUNDLE_IDENTIFIER build setting value ''.

Reviewed By: #platform_macos, brecht
Differential Revision: https://developer.blender.org/D13826
2022-01-14 19:33:23 +05:30
6f51cb0ad7 Info.plist: Bump LSMinimumSystemVersion to silence warning
Didn't remove the key-value pair since old Xcode behavior is not
known.

warning: LSMinimumSystemVersion of '10.9.0' is less than the value of
MACOSX_DEPLOYMENT_TARGET '10.13' - setting to '10.13'. (in target
'blender' from project 'Blender')

Reviewed By: #platform_macos, brecht
Differential Revision: https://developer.blender.org/D13831
2022-01-14 19:33:06 +05:30
a5cb7c1e62 blenlib/ Any tests: fix self-assignment warning and typo
Fix assignment warning

source/blender/blenlib/tests/BLI_any_test.cc:56:5: warning: explicitly
assigning value of variable of type 'blender::Any<void, 8, 8>'
to itself [-Wself-assign-overloaded]
  c = c;

Reviewed By: JacquesLucke
Differential Revision: https://developer.blender.org/D13835
2022-01-14 19:32:29 +05:30
0cf746c1fa Fix T94878: LineArt crease threshold logic error.
A coding mistake allows default crease to override object crease, now fixed.
2022-01-14 21:43:52 +08:00
c0432d5edb Fix T94089: GPencil Drawing don't Update after paste in Dopesheet
When paste new frames, the datablock need to be tagged to update the drawings.
2022-01-14 13:51:30 +01:00
86b7746e3c Fix T94903: GPencil: Copying keys doesn't preserve Keyframe Type
When a new frame is created, ensure the keytype of source key is used.
2022-01-14 13:05:57 +01:00
0a3de0305c Cleanup: move attribute operators to c++ 2022-01-14 12:53:19 +01:00
c9a8975de5 Fix T94867: viewport render not updating when editing color ramp
The changed node wasn't tagged correctly.
2022-01-14 12:50:53 +01:00
261517e475 Cleanup: Fix warning when compiling without Audaspace 2022-01-14 11:56:02 +01:00
c8e536bac3 Fix T94837: curve tilt on a 2-point-curve is wrong
2-point-curves are treated separately from 3plus-point-curves (assume a
lot of the twisting reduction can be skipped, so there is a dedicated
function for single segment curves).

And while using the 3plus-point-curves function [`make_bevel_list_3D`]
would actually work in this case, the dedicated function
`make_bevel_list_segment_3D` would only consider the tilt of the second
point and would just copy over the quat to the first point as well. Dont
see a reason for this, now consider the first point's tilt as well.

Maniphest Tasks: T94837

Differential Revision: https://developer.blender.org/D13813
2022-01-14 11:26:21 +01:00
e0ac75cb44 Cleanup: Reduce indentation in foreach_libblock_remap_callback. 2022-01-14 09:55:35 +01:00
7c568e7d36 Python API: add "children_recursive" property to Object & Collection
This is a convenience property, already available for bones.

Simplifies D13821 which in-lined this function.
2022-01-14 12:21:56 +11:00
cea588b9ef Cleanup: spelling in comments, C++ style comments for disabled code
Also ensure space at end of comment.
2022-01-14 11:23:46 +11:00
7a0cf2c72f Fix crash caused by exception in Python gizmo target get handler 2022-01-14 10:18:52 +11:00
1bd0a87384 Cleanup: Clang tidy
- modernize-deprecated-headers
- modernize-use-using
- modernize-use-nullptr
- modernize-use-bool-literals
2022-01-13 17:11:38 -06:00
8b3d798374 CMake: add WITH_LINKER_MOLD option for GCC/Clang Unix platforms
Can give considerably faster linking, especially on system with many
cores.

The mold linker recently reached 1.0, see:
https://github.com/rui314/mold

The current stable release of GCC can't use this linker via
-fuse-ld=mold, so this patch uses the "-B" argument to add a binary
directory containing an alternate "ld" command that points to
"mold" (which is part of the default mold installation).

Some timing tests for linking full builds for AMD TR 3970X:

- BFD: 20.78 seconds.
- LLD: 12.16 seconds.
- GOLD: 7.21 seconds.
- MOLD: 2.53 seconds.

Ref D13807

Reviewed by: sergey, brecht
2022-01-14 09:44:58 +11:00
0c5ccae79d Fix: Incorrect logic in mesh validation for removing layers
The mask is only used if it's not zero. Adding the normal mask made
it not zero, but it didn't include anything else, so all custom data
layers except normals were removed. The fix is to only add normals
to the mask when it should be used.
2022-01-13 16:36:50 -06:00
cfa53e0fbe Refactor: Move normals out of MVert, lazy calculation
As described in T91186, this commit moves mesh vertex normals into a
contiguous array of float vectors in a custom data layer, how face
normals are currently stored.

The main interface is documented in `BKE_mesh.h`. Vertex and face
normals are now calculated on-demand and cached, retrieved with an
"ensure" function. Since the logical state of a mesh is now "has
normals when necessary", they can be retrieved from a `const` mesh.

The goal is to use on-demand calculation for all derived data, but
leave room for eager calculation for performance purposes (modifier
evaluation is threaded, but viewport data generation is not).

**Benefits**
This moves us closer to a SoA approach rather than the current AoS
paradigm. Accessing a contiguous `float3` is much more efficient than
retrieving data from a larger struct. The memory requirements for
accessing only normals or vertex locations are smaller, and at the
cost of more memory usage for just normals, they now don't have to
be converted between float and short, which also simplifies code

In the future, the remaining items can be removed from `MVert`,
leaving only `float3`, which has similar benefits (see T93602).

Removing the combination of derived and original data makes it
conceptually simpler to only calculate normals when necessary.
This is especially important now that we have more opportunities
for temporary meshes in geometry nodes.

**Performance**
In addition to the theoretical future performance improvements by
making `MVert == float3`, I've done some basic performance testing
on this patch directly. The data is fairly rough, but it gives an idea
about where things stand generally.
 - Mesh line primitive 4m Verts: 1.16x faster (36 -> 31 ms),
   showing that accessing just `MVert` is now more efficient.
 - Spring Splash Screen: 1.03-1.06 -> 1.06-1.11 FPS, a very slight
   change that at least shows there is no regression.
 - Sprite Fright Snail Smoosh: 3.30-3.40 -> 3.42-3.50 FPS, a small
   but observable speedup.
 - Set Position Node with Scaled Normal: 1.36x faster (53 -> 39 ms),
   shows that using normals in geometry nodes is faster.
 - Normal Calculation 1.6m Vert Cube: 1.19x faster (25 -> 21 ms),
   shows that calculating normals is slightly faster now.
 - File Size of 1.6m Vert Cube: 1.03x smaller (214.7 -> 208.4 MB),
   Normals are not saved in files, which can help with large meshes.

As for memory usage, it may be slightly more in some cases, but
I didn't observe any difference in the production files I tested.

**Tests**
Some modifiers and cycles test results need to be updated with this
commit, for two reasons:
 - The subdivision surface modifier is not responsible for calculating
   normals anymore. In master, the modifier creates different normals
   than the result of the `Mesh` normal calculation, so this is a bug
   fix.
 - There are small differences in the results of some modifiers that
   use normals because they are not converted to and from `short`
   anymore.

**Future improvements**
 - Remove `ModifierTypeInfo::dependsOnNormals`. Code in each modifier
   already retrieves normals if they are needed anyway.
 - Copy normals as part of a better CoW system for attributes.
 - Make more areas use lazy instead of eager normal calculation.
 - Remove `BKE_mesh_normals_tag_dirty` in more places since that is
   now the default state of a new mesh.
 - Possibly apply a similar change to derived face corner normals.

Differential Revision: https://developer.blender.org/D12770
2022-01-13 14:38:25 -06:00
800fc17367 Fix/workaround MSVC compile error with messag-bus
Some of the message-bus macros are not safe to use in C++. This has come
up before, but no good solution was found. Now @LazyDodo, @HooglyBoogly
and I concluded this is the best duct tape "solution" for the moment.
The message-bus API should address this.
2022-01-13 20:40:52 +01:00
1c4a1c13e0 Cleanup: Run make format 2022-01-13 19:56:11 +01:00
5ecaa9a838 Fix compilation error caused by missing target relation
compositor depends on DNA now so that it can access offsets.
2022-01-13 11:34:41 -07:00
3537abe84b Geometry Nodes: Rename String to Curves socket
Today many users seem to think the output from
this node is a single curve with multiple splines.
This patch renames the geometry output socket
from "Curves" to "Curve Instances" to avoid confusion.

Differential Revision: https://developer.blender.org/D13693
2022-01-13 19:17:03 +01:00
743b9c5e1d CMake: fix build issue with gcc+clang-tidy
Precompiled headers are in a compiler specific format,
when using clang-tidy it tries to read the GCC PCH file
and fails at that.

Disable PCH's for now when WITH_CLANG_TIDY is enabled since
a clean work-around doesn't seem readily available.

relevant LLVM/CMake bugs:

https://bugs.llvm.org/show_bug.cgi?id=41579
https://gitlab.kitware.com/cmake/cmake/-/issues/22081

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

Reviewed by: sergey, Blendify
2022-01-13 09:47:14 -07:00
b8157f5bf1 Fix compilation error caused by missing target relation
Space clip depends on DNA now so that it can access offsets.
2022-01-13 17:25:57 +01:00
22dc865a86 Cleanup: Use nullptr in new Outliner C++ files 2022-01-13 17:01:47 +01:00
039cc32917 Outliner: Compile all Outliner files in C++
We want to refactor quite some of the Outliner code using C++, this is a
logical step to help the transition to a new architecture.

Includes plenty of fixes to make this compile without warnings, trying
not to change logic. The usual stuff (casts from `void *`, designated
initializers, compound literals, etc.).
2022-01-13 17:01:47 +01:00
1a4f8ab389 Cleanup: Make message-bus utility macros callable from C++
C++ doesn't support compound literals like used here (GCC does via an
extension).
2022-01-13 17:01:47 +01:00
f173973ae4 Fix T94874: Drivers using bone custom properties don't work on modifiers 2022-01-13 15:17:32 +01:00
79e985ea54 Cleanup: fix building all geometry nodes in one translation unit
There were a couple of function name collisions which were caused
by sharing code with the mask modifier. I just removed the dependence
on the mask modifier now. The code that I duplicated for that purpose
is only in a legacy node, so it can be expected to be removed soonish.
2022-01-13 12:39:48 +01:00
19a6220308 Fix link errors after recent FFMPEG / link_directories changes 2022-01-13 11:12:56 +01:00
d53738396f Tests: skip some compositor tests when WITH_LIBMV=OFF 2022-01-13 10:41:34 +01:00
7bb572f208 Fix T94737: Cycles wrong normal map normal with OSL
Ensure valid reflection was moved elsewhere, should not be done in the node
anymore.
2022-01-13 10:40:41 +01:00
0cf2fafd81 Fix T94050, T94570, T94527: Cycles Bevel and AO nodes not working with Metal
Workaround what may be a compiler bug, solution found by Michael Jones.
2022-01-13 10:40:41 +01:00
a3deef6fff Fix Cycles CPU + GPU render not using CPU after recent changes
In some places the task scheduler was not initialized in time.
2022-01-13 10:40:41 +01:00
eaa4cdaa42 Fix T94758: wrong denoising albedo with BSSRDF retro reflection 2022-01-13 10:40:40 +01:00
Brecht Van Lommel
29450a2af3 Build: remove usage of link_directories
We are now always using absolute paths for libraries, as recommended by the
CMake docs.

Followup to D9177.
2022-01-13 10:40:38 +01:00
Brecht Van Lommel
75a1a578bd CMake: use FFmpeg find module on Linux
And change install_deps.sh to build shared (instead of static) FFMPEG
libraries, for consistency with other library dependencies and to simplify
the logic. This may require users of install_deps.sh to rebuild FFMPEG.

This is the last step that lets us get rid of LIBPATH variables and
link_directories() entirely, as recommended by the CMake docs.

Some fixes were needed in the find FFMPEG module to make it actually work,
this code was unused up to now.

Followup to D8855.

Differential Revision: https://developer.blender.org/D9177
2022-01-13 10:27:11 +01:00
f1a488d0f2 Fix T92953: Tool Settings: Drag on Tweak fails with LMB select 2022-01-13 14:30:12 +11:00
a7c9fb59ca Cleanup: follow code-style for float suffix 2022-01-13 12:34:28 +11:00
227f0f3582 Cleanup: quiet missing braces warning 2022-01-13 12:33:34 +11:00
97c2c39916 Fix T94624: Object as font instances don't work
The fundamental limitation is that we can only have one instance
("dupli") generator at a time. Because the mesh output of a curve
object is output as an instances, the geometry set instances existed,
replacing the object as font instances. The "fix" is to reverse the
order. The behavior won't be perfect still, but at least the old
behavior will be preserved, which is really what matters for a
feature like this.

One way to take this change further would be completely disabling
regular geometry evaluation while this option is active. However,
it doesn't seem like that would actually improve the state of the code.

Differential Revision: https://developer.blender.org/D13768
2022-01-12 13:46:13 -06:00
a311fa96aa Fix T85706: wm_window_make_drawable update DPI
When drawing windows on monitors that differ in DPI, we can sometimes
have UI elements draw at an incorrect scale. This patch just ensures
that `wm_window_make_drawable` always updates DPI.

See D10483 for more details.

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

Reviewed by Brecht Van Lommel
2022-01-12 10:37:52 -08:00
e594f23a27 Revert "CMake: use FFmpeg find module on Linux"
This reverts commit 62a0de1673. Linux buildbot
is giving link errors.
2022-01-12 19:07:40 +01:00
fa8c2c7885 Fix T94071: Area Split Improvements
Allow area Split to be initiated in any area and give better feedback
when not allowed.

See D13599 for more details and usage examples.

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

Reviewed by Campbell Barton
2022-01-12 09:45:19 -08:00
a0dcd0bf2c Fix warnings after bab47b60cb
It's not really clear how this part of the defaults code should be used,
I think this is fine now and solves the warnings.
2022-01-12 18:37:53 +01:00
a72a9e099c Cleanup: Correct indentation 2022-01-12 18:37:53 +01:00
Brecht Van Lommel
62a0de1673 CMake: use FFmpeg find module on Linux
And change install_deps.sh to build shared (instead of static) FFMPEG
libraries, for consistency with other library dependencies and to simplify
the logic. This may require users of install_deps.sh to rebuild FFMPEG.

This is the last step that lets us get rid of LIBPATH variables and
link_directories() entirely, as recommended by the CMake docs.

Some fixes were needed in the find FFMPEG module to make it actually work,
this code was unused up to now.

Followup to D8855.

Differential Revision: https://developer.blender.org/D9177
2022-01-12 18:25:24 +01:00
Simon Lenz
bab47b60cb DNA: Add space clip editor defaults
This is my attempt of adding defaults for the space clip editor struct
(in line with https://developer.blender.org/T80164).

It adds the default allocation for `SpaceClip` and
`node_composite_movieclip.cc`. This also solves the error below (for
C++ files using the DNA_default_alloc), which was put forward by
Sergey Sharybin.

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

Reviewed by: Julian Eisel
2022-01-12 18:04:48 +01:00
Bastien Montagne
a909ab984c Outliner: Add way to display warning icon for items.
While theorically fairly generic, current code is only enabled for
bledfile and liboverride views, and only used to display messages from
library IDs.

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D13766
2022-01-12 18:01:50 +01:00
5f7ad4baaa BLI_math: Fix building when WITH_GMP is off 2022-01-12 17:24:57 +01:00
Nikhil Shringarpurey
e5858a3ad0 Icons: Remove absolute pathnames and deprecated gradients from SVG files
SVG files contained specific detailed pathnames on developers'
computers. These included full local user profile and path and should
not be in the release.

This patches corrects those lines. It also removes unused gradients from
the private icons SVG.

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

Reviewed by: Yevgeny Makarov, Julian Eisel
2022-01-12 15:03:05 +01:00
ec5560db73 DRW: Add DRW_gpu_wrapper.hh
This adds wrapper classes that make it easier to use GPU objects in C++.

####Motivations:####

 - Easier handling of GPU objects.
 - EEVEE rewrite already makes use of similar wrappers.
 - There is the ongoing effort to use more C++ in the codebase
 and lans to port more engines to it.
 - The shader code refactor will make use of many UBOs with shared
 struct declaration. This helps managing them.
 - Safer handling of `TextureFromPool` which can't be bound as normal
 texture (only texture ref) and can be better tracked in the future.

####Considerations:####

 - I chose the `blender::draw` namespace because `blender::gpu` already has private classes (i.e: `gpu::Texture`).
 - Theses are wrappers that manage a GPU object internally. They might be confused with actual `Texture`. However, the name `TextureWrapper` is a bit too much verbose in my opinion. I'm open to suggestion about better name.

Reviewed By: jbakker

Differential Revision: http://developer.blender.org/D13805
2022-01-12 13:05:18 +01:00
0882069095 Cleanup: codestyle obj_exporter_tests.cc. 2022-01-12 13:02:28 +01:00
1552b86b55 Cleanup: Not needed if statement around delete. 2022-01-12 13:02:28 +01:00
d43b5791e0 BLI: Refactor vector types & functions to use templates
This patch implements the vector types (i.e:`float2`) by making heavy
usage of templating. All vector functions are now outside of the vector
classes (inside the `blender::math` namespace) and are not vector size
dependent for the most part.

In the ongoing effort to make shaders less GL centric, we are aiming
to share more code between GLSL and C++ to avoid code duplication.

####Motivations:
- We are aiming to share UBO and SSBO structures between GLSL and C++.
This means we will use many of the existing vector types and others
we currently don't have (uintX, intX). All these variations were
asking for many more code duplication.
- Deduplicate existing code which is duplicated for each vector size.
- We also want to share small functions. Which means that vector
functions should be static and not in the class namespace.
- Reduce friction to use these types in new projects due to their
incompleteness.
- The current state of the `BLI_(float|double|mpq)(2|3|4).hh` is a
bit of a let down. Most clases are incomplete, out of sync with each
others with different codestyles, and some functions that should be
static are not (i.e: `float3::reflect()`).

####Upsides:
- Still support `.x, .y, .z, .w` for readability.
- Compact, readable and easilly extendable.
- All of the vector functions are available for all the vectors types
and can be restricted to certain types. Also template specialization
let us define exception for special class (like mpq).
- With optimization ON, the compiler unroll the loops and performance
is the same.

####Downsides:
- Might impact debugability. Though I would arge that the bugs are
rarelly caused by the vector class itself (since the operations are
quite trivial) but by the type conversions.
- Might impact compile time. I did not saw a significant impact since
the usage is not really widespread.
- Functions needs to be rewritten to support arbitrary vector length.
For instance, one can't call `len_squared_v3v3` in
`math::length_squared()` and call it a day.
- Type cast does not work with the template version of the `math::`
vector functions. Meaning you need to manually cast `float *` and
`(float *)[3]` to `float3` for the function calls.
i.e: `math::distance_squared(float3(nearest.co), positions[i]);`
- Some parts might loose in readability:
`float3::dot(v1.normalized(), v2.normalized())`
becoming
`math::dot(math::normalize(v1), math::normalize(v2))`
But I propose, when appropriate, to use
`using namespace blender::math;` on function local or file scope to
increase readability.
`dot(normalize(v1), normalize(v2))`

####Consideration:
- Include back `.length()` method. It is quite handy and is more C++
oriented.
- I considered the GLM library as a candidate for replacement. It felt
like too much for what we need and would be difficult to extend / modify
to our needs.
- I used Macros to reduce code in operators declaration and potential
copy paste bugs. This could reduce debugability and could be reverted.
- This touches `delaunay_2d.cc` and the intersection code. I would like
to know @howardt opinion on the matter.
- The `noexcept` on the copy constructor of `mpq(2|3)` is being removed.
But according to @JacquesLucke it is not a real problem for now.

I would like to give a huge thanks to @JacquesLucke who helped during this
and pushed me to reduce the duplication further.

Reviewed By: brecht, sergey, JacquesLucke

Differential Revision: https://developer.blender.org/D13791
2022-01-12 12:57:07 +01:00
fb6bd88644 Revert "BLI: Refactor vector types & functions to use templates"
Includes unwanted changes

This reverts commit 46e049d0ce.
2022-01-12 12:50:02 +01:00
Clment Foucault
46e049d0ce BLI: Refactor vector types & functions to use templates
This patch implements the vector types (i.e:`float2`) by making heavy
usage of templating. All vector functions are now outside of the vector
classes (inside the `blender::math` namespace) and are not vector size
dependent for the most part.

In the ongoing effort to make shaders less GL centric, we are aiming
to share more code between GLSL and C++ to avoid code duplication.

####Motivations:
 - We are aiming to share UBO and SSBO structures between GLSL and C++.
 This means we will use many of the existing vector types and others
 we currently don't have (uintX, intX). All these variations were
 asking for many more code duplication.
 - Deduplicate existing code which is duplicated for each vector size.
 - We also want to share small functions. Which means that vector
 functions should be static and not in the class namespace.
 - Reduce friction to use these types in new projects due to their
 incompleteness.
 - The current state of the `BLI_(float|double|mpq)(2|3|4).hh` is a
 bit of a let down. Most clases are incomplete, out of sync with each
 others with different codestyles, and some functions that should be
 static are not (i.e: `float3::reflect()`).

####Upsides:
 - Still support `.x, .y, .z, .w` for readability.
 - Compact, readable and easilly extendable.
 - All of the vector functions are available for all the vectors types
 and can be restricted to certain types. Also template specialization
 let us define exception for special class (like mpq).
 - With optimization ON, the compiler unroll the loops and performance
 is the same.

####Downsides:
 - Might impact debugability. Though I would arge that the bugs are
 rarelly caused by the vector class itself (since the operations are
 quite trivial) but by the type conversions.
 - Might impact compile time. I did not saw a significant impact since
 the usage is not really widespread.
 - Functions needs to be rewritten to support arbitrary vector length.
 For instance, one can't call `len_squared_v3v3` in
 `math::length_squared()` and call it a day.
 - Type cast does not work with the template version of the `math::`
 vector functions. Meaning you need to manually cast `float *` and
 `(float *)[3]` to `float3` for the function calls.
 i.e: `math::distance_squared(float3(nearest.co), positions[i]);`
 - Some parts might loose in readability:
 `float3::dot(v1.normalized(), v2.normalized())`
 becoming
 `math::dot(math::normalize(v1), math::normalize(v2))`
 But I propose, when appropriate, to use
 `using namespace blender::math;` on function local or file scope to
 increase readability.
 `dot(normalize(v1), normalize(v2))`

####Consideration:
 - Include back `.length()` method. It is quite handy and is more C++
 oriented.
 - I considered the GLM library as a candidate for replacement. It felt
 like too much for what we need and would be difficult to extend / modify
 to our needs.
 - I used Macros to reduce code in operators declaration and potential
 copy paste bugs. This could reduce debugability and could be reverted.
 - This touches `delaunay_2d.cc` and the intersection code. I would like
 to know @howardt opinion on the matter.
 - The `noexcept` on the copy constructor of `mpq(2|3)` is being removed.
 But according to @JacquesLucke it is not a real problem for now.

I would like to give a huge thanks to @JacquesLucke who helped during this
and pushed me to reduce the duplication further.

Reviewed By: brecht, sergey, JacquesLucke

Differential Revision: https://developer.blender.org/D13791
2022-01-12 12:47:43 +01:00
e5766752d0 Revert "BLI: Refactor vector types & functions to use templates"
Reverted because the commit removes a lot of commits.

This reverts commit a2c1c368af.
2022-01-12 12:44:26 +01:00
Nathan Rozendaal
b2ccd8546c Compositor: Add Scene Time Node, Rename Time node
Fixes issue T94603
It adds a new compositor node called Scene Time which is already present as a geo node, having the same basic nodes available in all node trees is a nice thing to have.
Renames "Time" node to "Time Curve", this is done to avoid confusion between the Time node and the Scene Time node.

Reviewed By: jbakker

Maniphest Tasks: T94603

Differential Revision: https://developer.blender.org/D13762
2022-01-12 12:29:44 +01:00
a2c1c368af BLI: Refactor vector types & functions to use templates
This patch implements the vector types (i.e:float2) by making heavy
usage of templating. All vector functions are now outside of the vector
classes (inside the blender::math namespace) and are not vector size
dependent for the most part.

In the ongoing effort to make shaders less GL centric, we are aiming
to share more code between GLSL and C++ to avoid code duplication.

Motivations:
- We are aiming to share UBO and SSBO structures between GLSL and C++.
  This means we will use many of the existing vector types and others we
  currently don't have (uintX, intX). All these variations were asking
  for many more code duplication.
- Deduplicate existing code which is duplicated for each vector size.
- We also want to share small functions. Which means that vector functions
  should be static and not in the class namespace.
- Reduce friction to use these types in new projects due to their
  incompleteness.
- The current state of the BLI_(float|double|mpq)(2|3|4).hh is a bit of a
  let down. Most clases are incomplete, out of sync with each others with
  different codestyles, and some functions that should be static are not
  (i.e: float3::reflect()).

Upsides:
- Still support .x, .y, .z, .w for readability.
- Compact, readable and easilly extendable.
- All of the vector functions are available for all the vectors types and
  can be restricted to certain types. Also template specialization let us
  define exception for special class (like mpq).
- With optimization ON, the compiler unroll the loops and performance is
  the same.

Downsides:
- Might impact debugability. Though I would arge that the bugs are rarelly
  caused by the vector class itself (since the operations are quite trivial)
  but by the type conversions.
- Might impact compile time. I did not saw a significant impact since the
  usage is not really widespread.
- Functions needs to be rewritten to support arbitrary vector length. For
  instance, one can't call len_squared_v3v3 in math::length_squared() and
  call it a day.
- Type cast does not work with the template version of the math:: vector
  functions. Meaning you need to manually cast float * and (float *)[3] to
  float3 for the function calls.
  i.e: math::distance_squared(float3(nearest.co), positions[i]);
- Some parts might loose in readability:
  float3::dot(v1.normalized(), v2.normalized())
  becoming
  math::dot(math::normalize(v1), math::normalize(v2))
  But I propose, when appropriate, to use
  using namespace blender::math; on function local or file scope to
  increase readability. dot(normalize(v1), normalize(v2))

Consideration:
- Include back .length() method. It is quite handy and is more C++
  oriented.
- I considered the GLM library as a candidate for replacement.
  It felt like too much for what we need and would be difficult to
  extend / modify to our needs.
- I used Macros to reduce code in operators declaration and potential
  copy paste bugs. This could reduce debugability and could be reverted.
- This touches delaunay_2d.cc and the intersection code. I would like to
  know @Howard Trickey (howardt) opinion on the matter.
- The noexcept on the copy constructor of mpq(2|3) is being removed.
  But according to @Jacques Lucke (JacquesLucke) it is not a real problem
  for now.

I would like to give a huge thanks to @Jacques Lucke (JacquesLucke) who
helped during this and pushed me to reduce the duplication further.

Reviewed By: brecht, sergey, JacquesLucke

Differential Revision: http://developer.blender.org/D13791
2022-01-12 12:19:39 +01:00
d320f3677e Cleanup: make format 2022-01-12 11:29:18 +01:00
7442 changed files with 198031 additions and 215093 deletions

View File

@@ -205,6 +205,7 @@ ForEachMacros:
- FOREACH_SCENE_COLLECTION_BEGIN
- FOREACH_SCENE_OBJECT_BEGIN
- FOREACH_SELECTED_BASE_BEGIN
- FOREACH_SELECTED_BEZT_BEGIN
- FOREACH_SELECTED_EDITABLE_OBJECT_BEGIN
- FOREACH_SELECTED_OBJECT_BEGIN
- FOREACH_TRANS_DATA_CONTAINER
@@ -268,6 +269,7 @@ ForEachMacros:
StatementMacros:
- PyObject_HEAD
- PyObject_VAR_HEAD
- ccl_gpu_kernel_postfix
MacroBlockBegin: "^BSDF_CLOSURE_CLASS_BEGIN$"
MacroBlockEnd: "^BSDF_CLOSURE_CLASS_END$"

View File

@@ -34,6 +34,15 @@ indent_style = space
indent_size = 2
max_line_length = 99
# Tom's Obvious Minimal Language
[*.toml]
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4
max_line_length = 120
# reStructuredText
[*.rst]
charset = utf-8
@@ -42,3 +51,12 @@ insert_final_newline = true
indent_style = space
indent_size = 3
max_line_length = 120
# Makefile
[{Makefile,GNUmakefile}]
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = tab
indent_size = 4
max_line_length = 120

View File

@@ -1,23 +1,5 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# 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) 2006, Blender Foundation
# All rights reserved.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2006 Blender Foundation. All rights reserved.
#-----------------------------------------------------------------------------
# We don't allow in-source builds. This causes no end of troubles because
@@ -157,8 +139,9 @@ option(WITH_BLENDER "Build blender (disable to build only the blender player)" O
mark_as_advanced(WITH_BLENDER)
if(APPLE)
# Currently this causes a build error linking, disable.
set(WITH_BLENDER_THUMBNAILER OFF)
# In future, can be used with `quicklookthumbnailing/qlthumbnailreply` to create file
# thumbnails for say Finder. Turn it off for now.
option(WITH_BLENDER_THUMBNAILER "Build \"blender-thumbnailer\" thumbnail extraction utility" OFF)
elseif(WIN32)
option(WITH_BLENDER_THUMBNAILER "Build \"BlendThumb.dll\" helper for Windows explorer integration" ON)
else()
@@ -274,10 +257,12 @@ endif()
if(UNIX AND NOT APPLE)
option(WITH_SYSTEM_GLEW "Use GLEW OpenGL wrapper library provided by the operating system" OFF)
option(WITH_SYSTEM_GLES "Use OpenGL ES library provided by the operating system" ON)
option(WITH_SYSTEM_FREETYPE "Use the freetype library provided by the operating system" OFF)
else()
# not an option for other OS's
set(WITH_SYSTEM_GLEW OFF)
set(WITH_SYSTEM_GLES OFF)
set(WITH_SYSTEM_FREETYPE OFF)
endif()
@@ -299,6 +284,7 @@ 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
option(WITH_CODEC_AVI "Enable Blenders own AVI file support (raw/jpeg)" ON)
@@ -316,7 +302,7 @@ option(WITH_USD "Enable Universal Scene Description (USD) Suppor
option(WITH_OPENCOLLADA "Enable OpenCollada Support (http://www.opencollada.org)" ON)
# Sound output
option(WITH_SDL "Enable SDL for sound and joystick support" ON)
option(WITH_SDL "Enable SDL for sound" ON)
option(WITH_OPENAL "Enable OpenAL Support (http://www.openal.org)" ON)
if(APPLE)
option(WITH_COREAUDIO "Enable CoreAudio for audio support on macOS" ON)
@@ -423,6 +409,8 @@ option(WITH_CYCLES_DEBUG "Build Cycles with options useful for debug
option(WITH_CYCLES_STANDALONE "Build Cycles standalone application" OFF)
option(WITH_CYCLES_STANDALONE_GUI "Build Cycles standalone with GUI" OFF)
option(WITH_CYCLES_HYDRA_RENDER_DELEGATE "Build Cycles Hydra render delegate" OFF)
option(WITH_CYCLES_DEBUG_NAN "Build Cycles with additional asserts for detecting NaNs and invalid values" OFF)
option(WITH_CYCLES_NATIVE_ONLY "Build Cycles with native kernel only (which fits current CPU, use for development only)" OFF)
option(WITH_CYCLES_KERNEL_ASAN "Build Cycles kernels with address sanitizer when WITH_COMPILER_ASAN is on, even if it's very slow" OFF)
@@ -451,12 +439,7 @@ endif()
# AMD HIP
if(NOT APPLE)
if(WIN32)
option(WITH_CYCLES_DEVICE_HIP "Enable Cycles AMD HIP support" ON)
else()
option(WITH_CYCLES_DEVICE_HIP "Enable Cycles AMD HIP support" OFF)
endif()
option(WITH_CYCLES_DEVICE_HIP "Enable Cycles AMD HIP support" ON)
option(WITH_CYCLES_HIP_BINARIES "Build Cycles AMD HIP binaries" OFF)
set(CYCLES_HIP_BINARIES_ARCH gfx1010 gfx1011 gfx1012 gfx1030 gfx1031 gfx1032 gfx1034 CACHE STRING "AMD HIP architectures to build binaries for")
mark_as_advanced(WITH_CYCLES_DEVICE_HIP)
@@ -503,7 +486,7 @@ if((UNIX AND NOT APPLE) OR (CMAKE_GENERATOR MATCHES "^Visual Studio.+"))
endif()
option(WITH_BOOST "Enable features depending on boost" ON)
option(WITH_TBB "Enable features depending on TBB (OpenVDB, OpenImageDenoise, sculpt multithreading)" ON)
option(WITH_TBB "Enable multithreading. TBB is also required for features such as Cycles, OpenVDB and USD" ON)
# TBB malloc is only supported on for windows currently
if(WIN32)
@@ -517,7 +500,7 @@ else()
set(WITH_EXPERIMENTAL_FEATURES OFF)
endif()
# Unit testsing
# Unit testing
option(WITH_GTESTS "Enable GTest unit testing" OFF)
option(WITH_OPENGL_RENDER_TESTS "Enable OpenGL render related unit testing (Experimental)" OFF)
option(WITH_OPENGL_DRAW_TESTS "Enable OpenGL UI drawing related unit testing (Experimental)" OFF)
@@ -546,6 +529,19 @@ mark_as_advanced(
WITH_GPU_SHADER_BUILDER
)
# Metal
if (APPLE)
option(WITH_METAL_BACKEND "Use Metal for graphics instead of (or as well as) OpenGL on macOS." OFF)
mark_as_advanced(WITH_METAL_BACKEND)
else()
set(WITH_METAL_BACKEND OFF)
endif()
if (WITH_METAL_BACKEND)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version" FORCE)
endif()
if(WIN32)
option(WITH_GL_ANGLE "Link with the ANGLE library, an OpenGL ES 2.0 implementation based on Direct3D, instead of the system OpenGL library." OFF)
mark_as_advanced(WITH_GL_ANGLE)
@@ -569,6 +565,10 @@ if(UNIX AND NOT APPLE)
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)
mark_as_advanced(WITH_LINKER_MOLD)
endif()
endif()
option(WITH_COMPILER_ASAN "Build and link against address sanitizer (only for Debug & RelWithDebInfo targets)." OFF)
@@ -679,7 +679,7 @@ if(WIN32 OR XCODE)
option(IDE_GROUP_PROJECTS_IN_FOLDERS "Organize the projects according to source folder structure." ON)
mark_as_advanced(IDE_GROUP_PROJECTS_IN_FOLDERS)
if (IDE_GROUP_PROJECTS_IN_FOLDERS)
if(IDE_GROUP_PROJECTS_IN_FOLDERS)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
endif()
endif()
@@ -704,9 +704,12 @@ if(UNIX AND NOT APPLE)
endif()
# Installation process.
option(POSTINSTALL_SCRIPT "Run given CMake script after installation process" OFF)
set(POSTINSTALL_SCRIPT "" CACHE FILEPATH "Run given CMake script after installation process")
mark_as_advanced(POSTINSTALL_SCRIPT)
set(POSTCONFIGURE_SCRIPT "" CACHE FILEPATH "Run given CMake script as the last step of CMake configuration")
mark_as_advanced(POSTCONFIGURE_SCRIPT)
# end option(...)
@@ -737,9 +740,10 @@ endif()
#-----------------------------------------------------------------------------
# Check for conflicting/unsupported configurations
if(NOT WITH_BLENDER AND NOT WITH_CYCLES_STANDALONE)
if(NOT WITH_BLENDER AND NOT WITH_CYCLES_STANDALONE AND NOT WITH_CYCLES_HYDRA_RENDER_DELEGATE)
message(FATAL_ERROR
"At least one of WITH_BLENDER or WITH_CYCLES_STANDALONE "
"or WITH_CYCLES_HYDRA_RENDER_DELEGATE "
"must be enabled, nothing to do!"
)
endif()
@@ -802,6 +806,9 @@ set_and_warn_dependency(WITH_IMAGE_OPENEXR WITH_OPENCOLORIO OFF)
# Haru needs `TIFFFaxBlackCodes` & `TIFFFaxWhiteCodes` symbols from TIFF.
set_and_warn_dependency(WITH_IMAGE_TIFF WITH_HARU OFF)
# USD needs OpenSubDiv, since that is used by the Cycles Hydra render delegate.
set_and_warn_dependency(WITH_OPENSUBDIV WITH_USD OFF)
# auto enable openimageio for cycles
if(WITH_CYCLES)
set(WITH_OPENIMAGEIO ON)
@@ -874,7 +881,7 @@ if(WITH_CYCLES_DEVICE_HIP)
endif()
#-----------------------------------------------------------------------------
# Check check if submodules are cloned
# Check if submodules are cloned.
if(WITH_INTERNATIONAL)
file(GLOB RESULT "${CMAKE_SOURCE_DIR}/release/datafiles/locale")
@@ -897,8 +904,8 @@ if(WITH_PYTHON)
# Do this before main 'platform_*' checks,
# because UNIX will search for the old Python paths which may not exist.
# giving errors about missing paths before this case is met.
if(DEFINED PYTHON_VERSION AND "${PYTHON_VERSION}" VERSION_LESS "3.9")
message(FATAL_ERROR "At least Python 3.9 is required to build, but found Python ${PYTHON_VERSION}")
if(DEFINED PYTHON_VERSION AND "${PYTHON_VERSION}" VERSION_LESS "3.10")
message(FATAL_ERROR "At least Python 3.10 is required to build, but found Python ${PYTHON_VERSION}")
endif()
file(GLOB RESULT "${CMAKE_SOURCE_DIR}/release/scripts/addons")
@@ -1282,6 +1289,16 @@ else()
list(APPEND GL_DEFINITIONS -DWITH_GL_PROFILE_CORE)
endif()
#-----------------------------------------------------------------------------
# Configure Metal.
if (WITH_METAL_BACKEND)
add_definitions(-DWITH_METAL_BACKEND)
# No need to add frameworks here, all the ones we need for Metal and
# Metal-OpenGL Interop are already being added by
# build_files/cmake/platform/platform_apple.cmake
endif()
#-----------------------------------------------------------------------------
# Configure OpenMP.
if(WITH_OPENMP)
@@ -1676,6 +1693,8 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_DUPLICATE_ENUM -Wno-duplicate-enum)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNDEF -Wno-undef)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_NORETURN -Wno-missing-noreturn)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_BUT_SET_VARIABLE -Wno-unused-but-set-variable)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_DEPRECATED_DECLARATIONS -Wno-deprecated-declarations)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_PARAMETER -Wno-unused-parameter)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_PRIVATE_FIELD -Wno-unused-private-field)
@@ -1890,15 +1909,13 @@ if(WITH_BLENDER)
# source after intern and extern to gather all
# internal and external library information first, for test linking
add_subdirectory(source)
elseif(WITH_CYCLES_STANDALONE)
elseif(WITH_CYCLES_STANDALONE OR WITH_CYCLES_HYDRA_RENDER_DELEGATE)
add_subdirectory(intern/glew-mx)
add_subdirectory(intern/guardedalloc)
add_subdirectory(intern/libc_compat)
add_subdirectory(intern/numaapi)
add_subdirectory(intern/sky)
add_subdirectory(intern/cycles)
add_subdirectory(extern/clew)
if(WITH_CYCLES_LOGGING)
if(NOT WITH_SYSTEM_GFLAGS)
add_subdirectory(extern/gflags)
@@ -1955,7 +1972,7 @@ if(FIRST_RUN)
set(_msg " - ${_setting}")
string(LENGTH "${_msg}" _len)
while("32" GREATER "${_len}")
while("36" GREATER "${_len}")
string(APPEND _msg " ")
math(EXPR _len "${_len} + 1")
endwhile()
@@ -2070,3 +2087,8 @@ endif()
if(0)
print_all_vars()
endif()
# Should be the last step of configuration.
if(POSTCONFIGURE_SCRIPT)
include(${POSTCONFIGURE_SCRIPT})
endif()

View File

@@ -1,23 +1,4 @@
# -*- mode: gnumakefile; tab-width: 4; indent-tabs-mode: t; -*-
# vim: tabstop=4
#
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
# SPDX-License-Identifier: GPL-2.0-or-later
# This Makefile does an out-of-source CMake build in ../build_`OS`_`CPU`
# eg:
@@ -51,7 +32,7 @@ Other Convenience Targets
* config: Run cmake configuration tool to set build options.
* deps: Build library dependencies (intended only for platform maintainers).
The existance of locally build dependencies overrides the pre-built dependencies from subversion.
The existence of locally build dependencies overrides the pre-built dependencies from subversion.
These must be manually removed from '../lib/' to go back to using the pre-compiled libraries.
Project Files
@@ -63,8 +44,6 @@ Project Files
Package Targets
* package_debian: Build a debian package.
* package_pacman: Build an arch linux pacman package.
* package_archive: Build an archive package.
Testing Targets
@@ -72,24 +51,25 @@ Testing Targets
* test:
Run automated tests with ctest.
* test_cmake:
Runs our own cmake file checker
which detects errors in the cmake file list definitions
* test_pep8:
Checks all python script are pep8
which are tagged to use the stricter formatting
* test_deprecated:
Checks for deprecation tags in our code which may need to be removed
Static Source Code Checking
Not associated with building Blender.
* check_cppcheck: Run blender source through cppcheck (C & C++).
* check_clang_array: Run blender source through clang array checking script (C & C++).
* check_deprecated: Check if there is any deprecated code to remove.
* check_splint: Run blenders source through splint (C only).
* check_sparse: Run blenders source through sparse (C only).
* check_smatch: Run blenders source through smatch (C only).
* check_descriptions: Check for duplicate/invalid descriptions.
* check_licenses: Check license headers follow the SPDX license specification,
using one of the accepted licenses in 'doc/license/SPDX-license-identifiers.txt'
Append with 'SHOW_HEADERS=1' to show all unique headers
which can be useful for spotting license irregularities.
* check_cmake: Runs our own cmake file checker which detects errors in the cmake file list definitions.
* check_pep8: Checks all Python script are pep8 which are tagged to use the stricter formatting.
* check_mypy: Checks all Python scripts using mypy,
see: source/tools/check_source/check_mypy_config.py scripts which are included.
Spell Checkers
This runs the spell checker from the developer tools repositor.
@@ -140,7 +120,7 @@ Utilities
Updates git and all submodules but not svn.
* format:
Format source code using clang (uses PATHS if passed in). For example::
Format source code using clang-format & autopep8 (uses PATHS if passed in). For example::
make format PATHS="source/blender/blenlib source/blender/blenkernel"
@@ -150,6 +130,7 @@ Environment Variables
* BUILD_DIR: Override default build path.
* PYTHON: Use this for the Python command (used for checking tools).
* NPROCS: Number of processes to use building (auto-detect when omitted).
* AUTOPEP8: Command used for Python code-formatting (used for the format target).
Documentation Targets
Not associated with building Blender.
@@ -219,13 +200,34 @@ endif
# in libraries, or python 2 for running make update to get it.
ifeq ($(OS_NCASE),darwin)
ifeq (, $(shell command -v $(PYTHON)))
PYTHON:=$(DEPS_INSTALL_DIR)/python/bin/python3.7m
PYTHON:=$(DEPS_INSTALL_DIR)/python/bin/python3.10
ifeq (, $(shell command -v $(PYTHON)))
PYTHON:=python
endif
endif
endif
# Set the LIBDIR, an empty string when not found.
LIBDIR:=$(wildcard ../lib/${OS_NCASE}_${CPU})
ifeq (, $(LIBDIR))
LIBDIR:=$(wildcard ../lib/${OS_NCASE}_centos7_${CPU})
endif
ifeq (, $(LIBDIR))
LIBDIR:=$(wildcard ../lib/${OS_NCASE})
endif
# Use the autopep8 module in ../lib/ (which can be executed via Python directly).
# Otherwise the "autopep8" command can be used.
ifndef AUTOPEP8
ifneq (, $(LIBDIR))
AUTOPEP8:=$(wildcard $(LIBDIR)/python/lib/python3.10/site-packages/autopep8.py)
endif
ifeq (, $(AUTOPEP8))
AUTOPEP8:=autopep8
endif
endif
# -----------------------------------------------------------------------------
# additional targets for the build configuration
@@ -328,7 +330,7 @@ CMAKE_CONFIG = cmake $(CMAKE_CONFIG_ARGS) \
# -----------------------------------------------------------------------------
# Tool for 'make config'
# X11 spesific
# X11 specific.
ifdef DISPLAY
CMAKE_CONFIG_TOOL = cmake-gui
else
@@ -405,11 +407,6 @@ help: .FORCE
# -----------------------------------------------------------------------------
# Packages
#
package_debian: .FORCE
cd build_files/package_spec ; DEB_BUILD_OPTIONS="parallel=$(NPROCS)" sh ./build_debian.sh
package_pacman: .FORCE
cd build_files/package_spec/pacman ; MAKEFLAGS="-j$(NPROCS)" makepkg
package_archive: .FORCE
make -C "$(BUILD_DIR)" -s package_archive
@@ -420,21 +417,7 @@ package_archive: .FORCE
# Tests
#
test: .FORCE
$(PYTHON) ./build_files/utils/make_test.py "$(BUILD_DIR)"
# run pep8 check check on scripts we distribute.
test_pep8: .FORCE
$(PYTHON) tests/python/pep8.py > test_pep8.log 2>&1
@echo "written: test_pep8.log"
# run some checks on our cmakefiles.
test_cmake: .FORCE
$(PYTHON) build_files/cmake/cmake_consistency_check.py > test_cmake_consistency.log 2>&1
@echo "written: test_cmake_consistency.log"
# run deprecation tests, see if we have anything to remove.
test_deprecated: .FORCE
$(PYTHON) tests/check_deprecated.py
@$(PYTHON) ./build_files/utils/make_test.py "$(BUILD_DIR)"
# -----------------------------------------------------------------------------
@@ -456,44 +439,44 @@ project_eclipse: .FORCE
#
check_cppcheck: .FORCE
$(CMAKE_CONFIG)
cd "$(BUILD_DIR)" ; \
@$(CMAKE_CONFIG)
@cd "$(BUILD_DIR)" ; \
$(PYTHON) \
"$(BLENDER_DIR)/build_files/cmake/cmake_static_check_cppcheck.py" 2> \
"$(BLENDER_DIR)/check_cppcheck.txt"
@echo "written: check_cppcheck.txt"
check_clang_array: .FORCE
$(CMAKE_CONFIG)
cd "$(BUILD_DIR)" ; \
@$(CMAKE_CONFIG)
@cd "$(BUILD_DIR)" ; \
$(PYTHON) "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_clang_array.py"
check_splint: .FORCE
$(CMAKE_CONFIG)
cd "$(BUILD_DIR)" ; \
@$(CMAKE_CONFIG)
@cd "$(BUILD_DIR)" ; \
$(PYTHON) "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_splint.py"
check_sparse: .FORCE
$(CMAKE_CONFIG)
cd "$(BUILD_DIR)" ; \
@$(CMAKE_CONFIG)
@cd "$(BUILD_DIR)" ; \
$(PYTHON) "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_sparse.py"
check_smatch: .FORCE
$(CMAKE_CONFIG)
cd "$(BUILD_DIR)" ; \
@$(CMAKE_CONFIG)
@cd "$(BUILD_DIR)" ; \
$(PYTHON) "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_smatch.py"
check_mypy: .FORCE
$(PYTHON) "$(BLENDER_DIR)/source/tools/check_source/check_mypy.py"
@$(PYTHON) "$(BLENDER_DIR)/source/tools/check_source/check_mypy.py"
check_spelling_py: .FORCE
cd "$(BUILD_DIR)" ; \
@cd "$(BUILD_DIR)" ; \
PYTHONIOENCODING=utf_8 $(PYTHON) \
"$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \
"$(BLENDER_DIR)/release/scripts"
check_spelling_c: .FORCE
cd "$(BUILD_DIR)" ; \
@cd "$(BUILD_DIR)" ; \
PYTHONIOENCODING=utf_8 $(PYTHON) \
"$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \
--cache-file=$(CHECK_SPELLING_CACHE) \
@@ -503,53 +486,71 @@ check_spelling_c: .FORCE
"$(BLENDER_DIR)/intern/ghost" \
check_spelling_osl: .FORCE
cd "$(BUILD_DIR)" ;\
@cd "$(BUILD_DIR)" ; \
PYTHONIOENCODING=utf_8 $(PYTHON) \
"$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \
--cache-file=$(CHECK_SPELLING_CACHE) \
"$(BLENDER_DIR)/intern/cycles/kernel/shaders"
check_descriptions: .FORCE
$(BLENDER_BIN) --background -noaudio --factory-startup --python \
@$(BLENDER_BIN) --background -noaudio --factory-startup --python \
"$(BLENDER_DIR)/source/tools/check_source/check_descriptions.py"
check_deprecated: .FORCE
@PYTHONIOENCODING=utf_8 $(PYTHON) \
source/tools/check_source/check_deprecated.py
check_licenses: .FORCE
@PYTHONIOENCODING=utf_8 $(PYTHON) \
"$(BLENDER_DIR)/source/tools/check_source/check_licenses.py" \
"--show-headers=$(SHOW_HEADERS)"
check_pep8: .FORCE
@PYTHONIOENCODING=utf_8 $(PYTHON) \
tests/python/pep8.py
check_cmake: .FORCE
@PYTHONIOENCODING=utf_8 $(PYTHON) \
source/tools/check_source/check_cmake_consistency.py
# -----------------------------------------------------------------------------
# Utilities
#
source_archive: .FORCE
python3 ./build_files/utils/make_source_archive.py
@$(PYTHON) ./build_files/utils/make_source_archive.py
source_archive_complete: .FORCE
cmake \
@cmake \
-S "$(BLENDER_DIR)/build_files/build_environment" -B"$(BUILD_DIR)/source_archive" \
-DCMAKE_BUILD_TYPE_INIT:STRING=$(BUILD_TYPE) -DPACKAGE_USE_UPSTREAM_SOURCES=OFF
# This assumes CMake is still using a default `PACKAGE_DIR` variable:
python3 ./build_files/utils/make_source_archive.py --include-packages "$(BUILD_DIR)/source_archive/packages"
@$(PYTHON) ./build_files/utils/make_source_archive.py --include-packages "$(BUILD_DIR)/source_archive/packages"
INKSCAPE_BIN?="inkscape"
icons: .FORCE
BLENDER_BIN=$(BLENDER_BIN) INKSCAPE_BIN=$(INKSCAPE_BIN) \
@BLENDER_BIN=$(BLENDER_BIN) INKSCAPE_BIN=$(INKSCAPE_BIN) \
"$(BLENDER_DIR)/release/datafiles/blender_icons_update.py"
INKSCAPE_BIN=$(INKSCAPE_BIN) \
@INKSCAPE_BIN=$(INKSCAPE_BIN) \
"$(BLENDER_DIR)/release/datafiles/prvicons_update.py"
INKSCAPE_BIN=$(INKSCAPE_BIN) \
@INKSCAPE_BIN=$(INKSCAPE_BIN) \
"$(BLENDER_DIR)/release/datafiles/alert_icons_update.py"
icons_geom: .FORCE
BLENDER_BIN=$(BLENDER_BIN) \
@BLENDER_BIN=$(BLENDER_BIN) \
"$(BLENDER_DIR)/release/datafiles/blender_icons_geom_update.py"
update: .FORCE
$(PYTHON) ./build_files/utils/make_update.py
@$(PYTHON) ./build_files/utils/make_update.py
update_code: .FORCE
$(PYTHON) ./build_files/utils/make_update.py --no-libraries
@$(PYTHON) ./build_files/utils/make_update.py --no-libraries
format: .FORCE
PATH="../lib/${OS_NCASE}_${CPU}/llvm/bin/:../lib/${OS_NCASE}_centos7_${CPU}/llvm/bin/:../lib/${OS_NCASE}/llvm/bin/:$(PATH)" \
$(PYTHON) source/tools/utils_maintenance/clang_format_paths.py $(PATHS)
@PATH="${LIBDIR}/llvm/bin/:$(PATH)" $(PYTHON) source/tools/utils_maintenance/clang_format_paths.py $(PATHS)
@$(PYTHON) source/tools/utils_maintenance/autopep8_format_paths.py --autopep8-command="$(AUTOPEP8)" $(PATHS)
# -----------------------------------------------------------------------------
@@ -558,25 +559,25 @@ format: .FORCE
# Simple version of ./doc/python_api/sphinx_doc_gen.sh with no PDF generation.
doc_py: .FORCE
ASAN_OPTIONS=halt_on_error=0:${ASAN_OPTIONS} \
@ASAN_OPTIONS=halt_on_error=0:${ASAN_OPTIONS} \
$(BLENDER_BIN) \
--background -noaudio --factory-startup \
--python doc/python_api/sphinx_doc_gen.py
sphinx-build -b html -j $(NPROCS) doc/python_api/sphinx-in doc/python_api/sphinx-out
@sphinx-build -b html -j $(NPROCS) doc/python_api/sphinx-in doc/python_api/sphinx-out
@echo "docs written into: '$(BLENDER_DIR)/doc/python_api/sphinx-out/index.html'"
doc_doxy: .FORCE
cd doc/doxygen; doxygen Doxyfile
@cd doc/doxygen; doxygen Doxyfile
@echo "docs written into: '$(BLENDER_DIR)/doc/doxygen/html/index.html'"
doc_dna: .FORCE
$(BLENDER_BIN) \
@$(BLENDER_BIN) \
--background -noaudio --factory-startup \
--python doc/blender_file_format/BlendFileDnaExporter_25.py
@echo "docs written into: '$(BLENDER_DIR)/doc/blender_file_format/dna.html'"
doc_man: .FORCE
$(PYTHON) doc/manpage/blender.1.py $(BLENDER_BIN) blender.1
@$(PYTHON) doc/manpage/blender.1.py --blender="$(BLENDER_BIN)" --output=blender.1 --verbose
help_features: .FORCE
@$(PYTHON) "$(BLENDER_DIR)/build_files/cmake/cmake_print_build_options.py" $(BLENDER_DIR)"/CMakeLists.txt"

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
####################################################################################################
#
@@ -45,8 +29,9 @@ cmake_minimum_required(VERSION 3.5)
include(ExternalProject)
include(cmake/check_software.cmake)
include(cmake/options.cmake)
include(cmake/versions.cmake)
include(cmake/options.cmake)
include(cmake/boost_build_options.cmake)
include(cmake/download.cmake)
if(ENABLE_MINGW64)
@@ -62,14 +47,13 @@ include(cmake/png.cmake)
include(cmake/jpeg.cmake)
include(cmake/blosc.cmake)
include(cmake/pthreads.cmake)
include(cmake/imath.cmake)
include(cmake/openexr.cmake)
include(cmake/brotli.cmake)
include(cmake/freetype.cmake)
include(cmake/freeglut.cmake)
include(cmake/glew.cmake)
include(cmake/alembic.cmake)
include(cmake/glfw.cmake)
include(cmake/clew.cmake)
include(cmake/cuew.cmake)
include(cmake/opensubdiv.cmake)
include(cmake/sdl.cmake)
include(cmake/opencollada.cmake)
@@ -90,7 +74,6 @@ endif()
include(cmake/osl.cmake)
include(cmake/tbb.cmake)
include(cmake/openvdb.cmake)
include(cmake/nanovdb.cmake)
include(cmake/python.cmake)
option(USE_PIP_NUMPY "Install NumPy using pip wheel instead of building from source" OFF)
if(APPLE AND ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64"))
@@ -109,12 +92,15 @@ include(cmake/pugixml.cmake)
include(cmake/ispc.cmake)
include(cmake/openimagedenoise.cmake)
include(cmake/embree.cmake)
include(cmake/fmt.cmake)
include(cmake/robinmap.cmake)
if(NOT APPLE)
include(cmake/xr_openxr.cmake)
endif()
# OpenColorIO and dependencies.
include(cmake/expat.cmake)
include(cmake/pystring.cmake)
include(cmake/yamlcpp.cmake)
include(cmake/opencolorio.cmake)
@@ -122,8 +108,9 @@ if(BLENDER_PLATFORM_ARM)
include(cmake/sse2neon.cmake)
endif()
if(WITH_WEBP)
include(cmake/webp.cmake)
include(cmake/webp.cmake)
if(NOT APPLE)
include(cmake/level-zero.cmake)
endif()
if(NOT WIN32 OR ENABLE_MINGW64)

View File

@@ -1,46 +1,16 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
set(ALEMBIC_EXTRA_ARGS
-DBUILDSTATIC=ON
-DLINKSTATIC=ON
-DILMBASE_ROOT=${LIBDIR}/openexr
-DALEMBIC_ILMBASE_INCLUDE_DIRECTORY=${LIBDIR}/openexr/include/OpenEXR
-DALEMBIC_ILMBASE_HALF_LIB=${LIBDIR}/openexr/lib/${LIBPREFIX}Half${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DALEMBIC_ILMBASE_IMATH_LIB=${LIBDIR}/openexr/lib/${LIBPREFIX}Imath${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DALEMBIC_ILMBASE_ILMTHREAD_LIB=${LIBDIR}/openexr/lib/${LIBPREFIX}IlmThread${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DALEMBIC_ILMBASE_IEX_LIB=${LIBDIR}/openexr/lib/${LIBPREFIX}Iex${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DALEMBIC_ILMBASE_IEXMATH_LIB=${LIBDIR}/openexr/lib/${LIBPREFIX}IexMath${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DUSE_PYILMBASE=0
-DUSE_PYALEMBIC=0
-DUSE_ARNOLD=0
-DUSE_MAYA=0
-DUSE_PRMAN=0
-DUSE_HDF5=Off
-DUSE_STATIC_HDF5=Off
-DUSE_TESTS=Off
-DALEMBIC_NO_OPENGL=1
-DImath_ROOT=${LIBDIR}/imath
-DUSE_PYALEMBIC=OFF
-DUSE_ARNOLD=OFF
-DUSE_MAYA=OFF
-DUSE_PRMAN=OFF
-DUSE_HDF5=OFF
-DUSE_TESTS=OFF
-DUSE_BINARIES=ON
-DALEMBIC_ILMBASE_LINK_STATIC=On
-DALEMBIC_ILMBASE_LINK_STATIC=OFF
-DALEMBIC_SHARED_LIBS=OFF
-DGLUT_INCLUDE_DIR=""
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
)
ExternalProject_Add(external_alembic
@@ -71,6 +41,5 @@ endif()
add_dependencies(
external_alembic
external_zlib
external_openexr
)

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
set(BLOSC_EXTRA_ARGS
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
@@ -40,7 +24,6 @@ ExternalProject_Add(external_blosc
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${BLOSC_HASH_TYPE}=${BLOSC_HASH}
PREFIX ${BUILD_DIR}/blosc
PATCH_COMMAND ${PATCH_CMD} --verbose -p 1 -N -d ${BUILD_DIR}/blosc/src/external_blosc < ${PATCH_DIR}/blosc.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/blosc ${DEFAULT_CMAKE_FLAGS} ${BLOSC_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/blosc
)

View File

@@ -1,33 +1,6 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(BOOST_ADDRESS_MODEL 64)
if(BLENDER_PLATFORM_ARM)
set(BOOST_ARCHITECTURE arm)
else()
set(BOOST_ARCHITECTURE x86)
endif()
# SPDX-License-Identifier: GPL-2.0-or-later
if(WIN32)
set(BOOST_TOOLSET toolset=msvc-14.1)
set(BOOST_COMPILER_STRING -vc141)
set(BOOST_CONFIGURE_COMMAND bootstrap.bat)
set(BOOST_BUILD_COMMAND b2)
set(BOOST_BUILD_OPTIONS runtime-link=shared )
@@ -47,11 +20,6 @@ else()
set(BOOST_BUILD_COMMAND ./b2)
set(BOOST_BUILD_OPTIONS cxxflags=${PLATFORM_CXXFLAGS} --disable-icu boost.locale.icu=off)
set(BOOST_PATCH_COMMAND echo .)
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
set(BOOST_ADDRESS_MODEL 64)
else()
set(BOOST_ADDRESS_MODEL 32)
endif()
endif()
if(WITH_BOOST_PYTHON)

View File

@@ -0,0 +1,30 @@
# SPDX-License-Identifier: GPL-2.0-or-later
set(BOOST_ADDRESS_MODEL 64)
if(BLENDER_PLATFORM_ARM)
set(BOOST_ARCHITECTURE arm)
else()
set(BOOST_ARCHITECTURE x86)
endif()
if(WIN32)
if(MSVC_VERSION GREATER_EQUAL 1920) # 2019
set(BOOST_TOOLSET toolset=msvc-14.2)
set(BOOST_COMPILER_STRING -vc142)
else() # 2017
set(BOOST_TOOLSET toolset=msvc-14.1)
set(BOOST_COMPILER_STRING -vc141)
endif()
endif()
set(DEFAULT_BOOST_FLAGS
-DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
-DBoost_USE_MULTITHREADED=ON
-DBoost_USE_STATIC_LIBS=ON
-DBoost_USE_STATIC_RUNTIME=OFF
-DBOOST_ROOT=${LIBDIR}/boost
-DBoost_NO_SYSTEM_PATHS=ON
-DBoost_NO_BOOST_CMAKE=ON
-DBoost_ADDITIONAL_VERSIONS=${BOOST_VERSION_SHORT}
-DBOOST_LIBRARYDIR=${LIBDIR}/boost/lib/
)

View File

@@ -0,0 +1,22 @@
# SPDX-License-Identifier: GPL-2.0-or-later
set(BROTLI_EXTRA_ARGS
)
ExternalProject_Add(external_brotli
URL file://${PACKAGE_DIR}/${BROTLI_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${BROTLI_HASH_TYPE}=${BROTLI_HASH}
PREFIX ${BUILD_DIR}/brotli
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/brotli ${DEFAULT_CMAKE_FLAGS} ${BROTLI_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/brotli
)
if(BUILD_MODE STREQUAL Release AND WIN32)
ExternalProject_Add_Step(external_brotli after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/brotli/include ${HARVEST_TARGET}/brotli/include
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/brotli/lib/brotlidec-static${LIBEXT} ${HARVEST_TARGET}/brotli/lib/brotlidec-static${LIBEXT}
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/brotli/lib/brotlicommon-static${LIBEXT} ${HARVEST_TARGET}/brotli/lib/brotlicommon-static${LIBEXT}
DEPENDEES install
)
endif()

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
set(BZIP2_PREFIX "${LIBDIR}/bzip2")
set(BZIP2_CONFIGURE_ENV echo .)

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
if(UNIX)
if(APPLE)

View File

@@ -1,28 +0,0 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(CLEW_EXTRA_ARGS)
ExternalProject_Add(external_clew
URL file://${PACKAGE_DIR}/${CLEW_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${CLEW_HASH_TYPE}=${CLEW_HASH}
PREFIX ${BUILD_DIR}/clew
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/clew -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${CLEW_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/clew
)

View File

@@ -1,29 +0,0 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(CUEW_EXTRA_ARGS)
ExternalProject_Add(external_cuew
URL file://${PACKAGE_DIR}/${CUEW_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${CUEW_HASH_TYPE}=${CUEW_HASH}
PREFIX ${BUILD_DIR}/cuew
PATCH_COMMAND ${PATCH_CMD} --verbose -p 0 -N -d ${BUILD_DIR}/cuew/src/external_cuew < ${PATCH_DIR}/cuew.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/cuew -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${CUEW_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/cuew
)

View File

@@ -1,9 +1,16 @@
# SPDX-License-Identifier: GPL-2.0-or-later
## Update and uncomment this in the release branch
set(BLENDER_VERSION 3.2)
function(download_source dep)
set(TARGET_FILE ${${dep}_FILE})
set(TARGET_HASH_TYPE ${${dep}_HASH_TYPE})
set(TARGET_HASH ${${dep}_HASH})
if(PACKAGE_USE_UPSTREAM_SOURCES)
set(TARGET_URI ${${dep}_URI})
elseif(BLENDER_VERSION)
set(TARGET_URI https://svn.blender.org/svnroot/bf-blender/tags/blender-${BLENDER_VERSION}-release/lib/packages/${TARGET_FILE})
else()
set(TARGET_URI https://svn.blender.org/svnroot/bf-blender/trunk/lib/packages/${TARGET_FILE})
endif()
@@ -32,10 +39,6 @@ download_source(FREETYPE)
download_source(GLEW)
download_source(FREEGLUT)
download_source(ALEMBIC)
download_source(GLFW)
download_source(CLEW)
download_source(GLFW)
download_source(CUEW)
download_source(OPENSUBDIV)
download_source(SDL)
download_source(OPENCOLLADA)
@@ -64,9 +67,7 @@ download_source(FFMPEG)
download_source(FFTW)
download_source(ICONV)
download_source(SNDFILE)
if(WITH_WEBP)
download_source(WEBP)
endif()
download_source(WEBP)
download_source(SPNAV)
download_source(JEMALLOC)
download_source(XML2)
@@ -94,3 +95,9 @@ download_source(POTRACE)
download_source(HARU)
download_source(ZSTD)
download_source(FLEX)
download_source(BROTLI)
download_source(FMT)
download_source(ROBINMAP)
download_source(IMATH)
download_source(PYSTRING)
download_source(LEVEL_ZERO)

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
# Note the utility apps may use png/tiff/gif system libraries, but the
# library itself does not depend on them, so should give no problems.
@@ -33,6 +17,16 @@ set(EMBREE_EXTRA_ARGS
-DTBB_STATIC_LIB=${TBB_STATIC_LIBRARY}
)
if(BLENDER_PLATFORM_ARM)
set(EMBREE_EXTRA_ARGS
${EMBREE_EXTRA_ARGS}
-DEMBREE_MAX_ISA=NEON)
else()
set(EMBREE_EXTRA_ARGS
${EMBREE_EXTRA_ARGS}
-DEMBREE_MAX_ISA=AVX2)
endif()
if(TBB_STATIC_LIBRARY)
set(EMBREE_EXTRA_ARGS
${EMBREE_EXTRA_ARGS}
@@ -53,26 +47,15 @@ else()
set(EMBREE_BUILD_DIR)
endif()
if(BLENDER_PLATFORM_ARM)
ExternalProject_Add(external_embree
GIT_REPOSITORY ${EMBREE_ARM_GIT}
GIT_TAG "blender-arm"
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/embree
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/embree ${DEFAULT_CMAKE_FLAGS} ${EMBREE_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/embree
)
else()
ExternalProject_Add(external_embree
URL file://${PACKAGE_DIR}/${EMBREE_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${EMBREE_HASH_TYPE}=${EMBREE_HASH}
PREFIX ${BUILD_DIR}/embree
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/embree/src/external_embree < ${PATCH_DIR}/embree.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/embree ${DEFAULT_CMAKE_FLAGS} ${EMBREE_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/embree
)
endif()
ExternalProject_Add(external_embree
URL file://${PACKAGE_DIR}/${EMBREE_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${EMBREE_HASH_TYPE}=${EMBREE_HASH}
PREFIX ${BUILD_DIR}/embree
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/embree/src/external_embree < ${PATCH_DIR}/embree.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/embree ${DEFAULT_CMAKE_FLAGS} ${EMBREE_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/embree
)
add_dependencies(
external_embree

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
set(EXPAT_EXTRA_ARGS
-DEXPAT_BUILD_DOCS=OFF

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
ExternalProject_Add(external_ffi
URL file://${PACKAGE_DIR}/${FFI_FILE}

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
set(FFMPEG_CFLAGS "-I${mingw_LIBDIR}/lame/include -I${mingw_LIBDIR}/openjpeg/include/ -I${mingw_LIBDIR}/ogg/include -I${mingw_LIBDIR}/vorbis/include -I${mingw_LIBDIR}/theora/include -I${mingw_LIBDIR}/opus/include -I${mingw_LIBDIR}/vpx/include -I${mingw_LIBDIR}/x264/include -I${mingw_LIBDIR}/xvidcore/include -I${mingw_LIBDIR}/zlib/include")
set(FFMPEG_LDFLAGS "-L${mingw_LIBDIR}/lame/lib -L${mingw_LIBDIR}/openjpeg/lib -L${mingw_LIBDIR}/ogg/lib -L${mingw_LIBDIR}/vorbis/lib -L${mingw_LIBDIR}/theora/lib -L${mingw_LIBDIR}/opus/lib -L${mingw_LIBDIR}/vpx/lib -L${mingw_LIBDIR}/x264/lib -L${mingw_LIBDIR}/xvidcore/lib -L${mingw_LIBDIR}/zlib/lib")

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
set(FFTW_EXTRA_ARGS)

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
ExternalProject_Add(external_flac
URL file://${PACKAGE_DIR}/${FLAC_FILE}

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
ExternalProject_Add(external_flex
URL file://${PACKAGE_DIR}/${FLEX_FILE}

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
set(FLEXBISON_EXTRA_ARGS)

View File

@@ -0,0 +1,14 @@
# SPDX-License-Identifier: GPL-2.0-or-later
set(FMT_EXTRA_ARGS
-DFMT_TEST=Off
)
ExternalProject_Add(external_fmt
URL file://${PACKAGE_DIR}/${FMT_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${FMT_HASH_TYPE}=${FMT_HASH}
PREFIX ${BUILD_DIR}/fmt
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/fmt ${DEFAULT_CMAKE_FLAGS} ${FMT_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/fmt
)

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
if(WIN32)
if(BUILD_MODE STREQUAL Release)

View File

@@ -1,31 +1,15 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
set(FREETYPE_EXTRA_ARGS
-DCMAKE_RELEASE_POSTFIX:STRING=2ST
-DCMAKE_DEBUG_POSTFIX:STRING=2ST_d
-DWITH_BZip2=OFF
-DWITH_HarfBuzz=OFF
-DFT_WITH_HARFBUZZ=OFF
-DFT_WITH_BZIP2=OFF
-DCMAKE_DISABLE_FIND_PACKAGE_HarfBuzz=TRUE
-DCMAKE_DISABLE_FIND_PACKAGE_BZip2=TRUE
-DCMAKE_DISABLE_FIND_PACKAGE_BrotliDec=TRUE)
-DFT_DISABLE_BZIP2=ON
-DFT_DISABLE_HARFBUZZ=ON
-DFT_DISABLE_PNG=ON
-DFT_REQUIRE_BROTLI=ON
-DPC_BROTLIDEC_INCLUDEDIR=${LIBDIR}/brotli/include
-DPC_BROTLIDEC_LIBDIR=${LIBDIR}/brotli/lib
)
ExternalProject_Add(external_freetype
URL file://${PACKAGE_DIR}/${FREETYPE_FILE}
@@ -36,6 +20,11 @@ ExternalProject_Add(external_freetype
INSTALL_DIR ${LIBDIR}/freetype
)
add_dependencies(
external_freetype
external_brotli
)
if(BUILD_MODE STREQUAL Release AND WIN32)
ExternalProject_Add_Step(external_freetype after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/freetype ${HARVEST_TARGET}/freetype

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
set(GLEW_EXTRA_ARGS
-DBUILD_UTILS=Off

View File

@@ -1,28 +0,0 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(GLFW_EXTRA_ARGS)
ExternalProject_Add(external_glfw
URL file://${PACKAGE_DIR}/${GLFW_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${GLFW_HASH_TYPE}=${GLFW_HASH}
PREFIX ${BUILD_DIR}/glfw
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/glfw -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${GLFW_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/glfw
)

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
set(GMP_EXTRA_ARGS -enable-cxx)

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
set(HARU_EXTRA_ARGS
-DLIBHPDF_SHARED=OFF

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
########################################################################
# Copy all generated files to the proper structure as blender prefers
@@ -30,8 +14,8 @@ if(WIN32)
if(BUILD_MODE STREQUAL Release)
add_custom_target(Harvest_Release_Results
COMMAND # jpeg rename libfile + copy include
${CMAKE_COMMAND} -E copy ${LIBDIR}/jpg/lib/jpeg-static.lib ${HARVEST_TARGET}/jpeg/lib/libjpeg.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/jpg/include/ ${HARVEST_TARGET}/jpeg/include/ &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/jpeg/lib/jpeg-static.lib ${HARVEST_TARGET}/jpeg/lib/libjpeg.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/jpeg/include/ ${HARVEST_TARGET}/jpeg/include/ &&
# png
${CMAKE_COMMAND} -E copy ${LIBDIR}/png/lib/libpng16_static.lib ${HARVEST_TARGET}/png/lib/libpng.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/png/include/ ${HARVEST_TARGET}/png/include/ &&
@@ -79,8 +63,12 @@ endfunction()
harvest(alembic/include alembic/include "*.h")
harvest(alembic/lib/libAlembic.a alembic/lib/libAlembic.a)
harvest(alembic/bin alembic/bin "*")
harvest(brotli/include brotli/include "*.h")
harvest(brotli/lib brotli/lib "*.a")
harvest(boost/include boost/include "*")
harvest(boost/lib boost/lib "*.a")
harvest(imath/include imath/include "*.h")
harvest(imath/lib imath/lib "*.a")
harvest(ffmpeg/include ffmpeg/include "*.h")
harvest(ffmpeg/lib ffmpeg/lib "*.a")
harvest(fftw3/include fftw3/include "*.h")
@@ -94,9 +82,13 @@ harvest(gmp/include gmp/include "*.h")
harvest(gmp/lib gmp/lib "*.a")
harvest(jemalloc/include jemalloc/include "*.h")
harvest(jemalloc/lib jemalloc/lib "*.a")
harvest(jpg/include jpeg/include "*.h")
harvest(jpg/lib jpeg/lib "libjpeg.a")
harvest(jpeg/include jpeg/include "*.h")
harvest(jpeg/lib jpeg/lib "libjpeg.a")
harvest(lame/lib ffmpeg/lib "*.a")
if(NOT APPLE)
harvest(level-zero/include/level_zero level-zero/include/level_zero "*.h")
harvest(level-zero/lib level-zero/lib "*.so*")
endif()
harvest(llvm/bin llvm/bin "clang-format")
if(BUILD_CLANG_TOOLS)
harvest(llvm/bin llvm/bin "clang-tidy")
@@ -149,13 +141,13 @@ harvest(openimagedenoise/include openimagedenoise/include "*")
harvest(openimagedenoise/lib openimagedenoise/lib "*.a")
harvest(embree/include embree/include "*.h")
harvest(embree/lib embree/lib "*.a")
harvest(openjpeg/include/openjpeg-2.3 openjpeg/include "*.h")
harvest(openjpeg/include/openjpeg-${OPENJPEG_SHORT_VERSION} openjpeg/include "*.h")
harvest(openjpeg/lib openjpeg/lib "*.a")
harvest(opensubdiv/include opensubdiv/include "*.h")
harvest(opensubdiv/lib opensubdiv/lib "*.a")
harvest(openvdb/include/openvdb openvdb/include/openvdb "*.h")
harvest(openvdb/include/nanovdb openvdb/include/nanovdb "*.h")
harvest(openvdb/lib openvdb/lib "*.a")
harvest(nanovdb/nanovdb nanovdb/include/nanovdb "*.h")
harvest(xr_openxr_sdk/include/openxr xr_openxr_sdk/include/openxr "*.h")
harvest(xr_openxr_sdk/lib xr_openxr_sdk/lib "*.a")
harvest(osl/bin osl/bin "oslc")
@@ -183,9 +175,10 @@ harvest(tiff/lib tiff/lib "*.a")
harvest(vorbis/lib ffmpeg/lib "*.a")
harvest(opus/lib ffmpeg/lib "*.a")
harvest(vpx/lib ffmpeg/lib "*.a")
harvest(webp/lib ffmpeg/lib "*.a")
harvest(x264/lib ffmpeg/lib "*.a")
harvest(xvidcore/lib ffmpeg/lib "*.a")
harvest(webp/lib webp/lib "*.a")
harvest(webp/include webp/include "*.h")
harvest(usd/include usd/include "*.h")
harvest(usd/lib/usd usd/lib/usd "*")
harvest(usd/plugin usd/plugin "*")

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
set(ICONV_EXTRA_ARGS)

View File

@@ -0,0 +1,24 @@
# SPDX-License-Identifier: GPL-2.0-or-later
set(IMATH_EXTRA_ARGS
-DBUILD_SHARED_LIBS=OFF
-DBUILD_TESTING=OFF
-DIMATH_LIB_SUFFIX=${OPENEXR_VERSION_BUILD_POSTFIX}
)
ExternalProject_Add(external_imath
URL file://${PACKAGE_DIR}/${IMATH_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${IMATH_HASH_TYPE}=${IMATH_HASH}
PREFIX ${BUILD_DIR}/imath
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/imath ${DEFAULT_CMAKE_FLAGS} ${IMATH_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/imath
)
if(WIN32)
ExternalProject_Add_Step(external_imath after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/imath/lib ${HARVEST_TARGET}/imath/lib
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/imath/include ${HARVEST_TARGET}/imath/include
DEPENDEES install
)
endif()

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
if(WIN32)
set(ISPC_EXTRA_ARGS_WIN

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
ExternalProject_Add(external_jemalloc
URL file://${PACKAGE_DIR}/${JEMALLOC_FILE}

View File

@@ -1,61 +1,53 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
if(WIN32)
# cmake for windows
set(JPEG_EXTRA_ARGS -DNASM=${NASM_PATH} -DWITH_JPEG8=ON -DCMAKE_DEBUG_POSTFIX=d -DWITH_CRT_DLL=On)
set(JPEG_EXTRA_ARGS
-DNASM=${NASM_PATH}
-DWITH_JPEG8=ON
-DCMAKE_DEBUG_POSTFIX=d
-DWITH_CRT_DLL=On
-DENABLE_SHARED=OFF
-DENABLE_STATIC=ON
)
ExternalProject_Add(external_jpeg
URL file://${PACKAGE_DIR}/${JPEG_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${JPEG_HASH_TYPE}=${JPEG_HASH}
PREFIX ${BUILD_DIR}/jpg
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/jpg ${DEFAULT_CMAKE_FLAGS} ${JPEG_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/jpg
PREFIX ${BUILD_DIR}/jpeg
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/jpeg ${DEFAULT_CMAKE_FLAGS} ${JPEG_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/jpeg
)
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_jpeg after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/jpg/lib/jpegd${LIBEXT} ${LIBDIR}/jpg/lib/jpeg${LIBEXT}
DEPENDEES install
)
endif()
if(BUILD_MODE STREQUAL Release)
set(JPEG_LIBRARY jpeg-static${LIBEXT})
else()
set(JPEG_LIBRARY jpeg-staticd${LIBEXT})
endif()
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_jpeg after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/jpeg/lib/${JPEG_LIBRARY} ${LIBDIR}/jpeg/lib/jpeg${LIBEXT}
DEPENDEES install
)
endif()
else(WIN32)
# cmake for unix
set(JPEG_EXTRA_ARGS
-DWITH_JPEG8=ON
-DENABLE_STATIC=ON
-DENABLE_SHARED=OFF
-DCMAKE_INSTALL_LIBDIR=${LIBDIR}/jpg/lib)
-DCMAKE_INSTALL_LIBDIR=${LIBDIR}/jpeg/lib)
ExternalProject_Add(external_jpeg
URL file://${PACKAGE_DIR}/${JPEG_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${JPEG_HASH_TYPE}=${JPEG_HASH}
PREFIX ${BUILD_DIR}/jpg
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/jpg ${DEFAULT_CMAKE_FLAGS} ${JPEG_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/jpg
PREFIX ${BUILD_DIR}/jpeg
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/jpeg ${DEFAULT_CMAKE_FLAGS} ${JPEG_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/jpeg
)
set(JPEG_LIBRARY libjpeg${LIBEXT})

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
set(LAME_EXTRA_ARGS)
if(MSVC)

View File

@@ -0,0 +1,21 @@
# SPDX-License-Identifier: GPL-2.0-or-later
set(LEVEL_ZERO_EXTRA_ARGS
)
ExternalProject_Add(external_level-zero
URL file://${PACKAGE_DIR}/${LEVEL_ZERO_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${LEVEL_ZERO_HASH_TYPE}=${LEVEL_ZERO_HASH}
PREFIX ${BUILD_DIR}/level-zero
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/level-zero/src/external_level-zero < ${PATCH_DIR}/level-zero.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/level-zero ${DEFAULT_CMAKE_FLAGS} ${LEVEL_ZERO_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/level-zero
)
if(BUILD_MODE STREQUAL Release AND WIN32)
ExternalProject_Add_Step(external_level-zero after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/level-zero ${HARVEST_TARGET}/level-zero
DEPENDEES install
)
endif()

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
set(LIBGLU_CFLAGS "-static-libgcc")
set(LIBGLU_CXXFLAGS "-static-libgcc -static-libstdc++ -Bstatic -lstdc++ -Bdynamic -l:libstdc++.a")

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
if(BLENDER_PLATFORM_ARM)
set(LLVM_TARGETS AArch64$<SEMICOLON>ARM)

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
set(LZMA_PATCH_CMD echo .)

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
set(MESA_CFLAGS "-static-libgcc")
set(MESA_CXXFLAGS "-static-libgcc -static-libstdc++ -Bstatic -lstdc++ -Bdynamic -l:libstdc++.a")

View File

@@ -1,55 +0,0 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(NANOVDB_EXTRA_ARGS
# NanoVDB is header-only, so only need the install target
-DNANOVDB_BUILD_UNITTESTS=OFF
-DNANOVDB_BUILD_EXAMPLES=OFF
-DNANOVDB_BUILD_BENCHMARK=OFF
-DNANOVDB_BUILD_DOCS=OFF
-DNANOVDB_BUILD_TOOLS=OFF
-DNANOVDB_CUDA_KEEP_PTX=OFF
# Do not need to include any of the dependencies because of this
-DNANOVDB_USE_OPENVDB=OFF
-DNANOVDB_USE_OPENGL=OFF
-DNANOVDB_USE_OPENCL=OFF
-DNANOVDB_USE_CUDA=OFF
-DNANOVDB_USE_TBB=OFF
-DNANOVDB_USE_BLOSC=OFF
-DNANOVDB_USE_ZLIB=OFF
-DNANOVDB_USE_OPTIX=OFF
-DNANOVDB_ALLOW_FETCHCONTENT=OFF
)
ExternalProject_Add(nanovdb
URL file://${PACKAGE_DIR}/${NANOVDB_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${NANOVDB_HASH_TYPE}=${NANOVDB_HASH}
PREFIX ${BUILD_DIR}/nanovdb
SOURCE_SUBDIR nanovdb
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/nanovdb/src/nanovdb < ${PATCH_DIR}/nanovdb.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/nanovdb ${DEFAULT_CMAKE_FLAGS} ${NANOVDB_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/nanovdb
)
if(WIN32)
ExternalProject_Add_Step(nanovdb after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/nanovdb/nanovdb ${HARVEST_TARGET}/nanovdb/include/nanovdb
DEPENDEES install
)
endif()

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
ExternalProject_Add(external_nasm
URL file://${PACKAGE_DIR}/${NASM_FILE}

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
if(MSVC)
message("BIN >${PYTHON_BINARY}<")

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
ExternalProject_Add(external_ogg
URL file://${PACKAGE_DIR}/${OGG_FILE}

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
if(BUILD_MODE STREQUAL Release)
set(OPENAL_EXTRA_ARGS

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
if(UNIX)
set(OPENCOLLADA_EXTRA_ARGS

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
set(OPENCOLORIO_EXTRA_ARGS
-DOCIO_BUILD_APPS=OFF
@@ -27,13 +11,12 @@ set(OPENCOLORIO_EXTRA_ARGS
-DOCIO_BUILD_GPU_TESTS=OFF
-DOCIO_USE_SSE=ON
# Manually build ext packages except for pystring, which does not have
# a CMake or autotools build system that we can easily use.
-DOCIO_INSTALL_EXT_PACKAGES=MISSING
-DHalf_ROOT=${LIBDIR}/openexr
-DHalf_STATIC_LIBRARY=ON
-DOCIO_INSTALL_EXT_PACKAGES=NONE
-Dexpat_ROOT=${LIBDIR}/expat
-Dyaml-cpp_ROOT=${LIBDIR}/yamlcpp
-Dpystring_ROOT=${LIBDIR}/pystring
-DImath_ROOT=${LIBDIR}/imath
)
if(BLENDER_PLATFORM_ARM)
@@ -46,7 +29,9 @@ endif()
if(WIN32)
set(OPENCOLORIO_EXTRA_ARGS
${OPENCOLORIO_EXTRA_ARGS}
-DOCIO_INLINES_HIDDEN=OFF
-Dexpat_LIBRARY=${LIBDIR}/expat/lib/libexpatMD
-Dyaml-cpp_LIBRARY=${LIBDIR}/expat/lib/libyaml-cppmd.lib
-DImath_LIBRARY=${LIBDIR}/imath/lib/imath${OPENEXR_VERSION_POSTFIX}
)
else()
set(OPENCOLORIO_EXTRA_ARGS
@@ -68,7 +53,8 @@ add_dependencies(
external_opencolorio
external_yamlcpp
external_expat
external_openexr
external_imath
external_pystring
)
if(WIN32)
@@ -78,7 +64,7 @@ if(WIN32)
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/opencolorio/lib ${HARVEST_TARGET}/opencolorio/lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/yamlcpp/lib/libyaml-cppmd.lib ${HARVEST_TARGET}/opencolorio/lib/libyaml-cpp.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/expat/lib/libexpatMD.lib ${HARVEST_TARGET}/opencolorio/lib/libexpatMD.lib
COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/opencolorio/src/external_opencolorio-build/ext/dist/lib/pystring.lib ${HARVEST_TARGET}/opencolorio/lib/pystring.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/pystring/lib/pystring.lib ${HARVEST_TARGET}/opencolorio/lib/pystring.lib
DEPENDEES install
)
endif()
@@ -87,7 +73,7 @@ if(WIN32)
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencolorio/lib/Opencolorio.lib ${HARVEST_TARGET}/opencolorio/lib/OpencolorIO_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/yamlcpp/lib/libyaml-cppmdd.lib ${HARVEST_TARGET}/opencolorio/lib/libyaml-cpp_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/expat/lib/libexpatdMD.lib ${HARVEST_TARGET}/opencolorio/lib/libexpatdMD.lib
COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/opencolorio/src/external_opencolorio-build/ext/dist/lib/pystring.lib ${HARVEST_TARGET}/opencolorio/lib/pystring_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/pystring/lib/pystring.lib ${HARVEST_TARGET}/opencolorio/lib/pystring_d.lib
DEPENDEES install
)
endif()
@@ -95,7 +81,7 @@ else()
ExternalProject_Add_Step(external_opencolorio after_install
COMMAND cp ${LIBDIR}/yamlcpp/lib/libyaml-cpp.a ${LIBDIR}/opencolorio/lib/
COMMAND cp ${LIBDIR}/expat/lib/libexpat.a ${LIBDIR}/opencolorio/lib/
COMMAND cp ${BUILD_DIR}/opencolorio/src/external_opencolorio-build/ext/dist/lib/libpystring.a ${LIBDIR}/opencolorio/lib/
COMMAND cp ${LIBDIR}/pystring/lib/libpystring.a ${LIBDIR}/opencolorio/lib/
DEPENDEES install
)
endif()

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
if(WIN32)
set(OPENEXR_CMAKE_CXX_STANDARD_LIBRARIES "kernel32${LIBEXT} user32${LIBEXT} gdi32${LIBEXT} winspool${LIBEXT} shell32${LIBEXT} ole32${LIBEXT} oleaut32${LIBEXT} uuid${LIBEXT} comdlg32${LIBEXT} advapi32${LIBEXT} psapi${LIBEXT}")
@@ -32,12 +16,10 @@ set(OPENEXR_EXTRA_ARGS
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
-DBUILD_TESTING=OFF
-DOPENEXR_BUILD_BOTH_STATIC_SHARED=OFF
-DILMBASE_BUILD_BOTH_STATIC_SHARED=OFF
-DBUILD_SHARED_LIBS=OFF
-DOPENEXR_BUILD_UTILS=OFF
-DPYILMBASE_ENABLE=OFF
-DOPENEXR_VIEWERS_ENABLE=OFF
-DILMBASE_LIB_SUFFIX=${OPENEXR_VERSION_BUILD_POSTFIX}
-DOPENEXR_INSTALL_TOOLS=OFF
-DOPENEXR_INSTALL_EXAMPLES=OFF
-DImath_DIR=${LIBDIR}/imath/lib/cmake/Imath
-DOPENEXR_LIB_SUFFIX=${OPENEXR_VERSION_BUILD_POSTFIX}
)

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
set(OIDN_EXTRA_ARGS
@@ -24,6 +8,7 @@ set(OIDN_EXTRA_ARGS
-DOIDN_STATIC_LIB=ON
-DOIDN_STATIC_RUNTIME=OFF
-DISPC_EXECUTABLE=${LIBDIR}/ispc/bin/ispc
-DOIDN_FILTER_RTLIGHTMAP=OFF
)
if(WIN32)

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
if(BUILD_MODE STREQUAL Release)
set(OIIO_TOOLS ON)
@@ -39,35 +23,20 @@ else()
set(OIIO_SIMD_FLAGS)
endif()
if(WITH_WEBP)
set(WEBP_ARGS
-DWEBP_INCLUDE_DIR=${LIBDIR}/webp/include
-DWEBP_LIBRARY=${LIBDIR}/webp/lib/${LIBPREFIX}webp${LIBEXT}
)
set(WEBP_DEP external_webp)
endif()
if(MSVC)
set(OPENJPEG_FLAGS
-DOpenJpeg_ROOT=${LIBDIR}/openjpeg_msvc
-DOpenJPEG_ROOT=${LIBDIR}/openjpeg_msvc
)
else()
set(OPENJPEG_FLAGS
-DOpenJpeg_ROOT=${LIBDIR}/openjpeg
-DOpenJPEG_ROOT=${LIBDIR}/openjpeg
)
endif()
set(OPENIMAGEIO_EXTRA_ARGS
-DBUILD_SHARED_LIBS=OFF
${OPENIMAGEIO_LINKSTATIC}
-DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
-DBoost_USE_MULTITHREADED=ON
-DBoost_USE_STATIC_LIBS=ON
-DBoost_USE_STATIC_RUNTIME=OFF
-DBOOST_ROOT=${LIBDIR}/boost
-DBOOST_LIBRARYDIR=${LIBDIR}/boost/lib/
-DBoost_NO_SYSTEM_PATHS=ON
-DBoost_NO_BOOST_CMAKE=ON
${DEFAULT_BOOST_FLAGS}
-DUSE_LIBSQUISH=OFF
-DUSE_QT5=OFF
-DUSE_NUKE=OFF
@@ -78,7 +47,6 @@ set(OPENIMAGEIO_EXTRA_ARGS
-DUSE_LIBHEIF=OFF
-DUSE_OPENGL=OFF
-DUSE_TBB=OFF
-DUSE_FIELD3D=OFF
-DUSE_QT=OFF
-DUSE_PYTHON=OFF
-DUSE_GIF=OFF
@@ -89,7 +57,7 @@ set(OPENIMAGEIO_EXTRA_ARGS
-DUSE_FREETYPE=OFF
-DUSE_LIBRAW=OFF
-DUSE_OPENCOLORIO=OFF
-DUSE_WEBP=${WITH_WEBP}
-DUSE_WEBP=ON
-DOIIO_BUILD_TOOLS=${OIIO_TOOLS}
-DOIIO_BUILD_TESTS=OFF
-DBUILD_TESTING=OFF
@@ -99,14 +67,9 @@ set(OPENIMAGEIO_EXTRA_ARGS
-DPNG_PNG_INCLUDE_DIR=${LIBDIR}/png/include
-DTIFF_LIBRARY=${LIBDIR}/tiff/lib/${LIBPREFIX}tiff${LIBEXT}
-DTIFF_INCLUDE_DIR=${LIBDIR}/tiff/include
-DJPEG_LIBRARY=${LIBDIR}/jpg/lib/${JPEG_LIBRARY}
-DJPEG_INCLUDE_DIR=${LIBDIR}/jpg/include
-DJPEG_LIBRARY=${LIBDIR}/jpeg/lib/${JPEG_LIBRARY}
-DJPEG_INCLUDE_DIR=${LIBDIR}/jpeg/include
${OPENJPEG_FLAGS}
-DOpenEXR_USE_STATIC_LIBS=On
-DILMBASE_INCLUDE_DIR=${LIBDIR}/openexr/include/
-DOPENEXR_INCLUDE_DIR=${LIBDIR}/openexr/include/
-DOPENEXR_HALF_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}Half${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DOPENEXR_IMATH_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}Imath${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DOPENEXR_ILMTHREAD_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}IlmThread${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DOPENEXR_IEX_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}Iex${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DOPENEXR_ILMIMF_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf${OPENEXR_VERSION_POSTFIX}${LIBEXT}
@@ -114,8 +77,14 @@ set(OPENIMAGEIO_EXTRA_ARGS
-DUSE_EXTERNAL_PUGIXML=ON
-DPUGIXML_LIBRARY=${LIBDIR}/pugixml/lib/${LIBPREFIX}pugixml${LIBEXT}
-DPUGIXML_INCLUDE_DIR=${LIBDIR}/pugixml/include/
${WEBP_FLAGS}
-DBUILD_MISSING_ROBINMAP=OFF
-DBUILD_MISSING_FMT=OFF
-DFMT_INCLUDE_DIR=${LIBDIR}/fmt/include/
-DRobinmap_ROOT=${LIBDIR}/robinmap
-DWebP_ROOT=${LIBDIR}/webp
${OIIO_SIMD_FLAGS}
-DOpenEXR_ROOT=${LIBDIR}/openexr
-DImath_ROOT=${LIBDIR}/imath
)
ExternalProject_Add(external_openimageio
@@ -133,12 +102,15 @@ add_dependencies(
external_png
external_zlib
external_openexr
external_imath
external_jpeg
external_boost
external_tiff
external_pugixml
external_fmt
external_robinmap
external_openjpeg${OPENJPEG_POSTFIX}
${WEBP_DEP}
external_webp
)
if(WIN32)
@@ -153,8 +125,8 @@ if(WIN32)
endif()
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_openimageio after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimageio/lib/OpenImageIO.lib ${HARVEST_TARGET}/openimageio/lib/OpenImageIO_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimageio/lib/OpenImageIO_Util.lib ${HARVEST_TARGET}/openimageio/lib/OpenImageIO_Util_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimageio/lib/OpenImageIO_d.lib ${HARVEST_TARGET}/openimageio/lib/OpenImageIO_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimageio/lib/OpenImageIO_Util_d.lib ${HARVEST_TARGET}/openimageio/lib/OpenImageIO_Util_d.lib
DEPENDEES install
)
endif()

View File

@@ -1,38 +1,26 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
# Note the encoder/decoder may use png/tiff/lcms system libraries, but the
# library itself does not depend on them, so should give no problems.
set(OPENJPEG_EXTRA_ARGS -DBUILD_SHARED_LIBS=OFF)
if(WIN32)
set(OPENJPEG_EXTRA_ARGS -G "MSYS Makefiles" -DBUILD_PKGCONFIG_FILES=On)
else()
set(OPENJPEG_EXTRA_ARGS ${DEFAULT_CMAKE_FLAGS})
endif()
set(OPENJPEG_EXTRA_ARGS
${OPENJPEG_EXTRA_ARGS}
-DBUILD_SHARED_LIBS=OFF
-DBUILD_CODEC=OFF
)
ExternalProject_Add(external_openjpeg
URL file://${PACKAGE_DIR}/${OPENJPEG_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${OPENJPEG_HASH_TYPE}=${OPENJPEG_HASH}
PREFIX ${BUILD_DIR}/openjpeg
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/openjpeg/src/external_openjpeg-build && ${CMAKE_COMMAND} ${OPENJPEG_EXTRA_ARGS} -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openjpeg -DBUILD_SHARED_LIBS=Off -DBUILD_THIRDPARTY=OFF ${BUILD_DIR}/openjpeg/src/external_openjpeg
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/openjpeg/src/external_openjpeg-build && ${CMAKE_COMMAND} ${OPENJPEG_EXTRA_ARGS} -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openjpeg ${BUILD_DIR}/openjpeg/src/external_openjpeg
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/openjpeg/src/external_openjpeg-build/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/openjpeg/src/external_openjpeg-build/ && make install
INSTALL_DIR ${LIBDIR}/openjpeg

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
if(APPLE)
set(OPENMP_PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/openmp/src/external_openmp < ${PATCH_DIR}/openmp.diff)

View File

@@ -1,35 +1,25 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
set(OPENSUBDIV_EXTRA_ARGS
-DNO_LIB=OFF
-DNO_EXAMPLES=ON
-DNO_TUTORIALS=ON
-DNO_REGRESSION=ON
-DNO_PYTHON=ON
-DNO_MAYA=ON
-DNO_PTEX=ON
-DNO_DOC=ON
-DNO_CLEW=OFF
-DNO_OPENCL=OFF
-DNO_TUTORIALS=ON
-DGLEW_INCLUDE_DIR=${LIBDIR}/glew/include
-DGLEW_LIBRARY=${LIBDIR}/glew/lib/libGLEW${LIBEXT}
-DGLFW_INCLUDE_DIR=${LIBDIR}/glfw/include
-DGLFW_LIBRARIES=${LIBDIR}/glfw/lib/glfw3${LIBEXT}
-DNO_OMP=ON
-DNO_TBB=OFF
-DNO_CUDA=ON
-DNO_OPENCL=ON
-DNO_CLEW=ON
-DNO_OPENGL=OFF
-DNO_METAL=OFF
-DNO_DX=ON
-DNO_TESTS=ON
-DNO_GLTESTS=ON
-DNO_GLEW=ON
-DNO_GLFW=ON
-DNO_GLFW_X11=ON
)
if(WIN32)
@@ -37,30 +27,12 @@ if(WIN32)
${OPENSUBDIV_EXTRA_ARGS}
-DTBB_INCLUDE_DIR=${LIBDIR}/tbb/include
-DTBB_LIBRARIES=${LIBDIR}/tbb/lib/tbb.lib
-DCLEW_INCLUDE_DIR=${LIBDIR}/clew/include/CL
-DCLEW_LIBRARY=${LIBDIR}/clew/lib/clew${LIBEXT}
-DCUEW_INCLUDE_DIR=${LIBDIR}/cuew/include
-DCUEW_LIBRARY=${LIBDIR}/cuew/lib/cuew${LIBEXT}
)
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
set(OPENSUBDIV_EXTRA_ARGS
${OPENSUBDIV_EXTRA_ARGS}
-DNO_CUDA=OFF
)
else()
set(OPENSUBDIV_EXTRA_ARGS
${OPENSUBDIV_EXTRA_ARGS}
-DNO_CUDA=ON
)
endif()
else()
set(OPENSUBDIV_EXTRA_ARGS
${OPENSUBDIV_EXTRA_ARGS}
-DNO_CUDA=ON
-DCUEW_INCLUDE_DIR=${LIBDIR}/cuew/include
-DCLEW_INCLUDE_DIR=${LIBDIR}/clew/include/CL
-DCLEW_LIBRARY=${LIBDIR}/clew/lib/static/${LIBPREFIX}clew${LIBEXT}
-DTBB_INCLUDE_DIR=${LIBDIR}/tbb/include
-DTBB_tbb_LIBRARY=${LIBDIR}/tbb/lib/${LIBPREFIX}tbb_static${LIBEXT}
)
endif()
@@ -92,9 +64,5 @@ endif()
add_dependencies(
external_opensubdiv
external_glew
external_glfw
external_clew
external_cuew
external_tbb
)

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
if(BUILD_MODE STREQUAL Debug)
set(BLOSC_POST _d)
@@ -29,6 +13,7 @@ else()
endif()
set(OPENVDB_EXTRA_ARGS
${DEFAULT_BOOST_FLAGS}
-DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
-DBoost_USE_MULTITHREADED=ON
-DBoost_USE_STATIC_LIBS=ON
@@ -40,22 +25,20 @@ set(OPENVDB_EXTRA_ARGS
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
-DBlosc_INCLUDE_DIR=${LIBDIR}/blosc/include/
-DBlosc_LIBRARY=${LIBDIR}/blosc/lib/libblosc${BLOSC_POST}${LIBEXT}
-DOPENVDB_ENABLE_3_ABI_COMPATIBLE=OFF
-DOPENVDB_BUILD_UNITTESTS=Off
-DOPENVDB_BUILD_PYTHON_MODULE=Off
-DBlosc_LIBRARY_RELEASE=${LIBDIR}/blosc/lib/libblosc${BLOSC_POST}${LIBEXT}
-DBlosc_LIBRARY_DEBUG=${LIBDIR}/blosc/lib/libblosc${BLOSC_POST}${LIBEXT}
-DOPENVDB_BUILD_UNITTESTS=OFF
-DOPENVDB_BUILD_PYTHON_MODULE=OFF
-DOPENVDB_BUILD_NANOVDB=ON
-DNANOVDB_BUILD_TOOLS=OFF
-DBlosc_ROOT=${LIBDIR}/blosc/
-DTBB_ROOT=${LIBDIR}/tbb/
-DOpenEXR_ROOT=${LIBDIR}/openexr
-DIlmBase_ROOT=${LIBDIR}/openexr
-DOPENEXR_LIBRARYDIR=${LIBDIR}/openexr/lib
# All libs live in openexr, even the ilmbase ones
-DILMBASE_LIBRARYDIR=${LIBDIR}/openexr/lib
-DOPENVDB_CORE_SHARED=${OPENVDB_SHARED}
-DOPENVDB_CORE_STATIC=${OPENVDB_STATIC}
-DOPENVDB_BUILD_BINARIES=Off
-DOPENVDB_BUILD_BINARIES=OFF
-DCMAKE_DEBUG_POSTFIX=_d
-DILMBASE_USE_STATIC_LIBS=On
-DOPENEXR_USE_STATIC_LIBS=On
-DBLOSC_USE_STATIC_LIBS=ON
-DUSE_NANOVDB=ON
)
if(WIN32)
@@ -64,15 +47,6 @@ if(WIN32)
# needs to link pthreads due to it being a blosc dependency
set(OPENVDB_EXTRA_ARGS ${OPENVDB_EXTRA_ARGS}
-DCMAKE_CXX_STANDARD_LIBRARIES="${LIBDIR}/pthreads/lib/pthreadVC3.lib"
-DUSE_EXR=On
)
else()
# OpenVDB can't find the _static libraries automatically.
set(OPENVDB_EXTRA_ARGS ${OPENVDB_EXTRA_ARGS}
-DTbb_LIBRARIES=${LIBDIR}/tbb/lib/${LIBPREFIX}tbb_static${LIBEXT}
-DTbb_tbb_LIBRARY=${LIBDIR}/tbb/lib/${LIBPREFIX}tbb_static${LIBEXT}
-DTbb_tbbmalloc_LIBRARY=${LIBDIR}/tbb/lib/${LIBPREFIX}tbbmalloc_static${LIBEXT}
-DTbb_tbbmalloc_proxy_LIBRARY=${LIBDIR}/tbb/lib/${LIBPREFIX}tbbmalloc_proxy_static${LIBEXT}
)
endif()
@@ -90,7 +64,6 @@ add_dependencies(
openvdb
external_tbb
external_boost
external_openexr
external_zlib
external_blosc
)
@@ -98,7 +71,7 @@ add_dependencies(
if(WIN32)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(openvdb after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openvdb/include/openvdb ${HARVEST_TARGET}/openvdb/include/openvdb
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openvdb/include ${HARVEST_TARGET}/openvdb/include
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openvdb/lib/openvdb.lib ${HARVEST_TARGET}/openvdb/lib/openvdb.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openvdb/bin/openvdb.dll ${HARVEST_TARGET}/openvdb/bin/openvdb.dll
DEPENDEES install

View File

@@ -1,25 +1,8 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
if(WIN32)
option(ENABLE_MINGW64 "Enable building of ffmpeg/iconv/libsndfile/fftw3 by installing mingw64" ON)
endif()
option(WITH_WEBP "Enable building of oiio with webp support" OFF)
option(WITH_BOOST_PYTHON "Enable building of boost with python support" OFF)
cmake_host_system_information(RESULT NUM_CORES QUERY NUMBER_OF_LOGICAL_CORES)
set(MAKE_THREADS ${NUM_CORES} CACHE STRING "Number of threads to run make with")
@@ -58,29 +41,29 @@ if(WIN32)
set(LIBPREFIX "")
# For OIIO and OSL
set(COMMON_DEFINES /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS)
set(COMMON_DEFINES /DPSAPI_VERSION=2 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS)
if(MSVC_VERSION GREATER 1909)
set(COMMON_MSVC_FLAGS "/Wv:18") #some deps with warnings as error aren't quite ready for dealing with the new 2017 warnings.
endif()
string(APPEND COMMON_MSVC_FLAGS " /bigobj")
if(WITH_OPTIMIZED_DEBUG)
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MDd ${COMMON_MSVC_FLAGS} /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MDd ${COMMON_MSVC_FLAGS} /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=2 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
else()
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MDd ${COMMON_MSVC_FLAGS} /Zi /Ob0 /Od /RTC1 /D_DEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MDd ${COMMON_MSVC_FLAGS} /Zi /Ob0 /Od /RTC1 /D_DEBUG /DPSAPI_VERSION=2 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
endif()
set(BLENDER_CMAKE_C_FLAGS_MINSIZEREL "/MD ${COMMON_MSVC_FLAGS} /O1 /Ob1 /D NDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_RELEASE "/MD ${COMMON_MSVC_FLAGS} /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_RELWITHDEBINFO "/MD ${COMMON_MSVC_FLAGS} /Zi /O2 /Ob1 /D NDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_MINSIZEREL "/MD ${COMMON_MSVC_FLAGS} /O1 /Ob1 /D NDEBUG /DPSAPI_VERSION=2 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_RELEASE "/MD ${COMMON_MSVC_FLAGS} /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=2 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_RELWITHDEBINFO "/MD ${COMMON_MSVC_FLAGS} /Zi /O2 /Ob1 /D NDEBUG /DPSAPI_VERSION=2 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
if(WITH_OPTIMIZED_DEBUG)
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/MDd ${COMMON_MSVC_FLAGS} /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/MDd ${COMMON_MSVC_FLAGS} /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=2 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
else()
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /D PLATFORM_WINDOWS /MTd ${COMMON_MSVC_FLAGS} /Zi /Ob0 /Od /RTC1 /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /D PLATFORM_WINDOWS /MTd ${COMMON_MSVC_FLAGS} /Zi /Ob0 /Od /RTC1 /DPSAPI_VERSION=2 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
endif()
set(BLENDER_CMAKE_CXX_FLAGS_MINSIZEREL "/MD /${COMMON_MSVC_FLAGS} /O1 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_CXX_FLAGS_RELEASE "/MD ${COMMON_MSVC_FLAGS} /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MD ${COMMON_MSVC_FLAGS} /Zi /O2 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_CXX_FLAGS_MINSIZEREL "/MD /${COMMON_MSVC_FLAGS} /O1 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=2 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_CXX_FLAGS_RELEASE "/MD ${COMMON_MSVC_FLAGS} /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=2 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MD ${COMMON_MSVC_FLAGS} /Zi /O2 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=2 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(PLATFORM_FLAGS)
set(PLATFORM_CXX_FLAGS)

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
ExternalProject_Add(external_opus
URL file://${PACKAGE_DIR}/${OPUS_FILE}

View File

@@ -1,51 +1,17 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
if(WIN32)
set(OSL_CMAKE_CXX_STANDARD_LIBRARIES "kernel32${LIBEXT} user32${LIBEXT} gdi32${LIBEXT} winspool${LIBEXT} shell32${LIBEXT} ole32${LIBEXT} oleaut32${LIBEXT} uuid${LIBEXT} comdlg32${LIBEXT} advapi32${LIBEXT} psapi${LIBEXT}")
set(OSL_FLEX_BISON -DFLEX_EXECUTABLE=${LIBDIR}/flexbison/win_flex.exe -DBISON_EXECUTABLE=${LIBDIR}/flexbison/win_bison.exe)
set(OSL_SIMD_FLAGS -DOIIO_NOSIMD=1 -DOIIO_SIMD=sse2)
else()
set(OSL_CMAKE_CXX_STANDARD_LIBRARIES)
set(OSL_FLEX_BISON)
set(OSL_OPENIMAGEIO_LIBRARY "${LIBDIR}/openimageio/lib/${LIBPREFIX}OpenImageIO${LIBEXT};${LIBDIR}/openimageio/lib/${LIBPREFIX}OpenImageIO_Util${LIBEXT};${LIBDIR}/png/lib/${LIBPREFIX}png16${LIBEXT};${LIBDIR}/jpg/lib/${LIBPREFIX}jpeg${LIBEXT};${LIBDIR}/tiff/lib/${LIBPREFIX}tiff${LIBEXT};${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf${OPENEXR_VERSION_POSTFIX}${LIBEXT}")
set(OSL_OPENIMAGEIO_LIBRARY "${LIBDIR}/openimageio/lib/${LIBPREFIX}OpenImageIO${LIBEXT};${LIBDIR}/openimageio/lib/${LIBPREFIX}OpenImageIO_Util${LIBEXT};${LIBDIR}/png/lib/${LIBPREFIX}png16${LIBEXT};${LIBDIR}/jpeg/lib/${LIBPREFIX}jpeg${LIBEXT};${LIBDIR}/tiff/lib/${LIBPREFIX}tiff${LIBEXT};${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf${OPENEXR_VERSION_POSTFIX}${LIBEXT}")
endif()
set(OSL_ILMBASE_CUSTOM_LIBRARIES "${LIBDIR}/openexr/lib/Imath${OPENEXR_VERSION_POSTFIX}.lib^^${LIBDIR}/openexr/lib/Half{OPENEXR_VERSION_POSTFIX}.lib^^${LIBDIR}/openexr/lib/IlmThread${OPENEXR_VERSION_POSTFIX}.lib^^${LIBDIR}/openexr/lib/Iex${OPENEXR_VERSION_POSTFIX}.lib")
set(OSL_EXTRA_ARGS
-DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
-DBoost_USE_MULTITHREADED=ON
-DBoost_USE_STATIC_LIBS=ON
-DBoost_USE_STATIC_RUNTIME=OFF
-DBOOST_ROOT=${LIBDIR}/boost
-DBOOST_LIBRARYDIR=${LIBDIR}/boost/lib/
-DBoost_NO_SYSTEM_PATHS=ON
-DBoost_NO_BOOST_CMAKE=ON
${DEFAULT_BOOST_FLAGS}
-DOpenEXR_ROOT=${LIBDIR}/openexr/
-DIlmBase_ROOT=${LIBDIR}/openexr/
-DILMBASE_INCLUDE_DIR=${LIBDIR}/openexr/include/
-DOPENEXR_HALF_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}Half${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DOPENEXR_IMATH_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}Imath${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DOPENEXR_ILMTHREAD_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}IlmThread${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DOPENEXR_IEX_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}Iex${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DOPENEXR_INCLUDE_DIR=${LIBDIR}/openexr/include/
-DOPENEXR_ILMIMF_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DOpenImageIO_ROOT=${LIBDIR}/openimageio/
-DOSL_BUILD_TESTS=OFF
-DOSL_BUILD_MATERIALX=OFF
@@ -65,10 +31,10 @@ set(OSL_EXTRA_ARGS
-DUSE_QT=OFF
-DUSE_Qt5=OFF
-DINSTALL_DOCS=OFF
${OSL_SIMD_FLAGS}
-Dpugixml_ROOT=${LIBDIR}/pugixml
-DUSE_PYTHON=OFF
-DCMAKE_CXX_STANDARD=14
-DImath_ROOT=${LIBDIR}/imath
)
ExternalProject_Add(external_osl

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
if(MSVC)
set(PYTARGET ${HARVEST_TARGET}/python/${PYTHON_SHORT_VERSION_NO_DOTS})

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
set(PNG_EXTRA_ARGS
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
set(POTRACE_EXTRA_ARGS
)

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
if(WIN32)

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
set(PUGIXML_EXTRA_ARGS
)

View File

@@ -0,0 +1,22 @@
# SPDX-License-Identifier: GPL-2.0-or-later
set(PYSTRING_EXTRA_ARGS
)
ExternalProject_Add(external_pystring
URL file://${PACKAGE_DIR}/${PYSTRING_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${PYSTRING_HASH_TYPE}=${PYSTRING_HASH}
PREFIX ${BUILD_DIR}/pystring
PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/cmakelists_pystring.txt ${BUILD_DIR}/pystring/src/external_pystring/CMakeLists.txt
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/pystring ${DEFAULT_CMAKE_FLAGS} ${PYSTRING_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/pystring
)
if(WIN32)
ExternalProject_Add_Step(external_pystring after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/pystring/lib ${HARVEST_TARGET}/pystring/lib
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/pystring/include ${HARVEST_TARGET}/pystring/include
DEPENDEES install
)
endif()

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
set(PYTHON_POSTFIX)
if(BUILD_MODE STREQUAL Debug)

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
if(WIN32 AND BUILD_MODE STREQUAL Debug)
set(SITE_PACKAGES_EXTRA --global-option build --global-option --debug)
@@ -31,7 +15,7 @@ ExternalProject_Add(external_python_site_packages
CONFIGURE_COMMAND ${PIP_CONFIGURE_COMMAND}
BUILD_COMMAND ""
PREFIX ${BUILD_DIR}/site_packages
INSTALL_COMMAND ${PYTHON_BINARY} -m pip install ${SITE_PACKAGES_EXTRA} cython==${CYTHON_VERSION} idna==${IDNA_VERSION} charset-normalizer==${CHARSET_NORMALIZER_VERSION} urllib3==${URLLIB3_VERSION} certifi==${CERTIFI_VERSION} requests==${REQUESTS_VERSION} zstandard==${ZSTANDARD_VERSION} --no-binary :all:
INSTALL_COMMAND ${PYTHON_BINARY} -m pip install --no-cache-dir ${SITE_PACKAGES_EXTRA} cython==${CYTHON_VERSION} idna==${IDNA_VERSION} charset-normalizer==${CHARSET_NORMALIZER_VERSION} urllib3==${URLLIB3_VERSION} certifi==${CERTIFI_VERSION} requests==${REQUESTS_VERSION} zstandard==${ZSTANDARD_VERSION} autopep8==${AUTOPEP8_VERSION} pycodestyle==${PYCODESTYLE_VERSION} toml==${TOML_VERSION} --no-binary :all:
)
if(USE_PIP_NUMPY)

View File

@@ -0,0 +1,13 @@
# SPDX-License-Identifier: GPL-2.0-or-later
set(ROBINMAP_EXTRA_ARGS
)
ExternalProject_Add(external_robinmap
URL file://${PACKAGE_DIR}/${ROBINMAP_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${ROBINMAP_HASH_TYPE}=${ROBINMAP_HASH}
PREFIX ${BUILD_DIR}/robinmap
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/robinmap ${DEFAULT_CMAKE_FLAGS} ${ROBINMAP_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/robinmap
)

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
if(WIN32)
set(SDL_EXTRA_ARGS

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
####################################################################################################################
# Mingw64 Builds

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
set(SNDFILE_EXTRA_ARGS)
set(SNDFILE_ENV PKG_CONFIG_PATH=${mingw_LIBDIR}/ogg/lib/pkgconfig:${mingw_LIBDIR}/vorbis/lib/pkgconfig:${mingw_LIBDIR}/flac/lib/pkgconfig:${mingw_LIBDIR})

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
ExternalProject_Add(external_spnav
URL file://${PACKAGE_DIR}/${SPNAV_FILE}

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
set(SQLITE_CONFIGURE_ENV echo .)
set(SQLITE_CONFIGURATION_ARGS)

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
ExternalProject_Add(external_sse2neon
GIT_REPOSITORY ${SSE2NEON_GIT}

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
set(SSL_CONFIGURE_COMMAND ./Configure)
set(SSL_PATCH_CMD echo .)

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
if(WIN32)
set(TBB_EXTRA_ARGS
-DTBB_BUILD_SHARED=On

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
if(UNIX)
set(THEORA_CONFIGURE_ENV ${CONFIGURE_ENV} && export HAVE_PDFLATEX=no)

View File

@@ -1,26 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(WITH_WEBP)
set(WITH_TIFF_WEBP ON)
else()
set(WITH_TIFF_WEBP OFF)
endif()
# SPDX-License-Identifier: GPL-2.0-or-later
set(TIFF_EXTRA_ARGS
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
@@ -30,7 +8,7 @@ set(TIFF_EXTRA_ARGS
-Dlzma=OFF
-Djbig=OFF
-Dzstd=OFF
-Dwebp=${WITH_TIFF_WEBP}
-Dwebp=OFF
)
ExternalProject_Add(external_tiff

View File

@@ -1,55 +1,72 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
if(WIN32)
# OIIO and OSL are statically linked for us, but USD doesn't know
set(USD_CXX_FLAGS "${CMAKE_CXX_FLAGS} /DOIIO_STATIC_DEFINE /DOSL_STATIC_DEFINE")
if(BUILD_MODE STREQUAL Debug)
# USD does not look for debug libs, nor does it link them
# when building static, so this is just to keep find_package happy
# if we ever link dynamically on windows util will need to be linked as well.
set(USD_OIIO_CMAKE_DEFINES "-DOIIO_LIBRARIES=${LIBDIR}/openimageio/lib/OpenImageIO_d${LIBEXT}")
endif()
set(USD_PLATFORM_FLAGS
${USD_OIIO_CMAKE_DEFINES}
-DCMAKE_CXX_FLAGS=${USD_CXX_FLAGS}
)
endif()
set(USD_EXTRA_ARGS
-DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
-DBoost_USE_MULTITHREADED=ON
-DBoost_USE_STATIC_LIBS=ON
-DBoost_USE_STATIC_RUNTIME=OFF
-DBOOST_ROOT=${LIBDIR}/boost
-DBoost_NO_SYSTEM_PATHS=ON
-DBoost_NO_BOOST_CMAKE=ON
${DEFAULT_BOOST_FLAGS}
${USD_PLATFORM_FLAGS}
# This is a preventative measure that avoids possible conflicts when add-ons
# try to load another USD library into the same process space.
-DPXR_SET_INTERNAL_NAMESPACE=usdBlender
-DOPENSUBDIV_ROOT_DIR=${LIBDIR}/opensubdiv
-DOpenImageIO_ROOT=${LIBDIR}/openimageio
-DOPENEXR_LIBRARIES=${LIBDIR}/imath/lib/imath${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DOPENEXR_INCLUDE_DIR=${LIBDIR}/imath/include
-DPXR_ENABLE_PYTHON_SUPPORT=OFF
-DPXR_BUILD_IMAGING=ON
-DPXR_BUILD_TESTS=OFF
-DPXR_BUILD_EXAMPLES=OFF
-DPXR_BUILD_TUTORIALS=OFF
-DPXR_ENABLE_HDF5_SUPPORT=OFF
-DPXR_ENABLE_MATERIALX_SUPPORT=OFF
-DPXR_ENABLE_OPENVDB_SUPPORT=OFF
-DPYTHON_EXECUTABLE=${PYTHON_BINARY}
-DPXR_BUILD_MONOLITHIC=ON
# OSL is an optional dependency of the Imaging module. However, since that
# module was included for its support for converting primitive shapes (sphere,
# cube, etc.) to geometry, it's not necessary. Disabling it will make it
# simpler to build Blender; currently only Cycles uses OSL.
-DPXR_ENABLE_OSL_SUPPORT=OFF
# GL support on Linux also links to X11 libraries. Enabling it would break
# headless or Wayland-only builds. OpenGL support would be useful if someone
# wants to work on a Hydra viewport in Blender; when that's actually being
# worked on, we could patch in a new PXR_ENABLE_X11_SUPPORT option (to
# separate OpenGL from X11) and contribute it upstream.
-DPXR_ENABLE_GL_SUPPORT=OFF
# Disable Metal since USD fails to build this when OpenGL is disabled.
-DPXR_ENABLE_METAL_SUPPORT=OFF
# OIIO is used for loading image textures in Hydra Storm / Embree renderers,
# which we don't use.
-DPXR_BUILD_OPENIMAGEIO_PLUGIN=OFF
# USD 22.03 does not support OCIO 2.x
# Tracking ticket https://github.com/PixarAnimationStudios/USD/issues/1386
-DPXR_BUILD_OPENCOLORIO_PLUGIN=OFF
-DPXR_ENABLE_PTEX_SUPPORT=OFF
-DPXR_BUILD_USD_TOOLS=OFF
-DCMAKE_DEBUG_POSTFIX=_d
-DBUILD_SHARED_LIBS=Off
# USD is hellbound on making a shared lib, unless you point this variable to a valid cmake file
# doesn't have to make sense, but as long as it points somewhere valid it will skip the shared lib.
-DPXR_MONOLITHIC_IMPORT=${BUILD_DIR}/usd/src/external_usd/cmake/defaults/Version.cmake
-DTBB_INCLUDE_DIRS=${LIBDIR}/tbb/include
-DTBB_LIBRARIES=${LIBDIR}/tbb/lib/${LIBPREFIX}${TBB_LIBRARY}${LIBEXT}
-DTbb_TBB_LIBRARY=${LIBDIR}/tbb/lib/${LIBPREFIX}${TBB_LIBRARY}${LIBEXT}
# USD wants the tbb debug lib set even when you are doing a release build
# Otherwise it will error out during the cmake configure phase.
-DTBB_LIBRARIES_DEBUG=${LIBDIR}/tbb/lib/${LIBPREFIX}${TBB_LIBRARY}${LIBEXT}
# This is a preventative measure that avoids possible conflicts when add-ons
# try to load another USD library into the same process space.
-DPXR_SET_INTERNAL_NAMESPACE=usdBlender
-DPXR_ENABLE_PYTHON_SUPPORT=OFF
-DPXR_BUILD_IMAGING=OFF
-DPXR_BUILD_TESTS=OFF
-DBUILD_SHARED_LIBS=OFF
-DPYTHON_EXECUTABLE=${PYTHON_BINARY}
-DPXR_BUILD_MONOLITHIC=ON
# The PXR_BUILD_USD_TOOLS argument is patched-in by usd.diff. An upstream pull request
# can be found at https://github.com/PixarAnimationStudios/USD/pull/1048.
-DPXR_BUILD_USD_TOOLS=OFF
-DCMAKE_DEBUG_POSTFIX=_d
# USD is hellbound on making a shared lib, unless you point this variable to a valid cmake file
# doesn't have to make sense, but as long as it points somewhere valid it will skip the shared lib.
-DPXR_MONOLITHIC_IMPORT=${BUILD_DIR}/usd/src/external_usd/cmake/defaults/Version.cmake
)
ExternalProject_Add(external_usd
@@ -66,29 +83,31 @@ add_dependencies(
external_usd
external_tbb
external_boost
external_opensubdiv
)
# Since USD 21.11 the libraries are prefixed with "usd_", i.e. "libusd_m.a" became "libusd_usd_m.a".
# See https://github.com/PixarAnimationStudios/USD/blob/release/CHANGELOG.md#2111---2021-11-01
if(NOT WIN32)
if (USD_VERSION VERSION_LESS 21.11)
set(PXR_LIB_PREFIX "")
else()
set(PXR_LIB_PREFIX "usd_")
endif()
endif()
if(WIN32)
# USD currently demands python be available at build time
# and then proceeds not to use it, but still checks that the
# version of the interpreter it is not going to use is atleast 2.7
# so we need this dep currently since there is no system python
# on windows.
add_dependencies(
external_usd
external_python
)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_usd after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/usd/ ${HARVEST_TARGET}/usd
COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/usd/src/external_usd-build/pxr/Release/usd_m.lib ${HARVEST_TARGET}/usd/lib/libusd_m.lib
COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/usd/src/external_usd-build/pxr/Release/usd_usd_m.lib ${HARVEST_TARGET}/usd/lib/usd_usd_m.lib
DEPENDEES install
)
endif()
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_usd after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/usd/lib ${HARVEST_TARGET}/usd/lib
COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/usd/src/external_usd-build/pxr/Debug/usd_m_d.lib ${HARVEST_TARGET}/usd/lib/libusd_m_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/usd/src/external_usd-build/pxr/Debug/usd_usd_m_d.lib ${HARVEST_TARGET}/usd/lib/usd_usd_m_d.lib
DEPENDEES install
)
endif()
@@ -100,7 +119,7 @@ else()
# case (only the shared library). As a result, we need to grab the `libusd_m.a`
# file from the build directory instead of from the install directory.
ExternalProject_Add_Step(external_usd after_install
COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/usd/src/external_usd-build/pxr/libusd_m.a ${HARVEST_TARGET}/usd/lib/libusd_m.a
COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/usd/src/external_usd-build/pxr/lib${PXR_LIB_PREFIX}usd_m.a ${HARVEST_TARGET}/usd/lib/lib${PXR_LIB_PREFIX}usd_m.a
DEPENDEES install
)
endif()

View File

@@ -1,30 +1,14 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
set(ZLIB_VERSION 1.2.11)
set(ZLIB_VERSION 1.2.12)
set(ZLIB_URI https://zlib.net/zlib-${ZLIB_VERSION}.tar.gz)
set(ZLIB_HASH 1c9f62f0778697a09d36121ead88e08e)
set(ZLIB_HASH 5fc414a9726be31427b440b434d05f78)
set(ZLIB_HASH_TYPE MD5)
set(ZLIB_FILE zlib-${ZLIB_VERSION}.tar.gz)
set(OPENAL_VERSION 1.20.1)
set(OPENAL_VERSION 1.21.1)
set(OPENAL_URI http://openal-soft.org/openal-releases/openal-soft-${OPENAL_VERSION}.tar.bz2)
set(OPENAL_HASH 556695068ce8375b89986083d810fd35)
set(OPENAL_HASH a936806ebd8de417b0ffd8cf3f48f456)
set(OPENAL_HASH_TYPE MD5)
set(OPENAL_FILE openal-soft-${OPENAL_VERSION}.tar.bz2)
@@ -34,24 +18,24 @@ set(PNG_HASH 505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca)
set(PNG_HASH_TYPE SHA256)
set(PNG_FILE libpng-${PNG_VERSION}.tar.xz)
set(JPEG_VERSION 2.0.4)
set(JPEG_VERSION 2.1.3)
set(JPEG_URI https://github.com/libjpeg-turbo/libjpeg-turbo/archive/${JPEG_VERSION}.tar.gz)
set(JPEG_HASH 44c43e4a9fb352f47090804529317c88)
set(JPEG_HASH 627b980fad0573e08e4c3b80b290fc91)
set(JPEG_HASH_TYPE MD5)
set(JPEG_FILE libjpeg-turbo-${JPEG_VERSION}.tar.gz)
set(BOOST_VERSION 1.73.0)
set(BOOST_VERSION_NODOTS 1_73_0)
set(BOOST_VERSION_NODOTS_SHORT 1_73)
set(BOOST_VERSION 1.78.0)
set(BOOST_VERSION_SHORT 1.78)
set(BOOST_VERSION_NODOTS 1_78_0)
set(BOOST_VERSION_NODOTS_SHORT 1_78)
set(BOOST_URI https://boostorg.jfrog.io/artifactory/main/release/${BOOST_VERSION}/source/boost_${BOOST_VERSION_NODOTS}.tar.gz)
set(BOOST_HASH 4036cd27ef7548b8d29c30ea10956196)
set(BOOST_HASH c2f6428ac52b0e5a3c9b2e1d8cc832b5)
set(BOOST_HASH_TYPE MD5)
set(BOOST_FILE boost_${BOOST_VERSION_NODOTS}.tar.gz)
# Using old version as recommended by OpenVDB build documentation.
set(BLOSC_VERSION 1.5.0)
set(BLOSC_VERSION 1.21.1)
set(BLOSC_URI https://github.com/Blosc/c-blosc/archive/v${BLOSC_VERSION}.tar.gz)
set(BLOSC_HASH 6e4a49c8c06f05aa543f3312cfce3d55)
set(BLOSC_HASH 134b55813b1dca57019d2a2dc1f7a923)
set(BLOSC_HASH_TYPE MD5)
set(BLOSC_FILE blosc-${BLOSC_VERSION}.tar.gz)
@@ -61,12 +45,19 @@ set(PTHREADS_HASH f3bf81bb395840b3446197bcf4ecd653)
set(PTHREADS_HASH_TYPE MD5)
set(PTHREADS_FILE pthreads4w-code-${PTHREADS_VERSION}.zip)
set(OPENEXR_VERSION 2.5.5)
set(OPENEXR_VERSION 3.1.4)
set(OPENEXR_URI https://github.com/AcademySoftwareFoundation/openexr/archive/v${OPENEXR_VERSION}.tar.gz)
set(OPENEXR_HASH 85e8a979092c9055d10ed103062d31a0)
set(OPENEXR_HASH e990be1ff765797bc2d93a8060e1c1f2)
set(OPENEXR_HASH_TYPE MD5)
set(OPENEXR_FILE openexr-${OPENEXR_VERSION}.tar.gz)
set(IMATH_VERSION 3.1.4)
set(IMATH_URI https://github.com/AcademySoftwareFoundation/Imath/archive/v${OPENEXR_VERSION}.tar.gz)
set(IMATH_HASH fddf14ec73e12c34e74c3c175e311a3f)
set(IMATH_HASH_TYPE MD5)
set(IMATH_FILE imath-${IMATH_VERSION}.tar.gz)
if(WIN32)
# Openexr started appending _d on its own so now
# we need to tell the build the postfix is _s while
@@ -83,9 +74,9 @@ else()
set(OPENEXR_VERSION_POSTFIX)
endif()
set(FREETYPE_VERSION 2.10.2)
set(FREETYPE_VERSION 2.11.1)
set(FREETYPE_URI http://prdownloads.sourceforge.net/freetype/freetype-${FREETYPE_VERSION}.tar.gz)
set(FREETYPE_HASH b1cb620e4c875cd4d1bfa04945400945)
set(FREETYPE_HASH bd4e3b007474319909a6b79d50908e85)
set(FREETYPE_HASH_TYPE MD5)
set(FREETYPE_FILE freetype-${FREETYPE_VERSION}.tar.gz)
@@ -101,42 +92,21 @@ set(FREEGLUT_HASH 90c3ca4dd9d51cf32276bc5344ec9754)
set(FREEGLUT_HASH_TYPE MD5)
set(FREEGLUT_FILE freeglut-${FREEGLUT_VERSION}.tar.gz)
set(ALEMBIC_VERSION 1.7.16)
set(ALEMBIC_VERSION 1.8.3)
set(ALEMBIC_URI https://github.com/alembic/alembic/archive/${ALEMBIC_VERSION}.tar.gz)
set(ALEMBIC_HASH effcc86e42fe6605588e3de57bde6677)
set(ALEMBIC_HASH 2cd8d6e5a3ac4a014e24a4b04f4fadf9)
set(ALEMBIC_HASH_TYPE MD5)
set(ALEMBIC_FILE alembic-${ALEMBIC_VERSION}.tar.gz)
# hash is for 3.1.2
set(GLFW_GIT_UID 30306e54705c3adae9fe082c816a3be71963485c)
set(GLFW_URI https://github.com/glfw/glfw/archive/${GLFW_GIT_UID}.zip)
set(GLFW_HASH 20cacb1613da7eeb092f3ac4f6b2b3d0)
set(GLFW_HASH_TYPE MD5)
set(GLFW_FILE glfw-${GLFW_GIT_UID}.zip)
# latest uid in git as of 2016-04-01
set(CLEW_GIT_UID 277db43f6cafe8b27c6f1055f69dc67da4aeb299)
set(CLEW_URI https://github.com/OpenCLWrangler/clew/archive/${CLEW_GIT_UID}.zip)
set(CLEW_HASH 2c699d10ed78362e71f56fae2a4c5f98)
set(CLEW_HASH_TYPE MD5)
set(CLEW_FILE clew-${CLEW_GIT_UID}.zip)
# latest uid in git as of 2016-04-01
set(CUEW_GIT_UID 1744972026de9cf27c8a7dc39cf39cd83d5f922f)
set(CUEW_URI https://github.com/CudaWrangler/cuew/archive/${CUEW_GIT_UID}.zip)
set(CUEW_HASH 86760d62978ebfd96cd93f5aa1abaf4a)
set(CUEW_HASH_TYPE MD5)
set(CUEW_FILE cuew-${CUEW_GIT_UID}.zip)
set(OPENSUBDIV_VERSION v3_4_3)
set(OPENSUBDIV_VERSION v3_4_4)
set(OPENSUBDIV_URI https://github.com/PixarAnimationStudios/OpenSubdiv/archive/${OPENSUBDIV_VERSION}.tar.gz)
set(OPENSUBDIV_HASH 7bbfa275d021fb829e521df749160edb)
set(OPENSUBDIV_HASH 39ecc5caf0abebc943d1ce131855e76e)
set(OPENSUBDIV_HASH_TYPE MD5)
set(OPENSUBDIV_FILE opensubdiv-${OPENSUBDIV_VERSION}.tar.gz)
set(SDL_VERSION 2.0.12)
set(SDL_VERSION 2.0.20)
set(SDL_URI https://www.libsdl.org/release/SDL2-${SDL_VERSION}.tar.gz)
set(SDL_HASH 783b6f2df8ff02b19bb5ce492b99c8ff)
set(SDL_HASH a53acc02e1cca98c4123229069b67c9e)
set(SDL_HASH_TYPE MD5)
set(SDL_FILE SDL2-${SDL_VERSION}.tar.gz)
@@ -146,9 +116,9 @@ set(OPENCOLLADA_HASH ee7dae874019fea7be11613d07567493)
set(OPENCOLLADA_HASH_TYPE MD5)
set(OPENCOLLADA_FILE opencollada-${OPENCOLLADA_VERSION}.tar.gz)
set(OPENCOLORIO_VERSION 2.0.0)
set(OPENCOLORIO_VERSION 2.1.1)
set(OPENCOLORIO_URI https://github.com/AcademySoftwareFoundation/OpenColorIO/archive/v${OPENCOLORIO_VERSION}.tar.gz)
set(OPENCOLORIO_HASH 1a2e3478b6cd9a1549f24e1b2205e3f0)
set(OPENCOLORIO_HASH 604f562e073f23d88ce89ed4f7f709ba)
set(OPENCOLORIO_HASH_TYPE MD5)
set(OPENCOLORIO_FILE OpenColorIO-${OPENCOLORIO_VERSION}.tar.gz)
@@ -171,62 +141,77 @@ set(OPENMP_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${
set(OPENMP_HASH_TYPE MD5)
set(OPENMP_FILE openmp-${OPENMP_VERSION}.src.tar.xz)
set(OPENIMAGEIO_VERSION 2.2.15.1)
set(OPENIMAGEIO_URI https://github.com/OpenImageIO/oiio/archive/Release-${OPENIMAGEIO_VERSION}.tar.gz)
set(OPENIMAGEIO_HASH 3db5c5f0b3dc91597c75e5df09eb9072)
set(OPENIMAGEIO_VERSION v2.3.13.0)
set(OPENIMAGEIO_URI https://github.com/OpenImageIO/oiio/archive/refs/tags/${OPENIMAGEIO_VERSION}.tar.gz)
set(OPENIMAGEIO_HASH de45fb38501c4581062b522b53b6141c)
set(OPENIMAGEIO_HASH_TYPE MD5)
set(OPENIMAGEIO_FILE OpenImageIO-${OPENIMAGEIO_VERSION}.tar.gz)
set(TIFF_VERSION 4.1.0)
# 8.0.0 is currently oiio's preferred vesion although never versions may be available.
# the preferred version can be found in oiio's externalpackages.cmake
set(FMT_VERSION 8.0.0)
set(FMT_URI https://github.com/fmtlib/fmt/archive/refs/tags/${FMT_VERSION}.tar.gz)
set(FMT_HASH 7bce0e9e022e586b178b150002e7c2339994e3c2bbe44027e9abb0d60f9cce83)
set(FMT_HASH_TYPE SHA256)
set(FMT_FILE fmt-${FMT_VERSION}.tar.gz)
# 0.6.2 is currently oiio's preferred vesion although never versions may be available.
# the preferred version can be found in oiio's externalpackages.cmake
set(ROBINMAP_VERSION v0.6.2)
set(ROBINMAP_URI https://github.com/Tessil/robin-map/archive/refs/tags/${ROBINMAP_VERSION}.tar.gz)
set(ROBINMAP_HASH c08ec4b1bf1c85eb0d6432244a6a89862229da1cb834f3f90fba8dc35d8c8ef1)
set(ROBINMAP_HASH_TYPE SHA256)
set(ROBINMAP_FILE robinmap-${ROBINMAP_VERSION}.tar.gz)
set(TIFF_VERSION 4.3.0)
set(TIFF_URI http://download.osgeo.org/libtiff/tiff-${TIFF_VERSION}.tar.gz)
set(TIFF_HASH 2165e7aba557463acc0664e71a3ed424)
set(TIFF_HASH 0a2e4744d1426a8fc8211c0cdbc3a1b3)
set(TIFF_HASH_TYPE MD5)
set(TIFF_FILE tiff-${TIFF_VERSION}.tar.gz)
set(OSL_VERSION 1.11.14.1)
set(OSL_VERSION 1.11.17.0)
set(OSL_URI https://github.com/imageworks/OpenShadingLanguage/archive/Release-${OSL_VERSION}.tar.gz)
set(OSL_HASH 1abd7ce40481771a9fa937f19595d2f2)
set(OSL_HASH 63265472ce14548839ace2e21e401544)
set(OSL_HASH_TYPE MD5)
set(OSL_FILE OpenShadingLanguage-${OSL_VERSION}.tar.gz)
set(PYTHON_VERSION 3.9.7)
set(PYTHON_SHORT_VERSION 3.9)
set(PYTHON_SHORT_VERSION_NO_DOTS 39)
set(PYTHON_VERSION 3.10.2)
set(PYTHON_SHORT_VERSION 3.10)
set(PYTHON_SHORT_VERSION_NO_DOTS 310)
set(PYTHON_URI https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tar.xz)
set(PYTHON_HASH fddb060b483bc01850a3f412eea1d954)
set(PYTHON_HASH 14e8c22458ed7779a1957b26cde01db9)
set(PYTHON_HASH_TYPE MD5)
set(PYTHON_FILE Python-${PYTHON_VERSION}.tar.xz)
set(TBB_VERSION 2020_U2)
set(TBB_VERSION 2020_U3)
set(TBB_URI https://github.com/oneapi-src/oneTBB/archive/${TBB_VERSION}.tar.gz)
set(TBB_HASH 1b711ae956524855088df3bbf5ec65dc)
set(TBB_HASH 55ec8df6eae5ed6364a47f0e671e460c)
set(TBB_HASH_TYPE MD5)
set(TBB_FILE oneTBB-${TBB_VERSION}.tar.gz)
set(OPENVDB_VERSION 8.0.1)
set(OPENVDB_VERSION 9.0.0)
set(OPENVDB_URI https://github.com/AcademySoftwareFoundation/openvdb/archive/v${OPENVDB_VERSION}.tar.gz)
set(OPENVDB_HASH 01b490be16cc0e15c690f9a153c21461)
set(OPENVDB_HASH 684ce40c2f74f3a0c9cac530e1c7b07e)
set(OPENVDB_HASH_TYPE MD5)
set(OPENVDB_FILE openvdb-${OPENVDB_VERSION}.tar.gz)
set(NANOVDB_GIT_UID dc37d8a631922e7bef46712947dc19b755f3e841)
set(NANOVDB_URI https://github.com/AcademySoftwareFoundation/openvdb/archive/${NANOVDB_GIT_UID}.tar.gz)
set(NANOVDB_HASH e7b9e863ec2f3b04ead171dec2322807)
set(NANOVDB_HASH_TYPE MD5)
set(NANOVDB_FILE nano-vdb-${NANOVDB_GIT_UID}.tar.gz)
set(IDNA_VERSION 3.2)
set(CHARSET_NORMALIZER_VERSION 2.0.6)
set(URLLIB3_VERSION 1.26.7)
set(IDNA_VERSION 3.3)
set(CHARSET_NORMALIZER_VERSION 2.0.10)
set(URLLIB3_VERSION 1.26.8)
set(CERTIFI_VERSION 2021.10.8)
set(REQUESTS_VERSION 2.26.0)
set(CYTHON_VERSION 0.29.24)
set(ZSTANDARD_VERSION 0.15.2 )
set(REQUESTS_VERSION 2.27.1)
set(CYTHON_VERSION 0.29.26)
# The version of the zstd library used to build the Python package should match ZSTD_VERSION defined below.
# At this time of writing, 0.17.0 was already released, but built against zstd 1.5.1, while we use 1.5.0.
set(ZSTANDARD_VERSION 0.16.0)
set(AUTOPEP8_VERSION 1.6.0)
set(PYCODESTYLE_VERSION 2.8.0)
set(TOML_VERSION 0.10.2)
set(NUMPY_VERSION 1.21.2)
set(NUMPY_SHORT_VERSION 1.21)
set(NUMPY_VERSION 1.22.0)
set(NUMPY_SHORT_VERSION 1.22)
set(NUMPY_URI https://github.com/numpy/numpy/releases/download/v${NUMPY_VERSION}/numpy-${NUMPY_VERSION}.zip)
set(NUMPY_HASH 5638d5dae3ca387be562912312db842e)
set(NUMPY_HASH 252de134862a27bd66705d29622edbfe)
set(NUMPY_HASH_TYPE MD5)
set(NUMPY_FILE numpy-${NUMPY_VERSION}.zip)
@@ -236,15 +221,15 @@ set(LAME_HASH 83e260acbe4389b54fe08e0bdbf7cddb)
set(LAME_HASH_TYPE MD5)
set(LAME_FILE lame-${LAME_VERSION}.tar.gz)
set(OGG_VERSION 1.3.4)
set(OGG_VERSION 1.3.5)
set(OGG_URI http://downloads.xiph.org/releases/ogg/libogg-${OGG_VERSION}.tar.gz)
set(OGG_HASH fe5670640bd49e828d64d2879c31cb4dde9758681bb664f9bdbf159a01b0c76e)
set(OGG_HASH 0eb4b4b9420a0f51db142ba3f9c64b333f826532dc0f48c6410ae51f4799b664)
set(OGG_HASH_TYPE SHA256)
set(OGG_FILE libogg-${OGG_VERSION}.tar.gz)
set(VORBIS_VERSION 1.3.6)
set(VORBIS_VERSION 1.3.7)
set(VORBIS_URI http://downloads.xiph.org/releases/vorbis/libvorbis-${VORBIS_VERSION}.tar.gz)
set(VORBIS_HASH 6ed40e0241089a42c48604dc00e362beee00036af2d8b3f46338031c9e0351cb)
set(VORBIS_HASH 0e982409a9c3fc82ee06e08205b1355e5c6aa4c36bca58146ef399621b0ce5ab)
set(VORBIS_HASH_TYPE SHA256)
set(VORBIS_FILE libvorbis-${VORBIS_VERSION}.tar.gz)
@@ -254,15 +239,15 @@ set(THEORA_HASH b6ae1ee2fa3d42ac489287d3ec34c5885730b1296f0801ae577a35193d3affbc
set(THEORA_HASH_TYPE SHA256)
set(THEORA_FILE libtheora-${THEORA_VERSION}.tar.bz2)
set(FLAC_VERSION 1.3.3)
set(FLAC_VERSION 1.3.4)
set(FLAC_URI http://downloads.xiph.org/releases/flac/flac-${FLAC_VERSION}.tar.xz)
set(FLAC_HASH 213e82bd716c9de6db2f98bcadbc4c24c7e2efe8c75939a1a84e28539c4e1748)
set(FLAC_HASH 8ff0607e75a322dd7cd6ec48f4f225471404ae2730d0ea945127b1355155e737 )
set(FLAC_HASH_TYPE SHA256)
set(FLAC_FILE flac-${FLAC_VERSION}.tar.xz)
set(VPX_VERSION 1.8.2)
set(VPX_VERSION 1.11.0)
set(VPX_URI https://github.com/webmproject/libvpx/archive/v${VPX_VERSION}/libvpx-v${VPX_VERSION}.tar.gz)
set(VPX_HASH 8735d9fcd1a781ae6917f28f239a8aa358ce4864ba113ea18af4bb2dc8b474ac)
set(VPX_HASH 965e51c91ad9851e2337aebcc0f517440c637c506f3a03948062e3d5ea129a83)
set(VPX_HASH_TYPE SHA256)
set(VPX_FILE libvpx-v${VPX_VERSION}.tar.gz)
@@ -272,9 +257,9 @@ set(OPUS_HASH 65b58e1e25b2a114157014736a3d9dfeaad8d41be1c8179866f144a2fb44ff9d)
set(OPUS_HASH_TYPE SHA256)
set(OPUS_FILE opus-${OPUS_VERSION}.tar.gz)
set(X264_VERSION 33f9e1474613f59392be5ab6a7e7abf60fa63622)
set(X264_VERSION 35fe20d1ba49918ec739a5b068c208ca82f977f7)
set(X264_URI https://code.videolan.org/videolan/x264/-/archive/${X264_VERSION}/x264-${X264_VERSION}.tar.gz)
set(X264_HASH 5456450ee1ae02cd2328be3157367a232a0ab73315e8c8f80dab80469524f525)
set(X264_HASH bb4f7da03936b5a030ed5827133b58eb3f701d7e5dce32cca4ba6df93797d42e)
set(X264_HASH_TYPE SHA256)
set(X264_FILE x264-${X264_VERSION}.tar.gz)
@@ -284,22 +269,22 @@ set(XVIDCORE_HASH abbdcbd39555691dd1c9b4d08f0a031376a3b211652c0d8b3b8aa9be1303ce
set(XVIDCORE_HASH_TYPE SHA256)
set(XVIDCORE_FILE xvidcore-${XVIDCORE_VERSION}.tar.gz)
set(OPENJPEG_VERSION 2.3.1)
set(OPENJPEG_SHORT_VERSION 2.3)
set(OPENJPEG_VERSION 2.4.0)
set(OPENJPEG_SHORT_VERSION 2.4)
set(OPENJPEG_URI https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz)
set(OPENJPEG_HASH 63f5a4713ecafc86de51bfad89cc07bb788e9bba24ebbf0c4ca637621aadb6a9)
set(OPENJPEG_HASH 8702ba68b442657f11aaeb2b338443ca8d5fb95b0d845757968a7be31ef7f16d)
set(OPENJPEG_HASH_TYPE SHA256)
set(OPENJPEG_FILE openjpeg-v${OPENJPEG_VERSION}.tar.gz)
set(FFMPEG_VERSION 4.4)
set(FFMPEG_VERSION 5.0)
set(FFMPEG_URI http://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2)
set(FFMPEG_HASH 42093549751b582cf0f338a21a3664f52e0a9fbe0d238d3c992005e493607d0e)
set(FFMPEG_HASH c0130b8db2c763430fd1c6905288d61bc44ee0548ad5fcd2dfd650b88432bed9)
set(FFMPEG_HASH_TYPE SHA256)
set(FFMPEG_FILE ffmpeg-${FFMPEG_VERSION}.tar.bz2)
set(FFTW_VERSION 3.3.8)
set(FFTW_VERSION 3.3.10)
set(FFTW_URI http://www.fftw.org/fftw-${FFTW_VERSION}.tar.gz)
set(FFTW_HASH 8aac833c943d8e90d51b697b27d4384d)
set(FFTW_HASH 8ccbf6a5ea78a16dbc3e1306e234cc5c)
set(FFTW_HASH_TYPE MD5)
set(FFTW_FILE fftw-${FFTW_VERSION}.tar.gz)
@@ -315,9 +300,9 @@ set(SNDFILE_HASH 646b5f98ce89ac60cdb060fcd398247c)
set(SNDFILE_HASH_TYPE MD5)
set(SNDFILE_FILE libsndfile-${SNDFILE_VERSION}.tar.gz)
set(WEBP_VERSION 0.6.1)
set(WEBP_VERSION 1.2.2)
set(WEBP_URI https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${WEBP_VERSION}.tar.gz)
set(WEBP_HASH b49ce9c3e3e9acae4d91bca44bb85a72)
set(WEBP_HASH b5e2e414a8adee4c25fe56b18dd9c549)
set(WEBP_HASH_TYPE MD5)
set(WEBP_FILE libwebp-${WEBP_VERSION}.tar.gz)
@@ -352,9 +337,15 @@ set(YAMLCPP_HASH b45bf1089a382e81f6b661062c10d0c2)
set(YAMLCPP_HASH_TYPE MD5)
set(YAMLCPP_FILE yaml-cpp-${YAMLCPP_VERSION}.tar.gz)
set(EXPAT_VERSION 2_2_10)
set(PYSTRING_VERSION v1.1.3)
set(PYSTRING_URI https://codeload.github.com/imageworks/pystring/tar.gz/refs/tags/${PYSTRING_VERSION})
set(PYSTRING_HASH f2c68786b359f5e4e62bed53bc4fb86d)
set(PYSTRING_HASH_TYPE MD5)
set(PYSTRING_FILE pystring-${PYSTRING_VERSION}.tar.gz)
set(EXPAT_VERSION 2_4_4)
set(EXPAT_URI https://github.com/libexpat/libexpat/archive/R_${EXPAT_VERSION}.tar.gz)
set(EXPAT_HASH 7ca5f09959fcb9a57618368deb627b9f)
set(EXPAT_HASH 2d3e81dee94b452369dc6394ff0f8f98)
set(EXPAT_HASH_TYPE MD5)
set(EXPAT_FILE libexpat-${EXPAT_VERSION}.tar.gz)
@@ -419,22 +410,21 @@ set(SQLITE_HASH fb558c49ee21a837713c4f1e7e413309aabdd9c7)
set(SQLITE_HASH_TYPE SHA1)
set(SQLITE_FILE sqlite-src-3240000.zip)
set(EMBREE_VERSION 3.10.0)
set(EMBREE_VERSION 3.13.3)
set(EMBREE_URI https://github.com/embree/embree/archive/v${EMBREE_VERSION}.zip)
set(EMBREE_HASH 4bbe29e7eaa46417efc75fc5f1e8eb87)
set(EMBREE_HASH f62766ba54e48a2f327c3a22596e7133)
set(EMBREE_HASH_TYPE MD5)
set(EMBREE_FILE embree-v${EMBREE_VERSION}.zip)
set(EMBREE_ARM_GIT https://github.com/brechtvl/embree.git)
set(USD_VERSION 21.02)
set(USD_VERSION 22.03)
set(USD_URI https://github.com/PixarAnimationStudios/USD/archive/v${USD_VERSION}.tar.gz)
set(USD_HASH 1dd1e2092d085ed393c1f7c450a4155a)
set(USD_HASH e0e441a05057692a83124a1195b09eed)
set(USD_HASH_TYPE MD5)
set(USD_FILE usd-v${USD_VERSION}.tar.gz)
set(OIDN_VERSION 1.4.1)
set(OIDN_VERSION 1.4.3)
set(OIDN_URI https://github.com/OpenImageDenoise/oidn/releases/download/v${OIDN_VERSION}/oidn-${OIDN_VERSION}.src.tar.gz)
set(OIDN_HASH df4007b0ab93b1c41cdf223b075d01c0)
set(OIDN_HASH 027093eaf5e8b4e45835b991137b38e6)
set(OIDN_HASH_TYPE MD5)
set(OIDN_FILE oidn-${OIDN_VERSION}.src.tar.gz)
@@ -456,9 +446,9 @@ set(NASM_HASH aded8b796c996a486a56e0515c83e414116decc3b184d88043480b32eb0a8589)
set(NASM_HASH_TYPE SHA256)
set(NASM_FILE nasm-${NASM_VERSION}.tar.gz)
set(XR_OPENXR_SDK_VERSION 1.0.17)
set(XR_OPENXR_SDK_VERSION 1.0.22)
set(XR_OPENXR_SDK_URI https://github.com/KhronosGroup/OpenXR-SDK/archive/release-${XR_OPENXR_SDK_VERSION}.tar.gz)
set(XR_OPENXR_SDK_HASH bf0fd8828837edff01047474e90013e1)
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)
@@ -468,9 +458,9 @@ set(WL_PROTOCOLS_URI https://gitlab.freedesktop.org/wayland/wayland-protocols/-/
set(WL_PROTOCOLS_HASH af5ca07e13517cdbab33504492cef54a)
set(WL_PROTOCOLS_HASH_TYPE MD5)
set(ISPC_VERSION v1.16.0)
set(ISPC_VERSION v1.17.0)
set(ISPC_URI https://github.com/ispc/ispc/archive/${ISPC_VERSION}.tar.gz)
set(ISPC_HASH 2e3abedbc0ea9aaec17d6562c632454d)
set(ISPC_HASH 4f476a3109332a77fe839a9014c60ca9)
set(ISPC_HASH_TYPE MD5)
set(ISPC_FILE ispc-${ISPC_VERSION}.tar.gz)
@@ -500,3 +490,15 @@ set(ZSTD_FILE zstd-${ZSTD_VERSION}.tar.gz)
set(SSE2NEON_GIT https://github.com/DLTcollab/sse2neon.git)
set(SSE2NEON_GIT_HASH fe5ff00bb8d19b327714a3c290f3e2ce81ba3525)
set(BROTLI_VERSION v1.0.9)
set(BROTLI_URI https://github.com/google/brotli/archive/refs/tags/${BROTLI_VERSION}.tar.gz)
set(BROTLI_HASH f9e8d81d0405ba66d181529af42a3354f838c939095ff99930da6aa9cdf6fe46)
set(BROTLI_HASH_TYPE SHA256)
set(BROTLI_FILE brotli-${BROTLI_VERSION}.tar.gz)
set(LEVEL_ZERO_VERSION v1.7.15)
set(LEVEL_ZERO_URI https://github.com/oneapi-src/level-zero/archive/refs/tags/${LEVEL_ZERO_VERSION}.tar.gz)
set(LEVEL_ZERO_HASH c39bb05a8e5898aa6c444e1704105b93d3f1888b9c333f8e7e73825ffbfb2617)
set(LEVEL_ZERO_HASH_TYPE SHA256)
set(LEVEL_ZERO_FILE level-zero-${LEVEL_ZERO_VERSION}.tar.gz)

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
ExternalProject_Add(external_vorbis
URL file://${PACKAGE_DIR}/${VORBIS_FILE}

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
if(WIN32)
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
ExternalProject_Add(external_wayland_protocols
URL file://${PACKAGE_DIR}/${WL_PROTOCOLS_FILE}

View File

@@ -1,28 +1,18 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
# Note the utility apps may use png/tiff/gif system libraries, but the
# library itself does not depend on them, so should give no problems.
set(WEBP_EXTRA_ARGS
-DWEBP_HAVE_SSE2=ON
-DWEBP_HAVE_SSE41=OFF
-DWEBP_HAVE_AVX2=OFF
-DWEBP_BUILD_ANIM_UTILS=OFF
-DWEBP_BUILD_CWEBP=OFF
-DWEBP_BUILD_DWEBP=OFF
-DWEBP_BUILD_GIF2WEBP=OFF
-DWEBP_BUILD_IMG2WEBP=OFF
-DWEBP_BUILD_VWEBP=OFF
-DWEBP_BUILD_WEBPINFO=OFF
-DWEBP_BUILD_WEBPMUX=OFF
-DWEBP_BUILD_EXTRAS=OFF
)
if(WIN32)

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
if(WIN32)
set(X264_EXTRA_ARGS --enable-win32thread --cross-prefix=${MINGW_HOST}- --host=${MINGW_HOST})

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
ExternalProject_Add(external_xml2
URL file://${PACKAGE_DIR}/${XML2_FILE}

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
# Keep flags in sync with install_deps.sh ones in compile_XR_OpenXR_SDK()

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
if(WIN32)
set(XVIDCORE_EXTRA_ARGS --host=${MINGW_HOST})

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
set(YAMLCPP_EXTRA_ARGS
-DYAML_CPP_BUILD_TESTS=OFF

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
ExternalProject_Add(external_zlib
URL file://${PACKAGE_DIR}/${ZLIB_FILE}

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
ExternalProject_Add(external_zlib_mingw
URL file://${PACKAGE_DIR}/${ZLIB_FILE}

View File

@@ -1,20 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later
set(ZSTD_EXTRA_ARGS
-DZSTD_BUILD_PROGRAMS=OFF

View File

@@ -37,10 +37,6 @@ graph[autosize = false, size = "25.7,8.3!", resolution = 300, overlap = false, s
external_openimageio -- external_webp;
external_openimageio -- external_opencolorio_extra;
external_openmp -- external_clang;
external_opensubdiv -- external_glew;
external_opensubdiv -- external_glfw;
external_opensubdiv -- external_clew;
external_opensubdiv -- external_cuew;
external_opensubdiv -- external_tbb;
openvdb -- external_tbb;
openvdb -- external_boost;

File diff suppressed because it is too large Load Diff

View File

@@ -1,3 +1,6 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2016 Blender Foundation.
# - Find BLOSC library
# Find the native BLOSC includes and library
# This module defines
@@ -11,17 +14,6 @@
# also defined, but not for general use are
# BLOSC_LIBRARY, where to find the BLOSC library.
#=============================================================================
# Copyright 2016 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# If BLOSC_ROOT_DIR was defined in the environment, use it.
IF(NOT BLOSC_ROOT_DIR AND NOT $ENV{BLOSC_ROOT_DIR} STREQUAL "")
SET(BLOSC_ROOT_DIR $ENV{BLOSC_ROOT_DIR})

View File

@@ -1,3 +1,6 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2016 Blender Foundation.
# - Find CPPUNIT library
# Find the native CPPUNIT includes and library
# This module defines
@@ -11,17 +14,6 @@
# also defined, but not for general use are
# CPPUNIT_LIBRARY, where to find the CPPUNIT library.
#=============================================================================
# Copyright 2016 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# If CPPUNIT_ROOT_DIR was defined in the environment, use it.
IF(NOT CPPUNIT_ROOT_DIR AND NOT $ENV{CPPUNIT_ROOT_DIR} STREQUAL "")
SET(CPPUNIT_ROOT_DIR $ENV{CPPUNIT_ROOT_DIR})

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: BSD-3-Clause
# Module to find IlmBase
#
# This module will first look into the directories defined by the variables:

View File

@@ -1,3 +1,6 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2016 Blender Foundation.
# - Find LOGC4PLUS library
# Find the native LOGC4PLUS includes and library
# This module defines
@@ -11,17 +14,6 @@
# also defined, but not for general use are
# LOGC4PLUS_LIBRARY, where to find the LOGC4PLUS library.
#=============================================================================
# Copyright 2016 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# If LOGC4PLUS_ROOT_DIR was defined in the environment, use it.
IF(NOT LOGC4PLUS_ROOT_DIR AND NOT $ENV{LOGC4PLUS_ROOT_DIR} STREQUAL "")
SET(LOGC4PLUS_ROOT_DIR $ENV{LOGC4PLUS_ROOT_DIR})

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: BSD-3-Clause
# Module to find OpenEXR.
#
# This module will first look into the directories defined by the variables:

View File

@@ -1,3 +1,6 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2016 Blender Foundation.
# - Find TBB library
# Find the native TBB includes and library
# This module defines
@@ -11,17 +14,6 @@
# also defined, but not for general use are
# TBB_LIBRARY, where to find the TBB library.
#=============================================================================
# Copyright 2016 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# If TBB_ROOT_DIR was defined in the environment, use it.
IF(NOT TBB_ROOT_DIR AND NOT $ENV{TBB_ROOT_DIR} STREQUAL "")
SET(TBB_ROOT_DIR $ENV{TBB_ROOT_DIR})

Some files were not shown because too many files have changed in this diff Show More