1
1
Commit Graph

121669 Commits

Author SHA1 Message Date
9c7554bdcb Merge branch 'main' into temp-usd-main-021323 2023-02-14 14:10:51 -05:00
715acf758c Curves: Use deformed points in edit mode overlay
Uses the deformed crazyspace to populate the position buffer for Curves edit mode overlay.

Pull Request #104705
2023-02-14 16:33:38 +01:00
cfe828b452 OBJ: Support polylines with more than 2 vertices.
The OBJ spec (page B1-17) allows "l" entries to specify
polylines with more than 2 vertices, optionally with texture
coordinates.

Previously, only the first 2 vertices of each polyline
were read and added as loose edges, failing when texture
coordinates were present.

This adds support for proper polylines, reading but ignoring
texture coordinates.

Pull Request #104503
2023-02-14 16:30:50 +01:00
4cc94679dd MSVC: suppress additional warnings out of external headers
In 161908157d we moved all warnings
coming out of the library folder to /W0 as many of them do not follow
our code-style nor can we force them to.

When i made this change, i took `/external:templates-` to mean
"and that goes for you too, templates" and it decisively does the
opposite leading to /W3 warnings coming out of openvdb

This change removes the flag as it should have never have been added
in the first place.
2023-02-14 07:56:14 -07:00
Robin Hohnsbeen
39f63c8c08 Sculpting: Vector displacement for the sculpting draw brush
Sculpt: Added vector displacement for the sculpting draw brush (area plane mapping only for now)

Vector displacement maps (VDM) provide a way to create complex displacements that can have overhangs in one brush dab.
This is unlike standard displacement with height maps that only displace in the normal direction.
Forms like ears, curled horns, etc can be created in one click if VMDs are used.
There is a checkbox on the draw brush in the texture settings "Vector Displacement" that enables/disables this feature.

Technical description: The RGB channels of a texture in a brush stroke are read and interpreted as individual vectors, that are used to offset vertices.
As of now, this is only working for the draw brush using the area plane mapping. Symmetry and radial symmetry are working.

A few things to consider when making VD-Maps:
* UVs need to stay intact for the bake mesh (e.g. voxel remeshing can't be used to create VD Meshes)
* When exporting a VD Map it should be in the file format OpenEXR (for positive and negative floating point values).
* Export resolution can be 512x512 or lower (EXR files can get very large, but VDM brushes don't need a high resolution)

And when using them:
* Inside Blender clamping needs to be unchecked on the texture
* The brush falloff should be set to constant (or nearly constant)

This patch was inspired by this [right-click-select proposal](https://blender.community/c/rightclickselect/WqWx/) Thanks for the post!

(Moved [this patch](https://archive.blender.org/developer/D17080) to here.)

Co-authored-by: Robin Hohnsbeen <robin@hohnsbeen.de>
Pull Request #104481
2023-02-14 15:29:27 +01:00
d4f7f1dfe4 Fix memory leak in view3d_select
There was an unintentional early return in the click select
execute function that caused the operator properties not
to be freed.
2023-02-14 14:59:07 +01:00
a76b5d3a07 Curves: change collision radius for consistency with default radius
Offset distance for curve collision  will be matched with default curve
radius for better visibility.

Pull Request #104648
2023-02-14 14:15:04 +01:00
59b9a88a35 Fix: duplicate elements node does not update curve type counts
Curve type counts are updated eagerly but it was missing in this
node leading to a crash further down the line where the counts
were expected to be correct.
2023-02-14 13:32:00 +01:00
4126284e46 Allocator: Fail building when trying to MEM_delete a void pointer
`MEM_delete()` is designed for type safe destruction and freeing, void
pointers make that impossible.
Was reviewing a patch that was trying to free a C-style custom data
pointer this way. Apparently MSVC compiles this just fine, other
compilers error out. Make sure this is a build error on all platforms
with a useful message.
2023-02-14 12:48:26 +01:00
1fd0c80725 Build: correct forwarding jobs argument to make_deps_wrapper.sh 2023-02-14 22:26:59 +11:00
5215543280 Constraints: use a dimensionless unit prop for Maintain Volume
The Volume property of the Maintain Volume constraint was marked as a
distance, which made it confusing--especially with non-metric units.

The volume can actually be understood as a factor of the initial
volume, so it should be dimensionless.

Additionally, the volume had a range of 0.001 to 100.0. This is wide
enough in most cases, but sometimes you may need to go orders of
magnitude higher or lower to consider vast or thin objects, and there
should be no drawback to extending the limits, provided they stay
positive.

Pull Request #104489
2023-02-14 12:19:53 +01:00
1e449bee21 Cycles: Temporary fix for Principled Hair albedo
The proper fix (bb9eb262d4) caused compilation problems with HIP, so we're
delaying it until 3.6.
To fix the original bug report (#104586), this is a quick workaround that'll
hopefully not upset the compiler.

Pull Request #104723
2023-02-14 12:18:10 +01:00
5040c39d1a Fix T103354: Author extents on UsdGeomMesh
A properly authored USD file will have the extent attribute authored on all prims conforming to UsdGeomBoundable.
This cached extent information is useful because it allows the 3D range of prims to be quickly understood without reading potentially large arrays of data. Note that because the shape of prims may change over time, extent attributes are always evaluated for a given timecode.

This patch introduces support for authoring extents on meshes and volumes during export to USD.

Because extents are common to multiple kinds of geometries, the main support for authoring extents has been placed in USDAbstractWriter, whose new author_extent method can operate on any prim conforming to pxr::UsdGeomBoundable. The USD library already provides us the code necessary to compute the bounds for a given prim, in pxr::UsdGeomBBoxCache::ComputeLocalBound.
Note that not all prims that are imageable are boundable, such as transforms and cameras.

For more details on extents, see https://graphics.pixar.com/usd/release/api/class_usd_geom_boundable.html#details.

Note that when new types of geometries are introduced, such as curves in https://developer.blender.org/D16545, we will need to update the USD writer for that geometry such that it calls this->author_extent.

Update on Feb 2: This patch has been updated to include a unit test to ensure authored extents are valid. This test requires new test assets that will need to be submitted via svn. The test assets are attached in the d16837_usd_test_assets.zip file. To use, unzip and merge the contents of this zip into the lib/tests/usd folder.

This unit test also addresses #104269 by validating compliance of exported USD via UsdUtils.ComplianceChecker.

Pull Request #104676
2023-02-14 12:11:53 +01:00
a3e6cb5dab Gizmo: press shift key to scale cage2d gizmo uniformly
Reviewed by: Campbell Barton
Pull Request #104418
2023-02-14 11:08:54 +01:00
fe0a219b5b Revert: Formatting changes space_toolsystem_toolbar 2023-02-14 10:30:49 +01:00
09498264f6 Deps: build one at a time, each using all available cores on Linux
Use a MAKE wrapper for 'make deps' on Linux that ensures dependencies
are built one at a time. This is preferable because building many
dependencies at once made troubleshooting impractical and had the
downside that large deps such as LLVM would bottleneck on a single core.

This may be used for macOS, so far it's only tested on Linux.
2023-02-14 16:37:04 +11:00
2e7ff5acac Merge branch 'main' into temp-usd-main-021323 2023-02-13 22:43:07 -05:00
46c34ba1f6 GNUmakefile: include install directory in 'make deps' message
Avoids uncertainly, ensure deps are copied from the right place.
2023-02-14 13:26:30 +11:00
d02f863b18 Update RNA to User manual mappings 2023-02-14 13:19:18 +11:00
d851c91856 PyDocs: update links in generated API docs for GITEA migration
- Correct broken link for undocumented modules.
  Point to the contributing page, it seems #51062 was lost with the
  GITEA task migration.
- Correct Blender Version link to the SHA1.
2023-02-14 12:41:51 +11:00
a6dcf6e6cb Cleanup: avoid redundant sqrt when picking reroute nodes 2023-02-14 12:26:29 +11:00
818c16ef1f Cleanup: pass a const argument to CustomData_get_elem_size 2023-02-14 12:26:01 +11:00
750e278fd1 Cleanup: line wrapping in USERPREF_PT_experimental_new_features
Changing from Phabricator links caused poor formatting.
Also remove blank lines between comment and it's function.
2023-02-14 12:13:04 +11:00
85f8ba9db7 Cleanup: include missing header, sort CMake file lists 2023-02-14 11:52:14 +11:00
1ac80e8338 Cleanup: quiet unreachable-code warning, use ARRAY_SIZE macro 2023-02-14 11:50:00 +11:00
6dc88682ea License headers: add missing license identifier 2023-02-14 11:47:13 +11:00
36937e523a Fix #66863: Bisect plane rotation behavior bugged for side/cut view
The matrix of the rotation gizmo is somewhat confusing.

Attaching to the Z axis has more predictable results.
2023-02-13 21:15:38 -03:00
0fa34aa0ec Cleanup: spelling in comments, reference enum types in doc-strings
Also use doxy formatting for structs in sculpt_uv.c.
2023-02-14 10:29:48 +11:00
e928dd300b Cleanup: format 2023-02-14 10:29:46 +11:00
dc46465490 Cleanup: use typed enum (eDirEntry_SelectFlag) where appropriate 2023-02-14 10:29:44 +11:00
1d7bf4f826 BLI_utildefines: add ^= operator to ENUM_OPERATORS macro 2023-02-14 10:29:42 +11:00
Erik Abrahamsson
526f2273c6 Docs: improve online manual lookup time time
Matching the RNA id's to the search pattern is slow because
of the function `fnmatchcase`. This patch first checks the string
prefix without any special characters used by fnmatch,
if the `startswith` check fails, there is no need to check `fnmatchcase`.
Before the optimization, an online manual lookup took about 400ms
which is quite noticeable, with this patch applied it's under 10ms.

Ref !104581.
2023-02-14 10:29:40 +11:00
bb9eb262d4 Revert "Cycles: Clean up the Principled Hair BSDF implementation"
This reverts commit cb77865c21.

Appears to break HIP compilation, so delay until 3.6.
2023-02-13 23:32:53 +01:00
1f615690e6 Cycles: Add support for CUDA 12
CUDA 12 no longer supports sm_3*, in particular 35 and sm_37,
so skip building those if only CUDA 12+ is available.

Pull Request #104713
2023-02-13 23:04:02 +01:00
6a0b1eae8c Fix #104097: re-enable Cycles AMD Vega support
The internal compiler error appears to be gone. Unclear why it appeared in the
first place and why it's gone now. Just random kernel code changes causing it.

Pull Request #104719
2023-02-13 22:53:08 +01:00
cb77865c21 Cycles: Clean up the Principled Hair BSDF implementation
- Rename roughness variables for more clarity - before, the SVM/OSL code would
  set s and v to the linear roughness values, and the setup function would over-
  write them with the distribution parameters. This actually caused a bug in the
  albedo code, since it intended to use the linear roughness value, but ended up
  getting the remapped value.
- Deduplicate the evaluation and sample functions. Most of their code is the
  same, only the middle part is different.
- Changed albedo computation to return the sum of the intensities of the four
  BSDF lobes. Previously, the code applied the inverse of the color->sigma
  mapping from the paper - this returns the color specified in the node, but
  for very dark hair (e.g. when using the Melanin controls) the result is
  extremely low (e.g. 0.000001) despite the hair still reflecting a significant
  amount of light (since the R lobe is independent of sigma). This causes issues
  with the light component passes, so this change fixes #104586.
- There's quite a few computations at the start of the evaluation function that
  are needed for sampling, evaluation and albedo computation, but only depend on
  the view direction. Therefore, just precompute them - we still have space in
  PrincipledHairExtra after all.
- Fix a tiny bug - the direction sampling code did not account for the R lobe
  roughness modifier.

Pull Request #104669
2023-02-13 22:49:01 +01:00
7dbf2e2e95 Curves: Draw point overlay only in point selection mode
In case the selection domain is `ATTR_DOMAIN_CURVE` then do not draw the points.

Pull Request #104715
2023-02-13 22:25:06 +01:00
dacd93c11e Synced submodules with those in main. 2023-02-13 15:12:39 -05:00
c92c52f0c9 Cleanup: Move draw_attributes.hh to C++
In order to experiment with different storage types for `DRW_Attributes`
and for general cleanup (see #103343). Also move a curves header to C++.

Pull Request #104716
2023-02-13 20:56:24 +01:00
dfacaf4f40 Fix: Incorrect BMesh to Mesh attribute copying
The existing logic to copy `BMesh` custom data layers to `Mesh`
attribute arrays was quite complicated, and incorrect in some cases
when the source and destinations didn't have the same layers.
The functions leave a lot to be desired in general, since they have
a lot of redundant complexity that ends up doing the same thing for
every element.

The problem in #104154 was that the "rest_position" attribute overwrote
the mesh positions since it has the same type and the positions weren't
copied. This same problem has shown up in boolean attribute conversion
in the past. Other changes fixed some specific cases but I think a
larger change is the only proper solution.

This patch adds preprocessing before looping over all elements to
find the basic information for copying the relevant layers, taking
layer names into account. The preprocessing makes the hot loops
simpler.

In a simple file with a 1 million vertex grid, I observed a 6%
improvement animation playback framerate in edit mode with a simple
geometry nodes modifier, from 5 to 5.3 FPS.

Fixes #104154, #104348

Pull Request #104421
2023-02-13 20:52:02 +01:00
0dfc102531 Fix #104588: Initialize Face Sets from edit mode selection broken
Mistake in da4bd24c3e
2023-02-13 14:16:23 -05:00
1e794d9a92 BMesh: Add flexibility for future lazily created UV selection
Don't crash on nonexisting uv selection layers. Add an assert
because for now it is a bug if they don't exist. But when converting
back to Mesh it is preferable to accept in release mode, as opposed to
crashing.

Pull Request #104600
2023-02-13 20:08:30 +01:00
684789c815 Fix #104501: Clear CD_FLAG_NOCOPY after use
When generating a Mesh from a BMesh the uv map bool layers are not
copied if all elements are false. To suppress the copying the flag
CD_FLAG_NOCOPY is set in the layer flags. However these layers *do*
need to be copied to other BMeshes (for example undo steps). So we
need to clear them afterwards.
2023-02-13 20:08:29 +01:00
72a85d976a USD Import: USD Shapes support
This commit adds the ability to import USD Shape primitives (Gprims).
They are imported as Blender Meshes using the USD API to convert, so
that they appear the same as they would in other applications. USD
Shapes are important in many workflows, particularly in gaming, where
they are used for stand-in geometry or for collision primitives.

Pull Request #104707
2023-02-13 19:49:24 +01:00
8d20db0594 Curves: Fix curve segment selection
Make sure that in curve selection mode, the segments are checked
for intersection instead of only the points.

Pull Request #104703
2023-02-13 19:05:28 +01:00
64f83f80c6 Fix #104373: Motion Tracker solve with anamorphic footage not working
The issue was caused by rather recent refactor in 7dea18b3aa.

The root of the issue lies within the fact that the optical center was updated
on the Blender side after the solution was run. There was a mistake in the code
which double-corrected for the pixel aspect ratio.

Added a comment in the code about this, so that it does not look suspicious.

Pull Request #104711
2023-02-13 18:49:45 +01:00
9b7d71cec2 Cleanup: Remove redundant translation markers in context poll message
`CTX_wm_operator_poll_msg_set()` is covered by the translation script
and always translates these strings. Checked with Bastien, he prefers
not having the redundancy here.
2023-02-13 18:41:38 +01:00
64e4aede7f Fix bug report including rB commit hash prefix not needed for Gitea 2023-02-13 18:34:13 +01:00
675717eb79 Cleanup: fix a few typos in UI messages
Issues reported by @Joan-Pujolar in #43295.

Pull Request #104672
2023-02-13 18:24:53 +01:00
c2a5c592fe Fix #103397: Vector UI control shader UBO alignment fix.
Replace float3 with packed_float3 when using additional type padding.

Authored by Apple: Michael Parkin-White

Ref #96261
Pull Request #104699
2023-02-13 18:16:38 +01:00