Пример #1
0
    def getJobTitle(self):
        '''
        Generate and return the title to be given to the job.  This is the title
        that will be displayed in the webUI.

        Construct the job title by using the software name (MAYA), followed by
        the filename of maya file (excluding directory path), followed by the
        renderlayers being rendered.  If all of the renderlayers in the maya
        scene are being rendered then don't list any of them.

        MAYA - <maya filename> - <renderlayers>

        example: "MAYA - my_maya_scene.ma - beauty, shadow, spec"
        '''
        maya_filepath = self.getSourceFilepath()
        _, maya_filename = os.path.split(maya_filepath)

        # Cross-reference all renderable renderlayers in the maya scene with
        # the renderlayers that the user has selected in the UI.  If there is
        # a 1:1 match, then don't list any render layers in the job title (as
        # it is assumed that all will be rendered).  If there is not a 1:1
        # match, then add the render layers to the title which the user has
        # selected in the UI
        selected_render_layers = self.extended_widget.getSelectedRenderLayers()

        all_renderable_layers = []
        for render_layer_info in maya_utils.get_render_layers_info():
            if render_layer_info['renderable']:
                all_renderable_layers.append(render_layer_info['layer_name'])

        # If all render layers are being rendered, then don't specify them in the job title
        if set(all_renderable_layers) == set(selected_render_layers):
            render_layer_str = ""
        # Otherwise specify the user-selected layers in the job title
        else:
            render_layer_str = " - " + ", ".join(selected_render_layers)

        title = "MAYA - %s%s" % (maya_filename, render_layer_str)
        return title
    def getJobTitle(self):
        '''
        Generate and return the title to be given to the job.  This is the title
        that will be displayed in the webUI.

        Construct the job title by using the software name (MAYA), followed by
        the filename of maya file (excluding directory path), followed by the
        renderlayers being rendered.  If all of the renderlayers in the maya
        scene are being rendered then don't list any of them.

        MAYA - <maya filename> - <renderlayers>

        example: "MAYA - my_maya_scene.ma - beauty, shadow, spec"
        '''
        maya_filepath = self.getSourceFilepath()
        _, maya_filename = os.path.split(maya_filepath)

        # Cross-reference all renderable renderlayers in the maya scene with
        # the renderlayers that the user has selected in the UI.  If there is
        # a 1:1 match, then don't list any render layers in the job title (as
        # it is assumed that all will be rendered).  If there is not a 1:1
        # match, then add the render layers to the title which the user has
        # selected in the UI
        selected_render_layers = self.extended_widget.getSelectedRenderLayers()

        all_renderable_layers = []
        for render_layer_info in maya_utils.get_render_layers_info():
            if render_layer_info['renderable']:
                all_renderable_layers.append(render_layer_info['layer_name'])

        # If all render layers are being rendered, then don't specify them in the job title
        if set(all_renderable_layers) == set(selected_render_layers):
            render_layer_str = ""
        # Otherwise specify the user-selected layers in the job title
        else:
            render_layer_str = " - " + ", ".join(selected_render_layers)

        title = "MAYA - %s%s" % (maya_filename, render_layer_str)
        return title
Пример #3
0
 def refreshUi(self):
     render_layers_info = maya_utils.get_render_layers_info()
     self.populateRenderLayers(render_layers_info)
 def refreshUi(self):
     render_layers_info = maya_utils.get_render_layers_info()
     self.populateRenderLayers(render_layers_info)