1
1
Commit Graph

118428 Commits

Author SHA1 Message Date
4847bcdbe1 DRW: Split ViewProjectionMatrix in order to increase precision
This also removes the need to compute the persmat and saves some memory
from the `ViewInfos` struct. This is needed to allow multiview support.

Initial testing found no major performance regression during vertex
heavy workload.

Differential Revision: https://developer.blender.org/D16125
2022-10-01 21:25:21 +02:00
520d111eca Cleanup: Simplify code and remove duplications
This commit simplify the previous fix for T101455

f6c2f1c65e
2022-09-29 15:03:23 +02:00
d2e576f34c GPencil: Remove Fill use_collide_only option
After a lot of testing, this option is not required and
now this is managed by stroke_collsion.

If the stroke_collision is enabled, only collide strokes 
are used.
2022-09-29 14:58:29 +02:00
10f1972ff7 GPencil: Fix missing Fill stroke cross detection
If the cross point was in the extreme of the stroke the
collision was not detected because it could be
outside of the bbox.

Removed the bbox check because now it is
not necessary.
2022-09-29 13:51:58 +02:00
f6c2f1c65e Fix T101455: GPencil Gizmo in wrong location when using Active Element
The gizmo was not set when this option was selected.

By design, in grease pencil the active element option uses
the object origin as pivot point.
2022-09-29 13:38:31 +02:00
b70b02ee42 Fix: Spline Parameter node produces NaN when curve is a single point
Issue found in file from T101256.
2022-09-29 13:32:03 +02:00
ffccdf069b Nodes: fix missing update when input of muted node changes 2022-09-29 13:09:00 +02:00
6757f81fab Viewport: Remove unnecassary assert 2022-09-29 04:05:03 -07:00
db0ef8b00d Fix T101410: ignore dangling reroute inputs
For consistency with other node systems in Blender and older
versions of geometry nodes, dangling reroute inputs should
not affect the output. When an input socket is linked to dangling
reroutes, its own value should be used instead.
2022-09-29 13:03:15 +02:00
5ffbabb24c Nodes: fix missing updates with muted nodes and reroutes
Muted nodes and reroutes can potentially affect the output when
they are linked to an input socket and don't have any inputs on
their own.

The issues was that previously "logically linked sockets" where used
which hide reroutes and muted nodes away. The solution is to work
with the directly linked sockets instead and handle reroutes etc
explicitly.
2022-09-29 12:43:43 +02:00
1494a22a90 Sculpt: Reset automask cache on non-color non-mask undo steps 2022-09-29 02:33:59 -07:00
f1990bd900 UI: Nodes typo in "distribute points in volume" node
Distribute Points In Volume →  Distribute Points in Volume.
2022-09-29 11:16:47 +02:00
fae975dd54 UI: Nodes re-organize the nodes in alphabetical order
This was a regression introduced after the 3.3 release.

This fix T101452
2022-09-29 11:13:27 +02:00
2fc136427d Fix T101451: curve attribute overlay disappears when origin is out of view
The core issue seems to be that `BKE_curve_minmax` does not create the
correct bounding box for `Curve` data passed to the render engine.
That's because this `Curve` object does not contain the legacy curve
data structure.

Fixing this will likely require some more consideration, so this fix just
avoids the culling check for now, which is actually also done in
`OVERLAY_extra_wire` using the same approach.
2022-09-29 11:12:05 +02:00
6d3da28676 Sculpt: fix draw face sets not updating on first stroke 2022-09-29 01:47:40 -07:00
Andrew Oates
4bdba62cb9 Fix T94441: fix crash parenting object to a bone
This crash occurs when the bone is newly created.  In certain
circumstances the depsgraph data for the armature is not updated,
causing `pchan_eval` to be NULL when the parent is updated.  This causes
a segfault in `ED_object_parent_set` when the flags are updated.

This change fixes the underlying depsgraph bug, and also adds both an
assertion and NULL pointer check to `ED_object_parent_set` to better
handle this scenario if it recurs via another path.

Maniphest Tasks: T94441

Differential Revision: https://developer.blender.org/D16065
2022-09-29 10:35:18 +02:00
039429faeb Sculpt: fix missing nullptr check in pbvh draw
This time it was face sets.
2022-09-29 01:25:47 -07:00
9be99bcb45 Cleanup: Address format-security warning 2022-09-29 10:02:04 +02:00
5dd48c50f0 Cleanup: Set but unused variable 2022-09-29 09:52:00 +02:00
46e0512d1e Cleanup; Warning about missing override for virtual function 2022-09-29 09:51:32 +02:00
eeb81c4a63 Cleanup: quiet warnings (unused arg & trailing fullstop) 2022-09-29 17:31:55 +10:00
a56da7b045 Fix bpy.utils.script_paths() ignoring environment variables
When check_all=True was passed,

- `os.path.join(bpy.utils.resource_path('USER'), "scripts")`
  was used instead of BLENDER_USER_SCRIPTS.
- `os.path.join(bpy.utils.resource_path('SYSTEM'), "scripts")`
  was used instead of BLENDER_SYSTEM_SCRIPTS.

Other minor changes:

- Simplify collecting paths.
- Don't add user-directories multiple times when check_all=True.
- Normalize paths before before checking duplicates to reduce the
  change the same path is added multiple times.

Found these issues while investigating T101389.
2022-09-29 17:31:55 +10:00
a66e584294 Cleanup: correct API usage for script access
In practice this didn't cause problems, but accessing scripts via
bpy.utils.resource_path('USER') ignores the BLENDER_USER_SCRIPTS
environment variable.
2022-09-29 17:22:32 +10:00
46076e4876 Cleanup: run clang-format in sculpt code 2022-09-28 23:41:53 -07:00
eab69d4930 Cleanup: Use c++-style unused paramter form in automasking code.
Also renamed shadowed variable in sculpt_filter_mesh.c
2022-09-28 23:38:48 -07:00
0de9081e89 Sculpt: fix missing nullptr check in pbvh draw
Check for nullptr when building mask vbos.
2022-09-28 23:33:02 -07:00
bbc69563d0 Sculpt: Normal-based automasking modes
Two new normal-based automasking modes.

The first mode, "brush", compares vertex normals with the initial
normal at the beginning of the brush stroke.

The second, "view", compares vertex normals with the view normal.
If "occlusion" is on then rays will be shot from each vertex to test
if it is occluded by other geometry (note: this can be very slow).\
Only geometry inside the sculpt mesh is considered.

Each mode has an associated angular limit and a falloff.

Reviewed by: Julien Kaspar and Jeroen Bakker
Differential Revision: https://developer.blender.org/D15297
Ref D15297
2022-09-28 23:21:56 -07:00
a4ff106c58 Cleanup: Remove more unused CustomData API functions
Due to increased usage of typed arrays in C++ and name/offset based
access for BMesh, these are unlikely to be used again, and haven't been
used in many years.
2022-09-28 23:13:58 -05:00
ff353842bd Cleanup: Deduplicate logic in CustomData access functions
Also remove comments that just restated what the next line
was doing, often incorrectly.
2022-09-28 23:13:58 -05:00
57620af33c Cleanup: Remove unused BMesh function 2022-09-28 23:13:58 -05:00
0c282c068f Cleanup: cmake indentation 2022-09-29 13:32:16 +10:00
f96020fb9a Cleanup: remove '.' from the end of descriptions
Quiet warnings at startup & build time.
2022-09-29 13:32:16 +10:00
91db47e914 Cleanup: simplify storage when uv island packing
Refactor ahead of upcoming packing changes.

Differential Revision: https://developer.blender.org/D16096
2022-09-29 15:48:53 +13:00
e2df195844 Fix wrong version bump to 3.4.1, we are still on 3.4.0
The patch levels are reserved for bugfix releases.
2022-09-29 03:57:30 +02:00
c64d3a692d Cleanup: use doxy-sections in anim_channels_edit.c 2022-09-29 10:28:56 +10:00
c1548938a4 Cleanup: spelling in comments 2022-09-29 10:28:39 +10:00
d459219307 Cleanup: quiet deprecated copy warning 2022-09-29 10:28:11 +10:00
ec8118a59e Cleanup: replace UNUSED() with commented arguments
This is the conventional way of dealing with unused arguments in C++.

Also quiet enum conversion warnings.
2022-09-29 10:26:10 +10:00
9cfa8b945a Cleanup: format 2022-09-29 10:11:42 +10:00
c087d09c16 Cleanup: fix unused variable warnings in draw_pbvh.cc 2022-09-28 16:39:21 -07:00
0156a677c7 Sculpt: New Cavity Automasking Mode
Add new cavity automasking mode based on local mesh
curvature.  Cavity masking is a great way to quickly add
detail in crevices and the like.  It's meant to be used
with the Paint brush in color attribute mode.  It does
work with other brushes but the results can be unpredictable.

{F13131497}

The old "dirty mask" operator has been replace with a new
"mask from cavity" operator that shares the same code with
cavity automasking.

Differences from the sculpt-dev implementation:
    * It uses the word "cavity."  When I first implemented
this I wasn't aware
      this feature existed in other software (and other
paint modes in Blender),
      and for reasons that escape me today I initially
decided to call it a concave or
      concavity mask.
    * The cavity factor works a bit differently.  It's
      no longer non-linear and functions as a simple
      scale around 0.5f.
    * Supports custom curves.
    * Supports blurring.

Reviewed By: Julian Kaspar, Jeroen Bakker and Campbell Barton
Differential Revision: https://developer.blender.org/D15122
Ref D15122
2022-09-28 16:22:34 -07:00
53ac3192ba Cleanup: remove duplicate declaration
Also got rid of ATTR_NO_OPT macro.
2022-09-28 15:50:09 -07:00
65900d88a8 Sculpt: Rewrite PBVH draw
Rewrite PBVH draw to allocate attributes into individual VBOs.
The old system tried to create a single VBO that could feed
every open viewport.  This required uploading every color and
UV attribute  to the viewport whether needed or not, often exceeding
the VBO limit.

This new system creates one VBO per attribute.  Each attribute layout is
given its own GPU batch which is cached inside the owning PBVH node.

Notes:

* This is a full C++ rewrite.  The old code is still there; ripping it out
can happen later.
* PBVH nodes now have a collection of batches, PBVHBatches, that keeps
track of all the batches inside the node.
* Batches are built exclusively from a list of attributes.
* Each attribute has its own VBO.
* Overlays, workbench and EEVEE can all have different attribute
  layouts, each of which will get its own batch.

Reviewed by: Clement Foucault
Differential Revision: https://developer.blender.org/D15428
Ref D15428
2022-09-28 14:51:23 -07:00
a790873d2a Cleanup: Typo in forward declaration 2022-09-28 16:32:59 -05:00
482d431bb6 Geometry Nodes: Curve and mesh topology access nodes
This patch contains an initial set of nodes to access basic
mesh topology information, as explored in T100020.

The nodes allow six direct topology mappings for meshes:
- **Corner -> Face** The face a corner is in, the index in the face
- **Vertex -> Edge** Choose an edge attached to the vertex
- **Vertex -> Corner** Choose a corner attached to the vertex
- **Corner -> Edge** The next and previous edge at each face corner
- **Corner -> Vertex** The vertex associated with a corner
- **Corner -> Corner** Offset a corner index within a face

And two new topology mappings for curves:
- **Curve -> Points** Choose a point within a curve
- **Point -> Curve** The curve a point is in, the index in the curve

The idea is that some of the 16 possible mesh mappings are more
important, and that this is a useful set of nodes to start exploring
this area. For mappings with an arbitrary number of connections, we
must sort them and use an index to choose a single element, because
geometry nodes does not support list fields. Note that the sort
index has repeating behavior as it goes over the "Total" number of
connections, and negative sort indices choose from the end.

Currently which of the "start" elements is used is determined by the
field context, so the "Field at Index" and "Interpolate Domain" nodes
will be quite important. Also, currently the "Sort Index" inputs are
clamped to the number of connections.

One important feature that isn't implemented here is using the winding
order for the output elements. This can be a separate mode for some
of these nodes. It will be optional because of the performance impact.

There are several todos for separate commits after this:
- Rename "Control Point Neighbors" to be consistent with this naming
- Version away the "Vertex Neighbors" node which is fully redundant now
- Implement a special case for when no weights are used for performance
- De-duplicating some of the sorting logic between the nodes
- Improve performance and memory use of topology mappings
- Look into caching some of the mappings on meshes

Differential Revision: https://developer.blender.org/D16029
2022-09-28 14:38:27 -05:00
25533dbe21 Mesh: Add C++ implementaiton of topology mappings
Because they are friendlier to use in C++ code than the existing mesh
mapping API, these mappings from one domain to another were often
reimplemented in separate files. This commit moves some basic
implementations to a `mesh_topology` namespace in the existing
mesh mapping header file. These is plenty of room for performance
improvement here, particularly by not using an array of Vectors, but
that can come later.

Split from D16029
2022-09-28 14:31:32 -05:00
878dea4e0f GPencil: Avoid infinite loop in Fill debug mode
If the internal flag is set to debug and the Ctrl key is used
the program keeps running endless.
2022-09-28 20:29:41 +02:00
6e9320d237 GPencil: Disable Fill visual aids if use Inverted
When the inverted mode is used, the visual aids must
not be displayed.
2022-09-28 20:23:49 +02:00
19955ef88e GPencil: Extend Fill lines when visual aids are disabled
When the visual aids are disabled, but the extend factor
is > 0, the lines must be extended, but not displayed.

Also, some variables renamed to clarify.
2022-09-28 20:07:20 +02:00
36096fe480 GPencil: Change property text for Fill Visual Aids 2022-09-28 19:42:03 +02:00