Skip to content

Commit

Permalink
Merge pull request #138 from mbrainerd/request-1818
Browse files Browse the repository at this point in the history
#1818: Collate templates from old shows.
  • Loading branch information
garvitverma authored Jul 5, 2019
2 parents 9cede6f + 5ca1fda commit 2251bdf
Show file tree
Hide file tree
Showing 2 changed files with 112 additions and 22 deletions.
92 changes: 76 additions & 16 deletions core/templates/ingest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,22 @@ keys:
edit_types:
- lower_case

instanceName:
type: str
alias: name
filter_by: '^[a-zA-Z0-9](\w+)?[a-zA-Z0-9]$'

vendorAssetType:
type: str
filter_by: '^([A-Za-z0-9]+)$'

deep.type:
type: str
choices:
deepimg: deepimg
deepshad: deepshad
default: deepshad

# removed duplicate cdl keys, moved to templates.yml

ingestCdlName:
Expand Down Expand Up @@ -110,6 +126,12 @@ paths:
ingest_sequence_area_cdl: '@ingest_sequence_area/SCRIPTS/nuke/{ingestCdlName}s/{ingestCdlName}_v{ingestVersion}'
ingest_project_area_cdl: '@ingest_project_area/SCRIPTS/nuke/{ingestCdlName}s/{ingestCdlName}_v{ingestVersion}'

# deep image paths
# TODO: Remove the _exr context_type hardcoding?
ingest_shot_area_deep_image: '@ingest_shot_area/IMG/{vendorStep}_{deep.type}/{ingestShot}_{name}_exr_v{ingestVersion}.{subcontext}'
ingest_sequence_area_deep_image: '@ingest_sequence_area/IMG/{vendorStep}_{deep.type}/{ingestSequence}_{name}_exr_v{ingestVersion}.{subcontext}'
ingest_project_area_deep_image: '@ingest_project_area/IMG/{vendorStep}_{deep.type}/{name}_exr_v{ingestVersion}.{subcontext}'

# image paths
ingest_shot_area_image: '@ingest_shot_area/IMG/{vendorStep}/{ingestShot}_{name}_v{ingestVersion}.{subcontext}'
ingest_sequence_area_image: '@ingest_sequence_area/IMG/{vendorStep}/{ingestSequence}_{name}_v{ingestVersion}.{subcontext}'
Expand All @@ -124,6 +146,11 @@ paths:
ingest_sequence_render: '@ingest_sequence_area_image/@ingest_sequence_input_name.{SEQ}.{ingestImgExtension}'
ingest_project_render: '@ingest_project_area_image/@ingest_project_input_name.{SEQ}.{ingestImgExtension}'

# Deep image inputs
ingest_shot_deep_render: '@ingest_shot_area_deep_image/@ingest_shot_input_name.{SEQ}.{ingestImgExtension}'
ingest_sequence_deep_render: '@ingest_sequence_area_deep_image/@ingest_sequence_input_name.{SEQ}.{ingestImgExtension}'
ingest_project_deep_render: '@ingest_project_area_deep_image/@ingest_project_input_name.{SEQ}.{ingestImgExtension}'

# parsing asset maya files
ingest_shot_asset_scene: '@ingest_shot_asset_area_scene/@ingest_shot_asset_input_name.{maya.ext}'
ingest_sequence_asset_scene: '@ingest_sequence_asset_area_scene/@ingest_sequence_asset_input_name.{maya.ext}'
Expand Down Expand Up @@ -155,14 +182,19 @@ paths:
ingest_sequence_output_render: '@sequence_publish_area_image/{snapshot_type}/@image_subdirs/@ingest_sequence_output_name.{SEQ}.{img.ext}'
ingest_shot_output_render: '@shot_publish_area_image/{snapshot_type}/@image_subdirs/@ingest_shot_output_name.{SEQ}.{img.ext}'

# DEEP RENDERS
ingest_project_output_deep_render: '@project_publish_area_image/{snapshot_type}/@ingest_deep_subdirs/@ingest_project_output_name.{SEQ}.{img.ext}'
ingest_sequence_output_deep_render: '@sequence_publish_area_image/{snapshot_type}/@ingest_deep_subdirs/@ingest_sequence_output_name.{SEQ}.{img.ext}'
ingest_shot_output_deep_render: '@shot_publish_area_image/{snapshot_type}/@ingest_deep_subdirs/@ingest_shot_output_name.{SEQ}.{img.ext}'

# TEXTURES
ingest_project_publish_texture: '@project_publish_area_texture/{snapshot_type}/@texture_subdirs/@ingest_project_output_name[.{UDIM}].{tex.ext}'
ingest_sequence_publish_texture: '@sequence_publish_area_texture/{snapshot_type}/@texture_subdirs/@ingest_sequence_output_name[.{UDIM}].{tex.ext}'
ingest_shot_publish_texture: '@shot_publish_area_texture/{snapshot_type}/@texture_subdirs/@ingest_shot_output_name[.{UDIM}].{tex.ext}'
ingest_project_publish_texture: '@project_publish_area_texture/{snapshot_type}/@texture_subdirs/@ingest_project_output_name[.{UDIM}].{tex.ext}'
ingest_sequence_publish_texture: '@sequence_publish_area_texture/{snapshot_type}/@texture_subdirs/@ingest_sequence_output_name[.{UDIM}].{tex.ext}'
ingest_shot_publish_texture: '@shot_publish_area_texture/{snapshot_type}/@texture_subdirs/@ingest_shot_output_name[.{UDIM}].{tex.ext}'

ingest_project_asset_publish_texture: '@project_asset_publish_area_texture/{snapshot_type}/@texture_subdirs/@ingest_project_asset_output_name[.{UDIM}].{tex.ext}'
ingest_sequence_asset_publish_texture: '@sequence_asset_publish_area_texture/{snapshot_type}/@texture_subdirs/@ingest_sequence_asset_output_name[.{UDIM}].{tex.ext}'
ingest_shot_asset_publish_texture: '@shot_asset_publish_area_texture/{snapshot_type}/@texture_subdirs/@ingest_shot_asset_output_name[.{UDIM}].{tex.ext}'
ingest_project_asset_publish_texture: '@project_asset_publish_area_texture/{snapshot_type}/@texture_subdirs/@ingest_project_asset_output_name[.{UDIM}].{tex.ext}'
ingest_sequence_asset_publish_texture: '@sequence_asset_publish_area_texture/{snapshot_type}/@texture_subdirs/@ingest_sequence_asset_output_name[.{UDIM}].{tex.ext}'
ingest_shot_asset_publish_texture: '@shot_asset_publish_area_texture/{snapshot_type}/@texture_subdirs/@ingest_shot_asset_output_name[.{UDIM}].{tex.ext}'

# PROXIES
project_proxy_image: '@project_publish_area_image/{snapshot_type}/@proxy_subdirs/@ingest_project_output_name.{SEQ}.{img.ext}'
Expand All @@ -185,19 +217,51 @@ paths:
ingest_shot_output_cache: '@shot_publish_area_anim/{snapshot_type}/@ingest_shot_output_name.{geo.ext}'

# ABC
ingest_project_output_abc: '@project_publish_area_anim/{snapshot_type}/v{version}/@ingest_project_output_name.abc'
ingest_sequence_output_abc: '@sequence_publish_area_anim/{snapshot_type}/v{version}/@ingest_sequence_output_name.abc'
ingest_shot_output_abc: '@shot_publish_area_anim/{snapshot_type}/v{version}/@ingest_shot_output_name.abc'
ingest_project_output_abc: '@project_publish_area_anim/{snapshot_type}/v{version}/@ingest_project_output_name.abc'
ingest_sequence_output_abc: '@sequence_publish_area_anim/{snapshot_type}/v{version}/@ingest_sequence_output_name.abc'
ingest_shot_output_abc: '@shot_publish_area_anim/{snapshot_type}/v{version}/@ingest_shot_output_name.abc'

ingest_project_asset_output_abc: '@project_asset_publish_area_scene/{snapshot_type}/@ingest_project_asset_output_name.abc'
ingest_sequence_asset_output_abc: '@sequence_asset_publish_area_scene/{snapshot_type}/@ingest_sequence_asset_output_name.abc'
ingest_shot_asset_output_abc: '@shot_asset_publish_area_scene/{snapshot_type}/@ingest_shot_asset_output_name.abc'

# YRT/2940/SHARED/ANIM/char/captainmarvel_body1/alembic_cache/md/integ/yrt2940_out_v001.abc
# YRT/2940/SHARED/ANIM/char/captainmarvel_body1/alembic_cache/md/integ/yrt2940_alembic_v001.mb

# Shotmodel
ingest_shot_area_shotmodel: '@ingest_shot_area/SHOTMODEL/{vendorAssetType}/{instanceName}/{snapshot_type}/{subcontext}/{vendorDepartment}'
ingest_shot_input_scene_shotmodel: '@ingest_shot_area_shotmodel/@ingest_shot_input_name_scene_shotmodel.{maya.ext}'
ingest_shot_input_abc_shotmodel: '@ingest_shot_area_shotmodel/@ingest_shot_input_name_scene_shotmodel.abc'

# Integ

# ORG/6300/SHARED/MODEL/integ/trkgeo/plate/obj_v005/oilrig_derrickc_vendor_lo_v003.obj
# ORG/6300/SHARED/MODEL/integ/trkgeo/plate/obj_v005/WenchBobby_trkGeo_v01.obj
ingest_shot_integ_bundle: '@ingest_shot_area/MODEL/integ/trkgeo/{subcontext}/obj_v{version}'
ingest_shot_integ_bundle_obj: '@ingest_shot_integ_bundle/{name}_v{ingestVersion}.{geo.ext}'

ingest_shot_area_integ: '@ingest_shot_area/ANIM/{vendorDepartment}/vendor/{vendorDepartment}/{snapshot_type}/{instanceName}_{subcontext}_v{version}'
ingest_shot_input_scene_integ: '@ingest_shot_area_integ/@ingest_shot_input_name_scene_integ.{maya.ext}'
ingest_shot_input_abc_integ: '@ingest_shot_area_integ/@ingest_shot_input_name_scene_integ.abc'

ingest_shot_area_mm: '@ingest_folder/{ingestSequence}/{Shot}/SHARED/ANIM/{vendorAssetType}/{instanceName}/{snapshot_type}/{subcontext}/{vendorDepartment}'
ingest_shot_input_scene_mm: '@ingest_shot_area_mm/@ingest_shot_input_name_scene_mm.{maya.ext}'
ingest_shot_input_cache_mm: '@ingest_shot_area_mm/@ingest_shot_input_name_scene_mm.abc'

ingest_project_asset_output_abc: '@project_asset_publish_area_scene/{snapshot_type}/@ingest_project_asset_output_name.abc'
ingest_sequence_asset_output_abc: '@sequence_asset_publish_area_scene/{snapshot_type}/@ingest_sequence_asset_output_name.abc'
ingest_shot_asset_output_abc: '@shot_asset_publish_area_scene/{snapshot_type}/@ingest_shot_asset_output_name.abc'

strings:

ingest_deep_subdirs: '{name}/v{version}/{deep.type}/{width}x{height}'

# strings for input names
ingest_shot_input_name: '{ingestShot}_{name}_v{ingestVersion}'
ingest_sequence_input_name: '{ingestSequence}_{name}_v{ingestVersion}'
ingest_project_input_name: '{ingestStep}_{name}_v{ingestVersion}'
# strings for integ
ingest_shot_input_name_scene_integ: '{ingestShot}_{instanceName}_v{version}'
ingest_shot_input_name_scene_mm: '{ingestShot}_{node}_v{version}'
# strings for shotmodel
ingest_shot_input_name_scene_shotmodel: '{ingestShot}_{node}_v{version}'

# strings for annotation names
ingest_shot_annotation_name: '{ingestShot}_{ingestStep}_{name}_v{ingestVersion}.annotation'
Expand Down Expand Up @@ -247,10 +311,6 @@ strings:
ingest_sequence_script: '@ingest_sequence_input_name.nk'
ingest_project_script: '@ingest_project_input_name.nk'

ingest_shot_cache: '@ingest_shot_input_name.{geo.ext}'
ingest_sequence_cache: '@ingest_sequence_input_name.{geo.ext}'
ingest_project_cache: '@ingest_project_input_name.{geo.ext}'

ingest_shot_movie: '@ingest_shot_input_name.mov'
ingest_sequence_movie: '@ingest_sequence_input_name.mov'
ingest_project_movie: '@ingest_project_input_name.mov'
42 changes: 36 additions & 6 deletions hooks/tk-multi-publish2/ingest/collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
"role supervisor": "annotation",
}

# Default snapshot_type
DEFAULT_SNAPSHOT_TYPE = "ingest"

# This is a dictionary of note_type values to their access keys in the fields dict.
DEFAULT_NOTE_TYPES_ACCESS_KEYS = {
"kickoff": ["sg_version", "name"],
Expand Down Expand Up @@ -89,7 +92,7 @@ def settings_schema(self):
"type": "str",
"description": "Specifies the default snapshot type to be used for an ingested item.",
"allows_empty": True,
"default_value": "ingest",
"default_value": DEFAULT_SNAPSHOT_TYPE,
}
items_schema["default_fields"] = {
"type": dict,
Expand Down Expand Up @@ -205,16 +208,17 @@ def _add_file_item(self, settings, parent_item, path, is_sequence=False, seq_fil
ignored_filename = settings["Ignore Filename"].value

file_components = publisher.util.get_file_path_components(path)
file_ignored = False
extension_ignored = False
filename_ignored = False

if file_components["extension"] in ignored_extensions:
file_ignored = True
extension_ignored = True

if ignored_filename:
file_ignored = any(re.match(ignored_string, file_components["filename"])
for ignored_string in ignored_filename)
filename_ignored = any(re.match(ignored_string, file_components["filename"])
for ignored_string in ignored_filename)

if file_ignored:
if extension_ignored or filename_ignored:

if is_sequence:
# include an indicator that this is an image sequence and the known
Expand Down Expand Up @@ -356,6 +360,32 @@ def process_file(self, settings, parent_item, path):

return file_items

def _get_item_type_info(self, settings, item_type):
"""
Return the dictionary corresponding to this item's 'Item Types' settings.
:param dict settings: Configured settings for this collector
:param item_type: The type of Item to identify info for
:return: A dictionary of information about the item to create::
# item_type = "file.image.sequence"
{
"extensions": ["jpeg", "jpg", "png"],
"type_display": "Rendered Image Sequence",
"icon_path": "/path/to/some/icons/folder/image_sequence.png",
"work_path_template": "some_template_name"
}
"""
item_info = super(IngestCollectorPlugin, self)._get_item_type_info(settings, item_type)

item_info.setdefault("default_snapshot_type", DEFAULT_SNAPSHOT_TYPE)
item_info.setdefault("default_fields", dict())

# everything should now be populated, so return the dictionary
return item_info

def _resolve_item_fields(self, settings, item):
"""
Populates the item's defaults that are to be stored on an ingested item.
Expand Down

0 comments on commit 2251bdf

Please sign in to comment.