Skip to content

Commit 4a00dcc

Browse files
committed
Initial working pipeline.
1 parent f2d6911 commit 4a00dcc

File tree

8 files changed

+277
-200
lines changed

8 files changed

+277
-200
lines changed

environment.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def download_file(url, path):
6969
"environment",
7070
"PYTHONPATH"
7171
),
72-
os.path.join(os.environ["CONDA_GIT_REPOSITORY"], "studio-library"),
72+
os.path.join(os.environ["CONDA_GIT_REPOSITORY"]),
7373
os.path.join(os.environ["CONDA_GIT_REPOSITORY"], "maya-capture"),
7474
os.path.join(os.environ["CONDA_GIT_REPOSITORY"], "maya-capture-gui"),
7575
os.path.join(os.environ["CONDA_GIT_REPOSITORY"], "maya-alembic-export"),
@@ -133,9 +133,9 @@ def download_file(url, path):
133133
os.path.join(os.path.dirname(__file__), "environment", "MAYA_PLUG_IN_PATH")
134134
]
135135

136-
# MAYA_SHELF_PATH
137-
environment["MAYA_SHELF_PATH"] = [
138-
os.path.join(os.path.dirname(__file__), "environment", "MAYA_SHELF_PATH")
136+
# XBMLANGPATH
137+
environment["XBMLANGPATH"] = [
138+
os.path.join(os.path.dirname(__file__), "environment", "XBMLANGPATH")
139139
]
140140

141141
# MAYA_MODULE_PATH

environment.yml

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,35 +15,35 @@ dependencies:
1515
- setuptools==36.4
1616
- https://github.com/pyqt/python-qt5/archive/0.3.0.zip
1717
- git:
18-
- https://github.com/chadmv/cvshapeinverter.git
19-
- https://github.com/bumpybox/Tapp.git
20-
- https://github.com/krathjen/studiolibrary.git
21-
- https://github.com/Psyop/Cryptomatte.git
22-
- https://github.com/tokejepsen/filelink.git
23-
- https://github.com/abstractfactory/maya-capture.git
24-
- https://github.com/BigRoy/maya-capture-gui.git
25-
- https://github.com/tokejepsen/maya-alembic-export.git
26-
- https://github.com/pyblish/pyblish-base.git
27-
- https://github.com/tokejepsen/pyblish-qml.git
28-
- https://github.com/pyblish/pyblish-maya.git
29-
- https://github.com/pyblish/pyblish-houdini.git
30-
- https://github.com/pyblish/pyblish-nuke.git
31-
- https://github.com/pyblish/pyblish-nukeassist.git
32-
- https://github.com/pyblish/pyblish-nukestudio.git
33-
- https://github.com/pyblish/pyblish-ftrack.git
34-
- https://github.com/pyblish/pyblish-deadline.git
35-
- https://github.com/bumpybox/pyblish-bumpybox.git
36-
- https://bitbucket.org/ftrack/ftrack-python-legacy-api.git
37-
- https://bitbucket.org/ftrack/ftrack-connect.git
38-
- https://bitbucket.org/ftrack/ftrack-connect-maya.git
39-
- https://bitbucket.org/ftrack/ftrack-connect-foundry.git
40-
- https://bitbucket.org/ftrack/ftrack-connect-nuke.git
41-
- https://bitbucket.org/ftrack/ftrack-connect-nuke-studio.git
42-
- https://bitbucket.org/tokejepsen/ftrack-connect-rv.git
43-
- https://github.com/tokejepsen/ftrack-hooks.git
44-
- https://github.com/tokejepsen/ftrack-connect-environment.git:
18+
- https://github.com/chadmv/cvshapeinverter.git@32bb71308a31a35d0855aa71248651caae3cae55
19+
- https://github.com/bumpybox/Tapp.git@0d5ca78f2ca8f28f12a3a5f0565f99e8efe962de
20+
- https://github.com/krathjen/studiolibrary.git@5b8c1c95d880db1b680598a1fdc134d2e1f53ca3
21+
- https://github.com/Psyop/Cryptomatte.git@bf6edff6c37d03ec1947cd2a50bd55961562d74e
22+
- https://github.com/tokejepsen/filelink.git@01c782e4ce8043914cc09908392747954f5284b1
23+
- https://github.com/abstractfactory/maya-capture.git@58763b758a27eafd6455e38f1da3eb84797a2e48
24+
- https://github.com/BigRoy/maya-capture-gui.git@c02c2385c485db9666b50f00582a60b784338f38
25+
- https://github.com/tokejepsen/maya-alembic-export.git@841d1e9bf965afe75a5a68bacd6af577c5da6afe
26+
- https://github.com/pyblish/pyblish-base.git@5f2661097dfb7c4a6dffa20e5d251b4d5beeb660
27+
- https://github.com/pyblish/pyblish-qml.git@927ce409f9e9219cb3fa244d52a48ecb71c841e6
28+
- https://github.com/pyblish/pyblish-maya.git@a68781285c7e47bb332922870bba461d70fef009
29+
- https://github.com/pyblish/pyblish-houdini.git@88b189a82fd6b757aa7557c1c490b97e740154a5
30+
- https://github.com/pyblish/pyblish-nuke.git@5073788302663035c306d5c72e50efafda23186e
31+
- https://github.com/pyblish/pyblish-nukeassist.git@878214900a4b518fa9ecc1dbc373f83e9fbfd1b1
32+
- https://github.com/pyblish/pyblish-nukestudio.git@225b2af344468fa43c51a14f71a512b8a317cb48
33+
- https://github.com/pyblish/pyblish-ftrack.git@5dcd1eee3ccbc33178c18adc93a8b7a8652fddc2
34+
- https://github.com/pyblish/pyblish-deadline.git@10c1a4ff3fd4f44dc7ff34f104fa41a62adb3091
35+
- https://github.com/bumpybox/pyblish-bumpybox.git@d0869f8a770126b27aaa89ec35e2df5fc22522a2
36+
- https://bitbucket.org/ftrack/ftrack-python-legacy-api.git@97cb35a6ae98958f95e61a7925701d9e8eea375d
37+
- https://bitbucket.org/ftrack/ftrack-connect.git@24ed8ce2404fce9bb6a58fbad363a93132efae14
38+
- https://bitbucket.org/tokejepsen/ftrack-connect-maya.git@d6ca2e46bd073a1e2707e5f5886a5987a9005a6e
39+
- https://bitbucket.org/ftrack/ftrack-connect-foundry.git@796931b22b0b9fbca7a43da71a473363d6f83d46
40+
- https://bitbucket.org/ftrack/ftrack-connect-nuke.git@f092b4daa5643ec736952e0fd84c5321eb279a88
41+
- https://bitbucket.org/ftrack/ftrack-connect-nuke-studio.git@dcb5d4e4cd3eccb60627207f287c9f9b8f99e614
42+
- https://bitbucket.org/tokejepsen/ftrack-connect-rv.git@6f113a118b0c5c15809c461c5d1c793892701224
43+
- https://github.com/tokejepsen/ftrack-hooks.git@87140664a3b4cf1070784de3e402b5314918dc30
44+
- https://github.com/tokejepsen/ftrack-connect-environment.git@63945f0244e94f539aa52006ec7781c2e63b8d2a:
4545
- python $REPO_PATH/environment.py
46-
- https://github.com/tokejepsen/pyblish-grill-environment.git:
46+
- https://github.com/tokejepsen/pyblish-grill-environment.git@212bdc2764586e0834430a47e64bb96f4f6dc9ec:
4747
- python $REPO_PATH/environment.py
4848
- https://github.com/bumpybox/bumpybox-environment.git:
4949
- python $REPO_PATH/environment.py

environment/MAYA_SHELF_PATH/shelf_Bumpybox.mel

Lines changed: 0 additions & 168 deletions
This file was deleted.

environment/PYTHONPATH/bumpybox_environment/maya/__init__.py

Whitespace-only changes.
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
import os
2+
import operator
3+
4+
import ftrack_api
5+
import ftrack_connect
6+
from ftrack_connect.connector import FTAssetObject
7+
from ftrack_connect_maya.connector import Connector
8+
9+
10+
def import_components(components, options={}):
11+
"""Import components with host plugins iterator."""
12+
13+
locations = {}
14+
session = ftrack_connect.session.get_shared_session()
15+
for location in session.query("select id from Location"):
16+
locations[location["id"]] = location
17+
18+
connector = Connector()
19+
for component in components:
20+
try:
21+
location_id = max(
22+
component.get_availability().iteritems(),
23+
key=operator.itemgetter(1)
24+
)[0]
25+
file_path = locations[location_id].get_resource_identifier(
26+
component
27+
)
28+
29+
asset = FTAssetObject(
30+
componentId=component['id'],
31+
filePath=file_path,
32+
componentName=component['name'],
33+
assetVersionId=component["version"]["id"],
34+
options=options
35+
)
36+
37+
connector.importAsset(asset)
38+
except ftrack_api.exception.ComponentNotInLocationError:
39+
pass
40+
41+
42+
def import_full_resolution_movie():
43+
44+
session = ftrack_connect.session.get_shared_session()
45+
task = session.get("Task", os.environ["FTRACK_TASKID"])
46+
47+
# Import Imageplane
48+
components = session.query(
49+
"Component where version.asset.name is \"editing_full_resolution\" "
50+
"and version.asset.parent.id is \"{0}\"".format(task["parent"]["id"])
51+
)
52+
53+
latest_component = get_latest_component(components)
54+
55+
if not latest_component:
56+
return
57+
58+
import_components(
59+
[latest_component],
60+
{
61+
"attachCamera": True,
62+
"renameCamera": True,
63+
"resolutionGate": True,
64+
"imagePlaneVisibility": "Hidden from other cameras",
65+
"createGround": False,
66+
"imagePlaneDepth": 10000
67+
}
68+
)
69+
70+
71+
def import_half_resolution_movie():
72+
73+
session = ftrack_connect.session.get_shared_session()
74+
task = session.get("Task", os.environ["FTRACK_TASKID"])
75+
76+
# Import Imageplane
77+
components = session.query(
78+
"Component where version.asset.name is \"editing_half_resolution\" "
79+
"and version.asset.parent.id is \"{0}\"".format(task["parent"]["id"])
80+
)
81+
82+
latest_component = get_latest_component(components)
83+
84+
if not latest_component:
85+
return
86+
87+
import_components(
88+
[latest_component],
89+
{
90+
"attachCamera": True,
91+
"renameCamera": True,
92+
"resolutionGate": True,
93+
"imagePlaneVisibility": "Hidden from other cameras",
94+
"createGround": False,
95+
"imagePlaneDepth": 10000
96+
}
97+
)
98+
99+
100+
def get_latest_component(components):
101+
max_version = 0
102+
latest_component = None
103+
for component in components:
104+
if max_version < component["version"]["version"]:
105+
max_version = component["version"]["version"]
106+
latest_component = component
107+
108+
return latest_component
109+
110+
111+
def import_rigging():
112+
"""Imports rigging from linked AssetBuilds."""
113+
114+
session = ftrack_connect.session.get_shared_session()
115+
task = session.get("Task", os.environ["FTRACK_TASKID"])
116+
117+
links = session.query(
118+
"select from_id from TypedContextLink where to_id is "
119+
"\"{0}\"".format(task["parent"]["id"])
120+
)
121+
for link in links:
122+
components = session.query(
123+
"Component where version.task.type.name is \"Rigging\" and "
124+
"version.asset.type.short is \"scene\" and "
125+
"version.asset.parent.id is \"{0}\"".format(link["from_id"])
126+
)
127+
128+
latest_component = get_latest_component(components)
129+
130+
if not latest_component:
131+
continue
132+
133+
import_components(
134+
[latest_component],
135+
{
136+
"mayaAddNamespace": True,
137+
"mayaNamespace": "Custom",
138+
"nameSpaceStr": "{0}_rig".format(
139+
latest_component["version"]["asset"]["parent"]["name"]
140+
),
141+
"mayaGroupNodes": False
142+
}
143+
)

0 commit comments

Comments
 (0)