Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: Product name and type #113

Merged
merged 68 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from 62 commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
139f048
added new product_name.py into create pipeline
iLLiCiTiT Feb 21, 2024
44b8035
use 'get_product_name' in core functionality
iLLiCiTiT Feb 21, 2024
6cff87d
CreateContext is using only product name and type
iLLiCiTiT Feb 21, 2024
3b2dc13
modified remaining base of create pipeline api to use product name an…
iLLiCiTiT Feb 21, 2024
88786d8
more usage of product type in create api
iLLiCiTiT Feb 21, 2024
993b761
use product type and name in rest of pipeline functions
iLLiCiTiT Feb 21, 2024
d7785ef
removed subset_name.py
iLLiCiTiT Feb 21, 2024
464fc4c
modified global plugins
iLLiCiTiT Feb 21, 2024
92d3efe
modified content of 'loadedVersions'
iLLiCiTiT Feb 21, 2024
9a6db4d
unreal is using product type and name
iLLiCiTiT Feb 22, 2024
b286e31
tvpaint is using product name and type
iLLiCiTiT Feb 22, 2024
ba47f6d
traypublisher is using product name and type
iLLiCiTiT Feb 22, 2024
f996037
substance painter is using product name and type
iLLiCiTiT Feb 22, 2024
99db531
photoshop is using product type and name
iLLiCiTiT Feb 22, 2024
190baf8
removed unused deprecated functions from nuke
iLLiCiTiT Feb 22, 2024
dd05368
maya is using product name and type
iLLiCiTiT Feb 22, 2024
23dbf74
max is using product name and types
iLLiCiTiT Feb 22, 2024
9d72a7b
houdini is using product name and type
iLLiCiTiT Feb 22, 2024
cf0ac31
harmony is using product name and type
iLLiCiTiT Feb 22, 2024
800249d
fusion is using product name and type
iLLiCiTiT Feb 23, 2024
8f03290
flame is using product name and type
iLLiCiTiT Feb 23, 2024
d19a9cc
celaction is using product name and type
iLLiCiTiT Feb 23, 2024
36129a1
blender is using product name and type
iLLiCiTiT Feb 23, 2024
7ca9d35
remove deprecated pre collect plugin
iLLiCiTiT Feb 23, 2024
1c1758e
aftereffects using product name and type
iLLiCiTiT Feb 23, 2024
dda7e97
Merge branch 'develop' into enhancement/OP-8264_Use-productName-n-pro…
iLLiCiTiT Feb 23, 2024
00436cf
nuke is using product name and type
iLLiCiTiT Feb 23, 2024
b7732db
resolve is using product name and type
iLLiCiTiT Feb 23, 2024
adf5318
add product_type to json in layout extraction
iLLiCiTiT Feb 23, 2024
b21d758
hiero is using product name and type
iLLiCiTiT Feb 23, 2024
8549588
change constants and do smaller fixes
iLLiCiTiT Feb 23, 2024
2ac1acb
loader is using product name and type
iLLiCiTiT Feb 23, 2024
4974c49
push to project is using product name and type
iLLiCiTiT Feb 23, 2024
1089f6e
creator tool is using product name and type
iLLiCiTiT Feb 23, 2024
08840e1
sceneinventory is using product name and type
iLLiCiTiT Feb 23, 2024
88bac81
subsetmanager using product naming
iLLiCiTiT Feb 23, 2024
14ed27e
texture copy using product name and type
iLLiCiTiT Feb 23, 2024
01720eb
workfiles tool is using product name and type
iLLiCiTiT Feb 23, 2024
2fbec7c
modify style
iLLiCiTiT Feb 23, 2024
7813be2
publisher using product name and type
iLLiCiTiT Feb 23, 2024
591819b
deadline using product name and type
iLLiCiTiT Feb 23, 2024
bd50593
royalrender using product name and type
iLLiCiTiT Feb 23, 2024
d327509
fix kwarg name
iLLiCiTiT Feb 23, 2024
4a7bc9a
'prepare_template_data' supports subdict values
iLLiCiTiT Feb 23, 2024
3afa0e3
fill both 'family' and 'productType'
iLLiCiTiT Feb 23, 2024
60ae47c
Merge branch 'develop' into enhancement/OP-8264_Use-productName-n-pro…
iLLiCiTiT Feb 23, 2024
f5e5b7a
Refactor get_write_node_template_attr function
jakubjezek001 Feb 23, 2024
ab7857f
use 'AYONProductName' to store 'productName' in houdini
iLLiCiTiT Feb 23, 2024
197279b
fix a typo
MustafaJafar Feb 23, 2024
22d3365
fix bug with using new parameter AYONproductName
MustafaJafar Feb 23, 2024
3573bd6
Merge pull request #115 from ynput/enhancement/OP-8264_Use-productNam…
iLLiCiTiT Feb 23, 2024
ea5acd0
fix change of product name in houdini
iLLiCiTiT Feb 23, 2024
6d56657
fix 'self.get_product_name' calls
iLLiCiTiT Feb 26, 2024
ad5b8ce
removed deprecated import
iLLiCiTiT Feb 26, 2024
c03bc9b
use product naming in workfile template builder
iLLiCiTiT Feb 26, 2024
cb4cf9d
more product naming
iLLiCiTiT Feb 26, 2024
f207c39
Refactor tag data handling for backward compatibility.
jakubjezek001 Feb 26, 2024
973aff1
fix 'prouctName' to 'productName'
iLLiCiTiT Feb 26, 2024
7888d2e
Add itertools import, update data handling, and handle backward compa…
jakubjezek001 Feb 26, 2024
8dd9d25
fix 'get_product_name' in blender workfile creator
iLLiCiTiT Feb 26, 2024
23858a8
remove "family" from json and modify layout loader to expect product …
iLLiCiTiT Feb 26, 2024
4fc80a2
remo unused '_id' from json
iLLiCiTiT Feb 27, 2024
c80e8fc
change order of arguments in 'get_product_name'
iLLiCiTiT Feb 27, 2024
4e2ae40
change 'get_dynamic_data' arguments to be same as in 'get_product_name'
iLLiCiTiT Feb 27, 2024
c4948f7
remove 'Return' from cache method docstrings
iLLiCiTiT Feb 27, 2024
80a02e4
Merge branch 'develop' into enhancement/OP-8264_Use-productName-n-pro…
iLLiCiTiT Feb 27, 2024
6c945b7
Merge branch 'develop' into enhancement/OP-8264_Use-productName-n-pro…
iLLiCiTiT Feb 28, 2024
d85b4ee
change AYON prefix in houdini
iLLiCiTiT Feb 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
71 changes: 40 additions & 31 deletions client/ayon_core/hosts/aftereffects/plugins/create/create_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from ayon_core.hosts.aftereffects.api.pipeline import cache_and_get_instances
from ayon_core.hosts.aftereffects.api.lib import set_settings
from ayon_core.lib import prepare_template_data
from ayon_core.pipeline.create import SUBSET_NAME_ALLOWED_SYMBOLS
from ayon_core.pipeline.create import PRODUCT_NAME_ALLOWED_SYMBOLS


class RenderCreator(Creator):
Expand All @@ -22,7 +22,7 @@ class RenderCreator(Creator):
"""
identifier = "render"
label = "Render"
family = "render"
product_type = "render"
description = "Render creator"

create_allow_context_change = True
Expand All @@ -31,7 +31,7 @@ class RenderCreator(Creator):
mark_for_review = True
force_setting_values = True

def create(self, subset_name_from_ui, data, pre_create_data):
def create(self, product_name, data, pre_create_data):
stub = api.get_stub() # only after After Effects is up

try:
Expand All @@ -58,33 +58,37 @@ def create(self, subset_name_from_ui, data, pre_create_data):
len(comps) > 1)
for comp in comps:
composition_name = re.sub(
"[^{}]+".format(SUBSET_NAME_ALLOWED_SYMBOLS),
"[^{}]+".format(PRODUCT_NAME_ALLOWED_SYMBOLS),
"",
comp.name
)
if use_composition_name:
if "{composition}" not in subset_name_from_ui.lower():
subset_name_from_ui += "{Composition}"
if "{composition}" not in product_name.lower():
product_name += "{Composition}"

dynamic_fill = prepare_template_data({"composition":
composition_name})
subset_name = subset_name_from_ui.format(**dynamic_fill)
comp_product_name = product_name.format(**dynamic_fill)
data["composition_name"] = composition_name
else:
subset_name = subset_name_from_ui
subset_name = re.sub(r"\{composition\}", '', subset_name,
flags=re.IGNORECASE)
comp_product_name = re.sub(
r"\{composition\}",
"",
product_name,
flags=re.IGNORECASE
)

for inst in self.create_context.instances:
if subset_name == inst.subset_name:
if comp_product_name == inst.product_name:
raise CreatorError("{} already exists".format(
inst.subset_name))
inst.product_name))

data["members"] = [comp.id]
data["orig_comp_name"] = composition_name

new_instance = CreatedInstance(self.family, subset_name, data,
self)
new_instance = CreatedInstance(
self.product_type, comp_product_name, data, self
)
if "farm" in pre_create_data:
use_farm = pre_create_data["farm"]
new_instance.creator_attributes["farm"] = use_farm
Expand All @@ -96,7 +100,7 @@ def create(self, subset_name_from_ui, data, pre_create_data):
new_instance.data_to_store())
self._add_instance_to_context(new_instance)

stub.rename_item(comp.id, subset_name)
stub.rename_item(comp.id, comp_product_name)
if self.force_setting_values:
set_settings(True, True, [comp.id], print_msg=False)

Expand All @@ -107,7 +111,7 @@ def get_pre_create_attr_defs(self):
"selected by default.",
default=True, label="Use selection"),
BoolDef("use_composition_name",
label="Use composition name in subset"),
label="Use composition name in product"),
UISeparatorDef(),
BoolDef("farm", label="Render on farm"),
BoolDef(
Expand All @@ -133,9 +137,14 @@ def get_icon(self):

def collect_instances(self):
for instance_data in cache_and_get_instances(self):
# legacy instances have family=='render' or 'renderLocal', use them
creator_id = (instance_data.get("creator_identifier") or
instance_data.get("family", '').replace("Local", ''))
# legacy instances have product_type=='render' or 'renderLocal', use them
creator_id = instance_data.get("creator_identifier")
if not creator_id:
# NOTE this is for backwards compatibility but probably can be
# removed
creator_id = instance_data.get("family", "")
creator_id = creator_id.replace("Local", "")

if creator_id == self.identifier:
instance_data = self._handle_legacy(instance_data)
instance = CreatedInstance.from_existing(
Expand All @@ -147,10 +156,10 @@ def update_instances(self, update_list):
for created_inst, _changes in update_list:
api.get_stub().imprint(created_inst.get("instance_id"),
created_inst.data_to_store())
subset_change = _changes.get("subset")
if subset_change:
name_change = _changes.get("productName")
if name_change:
api.get_stub().rename_item(created_inst.data["members"][0],
subset_change.new_value)
name_change.new_value)

def remove_instances(self, instances):
"""Removes metadata and renames to original comp name if available."""
Expand Down Expand Up @@ -183,15 +192,15 @@ def apply_settings(self, project_settings):
def get_detail_description(self):
return """Creator for Render instances

Main publishable item in AfterEffects will be of `render` family.
Main publishable item in AfterEffects will be of `render` product type.
Result of this item (instance) is picture sequence or video that could
be a final delivery product or loaded and used in another DCCs.

Select single composition and create instance of 'render' family or
turn off 'Use selection' to create instance for all compositions.
Select single composition and create instance of 'render' product type
or turn off 'Use selection' to create instance for all compositions.

'Use composition name in subset' allows to explicitly add composition
name into created subset name.
'Use composition name in product' allows to explicitly add composition
name into created product name.

Position of composition name could be set in
`project_settings/global/tools/creator/product_name_profiles` with
Expand All @@ -201,8 +210,8 @@ def get_detail_description(self):
be handled at same time.

If {composition} placeholder is not us 'product_name_profiles'
composition name will be capitalized and set at the end of subset name
if necessary.
composition name will be capitalized and set at the end of
product name if necessary.

If composition name should be used, it will be cleaned up of characters
that would cause an issue in published file names.
Expand Down Expand Up @@ -234,9 +243,9 @@ def _handle_legacy(self, instance_data):
instance_data["task"] = self.create_context.get_current_task_name()

if not instance_data.get("creator_attributes"):
is_old_farm = instance_data["family"] != "renderLocal"
is_old_farm = instance_data.get("family") != "renderLocal"
instance_data["creator_attributes"] = {"farm": is_old_farm}
instance_data["family"] = self.family
instance_data["productType"] = self.product_type

if instance_data["creator_attributes"].get("mark_for_review") is None:
instance_data["creator_attributes"]["mark_for_review"] = True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class AEWorkfileCreator(AutoCreator):
identifier = "workfile"
family = "workfile"
product_type = "workfile"

default_variant = "Main"

Expand All @@ -20,9 +20,9 @@ def collect_instances(self):
for instance_data in cache_and_get_instances(self):
creator_id = instance_data.get("creator_identifier")
if creator_id == self.identifier:
subset_name = instance_data["subset"]
product_name = instance_data["productName"]
instance = CreatedInstance(
self.family, subset_name, instance_data, self
self.product_type, product_name, instance_data, self
)
self._add_instance_to_context(instance)

Expand All @@ -33,7 +33,7 @@ def update_instances(self, update_list):
def create(self, options=None):
existing_instance = None
for instance in self.create_context.instances:
if instance.family == self.family:
if instance.product_type == self.product_type:
existing_instance = instance
break

Expand All @@ -49,7 +49,7 @@ def create(self, options=None):

if existing_instance is None:
asset_doc = get_asset_by_name(project_name, asset_name)
subset_name = self.get_subset_name(
product_name = self.get_product_name(
self.default_variant, task_name, asset_doc,
project_name, host_name
)
Expand All @@ -64,7 +64,7 @@ def create(self, options=None):
))

new_instance = CreatedInstance(
self.family, subset_name, data, self
self.product_type, product_name, data, self
)
self._add_instance_to_context(new_instance)

Expand All @@ -76,10 +76,10 @@ def create(self, options=None):
or existing_instance["task"] != task_name
):
asset_doc = get_asset_by_name(project_name, asset_name)
subset_name = self.get_subset_name(
product_name = self.get_product_name(
self.default_variant, task_name, asset_doc,
project_name, host_name
)
existing_instance["folderPath"] = asset_name
existing_instance["task"] = task_name
existing_instance["subset"] = subset_name
existing_instance["productName"] = product_name
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class BackgroundLoader(api.AfterEffectsLoader):
"""
Load images from Background family
Load images from Background product type
Creates for each background separate folder with all imported images
from background json AND automatically created composition with layers,
each layer for separate image.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ def get_instances(self, context):
if not inst.data.get("active", True):
continue

family = inst.data["family"]
if family not in ["render", "renderLocal"]: # legacy
product_type = inst.data["productType"]
if product_type not in ["render", "renderLocal"]: # legacy
continue

comp_id = int(inst.data["members"][0])
Expand All @@ -81,29 +81,32 @@ def get_instances(self, context):
fps = comp_info.frameRate
# TODO add resolution when supported by extension

task_name = inst.data.get("task") # legacy
task_name = inst.data.get("task")

render_q = CollectAERender.get_stub().get_render_info(comp_id)
if not render_q:
raise ValueError("No file extension set in Render Queue")
render_item = render_q[0]

product_type = "render"
instance_families = inst.data.get("families", [])
subset_name = inst.data["subset"]
instance_families.append(product_type)
product_name = inst.data["productName"]
instance = AERenderInstance(
family="render",
productType=product_type,
family=product_type,
families=instance_families,
version=version,
time="",
source=current_file,
label="{} - {}".format(subset_name, family),
subset=subset_name,
label="{} - {}".format(product_name, product_type),
productName=product_name,
folderPath=inst.data["folderPath"],
task=task_name,
attachTo=False,
setMembers='',
publish=True,
name=subset_name,
name=product_name,
resolutionWidth=render_item.width,
resolutionHeight=render_item.height,
pixelAspect=1,
Expand Down Expand Up @@ -176,7 +179,7 @@ def get_expected_files(self, render_instance):
if "#" not in file_name: # single frame (mov)W
path = os.path.join(base_dir, "{}_{}_{}.{}".format(
render_instance.folderPath,
render_instance.subset,
render_instance.productName,
version_str,
ext
))
Expand All @@ -185,7 +188,7 @@ def get_expected_files(self, render_instance):
for frame in range(start, end + 1):
path = os.path.join(base_dir, "{}_{}_{}.{}.{}".format(
render_instance.folderPath,
render_instance.subset,
render_instance.productName,
version_str,
str(frame).zfill(self.padding_width),
ext
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
None

Provides:
instance -> family ("review")
instance -> families ("review")
"""
import pyblish.api

Expand Down
Loading