Commit Graph

120915 Commits

Author SHA1 Message Date
Brecht Van Lommel bdb34c9804 Gitea: add more complete pull request template 2023-01-18 01:40:25 +01:00
Jacques Lucke 737e7a63b1 Fix: incorrect curve type counts after adding curves of same type 2023-01-18 00:05:54 +01:00
Hans Goudey 301119619c Curves: Remove attribute retrieval, deduplicate evaluation logic
Avoid calling `interpolate_to_evaluate` while evaluating normals,
which has to look up attributes by name for every curve. Also avoid
duplicating the curve type switch in a few functions. I didn't observe
a performance difference, but theoretically this could reduce
overhead for many small curves.
2023-01-17 14:58:54 -06:00
Germano Cavalcante dcb37959d4 Fix roation snap failing with zero angle
Due to precision issues, the cosine value calculated with
`dot_v3v3(start, end)` can be outside the -1, 1 range causing `acosf`
to return `nan(ind)`.

Use `angle_signed_on_axis_v3v3_v3` instead. It returns more accurate
values, deduplicates code, and avoids these `nan` issues.
2023-01-17 17:21:39 -03:00
Clément Foucault 17768b3df1 BLI: Math: Fix perspective matrix function
The port missed this one component that should have been left to 0.0.
2023-01-17 21:02:57 +01:00
Hans Goudey d42d4e339f Cleanup: Remove unnecessary includes in geometry set header 2023-01-17 12:50:06 -06:00
Hans Goudey 85ea74ad77 Cleanup: Remove unnecessary curves RNA verification disabling
There is no SDNA data for `position_data` anymore after
e9f82d3dc7.
2023-01-17 12:50:06 -06:00
Hans Goudey df54561233 Cleanup: Fix incorrect comments in mesh extrude node 2023-01-17 12:50:06 -06:00
Hans Goudey d76a0e98ba Fix: Avoid node reevaluations for selection and parenting
Since 90ea1b7643, node trees have been reevaluated
after many selection operations because nodes are sorted based on
the selection status and an update tag was added for that. However,
for years the node order was allowed to be different between the
original and evaluated copy of node trees.

Though it is a bit sketchy to have that difference in the evaluated
node tree, reevaluations for just selection are very bad, so use a
"smaller" update tag and add a comment for justification.

Differential Revision: https://developer.blender.org/D17023
2023-01-17 12:50:06 -06:00
Brecht Van Lommel 665732115e Gitea: add separate issue templates for bug, design and todo 2023-01-17 19:44:21 +01:00
Jacques Lucke 1d253b6652 Fix T103945: incorrect anonymous attribute references
The case where the same field group input is evaluated on
more than one geometry inputs was not handled correctly.
2023-01-17 18:40:28 +01:00
Jacques Lucke 34326fec02 Fix: sample index node outputs default value
Error in rBb5105085139227a713f154446ff6a3255cb8be99.
2023-01-17 18:29:25 +01:00
Weizhen Huang 543bf28fb1 Refactor: renamed I -> wi, omega_in -> wo in Cycles
wi is the viewing direction, and wo is the illumination direction. Under this notation, BSDF sampling always samples from wi and outputs wo, which is consistent with most of the papers and mitsuba. This order is reversed compared with PBRT, although PBRT also traces from the camera.
2023-01-17 18:07:13 +01:00
Hans Goudey 400f022989 Geometry Nodes: Add warning to set material node with no faces
The node can't do anything in this case, which isn't always obvious.

Resolves T103133
2023-01-17 10:31:07 -06:00
Hans Goudey 873794b196 Fix T103937: Applying modifier resets shape keys
The order of arguments to memcpy was reversed, which is sadly possible
because the constness `KeyBlock` of keyblock doesn't propagate to
pointers it contains.
2023-01-17 10:22:29 -06:00
Sergey Sharybin d411de96f7 Fix T103936: Regression: Track To constraint broken
Caused by 6769acbbba.

Some of the matrix variants are rather obscure from the
semantic: they don't really fully initialize the output:
as in, they only write to an upper-left 3x3 block.

A quick solution to fix the very commonly used constraint.
It feels that it is possible to minimize about of copy
operations.
2023-01-17 17:10:41 +01:00
Hans Goudey 0e89d24318 Cleanup: Use elif in custom property edit operator, reduce whitespace 2023-01-17 09:51:43 -06:00
Hans Goudey 50105b2952 Fix T103911: Editing boolean custom property UI data resets value
The old value wasn't retrieved for boolean array properties.
2023-01-17 09:51:43 -06:00
Michael Kowalski f8b11528b2 USD export: ensure edit mode changes are exported
Code authored by Charles Wardlaw.

Reviewed by Bastien, Sybren and makowalski.

Differential Revision: https://developer.blender.org/D15916
2023-01-17 10:24:43 -05:00
Hans Goudey 7df5d7c7a7 Cleanup: Curves selection boolean to float comparison
The conversion from float to boolean is now handled by
the attribute API.
2023-01-17 09:15:33 -06:00
Kevin C. Burke e144af1f7c GPencil: Provide Option for Fill in Material Popover
The Grease Pencil Material Popover currently has a color picker 
for the Stroke of a Material using Solid style, but not one for
 a Fill using Solid style. 

With the default Grease Pencil Materials, the current 
popover only shows the Stroke color for the grey "Solid Fill" 
material (which doesn't have its Stroke enabled) instead of 
the more useful Fill color.

This patch shows a Stroke color picker when the Material 
has Stroke enabled and the style is Solid. 
This is the same for the Fill.

Reviewed By: antoniov, mendio

Differential Revision: https://developer.blender.org/D17004
2023-01-17 15:44:38 +01:00
Miguel Pozo f8328ec172 Fix: Draw: Freeze Culling
Bind the frozen culling data as well.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D17010
2023-01-17 15:10:36 +01:00
Jacques Lucke 8b660e1cbf Cleanup: use defaulted constructor 2023-01-17 13:43:38 +01:00
Jacques Lucke b510508513 Geometry Nodes: optimize Sample Index node with constant index
Previously, the node would always evaluate the input field on the
entire geometry domain. This is good when most indices will be
accessed afterwards. However, it is quite a bad when only a single
index is used. Now the field is only evaluated for that one index.
2023-01-17 13:29:55 +01:00
Jacques Lucke 03fab057f1 Cleanup: correct asserts 2023-01-17 13:13:43 +01:00
Julian Eisel 2c6ed49c03 Cleanup: Rename confusing region variable
`scaleare` reads like "scale area", but should read "scale region".
2023-01-17 13:08:06 +01:00
Damien Picard 8082b96a75 Tracking: fix inverted pie menu items for pattern match of track
The two items had their effects inverted.

Reviewed By: sebastian_k

Differential Revision: https://developer.blender.org/D16438
2023-01-17 09:40:08 +01:00
Campbell Barton 962c3cf6b1 Cleanup: remove unused IDProperty members
Remove:

- IDPropertyTemplate.matrix_or_vector
  Matrix & vector types have been deprecated, this wasn't used.

- IDProperty.saved
  This was added preemptively but never used, replace with a pad so as
  not to hint at a feature that doesn't exist.
2023-01-17 12:05:21 +11:00
Campbell Barton 9789835db8 Docs: improve ID property doc-strings
Add some clarifications and reference enum types from DNA.
2023-01-17 11:59:05 +11:00
Hans Goudey 7241ab6ede Revert "Fix: don't set default value for unused socket in geometry nodes"
This reverts commit 154d3e95f8.

This caused crashes in the mouse house and flower shop benchmark files.
A proper solution will be investigated soon.
2023-01-16 16:58:24 -06:00
Hans Goudey 647a7da17d Curves: Avoid adding curve type attribute when setting default
The default curve type when there is no "curve_type" attribute is
Catmull ROM. In order to avoid allocating an entire array of values
just to set this default type, remove the attribute instead. This will
be less important when we can store attributes as single values.

Also fix a curve utility API comment.
2023-01-16 16:51:32 -06:00
Chris Blackbourn 6769acbbba BLI_math: simplify matrix multiply logic
Improve safety and correctness of matrix multiplication by using
temporary storage if one of the inputs is also the output.

No functional changes.

Differential Revision: https://developer.blender.org/D16876
Reviewed By: Campbell Barton, Sergey Sharybin
2023-01-17 11:18:33 +13:00
Hans Goudey 7026096099 Nodes: Use dynamic declarations for group nodes
Since a year and a half ago we've been switching to a new way to
represent what sockets a node should have called "declarations"
that's easier to use, clearer, and more flexible for upcoming
features like dynamic socket counts or generic type sockets.

All builtin nodes with a static set of sockets have switched, but one
missing area has been group nodes and group input/output nodes. These
nodes have **dynamic** declarations which change based on their
properties or the group they're inside of. This patch addresses that,
in preparation for using the same dynamic declaration feature for
simulation nodes.

Generally there shouldn't be user-visible differences, but one benefit
is that user-created socket descriptions are now visible directly in
the node editor for group nodes and group input/output nodes.

The commit contains a few changes:
- Add a node type callback for building dynamic declarations with
  different arguments
- Add an `Extend` socket declaration for the "virtual" sockets used
  for connecting new links
- A similar `Custom` socket declaration is used for addon-defined socket
- Simplify the node update loop to use the declaration to build update
  sockets
- Replace the "group update" functions with the declaration building
- Move the node group input/output link creation to link drag operator
- Make the field status part of group node declarations
  (not for group input/output nodes though)
- Some fixes for declarations to make them update and build properly

Differential Revision: https://developer.blender.org/D16850
2023-01-16 15:47:25 -06:00
Hans Goudey 6d12d43a05 Mesh: Skip conversion from legacy data if reading new format
Under some circumstances (loading autosaves), we end up reading from
files that were saved with the new mesh format (after T95965). When
that happens we should skip the conversion from the old format to
avoid data-loss. This will also give forward compatibility when we
stop saving in the old format completely in 4.0.

Here I mostly just check if the attributes in the new format already
exist. Along with checking for the null status of `Mesh::mvert`, that
should cover the majority of cases.

Fixes T103878

Differential Revision: https://developer.blender.org/D17011
2023-01-16 15:47:25 -06:00
Colin Basnett 39c6953462 UI: Fix alignment of custom properties edit & remove buttons
This fixes the UI alignment issues that were introduced by {D12815} with the addition of the boolean custom properties.

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D17012
2023-01-16 12:54:25 -08:00
Hans Goudey 6f6cc269a4 Cleanup: Move sculpt_dyntopo.c to C++
See T103343
2023-01-16 14:41:28 -06:00
Hans Goudey e0e6afb766 Geometry Nodes: Parallelize mesh and curve edit hint transformation
Previously transforming and translating meshes (used by the object info
and transform geometry nodes) was single threaded. Now use the same
code path as other geometry types which already includes multithreading.

I observed a 5x performance improvement for a 4 million vert mesh on a
Ryzen 7950x.
2023-01-16 13:16:44 -06:00
Brecht Van Lommel 93ca4eeec1 Cleanup: remove unused functions 2023-01-16 19:40:25 +01:00
Mattias Fredriksson c55767b32e Fix T103632: Single point trim samples curve end point incorrectly
Trim erronously samples the next to last control point when it should
sample the last control point on the curve. This only happens when
reducing the curve to a single point. These changes should correct
the behavior.

Differential Revision: https://developer.blender.org/D17003
2023-01-16 12:22:20 -06:00
Hans Goudey a219507d57 Cleanup: Add documentation to curve legacy conversion functions 2023-01-16 12:06:36 -06:00
Miguel Pozo b82f7814c4 Fix: Draw: Incorrect culling in the new Draw Manager
ViewCullingData::corners (vec4) was casted to a BoundingBox (vec3),  so the frustum corners were uploaded in the wrong format to the GPU.

Now the ViewCullingData::corners are used directly without casting, since the BoundBox API is not really needed.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D17008
2023-01-16 18:41:06 +01:00
Brecht Van Lommel c66da0b267 Docs: change readme.rst to README.md, as Gitea can't render rst 2023-01-16 17:54:11 +01:00
Brecht Van Lommel a84a8a528d Cycles: remove SSE3 and AVX kernel optimization levels
While keeping SSE2, SSE4.1 and AVX2. This does not affect hardware support, it
only slightly reduces performance for some older CPUs.

To reduce maintenance cost and improve compile times.

Differential Revision: https://developer.blender.org/D16978
2023-01-16 17:53:36 +01:00
Germano Cavalcante debd912bef Fix T103906: Crash when canceling transform operation with the mirror options set
Caused by rB3b761901b6d6.

Some mirror transdata values were not being initialized.
2023-01-16 12:14:27 -03:00
Dalai Felinto 8cc558814d Cleanup: make format 2023-01-16 14:39:17 +01:00
Iliya Katueshenock 154d3e95f8 Fix: don't set default value for unused socket in geometry nodes
Setting the default value resulted in an incorrect tooltip.

Differential Revision: https://developer.blender.org/D16957
2023-01-16 12:41:07 +01:00
Dalai Felinto 5320372c34 User Inteface: Missing separator in Geometry Nodes > Add Node > Geometry menu
This separator was missing in the original change in the menus (d4e638baac).
2023-01-16 12:23:52 +01:00
Marc Chéhab 9a1f0443cb Fix Unreported: GPencil Separating strokes creates negative times
Separating strokes using "selected points" didn't take into account 
that points->time can be 0 and thus created points with negative 
values in points->time, which should be an impossibility. 
This patch fixes this in BKE_gpencil_stroke_delete_tagged_points.

Also, it makes the build modifier's new drawspeed immune 
to (erroneous) negative time values, should they arise in other situations.

Reviewed By: antoniov


Differential Revision: https://developer.blender.org/D17006
2023-01-16 12:07:15 +01:00
Jeroen Bakker ff814ec5f6 Metal: Fix read from uninitialized memory.
Implementation didn't count the string terminator when allocating
memory to store `msl_patch_default`. The string terminator could
be overwritted by other memory adding some undefined behavior.
2023-01-16 11:12:14 +01:00
Campbell Barton 5cbc8ce3b1 Fix ASAN error when Wayland fell back to X11
An alternative fix to [0] which caused an error with ASAN
(freeing an GHOST_ISystem instead of a GHOST_System).
Reported by @Baardaap in chat, I'm unable to reproduce the issue.

Instead of calling the destructor directly, add a private method that
deletes data before raising an exception.

[0]: fd36221930
2023-01-16 15:29:22 +11:00