Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Settings: settings for plugins #1819

Merged
merged 8 commits into from
Jul 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Optional:
presets -> extensions (
example of use:
[".mov", ".mp4"]
["mov", "mp4"]
)
presets -> source_dir (
example of use:
Expand All @@ -11,6 +11,7 @@
"{root[work]}/{project[name]}/inputs"
"./input"
"../input"
""
)
"""

Expand Down Expand Up @@ -48,7 +49,7 @@ class CollectEditorial(pyblish.api.InstancePlugin):
actions = []

# presets
extensions = [".mov", ".mp4"]
extensions = ["mov", "mp4"]
source_dir = None

def process(self, instance):
Expand All @@ -72,7 +73,7 @@ def process(self, instance):
video_path = None
basename = os.path.splitext(os.path.basename(file_path))[0]

if self.source_dir:
if self.source_dir != "":
source_dir = self.source_dir.replace("\\", "/")
if ("./" in source_dir) or ("../" in source_dir):
# get current working dir
Expand All @@ -98,7 +99,7 @@ def process(self, instance):
if os.path.splitext(f)[0] not in basename:
continue
# filter out by respected extensions
if os.path.splitext(f)[1] not in self.extensions:
if os.path.splitext(f)[1][1:] not in self.extensions:
continue
video_path = os.path.join(
staging_dir, f
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,12 @@ class CollectInstances(pyblish.api.InstancePlugin):
"referenceMain": {
"family": "review",
"families": ["clip"],
"extensions": [".mp4"]
"extensions": ["mp4"]
},
"audioMain": {
"family": "audio",
"families": ["clip"],
"extensions": [".wav"],
},
"shotMain": {
"family": "shot",
"families": []
"extensions": ["wav"],
}
}
timeline_frame_start = 900000 # starndard edl default (10:00:00:00)
Expand Down Expand Up @@ -178,7 +174,16 @@ def process(self, instance):
data_key: instance.data.get(data_key)})

# adding subsets to context as instances
self.subsets.update({
"shotMain": {
"family": "shot",
"families": []
}
})
for subset, properities in self.subsets.items():
if properities["version"] == 0:
properities.pop("version")

# adding Review-able instance
subset_instance_data = instance_data.copy()
subset_instance_data.update(properities)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,19 +177,23 @@ def create_representations(
collection_head_name = None
# loop trough collections and create representations
for _collection in collections:
ext = _collection.tail
ext = _collection.tail[1:]
collection_head_name = _collection.head
frame_start = list(_collection.indexes)[0]
frame_end = list(_collection.indexes)[-1]
repre_data = {
"frameStart": frame_start,
"frameEnd": frame_end,
"name": ext[1:],
"ext": ext[1:],
"name": ext,
"ext": ext,
"files": [item for item in _collection],
"stagingDir": staging_dir
}

if instance_data.get("keepSequence"):
repre_data_keep = deepcopy(repre_data)
instance_data["representations"].append(repre_data_keep)

if "review" in instance_data["families"]:
repre_data.update({
"thumbnail": True,
Expand All @@ -208,20 +212,20 @@ def create_representations(

# loop trough reminders and create representations
for _reminding_file in remainder:
ext = os.path.splitext(_reminding_file)[-1]
ext = os.path.splitext(_reminding_file)[-1][1:]
if ext not in instance_data["extensions"]:
continue
if collection_head_name and (
(collection_head_name + ext[1:]) not in _reminding_file
) and (ext in [".mp4", ".mov"]):
(collection_head_name + ext) not in _reminding_file
) and (ext in ["mp4", "mov"]):
self.log.info(f"Skipping file: {_reminding_file}")
continue
frame_start = 1
frame_end = 1

repre_data = {
"name": ext[1:],
"ext": ext[1:],
"name": ext,
"ext": ext,
"files": _reminding_file,
"stagingDir": staging_dir
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,20 +131,21 @@ def create_hierarchy(self, instance):
tasks_to_add = dict()
project_tasks = io.find_one({"type": "project"})["config"]["tasks"]
for task_name, task_data in self.shot_add_tasks.items():
try:
if task_data["type"] in project_tasks.keys():
tasks_to_add.update({task_name: task_data})
else:
raise KeyError(
"Wrong FtrackTaskType `{}` for `{}` is not"
" existing in `{}``".format(
task_data["type"],
task_name,
list(project_tasks.keys())))
except KeyError as error:
_task_data = deepcopy(task_data)

# fixing enumerator from settings
_task_data["type"] = task_data["type"][0]

# check if task type in project task types
if _task_data["type"] in project_tasks.keys():
tasks_to_add.update({task_name: _task_data})
else:
raise KeyError(
"Wrong presets: `{0}`".format(error)
)
"Wrong FtrackTaskType `{}` for `{}` is not"
" existing in `{}``".format(
_task_data["type"],
task_name,
list(project_tasks.keys())))

instance.data["tasks"] = tasks_to_add
else:
Expand Down
6 changes: 6 additions & 0 deletions openpype/settings/defaults/project_settings/global.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@
"deadline_group": "",
"deadline_chunk_size": 1,
"deadline_priority": 50,
"publishing_script": "",
"skip_integration_repre_list": [],
"aov_filter": {
"maya": [
".+(?:\\.|_)([Bb]eauty)(?:\\.|_).*"
Expand All @@ -184,6 +186,10 @@
".*"
]
}
},
"CleanUp": {
"paterns": [],
"remove_temp_renders": false
}
},
"tools": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,58 @@
],
"output": []
}
},
"CollectEditorial": {
"source_dir": "",
"extensions": [
"mov",
"mp4"
]
},
"CollectHierarchyInstance": {
"shot_rename_template": "{project[code]}_{_sequence_}_{_shot_}",
"shot_rename_search_patterns": {
"_sequence_": "(\\d{4})(?=_\\d{4})",
"_shot_": "(\\d{4})(?!_\\d{4})"
},
"shot_add_hierarchy": {
"parents_path": "{project}/{folder}/{sequence}",
"parents": {
"project": "{project[name]}",
"sequence": "{_sequence_}",
"folder": "shots"
}
},
"shot_add_tasks": {}
},
"shot_add_tasks": {
"custom_start_frame": 0,
"timeline_frame_start": 900000,
"timeline_frame_offset": 0,
"subsets": {
"referenceMain": {
"family": "review",
"families": [
"clip"
],
"extensions": [
"mp4"
],
"version": 0,
"keepSequence": false
},
"audioMain": {
"family": "audio",
"families": [
"clip"
],
"extensions": [
"wav"
],
"version": 0,
"keepSequence": false
}
}
}
}
}
3 changes: 2 additions & 1 deletion openpype/settings/entities/enum_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ def _item_initalization(self):
"photoshop",
"resolve",
"tvpaint",
"unreal"
"unreal",
"standalonepublisher"
]
if self.use_empty_value:
host_names.insert(0, "")
Expand Down
Loading