Age | Commit message (Collapse) | Author |
|
|
|
A collection of smaller changes that are required in the /blender/source files. A lot of them are also due to variable renaming.
Reviewed By: sergey
Maniphest Tasks: T59995
Differential Revision: https://developer.blender.org/D3855
|
|
|
|
|
|
This is a partial rollback of f18ad385dffe70f5e57df00ff9bbb7b42fa05be0. It
turned out to be more tricky to determine animatedness of an object.
This fixes T71986.
|
|
There are no more 'layers' in Blender. I chose 'Visible Objects' rather
than 'Visible Collections' to be consistent with the other
'{Renderable,Selected} Objects Only' options.
No functional changes.
|
|
`AbcTransformWriter::hasAnimation` recently became smarter than just
returning `true`, but wasn't quite smart enough yet. Constraints are now
considered a source of 'animation'.
|
|
|
|
Instead of always writing the transform on every frame, it's now checked
whether the object is animated at all. This could be made stricter to
reduce false positives, for example by checking FCurves and drivers to
see whether translation/rotation/scale is animated. However, this
approach is already better than the `return true` we had before.
This commit adds the BKE_animdata_id_is_animated(id) function, which
returns true if the ID datablock has non-empty animation data. This is
determined by checking the the active action's fcurves, the drivers, and
NLA tracks.
|
|
The Alembic file metadata object was created in one place, a bit of
metadata was added, then it was passed along with other properties which
were then injected as metadata in another function. This is now cleaned up.
No functional changes.
|
|
This commit implements the change in behaviour described in T71246.
In short:
For export, per mesh:
- Custom loop normals are defined → loop normals are exported.
- One or more polys are marked flat → loop normals are exported.
- Otherwise, no normals are exported.
For import, when the Alembic mesh contains:
- loop normals (kFacevaryingScope) → use as custom loop normals, and
enble Auto Smooth to have Blender actually use them.
- vertex normals (kVertexScope or kVaryingScope) → convert to loop
normals, and handle as above.
- no normals → mark mesh as smooth.
- unsupported normal types (kConstantScope, kUniformScope,
kUnknownScope) → handle as 'no normals'.
This also fixes T71130: Alembic split normal export issue
Previously the mesh flag `ME_AUTOSMOOTH` was used in conjunction with
the poly flag `ME_SMOOTH` to determine whether loop normals or vertex
normals were exported. This behaviour was hard to predict for artists,
and hard to describe in the manual. Instead, Blender now only exports
loop normals, computing them if necessary. This way, the mesh in Alembic
should always have the same loop normals as in Blender.
Maniphest Tasks: T71130
Differential Revision: https://developer.blender.org/D6197
|
|
When importing subdivision surfaces a 'Topology Changed' error was shown
even though the topology didn't change at all. The code was comparing to
`totpoly` where `totloop` should have been used.
|
|
The auto-smoothing flag can now be used by artists when the Alembic file
does not contain custom loop normals.
- Auto-smoothing disabled: mesh is flat-shaded.
- Auto-smoothing enabled: works as usual; set angle to 180° to ensure
a 100% smoothed mesh.
|
|
Users now can turn on in a viewport collections that are temporarily
hidden (eye) in the view layer.
Design task: T61327
As for the implementation, I had to decouple the visibility in the
depsgraph from the visibility in the view layer.
Also there is a "bug" that in a way was there before which is some
operators (e.g., writing a text inside of a text object, tab into edit
mode) run regardless of the visibility of the active object. The bug was
present already (with object type visibility restriction) in 2.80 so if
we decide to tackle it, can be done separately (I have a patch for it
though P1132).
Reviewed by: brecht (thank you)
Differential Revision: D5992
|
|
Modifier stack evaluation would copy mesh settings other than mesh topology
automatically, outside of the individual modifier evaluation. This leads to hard
to understand code, and makes it unclear which settings are available in following
modifiers, and which only after the entire stack is evaluated.
Now every modifier is responsible to ensure the mesh it outputs preserves materials,
texture space and other settings, or alters them as needed.
Fixes T64739: incorrect texture space for various modifiers
Differential Revision: https://developer.blender.org/D5808
|
|
space issues"
This reverts commit e7a514369fe700dcc5a1fe433c8f709ed9595ded, it introduces
a bug in selection in edit mode.
Fixes T70103: can't select extruded Vertex
Ref T64739
|
|
Creases are stored by the vertex indices of the edges. Sometimes they
were stored with (v1, v2) when the edge itself was stored with (v2, v1).
We now search for both orientations.
Sorting the vertex indices before searching avoids the second search
altogether when loading the example file of T70021.
|
|
Error was introduced in 34143e45104b.
|
|
The parent hairs were written to Alembic even when the 'Parent Particles'
checkbox (`use_parent_particles`) was disabled. In this case the parent
hairs were not correct in Blender's memory, and thus also not correct in
the exported Alembic file. The Alembic exporter now respects this setting
and doesn't write the parent hairs when 'Parent Particles' is off.
|
|
Importing an Alembic file with a relative path is now also possible.
|
|
Modifier stack evaluation would copy mesh settings other than mesh topology
automatically, outside of the individual modifier evaluation. This leads to hard
to understand code, and makes it unclear which settings are available in following
modifiers, and which only after the entire stack is evaluated.
Now every modifier is responsible to ensure the mesh it outputs preserves materials,
texture space and other settings, or alters them as needed.
Fixes T64739: incorrect texture space for various modifiers
Differential Revision: https://developer.blender.org/D5808
|
|
crashes
The static mesh issue described in T65816 has been resolved by @Sergey
in T60094.
This commit fixes the last bit of the puzzle, which was two-fold:
- A missing depsgraph update when setting `orig_object.data = new_mesh`
from Python. Thanks @Sergey for providing the fix :)
- Properly locking the interface while exporting. This prevents crashes
as described in T60094. The previous approach of calling
`BKE_spacedata_draw_locks()` was not enough.
|
|
The `do_update` variable wasn't set after changing the `progress`
variable, causing the GUI only to update on redraw (f.e. when the user
was waving the mouse around).
|
|
variables
Using pointers instead of references when passing progress variables
makes the C++ code more in line with the C code (as it doesn't transform
pointer parameters to reference parameters). Also makes it easier to
spot when a common Blender pattern is implemented incorrectly (fix will
be in the next commit).
|
|
Currently unused, but will allow to keep of an owner of the depsgraph.
Could also simplify other APIs in the future by avoiding to pass bmain
explicitly to relation update functions and things like that.
|
|
This partially reverts commit 0b2d1badecc48b5cbff5ec088b29c6e9acc5e1d0
Post increment can deep-copy for C++ iterators, while in my own checks
GCC was able to optimize this to get the same output,
better follow C++ best practice and use pre-increment for iterators.
|
|
When the result isn't used, prefer post increment/decrement
(already used nearly everywhere in Blender).
|
|
|
|
|
|
|
|
This fixes the glitching hairs described in T56408, T63534, and possibly
also T63534.
The fix consists of returning the original mesh (i.e. as visible in edit
mode) when constructing the ORCO mesh. This allows a static set of
coordinates to be used when computing the child hair positions.
The original mesh is only returned when it has the same topology (at
least same number of vertices, loops, and polys. It's up the author of
the Alembic file to ensure stable geometry when it's desired to be
compatible with Blender's hair system.
Reviewers: mont29, brecht
Differential Revision: https://developer.blender.org/D5492
|
|
|
|
Some statements were split across multiple lines because of their
trailing comments.
In most cases it's clearer to put the comments above.
|
|
The mesh can be freed by BKE_mesh_nomain_to_mesh(), so we need to get
the `ME_AUTOSMOOTH` flag before that call, and not after.
|
|
Meshroom writes two hierarchies to Alembic, one rooted at
`/mvgRoot/mvgCameras` and the other at `/mvgRoot/mvgCamerasUndefined`.
These paths have no schema definition, and thus are ignored by Blender.
The cameras themselves have those schemaless paths as parent, and have
their transforms marked as "inherited", e.g. relative to their parent.
As these cameras have no valid parent, there is no Blender object to use
to convert their local matrices to world matrices, and Blender just
decided to reset them to the unit matrix.
Now "inherited" transforms without a parent in Blender are interpreted
as world transforms. Reparenting those objects to a Blender object will
re-interpret the transforms as local to the parent again.
|
|
T68035 by @luzpaz
|
|
|
|
|
|
When the mesh is using custom normals, those should always be exported,
regardless of the `ME_SMOOTH` flag on the invidivual polys.
Also replaced the loop normal writing with the same logic as we use for
reading (less pointer arithmetic, more normal counting).
|
|
Loop normals are called 'Face-varying normals' in Alembic. Before this
commit, the existence of such normals was used to enable smooth shading.
This is incorrect, as the normals could encode flat faces just as well.
This commit adds the loading of these normals as custom loop normals. It
then also enables Auto-Smoothing on the mesh (which is a bit of a
misnomer and indicates to Blender that the custom normals should be
used).
Fixes the glitching described in T65959.
Differential Revision: https://developer.blender.org/D5191
|
|
The name now indicates what happens when the variable is set to true.
No functional changes.
|
|
The only thing that is stored in this pointer is a `Mesh*`, and casting
it from/to `void*` is unnecessary and confusing. Maybe the entire
CDStreamConfig class could/should be removed at some point.
No functional changes.
|
|
By having a switch statement that lists all the values of the enum, it is
clear which cases we're not handling, and it also allows for warnings in
the future when the enum expands.
No functional changes.
|
|
No functional changes.
|
|
The `poly_start` parameter was always 0, so adding it to a poly index
from Alembic is a no-op.
No functional changes.
|
|
The w-component of the translation column of the scaled matrix wasn't
set to 1.0, which, apart from being incorrect, caused drawing problems.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D5290
|
|
When the object we iterate over is not part of the depsgraph, we cannot
get the evaluated copy to export. This workaround is temporary to avoid
a BLI_assert() failure getting the evaluated mesh of this object.
This will be handled more elegantly in the new AbstractHierarchyIterator
that I'm working on, but that requires a bigger change than we should
allow this close to the 2.80 release candidate.
This fixes a problem described in T58686.
|
|
These were just some missing nullptr checks.
|
|
The velocities std::vector was allocated in too narrow a scope, causing
use-after-free errors.
|
|
CDData checking on file load was not taking into account deprecated
CD_MTEXPOLY datatype, which unfortunately shows same weird glitch as
CD_PAINT_MASK and CD_FACEMAP ones...
Note that it was annoying (due to amount of warnings in console), but
totally harmless, since that data type is just deleted anyway.
This commit also generally cleans up the CD_MTEXPOLY deprecation code, we
have a system to handle that, let's use it, instead of defining local
static values to replace it...
|