Age | Commit message (Collapse) | Author |
|
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...
|
|
Leave the reader to be created on the CoW object in the depsgraph evaluation,
don't assign the one used for importing to the original object.
|
|
This fixes an issue introduced in 4337bc2e6303dbd5f295878f3e7490995a62713a.
|
|
An Alembic file saved by 3DS Max caused Blender to crash when importing.
Either the UV indices in the file are out of bounds or they are written
in a way we don't expect. In either case, this now no longer causes Blender
to crash.
|
|
There is now a checkbox to enable/disable depth of field per camera. For Eevee
this replace the scene level setting. For Cycles there is now only an F-Stop
value, no longer a Radius.
Existing files are converted based on Cycles or Eevee being set in the scene.
Differential Revision: https://developer.blender.org/D4882
|
|
No major API change here, only in the outliner restriction column
variables (e.g., show_restrict_column_selectable > show_restrict_column_select).
* Get rid of _INSTANCE (introduced on b1af68200159).
* Differentiate (everywhere but the API) between HIDE (temporary) and VIEWPORT (global).
* Use the expected icon for restrict viewport (same as objects and modifiers).
* selectable > select
|
|
See T61578 for discussions and mockups.
Visibility Options
==================
We are adding more granular control over restriction columns in the outliner,
exposing "indirect only" and "holdout" as options, and change the way
users enable/disable collections in a viewlayer.
We also rename the object viewport restriction to hide instance.
So the options we have are:
Collection
----------
* Render Visibility
* Instance Visibility
* Selectable
(View) Layer Collection
-----------------------
* Enable
* Holdout
* Indirect Only
* Viewport
Shortcuts
=========
Isolate Collection
------------------
* Ctr + click isolates the collection.
It turns all its parents and children "visible", and all the other
collections "invisible".
If ALL the collections were already properly set, we re-set the
collections to their default value.
Set Collection Inside Collections and Objects
---------------------------------------------
* Shift + click: Set/unset inside collections and objects.
We only set objects values as well when we are in View Layer mode and
(obviously) when the objects have a matching property.
Icons
=====
Little reminder that we will need better icons for holdout, indirect only, and
probably instanced (nothing wrong with the current, but it differs from
the proposal when it is turned off).
Also, we need to decide where do we want the modifier/bones/... icons to
be (in which column) and ideally make sure their icons match the ones we
use for collections/objects.
At the moment those are using the screen icon, which is not being used
by collections.
Reviewers: brecht, billrey
Subscribers: pablovazquez
Differential Revision: https://developer.blender.org/D4823
|
|
* The cache file datablock is now evaluated as part of the dependency graph,
creating/freeing the Alembic file handle matching the current frame.
Modifiers and constraints depend on this evaluation.
* Cache file handles and readers now only exist on COW datablocks, never the
original ones.
* Object data paths are flushed back to the original for the user interface.
* The cache file keeps a list of all readers associated with its handle, and
automatically frees them when the handle is freed. This kind of sharing of
data across datablocks is weak but we have no better mechanism for it.
Fix T62720: Alembic sequences not working and crashing
Differential Revision: https://developer.blender.org/D4774
|
|
|
|
tellp() is not valid to check if the string stream is empty. Just get the
string directly as there is no obvious efficient method to check otherwise.
|