The refactor in f1c0249f34 incorrectly placed the material index
remapping before the transfer of generic attributes. Now that the
material index is a generic attribute, it was overwritten.
This resolves some issues with correlation artifacts at higher sample counts.
Fix T101356, correlation issues in new PMJ pattern.
Differential Revision: https://developer.blender.org/D16561
The node level was an indication of how deep the node was in the tree.
It was only used for detecting link cycles. Now that the node topology
cache from 25e307d725 exists, this calculation can be removed
completely.
The level calculation was quadratic and very slow on larger node trees.
In the mouse house file with a few thousand nodes, it took 23ms on
every single update. Another benefit is storing slightly less runtime
data, though this was only 2 bytes per node.
Differential Revision: https://developer.blender.org/D16566
Instead of generating a dependency sorted node list whenever evaluating
texture or EEVEE/viewport shader nodes, use the existing sorted array
from the topology cache. This may be more efficient because the
algorithm isn't quadratic. It's also the second-to-last place to
use `node.runtime->level`, which can be removed soon.
Differential Revision: https://developer.blender.org/D16565
Commit c8dd33f5a37b6a6db0b6950d24f9a7cff5ceb799 in OSL changed behavior of
parameters that reference each other and are also overwritten with an
instance value. This is causing the "NormalIn" parameter of a few OSL nodes
in Cycles to be set to zero somehow, which should instead have received the
value from a "node_geometry" node Cycles generates and connects automatically.
I am not entirely sure why that is happening, but these parameters are
superfluous anyway, since OSL already provides the necessary data in the
global variable "N". So this patch simply removes those parameters (which
mimics SVM, where these parameters do not exist either), which also fixes
the rendering artifacts that occured with recent OSL.
While this fixes built-in shader nodes, custom OSL scripts can still have
this problem.
Ref T101222
Differential Revision: https://developer.blender.org/D16470
Remove `private:` from the PBVHFaceIter. This is not really a C++
class, and the C++ code generates a lot of warnings about unused
fields.
Also mark function static and run clang-format.
Fixes point cloud selection by using new draw call.
Reviewed By: fclem
Maniphest Tasks: T102659
Differential Revision: https://developer.blender.org/D16501
Fixes point cloud selection by using new draw call.
Reviewed By: fclem
Maniphest Tasks: T102659
Differential Revision: https://developer.blender.org/D16501
When attempting to load contents of a .blend, the code would just assume
if the number of added items is 0, that means it's not a .blend (but a
directory, although the previous commit fixed that part already).
However there may be situations where a .blend file simply doesn't
contain anything of interest to be added (e.g. when listing assets
only), so have a proper "none" value for this.
When loading asset libraries, there would be a bunch of "non-existent
directory" prints because we were calling a function to list directory
contents on .blend file paths. Make sure the path actually points to a
directory.
Some nodes, like Combine Color or the math nodes, label sockets
differently depending on the mode to be more descriptive.
`uiTemplateNodeView` now also uses this dynamic label rather than the
socket's name for labeling in the UI so the shown labels always match
the ones on the node itself.
Reviewed By: Hans Goudey
Differential Revision: http://developer.blender.org/D16563
You can install several versions of blender side by side and all
of them will try to create a "Blender" shortcut, which if already
exists the msi installer throws a warning about.
This change adds the blender version number to the desktop and start
menu shortcuts, side steps the problem and it's easier to tell the
various blender versions apart.
Rewrite the edge split code to operate directly on Mesh instead
of BMesh. This allows for the use of multi-threading and makes
the node around 2 times faster. Around 15% of the time is spent
just on the creation of the topology maps, so these being cached
on the mesh could cause an even greater speedup. The new node
gave identical results compared to the BMesh version on all the
meshes I tested it on (up to permutation of the indices).
Here are some of the results on a few simple test cases:
(Intel i7-7700HQ (8 cores) @ 2.800GHz , with 50% of edges selected)
| | 370x370 UV Sphere | 400x400 Grid | Suzanne 4 subdiv levels |
| ----- | ----------------- | -------------- | --------------------- |
| Mesh | 89ms | 111ms | 76ms |
| BMesh | 200ms | 276ms | 208ms |
Differential Revision: https://developer.blender.org/D16399
The "Activate Same Type Next/Prev" and "Find Node" operators pan
the view to the newly selected node if it's outside of the view. This
simplifies that check and improves it in the case where the node
is only partially visible-- now it pans in while it didn't before.
The previous code was quadratic; it looped over every link for every
node. For one large node tree I tested the operator took 20ms. On the
same node tree it now takes less than 1ms.
The change replaces the current building of the "dependency list"
on every call with a use of the topology cache from 25e307d725.
PaintMaskFloodMode is supposed to be an alias
of eSelectOp. paint_intern.h now includes
ED_select_utils.h and simply assigns the
relevent members of eSelectOp to PaintMaskFloodMode's
members.
This patch adds basic face iterators to the sculpt API. The interface is similar to the existing vertex iterators. It's not C++ (though it does mark private fields in PBVHFaceIter as private if compiling under C++).
Example:
```
PBVHFaceIter fd;
BKE_pbvh_face_iter_begin(pbvh, node, fd) {
/* Face reference and face index */
PBVHFaceRef face = fd->face;
int face_index = fd->index;
/* Can read and modify hide flag if it exist (it may not) */
if (fd->hide) {
*fd->hide ^= true; /* toggle hide */
}
/* Can read and modify face set if it exists */
if (fd->face_set) {
*fd->face_set = something;
}
/*Can read vertices*/
for (int i=0; i<fd.verts_num; i++) {
float *co = SCULPT_vertex_co_get(ss, fd.verts[i]);
}
}
BKE_pbvh_face_iter_end(fd);
```
Reviewed By: Brecht Von Lommen and Hans Goudey
Differential Revision: https://developer.blender.org/D16225
Ref D16225
If compositing uses renderlayers, and a camera was missing in the
associated scenes, the error message also referred to the scene the comp
tree was in (not the scene of the renderlayer -- which can potentionally
be different).
This was confusing and is now rectified.
Maniphest Tasks: T102514
Differential Revision: https://developer.blender.org/D16542
Always position the nodes added with the node search at the point where
the search operator was invoked by ensuring the operator context is the
main node editor region.
This was an unintended change of rBbdb57541475f, caused by the operator
now getting the cursor position in region space. So when the operator
was called from the menu, it would get the cursor position in the
region space of the menu, which lead to an offset when adding the node
since it expected the coordinates to be in the space of the node editor.
Setting the correct operator context also fixes inconsistent transform
sensitivity depending on zoom when adding nodes via the search in the
menu which has been an issue since as far back as Blender 2.79.
Also includes a small fix for the vertical offset of nodes added by the
search which varied depending on the UI scale. Same fix as in
rB998ffcbf096e.
Reviewed By: Hans Goudey
Differential Revision: http://developer.blender.org/D16555
Regression in [0] which exposed a problem with GHOST_kGrabHide on Win32
and to some extent X11.
Prior to [0], walk mode used it's own warping logic (hiding the cursor
& recording the motion between events). Using GHOST's grabbing makes
sense in this case as it's not very convenient for operators to
implement their own cursor warping, however doing so exposed a problem
where the mouse cursor could leave the window.
This would happen because the cursor needed to be within 2px of the
screen edge before warping.
Resolve by warping within a small region in the middle of the window.
Note that warping to the window center on each motion would be ideal
but is more involved as the logic for Win32 & X11 doesn't work properly
when every motion warps, so this needs further investigation to support.
This problem doesn't apply to GHOST/Cocoa which warps every motion event
on the spot and GHOST/Wayland doesn't set the mouse position at all to
implement this functionality.
[0]: 4c4e8cc926