Age | Commit message (Collapse) | Author |
|
Differential Revision: https://developer.blender.org/D12962
|
|
Goals of this refactor:
* More unified approach to updating everything that needs to be updated
after a change in a node tree.
* The updates should happen in the correct order and quadratic or worse
algorithms should be avoided.
* Improve detection of changes to the output to avoid tagging the depsgraph
when it's not necessary.
* Move towards a more declarative style of defining nodes by having a
more centralized update procedure.
The refactor consists of two main parts:
* Node tree tagging and update refactor.
* Generally, when changes are done to a node tree, it is tagged dirty
until a global update function is called that updates everything in
the correct order.
* The tagging is more fine-grained compared to before, to allow for more
precise depsgraph update tagging.
* Depsgraph changes.
* The shading specific depsgraph node for node trees as been removed.
* Instead, there is a new `NTREE_OUTPUT` depsgrap node, which is only
tagged when the output of the node tree changed (e.g. the Group Output
or Material Output node).
* The copy-on-write relation from node trees to the data block they are
embedded in is now non-flushing. This avoids e.g. triggering a material
update after the shader node tree changed in unrelated ways. Instead
the material has a flushing relation to the new `NTREE_OUTPUT` node now.
* The depsgraph no longer reports data block changes through to cycles
through `Depsgraph.updates` when only the node tree changed in ways
that do not affect the output.
Avoiding unnecessary updates seems to work well for geometry nodes and cycles.
The situation is a bit worse when there are drivers on the node tree, but that
could potentially be improved separately in the future.
Avoiding updates in eevee and the compositor is more tricky, but also less urgent.
* Eevee updates are triggered by calling `DRW_notify_view_update` in
`ED_render_view3d_update` indirectly from `DEG_editors_update`.
* Compositor updates are triggered by `ED_node_composite_job` in `node_area_refresh`.
This is triggered by calling `ED_area_tag_refresh` in `node_area_listener`.
Removing updates always has the risk of breaking some dependency that no
one was aware of. It's not unlikely that this will happen here as well. Adding
back missing updates should be quite a bit easier than getting rid of
unnecessary updates though.
Differential Revision: https://developer.blender.org/D13246
|
|
|
|
Sculpt.c is now three files:
* Sculpt.c: main API methods and the brush stroke operator
* Sculpt_brushes.c: Code for individual brushes.
* Sculpt_ops.c: Sculpt operators other than the brush stroke operator.
TODO: split brush stroke operator into a new file (sculpt_stroke.c?).
|
|
|
|
Also add groups in some files.
|
|
Some doc-strings were skipped because of blank-lines between
the doc-string and the symbol and needed to be moved manually.
- Added space below non doc-string comments to make it clear
these aren't comments for the symbols directly below them.
- Use doxy sections for some headers.
Ref T92709
|
|
Ref T92709
|
|
Dirty regions when painting are not using rcti. Meaning less
understandable code. Found issue when refactoring the image_gpu partial
update. In a future change gpu partial update API will be using rcti
also what makes the code even cleaner.
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D13260
|
|
|
|
Caused by {rBaf162658e127}, so long standing bug.
When changing clone slots (report involved a quite complicated sequence
of selecting textures and undo -- but I think this could happen in more
situations) code checks for UV of new clone slot.
However, since above commit the slot and the clone slot were mixed up,
so in this case the responsible NULL check (for when no UV is assigned)
wasnt working.
Now correct this (NULL check the clone slot uv -- instead of the paint
slot UV).
note: not sure why low level CustomData functions actually dont do the
name NULL checks themselves (seems like callers are always responsible).
Maniphest Tasks: T93117
Differential Revision: https://developer.blender.org/D13378
|
|
This patch separates the static-part from the dynamic-part when
generate brush masks. This makes the generation of brush masks 2-5 times
faster depending on the size of the brush.
More improvements can be done, this was just low hanging fruit.
|
|
Generating curve mask for 2d texture painting had some hard-coded
parameters that eventually weren't used in the algorithm (hardness and
rotation of the brush). This patch removes these parameters.
|
|
Curve mask generation is done during 2d texture painting. There are some
performance issues in this part of the code. Before addressing those we
move the code to CPP.
|
|
Curve mask is freed/allocated every time, but could still reuse the
previous allocated buffer when the diameter of the brush doesn't change.
|
|
|
|
|
|
Previously, `ImageTile->ok` and `ImageUser->ok` were used to indicate
whether an image failed to load. There were three possible values
which (probably) had the following meanings:
* `0`: There was an error while loading the image. Don't try to load again.
* `1`: Default value. Try to load the image.
* `2`: The image was loaded successfully.
This image-wide flag did not make sense unfortunately, because loading
may work for some frames of an image sequence but not for others.
Remember than an image data block can also contain a movie.
The purpose of the `->ok` flag was to serve as an optimization to avoid
trying to load a file over and over again when there is an error (e.g. the
file does not exist or is invalid). To get the optimization back, the patch
is changing `MovieCache` so that it can also cache failed load attempts.
As a consequence, `ibuf` is allowed to be `NULL` in a few more places.
I added the appropriate null checks.
This also solves issues when image sequences are used with the
Image Texture node in Geometry nodes (also see D12827).
Differential Revision: https://developer.blender.org/D12957
|
|
|
|
* Forbid editing linked palettes.
* Make `color` RNA property of ColorPalette '`LIB_EXCEPTION`', so that
the color buttons in the palette template remain active on linked data.
NOTE: This incidently makes linked palettes' colors editable from RNA,
not from UI though, so think this is OK for now.
|
|
Improve readability using underscores for separators, e.g.
prev_click_time instead of prevclicktime.
|
|
Use arrays for wmEvent coordinates, this quiets warnings with GCC11.
- `x, y` -> `xy`.
- `prevx, prevy` -> `prev_xy`.
- `prevclickx, prevclicky` -> `prev_click_xy`.
There is still some cleanup such as using `copy_v2_v2_int()`,
this can be done separately.
Reviewed By: campbellbarton, Severin
Ref D12901
|
|
|
|
CD_PROP_COLOR vertex data is stored in scene linear while legacy vertex
colors are srgb, so both operators also need to do this conversion
Reviewed By: sergey
Maniphest Tasks: T79005
Differential Revision: https://developer.blender.org/D8320
|
|
|
|
By argument naming and convention this is the intended argument order.
|
|
|
|
both inverse and keep mask modes being on
at the same time.
|
|
|
|
Caused by {rB3e5431fdf439}
Issue is that sculpting could start with using `SCULPT_smooth` and
(because of the Pressure sensitivity dropping to zero) code would switch
to `SCULPT_enhance_details_brush` at strength zero.
Issue with this though is that this can be in the middle or end of a
stroke and the necessary `ss->cache->detail_directions` are only
initialized for the first brush step (see
`SCULPT_stroke_is_first_brush_step` in `SCULPT_enhance_details_brush`).
With these missing, it could only go downhill from there.
Suggest to prevent the "mode-flip" from `SCULPT_smooth` to
`SCULPT_enhance_details_brush` (happening solely because of pressure
strength) by changing the condition.
Now do `SCULPT_enhance_details_brush` only if strength is **below** zero
and `SCULPT_smooth` else (flipping from enhance_details to regular smooth
is fine).
If inverting the brush in the middle of the stroke will be supported at
some point, the codepath of `smooth` would have to inform the cache that
invert changed and detail_directions would have to be initialized then
(even if not at the start of the stroke).
Maniphest Tasks: T89164
Differential Revision: https://developer.blender.org/D12676
|
|
Choosing a UV layer would actually affect the overlay in the viewport
and also painting with the mask brush was in that UV space, but the
resulting stencil mask was always applied with the active UV (not the
explicitly selected stencil UV -- the one one is looking at in the
viewport!) to painting.
This has been like that as far as I have checked back (at least 2.79b),
I am surprised this has not come up before, but it does not seem to make
sense at all...
Now use the UV specified for the stencil layer when applying the mask for
painting, so it corresponds to the stencil mask one is looking at in the
viewport.
Maniphest Tasks: T91557
Differential Revision: https://developer.blender.org/D12583
|
|
- Bend (Transform).
- Extrude to Cursor.
- Lasso Select (related operators such as node-cut links, mask.. etc).
- Rip Mesh / UV's.
- Vertex/Edge Slide.
|
|
|
|
This was left over from when changing the image set the faces texture.
|
|
|
|
adjacent edges
The exception to automatically pin vertices of grid corners also
has to take into account that the vertex is in a boundary.
Reviewed By: JacquesLucke
Maniphest Tasks: T90235
Differential Revision: https://developer.blender.org/D12044
|
|
the mesh
The active geometry element are usually updated by the cursor drawing
code (as they are needed for the cursor preview) and when an sculpt
operator starts. For brushes, this was not happening. This was making
brushes rely by default on the last cursor drawing update, which can
be incorrect if the mouse moved after starting the stroke without
hovering the active geometry.
Reviewed By: JacquesLucke
Maniphest Tasks: T90236
Differential Revision: https://developer.blender.org/D12045
|
|
|
|
|
|
|
|
|
|
While doxygen supports both, conform to our style guide.
Note that single back-tick's are already used in a majority of comments.
|
|
|
|
This shows the text as part of the assertion message.
|
|
This commit moves the storage of `bDeformGroup` and the active index
to `Mesh`, `Lattice`, and `bGPdata` instead of `Object`. Utility
functions are added to allow easy access to the vertex groups given
an object or an ID.
As explained in T88951, the list of vertex group names is currently
stored separately per object, even though vertex group data is stored
on the geometry. This tends to complicate code and cause bugs,
especially as geometry is created procedurally and tied less closely
to an object.
The "Copy Vertex Groups to Linked" operator is removed, since they
are stored on the geometry anyway.
This patch leaves the object-level python API for vertex groups in
place. Creating a geometry-level RNA API can be a separate step;
the changes in this commit are invasive enough as it is.
Note that opening a file saved in 3.0 in an earlier version means
the vertex groups will not be available.
Differential Revision: https://developer.blender.org/D11689
|
|
In most cases the undo system was loading undo steps twice.
This was needed since some undo systems (sculpt, paint, text)
require stepping out of the current undo step.
Use a flag to limit this to the undo systems that need it.
This improves performance for other undo systems.
This gives around 1.96x speedup in edit-mesh for high-poly objects.
Reviewed by: mont29
Ref D11893
|
|
|
|
|
|
Also use doxy style function reference `#` prefix chars when
referencing identifiers.
|
|
Generally the evaluated mesh should not be changed, since that is the
job of the modifier stack. Current code is far from const correct in
that regard. This commit uses a const variable for the reult of
`BKE_object_get_evaluated_mesh` in some cases. The most common
remaining case is retrieving a BVH tree from the mesh.
|