diff --git a/openpype/hosts/flame/api/lib.py b/openpype/hosts/flame/api/lib.py index bbb7c38119c..74d9e7607af 100644 --- a/openpype/hosts/flame/api/lib.py +++ b/openpype/hosts/flame/api/lib.py @@ -527,6 +527,7 @@ def get_segment_attributes(segment): # Add timeline segment to tree clip_data = { + "shot_name": segment.shot_name.get_value(), "segment_name": segment.name.get_value(), "segment_comment": segment.comment.get_value(), "tape_name": segment.tape_name, diff --git a/openpype/hosts/flame/api/plugin.py b/openpype/hosts/flame/api/plugin.py index db1793cba8a..ec49db16010 100644 --- a/openpype/hosts/flame/api/plugin.py +++ b/openpype/hosts/flame/api/plugin.py @@ -361,6 +361,7 @@ class PublishableClip: vertical_sync_default = False driving_layer_default = "" index_from_segment_default = False + use_shot_name_default = False def __init__(self, segment, **kwargs): self.rename_index = kwargs["rename_index"] @@ -376,6 +377,7 @@ def __init__(self, segment, **kwargs): # segment (clip) main attributes self.cs_name = self.clip_data["segment_name"] self.cs_index = int(self.clip_data["segment"]) + self.shot_name = self.clip_data["shot_name"] # get track name and index self.track_index = int(self.clip_data["track"]) @@ -419,18 +421,21 @@ def convert(self): # deal with clip name new_name = self.marker_data.pop("newClipName") - if self.rename: + if self.rename and not self.use_shot_name: # rename segment self.current_segment.name = str(new_name) self.marker_data["asset"] = str(new_name) + elif self.use_shot_name: + self.marker_data["asset"] = self.shot_name + self.marker_data["hierarchyData"]["shot"] = self.shot_name else: self.marker_data["asset"] = self.cs_name self.marker_data["hierarchyData"]["shot"] = self.cs_name if self.marker_data["heroTrack"] and self.review_layer: - self.marker_data.update({"reviewTrack": self.review_layer}) + self.marker_data["reviewTrack"] = self.review_layer else: - self.marker_data.update({"reviewTrack": None}) + self.marker_data["reviewTrack"] = None # create pype tag on track_item and add data fpipeline.imprint(self.current_segment, self.marker_data) @@ -463,6 +468,8 @@ def _populate_attributes(self): # ui_inputs data or default values if gui was not used self.rename = self.ui_inputs.get( "clipRename", {}).get("value") or self.rename_default + self.use_shot_name = self.ui_inputs.get( + "useShotName", {}).get("value") or self.use_shot_name_default self.clip_name = self.ui_inputs.get( "clipName", {}).get("value") or self.clip_name_default self.hierarchy = self.ui_inputs.get( diff --git a/openpype/hosts/flame/plugins/create/create_shot_clip.py b/openpype/hosts/flame/plugins/create/create_shot_clip.py index f055c77a898..11c00dab421 100644 --- a/openpype/hosts/flame/plugins/create/create_shot_clip.py +++ b/openpype/hosts/flame/plugins/create/create_shot_clip.py @@ -87,41 +87,48 @@ def get_gui_inputs(self): "target": "tag", "toolTip": "Parents folder for shot root folder, Template filled with `Hierarchy Data` section", # noqa "order": 0}, + "useShotName": { + "value": True, + "type": "QCheckBox", + "label": "Use Shot Name", + "target": "ui", + "toolTip": "Use name form Shot name clip attribute", # noqa + "order": 1}, "clipRename": { "value": False, "type": "QCheckBox", "label": "Rename clips", "target": "ui", "toolTip": "Renaming selected clips on fly", # noqa - "order": 1}, + "order": 2}, "clipName": { "value": "{sequence}{shot}", "type": "QLineEdit", "label": "Clip Name Template", "target": "ui", "toolTip": "template for creating shot namespaused for renaming (use rename: on)", # noqa - "order": 2}, + "order": 3}, "segmentIndex": { "value": True, "type": "QCheckBox", "label": "Segment index", "target": "ui", "toolTip": "Take number from segment index", # noqa - "order": 3}, + "order": 4}, "countFrom": { "value": 10, "type": "QSpinBox", "label": "Count sequence from", "target": "ui", "toolTip": "Set when the sequence number stafrom", # noqa - "order": 4}, + "order": 5}, "countSteps": { "value": 10, "type": "QSpinBox", "label": "Stepping number", "target": "ui", "toolTip": "What number is adding every new step", # noqa - "order": 5}, + "order": 6}, } }, "hierarchyData": { diff --git a/openpype/settings/defaults/project_settings/flame.json b/openpype/settings/defaults/project_settings/flame.json index b601f9bcba8..6fb6f555285 100644 --- a/openpype/settings/defaults/project_settings/flame.json +++ b/openpype/settings/defaults/project_settings/flame.json @@ -2,7 +2,8 @@ "create": { "CreateShotClip": { "hierarchy": "{folder}/{sequence}", - "clipRename": true, + "useShotName": true, + "clipRename": false, "clipName": "{sequence}{shot}", "segmentIndex": true, "countFrom": 10, diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_flame.json b/openpype/settings/entities/schemas/projects_schema/schema_project_flame.json index 9ef05fa8327..dc88d11f611 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_flame.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_flame.json @@ -28,6 +28,11 @@ "key": "hierarchy", "label": "Shot parent hierarchy" }, + { + "type": "boolean", + "key": "useShotName", + "label": "Use Shot Name" + }, { "type": "boolean", "key": "clipRename",