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

Flame: Flare integration preparation #2928

Merged
merged 93 commits into from
Apr 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
8dcc2ea
flame: adding batch utils
jakubjezek001 Feb 18, 2022
5391f1f
flame: adding write node to batch utils
jakubjezek001 Feb 18, 2022
cdc3d0b
flame: batch utils to api
jakubjezek001 Feb 22, 2022
5d8e3e2
flame: adding docstrigs to create_batch
jakubjezek001 Feb 22, 2022
162df8c
flame: itegrator wip
jakubjezek001 Feb 22, 2022
3a071a9
Merge branch 'develop' into feature/OP-1566_Flame-Create-Batch-Group
jakubjezek001 Mar 16, 2022
c120135
Removed submodule openpype/modules/default_modules/ftrack/python2_ven…
jakubjezek001 Mar 16, 2022
d1a733c
Removed submodule openpype/modules/default_modules/ftrack/python2_ven…
jakubjezek001 Mar 16, 2022
fdb9f0d
Removed submodule repos/avalon-unreal-integration
jakubjezek001 Mar 16, 2022
a521f48
Merge branch 'develop' into feature/OP-1566_Flame-Create-Batch-Group
jakubjezek001 Mar 22, 2022
db03b47
hound fix
jakubjezek001 Mar 22, 2022
aab2ed1
flame: ingegrate batch wip
jakubjezek001 Mar 22, 2022
12aeb88
flame: integrate batch [wip]
jakubjezek001 Mar 22, 2022
7dd0c86
flame: collect timeline instances settings
jakubjezek001 Mar 23, 2022
074703f
flame: use settings in collect timeline instances
jakubjezek001 Mar 23, 2022
029135a
flame: integrator bath group [finishing]
jakubjezek001 Mar 23, 2022
9fb6d7a
flame: batchgroup uses duration
jakubjezek001 Mar 24, 2022
a87f778
flame: reuse batch groups
jakubjezek001 Mar 24, 2022
c26ff2a
flame: fix task name on write file node
jakubjezek001 Mar 24, 2022
590e966
flame: updating anatomy data with correct task data
jakubjezek001 Mar 24, 2022
c57765d
Merge branch 'bugfix/task_data_with_correct_short_key' into feature/O…
jakubjezek001 Mar 24, 2022
d5521ae
flame: adding loading of plate into integrator
jakubjezek001 Mar 24, 2022
38268bc
flame: let extractor drive loading to batch group
jakubjezek001 Mar 24, 2022
0407465
flame: add loadable arguments to extracted repres
jakubjezek001 Mar 24, 2022
6388641
flame: finalize loading procedure in batch integrator
jakubjezek001 Mar 24, 2022
cde1caa
flame: clean args types
jakubjezek001 Mar 24, 2022
4cfd22b
flame: improving loading with exception
jakubjezek001 Mar 24, 2022
a4f8cdb
flame: better logging for loading fail
jakubjezek001 Mar 24, 2022
585d53d
flame: improving loading in integrate batch plugin
jakubjezek001 Mar 25, 2022
ed43881
flame: adding clip loader to current batch
jakubjezek001 Mar 25, 2022
267a3e0
flame: improving batch attributes
jakubjezek001 Mar 25, 2022
f8e99f3
flame: make dirs for batch renders
jakubjezek001 Mar 25, 2022
08f80ec
flame: make sure only one clip in xml
jakubjezek001 Mar 28, 2022
34a65cb
flame: ignore clip file with zero lines
jakubjezek001 Mar 28, 2022
1c6ab37
flame: improving tmp file validation
jakubjezek001 Mar 28, 2022
0abc8ae
flame: rework xml write file
jakubjezek001 Mar 28, 2022
ae36d08
flame: little fixes of loading
jakubjezek001 Mar 28, 2022
2bf75d2
flame: fix loaded name to `output`
jakubjezek001 Mar 28, 2022
eda39b5
flame: fix write to xml file input args
jakubjezek001 Mar 28, 2022
44257be
flame: fix utf8 error `'unicode' object has no attribute 'getiterator'`
jakubjezek001 Mar 29, 2022
69f5ace
flame: fix condition direction
jakubjezek001 Mar 29, 2022
3459cec
flame: task workdir for .clip when integrating batch
jakubjezek001 Mar 29, 2022
52cb51f
Merge branch 'develop' into feature/OP-1566_Flame-Create-Batch-Group
jakubjezek001 Mar 29, 2022
66a85a9
Merge branch 'bugfix/flame-centos-related-bugs' into feature/OP-1566_…
jakubjezek001 Mar 30, 2022
eabaca9
Merge branch 'develop' into feature/OP-1566_Flame-Create-Batch-Group
jakubjezek001 Mar 30, 2022
df64998
flame: cleaning code
jakubjezek001 Mar 30, 2022
5580ef0
hound catch
jakubjezek001 Mar 30, 2022
1926e10
flame: redundant code
jakubjezek001 Apr 4, 2022
5489716
haunch catch
jakubjezek001 Apr 4, 2022
0dfca2f
Flame: refining the code for better understanding of flow
jakubjezek001 Apr 5, 2022
5b260af
flame: avoid hidden segment processing
jakubjezek001 Apr 5, 2022
5758984
flame: fixing broken get_clips_in_reels
jakubjezek001 Apr 5, 2022
8d4541d
flame: hidden attribute is PyAttribute so need to get value
jakubjezek001 Apr 5, 2022
6011829
flame: make reel clip validation optional
jakubjezek001 Apr 5, 2022
818c3fe
flame: fallback if reel clip is not available
jakubjezek001 Apr 5, 2022
246127c
flame: hidding all unrelated segments and tracks
jakubjezek001 Apr 5, 2022
87f40d5
flame: adding media info getter obj
jakubjezek001 Apr 6, 2022
7dc2c61
flame: update media info file generator
jakubjezek001 Apr 6, 2022
d79773e
flame: fixing feeds to feed tag
jakubjezek001 Apr 6, 2022
67c759a
flame: add media info file class to api
jakubjezek001 Apr 6, 2022
f36512c
Merge branch 'develop' into feature/OP-1566_Flame-Create-Batch-Group
jakubjezek001 Apr 6, 2022
6c9f9c1
flame: add generator into init of class
jakubjezek001 Apr 6, 2022
f43e6f0
flame: get real source_in
jakubjezek001 Apr 6, 2022
c278807
flame: refactoring batch group creation
jakubjezek001 Apr 7, 2022
c2a4176
flame: fix integrating batch group to loader with bgroup
jakubjezek001 Apr 7, 2022
614c49b
flame: fix wiretap with umask
jakubjezek001 Apr 7, 2022
ce4aa40
flame: fixing umask to 0o000 to reflect permissions to 0777
jakubjezek001 Apr 7, 2022
cd59b3a
flame: make sure nodes are not duplicated and update
jakubjezek001 Apr 7, 2022
4ed6c02
flame: returning all batch nodes
jakubjezek001 Apr 7, 2022
4da106c
flame: debug log nodes attrs
jakubjezek001 Apr 7, 2022
d0a2a78
flame: fixing head and tail
jakubjezek001 Apr 7, 2022
1535b47
flame: add hack comment
jakubjezek001 Apr 7, 2022
3045845
flame: missing dict items function call
jakubjezek001 Apr 7, 2022
16bd110
flame: set node name
jakubjezek001 Apr 7, 2022
afbacb1
flame: fixing setter for node name
jakubjezek001 Apr 7, 2022
fc6d01d
hound catch
jakubjezek001 Apr 7, 2022
5f1940a
flame: adding maintainable temp file path
jakubjezek001 Apr 8, 2022
03bf240
flame: refactoring MediaInfoFile class so it is parentable
jakubjezek001 Apr 8, 2022
adbd359
flame: otio removing reel clip dependency
jakubjezek001 Apr 8, 2022
4797f58
flame: add todos for metadata feature
jakubjezek001 Apr 8, 2022
bfae95a
flame: OpenClipSolver inheriting from MediaInfoFile class
jakubjezek001 Apr 8, 2022
72ecb61
flame: fixing flame compatibility and python2
jakubjezek001 Apr 8, 2022
9256e02
flame: setter getter error
jakubjezek001 Apr 8, 2022
3f9b061
flame: fix getroot
jakubjezek001 Apr 8, 2022
8420a16
flame: temp reverse commit bfae95a8475981e014561c1eec8b9b54de5a8424
jakubjezek001 Apr 8, 2022
5f91947
Merge branch 'develop' into feature/OP-1566_Flame-Create-Batch-Group
jakubjezek001 Apr 8, 2022
d4182e5
dev_test_plugin
jakubjezek001 Apr 8, 2022
06d2e89
testing file
jakubjezek001 Apr 8, 2022
a103eba
flame: fixing OpenClipSolver
jakubjezek001 Apr 8, 2022
bb22264
reversing version rename
jakubjezek001 Apr 8, 2022
c5683f5
flame: fixing skip condition
jakubjezek001 Apr 8, 2022
16e8407
flame: processing comments
jakubjezek001 Apr 11, 2022
7a40cc2
fix orderdict
jakubjezek001 Apr 11, 2022
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
23 changes: 16 additions & 7 deletions openpype/hosts/flame/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
from .lib import (
CTX,
FlameAppFramework,
get_project_manager,
get_current_project,
get_current_sequence,
create_bin,
create_segment_data_marker,
get_segment_data_marker,
set_segment_data_marker,
Expand All @@ -29,7 +27,10 @@
get_frame_from_filename,
get_padding_from_filename,
maintained_object_duplication,
get_clip_segment
maintained_temp_file_path,
get_clip_segment,
get_batch_group_from_desktop,
MediaInfoFile
)
from .utils import (
setup,
Expand All @@ -56,7 +57,6 @@
PublishableClip,
ClipLoader,
OpenClipSolver

)
from .workio import (
open_file,
Expand All @@ -71,6 +71,10 @@
get_preset_path_by_xml_name,
modify_preset_file
)
from .batch_utils import (
create_batch_group,
create_batch_group_conent
)

__all__ = [
# constants
Expand All @@ -83,10 +87,8 @@
# lib
"CTX",
"FlameAppFramework",
"get_project_manager",
"get_current_project",
"get_current_sequence",
"create_bin",
"create_segment_data_marker",
"get_segment_data_marker",
"set_segment_data_marker",
Expand All @@ -101,7 +103,10 @@
"get_frame_from_filename",
"get_padding_from_filename",
"maintained_object_duplication",
"maintained_temp_file_path",
"get_clip_segment",
"get_batch_group_from_desktop",
"MediaInfoFile",

# pipeline
"install",
Expand Down Expand Up @@ -142,5 +147,9 @@
# render utils
"export_clip",
"get_preset_path_by_xml_name",
"modify_preset_file"
"modify_preset_file",

# batch utils
"create_batch_group",
"create_batch_group_conent"
]
151 changes: 151 additions & 0 deletions openpype/hosts/flame/api/batch_utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
import flame


def create_batch_group(
name,
frame_start,
frame_duration,
update_batch_group=None,
**kwargs
):
"""Create Batch Group in active project's Desktop

Args:
name (str): name of batch group to be created
frame_start (int): start frame of batch
frame_end (int): end frame of batch
update_batch_group (PyBatch)[optional]: batch group to update

Return:
PyBatch: active flame batch group
"""
# make sure some batch obj is present
batch_group = update_batch_group or flame.batch

schematic_reels = kwargs.get("shematic_reels") or ['LoadedReel1']
shelf_reels = kwargs.get("shelf_reels") or ['ShelfReel1']

handle_start = kwargs.get("handleStart") or 0
handle_end = kwargs.get("handleEnd") or 0

frame_start -= handle_start
frame_duration += handle_start + handle_end

if not update_batch_group:
# Create batch group with name, start_frame value, duration value,
# set of schematic reel names, set of shelf reel names
batch_group = batch_group.create_batch_group(
name,
start_frame=frame_start,
duration=frame_duration,
reels=schematic_reels,
shelf_reels=shelf_reels
)
else:
batch_group.name = name
batch_group.start_frame = frame_start
batch_group.duration = frame_duration

# add reels to batch group
_add_reels_to_batch_group(
batch_group, schematic_reels, shelf_reels)

# TODO: also update write node if there is any
# TODO: also update loaders to start from correct frameStart

if kwargs.get("switch_batch_tab"):
# use this command to switch to the batch tab
batch_group.go_to()

return batch_group


def _add_reels_to_batch_group(batch_group, reels, shelf_reels):
# update or create defined reels
# helper variables
reel_names = [
r.name.get_value()
for r in batch_group.reels
]
shelf_reel_names = [
r.name.get_value()
for r in batch_group.shelf_reels
]
# add schematic reels
for _r in reels:
if _r in reel_names:
continue
batch_group.create_reel(_r)

# add shelf reels
for _sr in shelf_reels:
if _sr in shelf_reel_names:
continue
batch_group.create_shelf_reel(_sr)


def create_batch_group_conent(batch_nodes, batch_links, batch_group=None):
"""Creating batch group with links

Args:
batch_nodes (list of dict): each dict is node definition
batch_links (list of dict): each dict is link definition
batch_group (PyBatch, optional): batch group. Defaults to None.

Return:
dict: all batch nodes {name or id: PyNode}
"""
# make sure some batch obj is present
batch_group = batch_group or flame.batch
all_batch_nodes = {
b.name.get_value(): b
for b in batch_group.nodes
}
for node in batch_nodes:
# NOTE: node_props needs to be ideally OrederDict type
node_id, node_type, node_props = (
node["id"], node["type"], node["properties"])

# get node name for checking if exists
node_name = node_props.pop("name", None) or node_id

if all_batch_nodes.get(node_name):
# update existing batch node
batch_node = all_batch_nodes[node_name]
else:
# create new batch node
batch_node = batch_group.create_node(node_type)

# set name
batch_node.name.set_value(node_name)

# set attributes found in node props
for key, value in node_props.items():
if not hasattr(batch_node, key):
continue
setattr(batch_node, key, value)

# add created node for possible linking
all_batch_nodes[node_id] = batch_node

# link nodes to each other
for link in batch_links:
_from_n, _to_n = link["from_node"], link["to_node"]

# check if all linking nodes are available
if not all([
all_batch_nodes.get(_from_n["id"]),
all_batch_nodes.get(_to_n["id"])
]):
continue

# link nodes in defined link
batch_group.connect_nodes(
all_batch_nodes[_from_n["id"]], _from_n["connector"],
all_batch_nodes[_to_n["id"]], _to_n["connector"]
)

# sort batch nodes
batch_group.organize()

return all_batch_nodes
Loading