diff options
author | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2022-01-17 16:50:47 +0300 |
---|---|---|
committer | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2022-01-17 16:51:04 +0300 |
commit | 0a08ac2528eee972c4dc23554ffd088305e6ae92 (patch) | |
tree | 2ef9014dc16053ce6d249d877110766b0972a2ac /release | |
parent | 9d3f35a0bf1bf5776363bfd61d53a7c85b5827a4 (diff) |
Alembic: add support for reading override layers
Override layers are a standard feature of Alembic, where archives can override
data from other archives, provided that the hierarchies match.
This is useful for modifying a UV map, updating an animation, or even creating
some sort of LOD system where low resolution meshes are swapped by high resolution
versions.
It is possible to add UV maps and vertex colors using this system, however, they
will only appear in the spreadsheet editor when viewing evaluated data, as the UV
map and Vertex color UI only show data present on the original mesh.
Implementation wise, this adds a `CacheFileLayer` data structure to the `CacheFile`
DNA, as well as some operators and UI to present and manage the layers. For both
the Alembic importer and the Cycles procedural, the main change is creating an
archive from a list of filepaths, instead of a single one.
After importing the base file through the regular import operator, layers can be added
to or removed from the `CacheFile` via the UI list under the `Override Layers` panel
located in the Mesh Sequence Cache modifier. Layers can also be moved around or
hidden.
See differential page for tests files and demos.
Reviewed by: brecht, sybren
Differential Revision: https://developer.blender.org/D13603
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_constraint.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_ui/properties_constraint.py b/release/scripts/startup/bl_ui/properties_constraint.py index 570a437c213..fcac0af7e86 100644 --- a/release/scripts/startup/bl_ui/properties_constraint.py +++ b/release/scripts/startup/bl_ui/properties_constraint.py @@ -1161,6 +1161,11 @@ class ConstraintButtonsSubPanel: context, self.layout.template_cache_file_time_settings ) + def draw_transform_cache_layers(self, context): + self.draw_transform_cache_subpanel( + context, self.layout.template_cache_file_layers + ) + def draw_transform_cache_subpanel(self, context, template_func): con = self.get_constraint(context) if con.cache_file is None: @@ -1574,6 +1579,22 @@ class BONE_PT_bTransformCacheConstraint_velocity(BoneConstraintPanel, Constraint self.draw_transform_cache_velocity(context) +class OBJECT_PT_bTransformCacheConstraint_layers(ObjectConstraintPanel, ConstraintButtonsSubPanel, Panel): + bl_parent_id = "OBJECT_PT_bTransformCacheConstraint" + bl_label = "Override Layers" + + def draw(self, context): + self.draw_transform_cache_layers(context) + + +class BONE_PT_bTransformCacheConstraint_layers(BoneConstraintPanel, ConstraintButtonsSubPanel, Panel): + bl_parent_id = "BONE_PT_bTransformCacheConstraint" + bl_label = "Override Layers" + + def draw(self, context): + self.draw_transform_cache_layers(context) + + class OBJECT_PT_bTransformCacheConstraint_procedural(ObjectConstraintPanel, ConstraintButtonsSubPanel, Panel): bl_parent_id = "OBJECT_PT_bTransformCacheConstraint" bl_label = "Render Procedural" @@ -1695,6 +1716,7 @@ classes = ( OBJECT_PT_bTransformCacheConstraint_time, OBJECT_PT_bTransformCacheConstraint_procedural, OBJECT_PT_bTransformCacheConstraint_velocity, + OBJECT_PT_bTransformCacheConstraint_layers, OBJECT_PT_bPythonConstraint, OBJECT_PT_bArmatureConstraint, OBJECT_PT_bArmatureConstraint_bones, @@ -1735,6 +1757,7 @@ classes = ( BONE_PT_bTransformCacheConstraint_time, BONE_PT_bTransformCacheConstraint_procedural, BONE_PT_bTransformCacheConstraint_velocity, + BONE_PT_bTransformCacheConstraint_layers, BONE_PT_bPythonConstraint, BONE_PT_bArmatureConstraint, BONE_PT_bArmatureConstraint_bones, |