mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Merge pull request #166 from BigRoy/enhancement/blender_extract_blend_compress
Blender: Implement 'compress' settings extract blend
This commit is contained in:
commit
63cd0ef6cc
4 changed files with 24 additions and 7 deletions
|
|
@ -13,6 +13,9 @@ class ExtractBlend(publish.Extractor, publish.OptionalPyblishPluginMixin):
|
|||
families = ["model", "camera", "rig", "action", "layout", "blendScene"]
|
||||
optional = True
|
||||
|
||||
# From settings
|
||||
compress = False
|
||||
|
||||
def process(self, instance):
|
||||
if not self.is_active(instance.data):
|
||||
return
|
||||
|
|
@ -53,7 +56,7 @@ class ExtractBlend(publish.Extractor, publish.OptionalPyblishPluginMixin):
|
|||
if node.image and node.image.packed_file is None:
|
||||
node.image.pack()
|
||||
|
||||
bpy.data.libraries.write(filepath, data_blocks)
|
||||
bpy.data.libraries.write(filepath, data_blocks, compress=self.compress)
|
||||
|
||||
if "representations" not in instance.data:
|
||||
instance.data["representations"] = []
|
||||
|
|
|
|||
|
|
@ -16,6 +16,9 @@ class ExtractBlendAnimation(
|
|||
families = ["animation"]
|
||||
optional = True
|
||||
|
||||
# From settings
|
||||
compress = False
|
||||
|
||||
def process(self, instance):
|
||||
if not self.is_active(instance.data):
|
||||
return
|
||||
|
|
@ -46,7 +49,7 @@ class ExtractBlendAnimation(
|
|||
data_blocks.add(child.animation_data.action)
|
||||
data_blocks.add(obj)
|
||||
|
||||
bpy.data.libraries.write(filepath, data_blocks)
|
||||
bpy.data.libraries.write(filepath, data_blocks, compress=self.compress)
|
||||
|
||||
if "representations" not in instance.data:
|
||||
instance.data["representations"] = []
|
||||
|
|
|
|||
|
|
@ -44,6 +44,14 @@ class ExtractBlendModel(BaseSettingsModel):
|
|||
default_factory=list,
|
||||
title="Families"
|
||||
)
|
||||
compress: bool = SettingsField(True, title="Compress")
|
||||
|
||||
|
||||
class ExtractBlendAnimationModel(BaseSettingsModel):
|
||||
enabled: bool = SettingsField(True)
|
||||
optional: bool = SettingsField(title="Optional")
|
||||
active: bool = SettingsField(title="Active")
|
||||
compress: bool = SettingsField(False, title="Compress")
|
||||
|
||||
|
||||
class ExtractPlayblastModel(BaseSettingsModel):
|
||||
|
|
@ -51,6 +59,7 @@ class ExtractPlayblastModel(BaseSettingsModel):
|
|||
optional: bool = SettingsField(title="Optional")
|
||||
active: bool = SettingsField(title="Active")
|
||||
presets: str = SettingsField("", title="Presets", widget="textarea")
|
||||
compress: bool = SettingsField(False, title="Compress")
|
||||
|
||||
@validator("presets")
|
||||
def validate_json(cls, value):
|
||||
|
|
@ -110,8 +119,8 @@ class PublishPuginsModel(BaseSettingsModel):
|
|||
default_factory=ValidatePluginModel,
|
||||
title="Extract ABC"
|
||||
)
|
||||
ExtractBlendAnimation: ValidatePluginModel = SettingsField(
|
||||
default_factory=ValidatePluginModel,
|
||||
ExtractBlendAnimation: ExtractBlendAnimationModel = SettingsField(
|
||||
default_factory=ExtractBlendAnimationModel,
|
||||
title="Extract Blend Animation"
|
||||
)
|
||||
ExtractAnimationFBX: ValidatePluginModel = SettingsField(
|
||||
|
|
@ -198,7 +207,8 @@ DEFAULT_BLENDER_PUBLISH_SETTINGS = {
|
|||
"action",
|
||||
"layout",
|
||||
"blendScene"
|
||||
]
|
||||
],
|
||||
"compress": False
|
||||
},
|
||||
"ExtractFBX": {
|
||||
"enabled": False,
|
||||
|
|
@ -213,7 +223,8 @@ DEFAULT_BLENDER_PUBLISH_SETTINGS = {
|
|||
"ExtractBlendAnimation": {
|
||||
"enabled": True,
|
||||
"optional": True,
|
||||
"active": True
|
||||
"active": True,
|
||||
"compress": False
|
||||
},
|
||||
"ExtractAnimationFBX": {
|
||||
"enabled": False,
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
__version__ = "0.1.6"
|
||||
__version__ = "0.1.7"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue