diff --git a/avalon/tools/projectmanager/app.py b/avalon/tools/projectmanager/app.py index ef94f39a1..d5ff7d4ed 100644 --- a/avalon/tools/projectmanager/app.py +++ b/avalon/tools/projectmanager/app.py @@ -174,7 +174,7 @@ def __init__(self, is_silo_project=None, parent=None): assets.view.setSelectionMode(assets.view.ExtendedSelection) add_episode = QtWidgets.QPushButton("Add episode") add_sequence = QtWidgets.QPushButton("Add sequence") - add_asset = QtWidgets.QPushButton("Add asset") + add_asset = QtWidgets.QPushButton("Add asset/shot") add_layout = QtWidgets.QHBoxLayout() add_layout.addWidget(add_episode) add_layout.addWidget(add_sequence) @@ -419,11 +419,11 @@ def on_add_episode(self): if not self.shotgrid_io: self.shotgrid_io = shotgun_io.ShotgunIO() shorgrid_data = self.shotgrid_io.sg.find_one( - "Project", [['tank_name', 'is', self.data["project"]["name"]]], ["id"]) + "Project", [['tank_name', 'is', self.data["project"]["name"]]], ["id"]) or {} dialog = EpisodeCreateDialog( is_silo_required=self.is_silo_project, parent=self, - shotgrid_io=self.shotgrid_io, shotgrid_project_id=shorgrid_data["id"] + shotgrid_io=self.shotgrid_io, shotgrid_project_id=shorgrid_data.get("id", None) ) def _on_episode_created(data): @@ -482,11 +482,11 @@ def on_add_sequence(self): if not self.shotgrid_io: self.shotgrid_io = shotgun_io.ShotgunIO() shorgrid_data = self.shotgrid_io.sg.find_one( - "Project", [['tank_name', 'is', self.data["project"]["name"]]], ["id"]) + "Project", [['tank_name', 'is', self.data["project"]["name"]]], ["id"]) or {} dialog = SequenceCreateDialog( is_silo_required=self.is_silo_project, parent=self, - shotgrid_io=self.shotgrid_io, shotgrid_project_id=shorgrid_data["id"] + shotgrid_io=self.shotgrid_io, shotgrid_project_id=shorgrid_data.get("id", None) ) def _on_sequence_created(data): @@ -556,11 +556,11 @@ def on_add_asset(self): if not self.shotgrid_io: self.shotgrid_io = shotgun_io.ShotgunIO() shorgrid_data = self.shotgrid_io.sg.find_one( - "Project", [['tank_name', 'is', self.data["project"]["name"]]], ["id"]) + "Project", [['tank_name', 'is', self.data["project"]["name"]]], ["id"]) or {} dialog = AssetCreateDialog( is_silo_required=self.is_silo_project, parent=self, - shotgrid_io=self.shotgrid_io, shotgrid_project_id=shorgrid_data["id"] + shotgrid_io=self.shotgrid_io, shotgrid_project_id=shorgrid_data.get("id", None) ) if self.is_silo_project: dialog.set_silo_input_enable(