Age | Commit message (Collapse) | Author |
|
When a vertex group is used to limit the influence of the modifier
to a subset of vertices, binding data for vertices with zero weight
is not needed. This wastes memory, disk space and CPU cycles.
If the vertex group contents is known to be final and constant,
it is reasonable to optimize by only storing data group vertices.
This has to be an option in case the group can change.
Supporting this requires adding a vertex index field and spliting
the vertex count into mesh and bind variants, but both happen to
fit in available padding. The old numverts field is renamed to the
new bound vertex count field to maintain the array length invariant.
Versioning is used to initialize the other new fields.
If a file with sparse binding is opened in an old blender version,
it is corrupted into a non-sparse bind with vertex count mismatch,
preventing the modifier from working until rebind.
Differential Revision: https://developer.blender.org/D11924
|
|
|
|
This allows us to remove a callback from the modifier type info struct.
In the future the these modifiers might just be replaced by nodes
internally anyway, but in the meantime it's nice to unify the handling
of evaluated geometry a bit.
Differential Revision: https://developer.blender.org/D11080
|
|
Approximately 91 spelling corrections, almost all in comments.
Differential Revision: https://developer.blender.org/D10288
Reviewed by Harley Acheson
|
|
|
|
There are two issues here. First, like in T81988 there are cases
where the modifier would deform some vertices immediately after
bind. This is caused by wrong assumptions in the code about the
possible relative angles between various vectors, which can cause
negative weights that don't blend correctly to appear.
Specifically, it seems originally the code assumes that the
centroid-point vector in the polygon plane lies somewhere
between the mid-edge vectors. This is however not necessarily
the case for distant vertices, because the polygon is not
guaranteed to be truly planar, so normal projection may be
a bit off. The code has to use signed angles and checks to
support all possible angular arrangements.
The second issue is very thin and long triangles, which tend
to be very spatially unstable in their thin dimension, resulting
in excess deformation. The code was weighting distance using
the distances between the centroid and the mid-edge points, which
in this case end up as nearly opposite vectors of sizable length
and don't correctly represent how thin the triangle actually is.
It is thus better to use centroid-to-line distances, and an
additional even stricter value for the midpoint that will use
only 3 vertices at evaluation time.
Differential Revision: https://developer.blender.org/D10065
|
|
It is used during evaluation so it shouldn't be greyed out in the UI.
Ref D10040
|
|
Using malloc to allocate a temporary array for each vertex,
which most commonly contains just 4 elements, is not efficient.
Checking the mode with a switch is also better.
Differential Revision: https://developer.blender.org/D10040
|
|
There is no need to first copy weights to a separate array,
or create the data layer if it doesn't exist. The threaded
code can retrieve the weight directly from the layer.
Differential Revision: https://developer.blender.org/D10015
|
|
|
|
Since the initial merge of the geometry nodes project, the modifyPointCloud
function already was already modifying a geometry set. The function wasn't
renamed back then, because then the merge would have touched many
more files.
Ref T83357.
|
|
|
|
|
|
|
|
Surface deform weight calculation assigned weights in a non-uniform
way that caused vertices to deform upon binding.
This was caused by the face-corner angle being used in
calculations which where squared & scaled.
Causing a triangle fan of many thin faces to have a much greater
influence compared to the same shape made from a single triangle.
Change the calculation of the weight so each face-corner is scaled
by it's angle.
|
|
Without this, there was no way of finding out which object, modifier
combination caused the error, making the logs not very useful
for debugging.
|
|
This removes `foreachObjectLink` from `ModifierTypeInfo`, `GpencilModifierTypeInfo`
and `ShaderFxTypeInfo`. There is no need to have both, `foreachObjectLink` and `foreachIDLink`.
There is not code that actually depends on `foreachObjectLink`.
Reviewers: brecht
Differential Revision: https://developer.blender.org/D9078
|
|
As noted in T80164, there are quite a few area of Blender where the
"Reset to Default Value" operator in button context menus doesn't work.
Modifiers are one of them, because the DNA defaults system was never
set up for them.
Additionally, this should make modifier versioning easier. Whenever a
new field is added it should be automatically initialized to the
default value.
I had to make some ordering changes in the following modifiers to work
around an error with `-Wsign-conversion` in the macros:
- Solidify Modifier
- Corrective Smooth Modifier
- Screw Modifier
Some modifiers are special cases and are skipped in this commit:
- Data Transfer Modifier
- Cloth Modifier
- Fluid Modifier
- Softbody Modifier
Differential Revision: https://developer.blender.org/D8747
|
|
This reduces the number of places that have to be modified
when a new modifier is added.
Reviewers: campbellbarton
Differential Revision: https://developer.blender.org/D9000
|
|
With this change `outliner_draw.c` does not have to be
edited anymore when a new modifier is added.
Reviewers: campbellbarton
Differential Revision: https://developer.blender.org/D8998
|
|
For modifier shortcuts we added a "custom_data" field to panels.
This commit uses the same system for accessing the list data that
corresponds to each panel. This way the context is only used once
and the modifier for each panel can be accessed more easily later.
This ends up being mostly a cleanup commit with a few small changes
in interface_panel.c. The large changes in the UI functions are due
to the fact that the panel custom data is now passed around as a
single pointer instead of being created again for every panel.
The list_index variable in Panel.runtime is removed as it's now
unnecessary.
Differential Revision: https://developer.blender.org/D8559
|
|
|
|
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/modifiers` module.
No functional changes.
|
|
|
|
|
|
This is part of a greater blenloader decentralization effort (T76372).
For modifiers the goal is that fewer files have to be modified when
a new modifier is added.
This patch just adds the `blendWrite` and `blendRead` callbacks to
`ModifierTypeInfo` but does not change any other code yet. In the next
steps, modifier specific code will be moved from `writefile.c` and
`readfile.c` into their corresponding `MOD_*` files.
|
|
|
|
Regression in deaff945d0b96
|
|
This patch implements the list panel system D7490 for modifiers.
It also moves modifier drawing to a callback in ModifierTypeInfo
in line with the extensible architecture refactoring goal T75724.
This adds a PanelRegister callback and utilities for registering
panels and subpanels. It also adds the callbacks for expansion saving
and drag and drop reordering described in D7490.
These utilities, callbacks, and other common UI elements shared
between modifiers live in MOD_ui_common.c.
Because modifier buttons are now in panels, we can make use of
subpanels for organization. The UI layouts also use the single
column layout style consistently used elsewhere in Blender.
Additionally, the mode-setting buttons are aligned and ordered
consistently with the outliner.
However, the large number of UI changes in this patch may mean
that additional polishing is required in master.
Thanks to William Reynish (@billreynish) who did a fair amount of the
layout work and to Julian Eisel (@Severin) for consistent help.
Differential Revision: https://developer.blender.org/D7498
|
|
|
|
|
|
|
|
There is no user visible difference in standard builds, as there are no
volume modifiers yet. When using WITH_NEW_OBJECT_TYPES some deform only
modifiers are now available for hair and pointcloud objects.
Differential Revision: https://developer.blender.org/D7141
|
|
|
|
|
|
This commit aims to add functionality to the surface deform modifier that
gives more control and allows it to work better with the modifier stack.
* Maintains compatibility with older files. The default settings keep it
so that the whole object is bound and vertex coordinates get overwritten
as the modifier currently does.
* Turns the deformations from an absolute vertex coordinate overwrite into
an additive offset from the vertex location before the modifier to the
resulting bound deformation. This gives the ability to control the
strength of the deformation and mix the deformation of the modifier
with the modifier stack that comes before it.
* Also adds in a vertex group with the invert option. This is applied after
the bind deformation is added. So the whole object is still bound to target,
and the vertex group filters afterwards what parts get affected.
I experimented with a version to only binds the geometry weighted to the
vertex group, but that would break compatibility with old files.
I may bring it in later as a separate option/mode for the surface deform.
With several fixes from @mont29.
Reviewed By: mont29
Differencial Revision: https://developer.blender.org/D6894
|
|
|
|
The Deform modifiers was reallocating buffers that only fit the vertices
of the inner loop. This patch first counts the maximum needed buffer and
allocates one.
When using the daily dweebs animation file the playback performance went
from 0.66 fps to 0.93 fps.
Reviewed By: sybren
Differential Revision: https://developer.blender.org/D7132
|
|
Note that `BKE_library.h`/`library.c` were renamed to
`BKE_lib_id.h`/`lib_id.c` to avoid having a too generic name here.
Part of T72604.
|
|
UI
Seems like we need to set the error with the evaluated ModifierData.
Pass this to 'surfacedeformBind' and report with that.
Differential Revision: https://developer.blender.org/D6601
|
|
|
|
|
|
This is a continuation of rB39f005eae8eed8b939579aff8c9a05a4f50e5e38
Now all the fields where we check for object type in RNA (like
rna_Curve_object_poll) will have a safe guard for when this isn't the
case. For example when loading files that has missing object libraries
and all missing objects are replaced with empties (placeholders).
Reviewed By: Brecht
Differential Revision: http://developer.blender.org/D5425
|
|
TLS and Settings can be used by other types of parallel 'for loops', so
removing 'Range' from their names.
No functional changes expected here.
|
|
Also remove duplicate comments in headers.
|
|
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
|
|
A regression since 64c8d72ef1ad.
The solution is to force modifier evaluation for an evaluated
object, and let it to copy binding data back to original when
is being evaluated for binding.
Reviewers: brecht
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D4642
|
|
This was wrong and violating design to force modifiers to query
evaluated objects and IDs. It is up to the caller to make sure
the object is properly evaluatable.
Effectively, reverting changes from de491abf9962 (and possibly
other related changes).
|
|
|
|
The general idea of this change is to have a runtime data pointer
in the ModifierData, so it can be preserved through copy-on-write
updates by the dependency graph.
This is where subdivision surface modifier can store its topology
cache, so it is not getting trashed on every copy-on-write which
is happening when moving a vertex.
Similar mechanism should be used by multiresolution, dynamic paint
and some other modifiers which cache evaluated data.
This fixes T61746.
Thing to keep in mind, that there are more reports about slow
subdivision surface in the tracker, but that boils down to the
fact that those have a lot of extraordinary vertices, and hence
a lot slower to evaluated topology.
Other thing is, this speeds up oeprations which doesn't change
topology (i.e. moving vertices).
Reviewers: brecht
Reviewed By: brecht
Maniphest Tasks: T61746
Differential Revision: https://developer.blender.org/D4541
|