Ejemplo n.º 1
0
 def __init__(self, scene, shot, project=None, shotgun_fields={}):
     self.project = Project._construct(project)
     self.scene = Scene._construct(scene=scene, project=self.project)
     self.name = projectAwareness.format_shotgun_shot_name(
         shot_name=shot,
         project_name=self.project.name,
         scene_name=self.scene.name)
     self._shotgun_fields = shotgun_fields
     self._cache_latest_tank_audio = None
Ejemplo n.º 2
0
 def __init__(self, scene, shot, project=None, shotgun_fields={}):
     self.project    = Project._construct( project )
     self.scene      = Scene._construct( scene = scene, project = self.project )
     self.name       = projectAwareness.format_shotgun_shot_name(
                                                                 shot_name = shot,
                                                                 project_name = self.project.name,
                                                                 scene_name = self.scene.name )
     self._shotgun_fields = shotgun_fields
     self._cache_latest_tank_audio = None
Ejemplo n.º 3
0
    def get_shot(self, shot_name, no_exception=False):
        shots = self.list_shots()
        shot_name = projectAwareness.format_shotgun_shot_name(
            shot_name=shot_name,
            scene_name=self.name,
            project_name=self.project.name)

        shot_search = [shot for shot in shots if shot.name == shot_name]

        if not shot_search:
            msg = "Scene %s does not have shot %s, available shots are {%s}" % (
                self.name, shot_name, ",".join([shot.name for shot in shots]))

            if no_exception:
                print "Warning:", msg
            else:
                raise KeyError, msg

            return None

        return shot_search[0]
Ejemplo n.º 4
0
    def get_shot(self, shot_name, no_exception=False):
        shots = self.list_shots()
        shot_name = projectAwareness.format_shotgun_shot_name(shot_name = shot_name,
                                                              scene_name = self.name,
                                                              project_name = self.project.name)

        shot_search = [ shot for shot in shots if shot.name == shot_name ]

        if not shot_search:
            msg = "Scene %s does not have shot %s, available shots are {%s}" % (
                                                                                          self.name,
                                                                                          shot_name,
                                                                                          ",".join( [shot.name for shot in shots])
                                                                                          )

            if no_exception:
                print "Warning:", msg
            else:
                raise KeyError, msg


            return None

        return shot_search[0]