Beispiel #1
0
    def __init__(self):
        Op.__init__(
            self,
            "Create new projects.",
            Parameter(
                name="result",
                description="",
                defaultValue=StringData(),
                userData={"UI": {"showResult": BoolData(True)}},
            ),
        )

        output = pipe.output()
        self.parameters().addParameters(
            [
                IntParameter(name="jobIndex", description="O Indice do Projeto.", defaultValue=self.getLastIndex() + 1),
                ValidatedStringParameter(
                    name="jobName",
                    description="O nome do job a ser criado/editado",
                    defaultValue="",
                    regex="^\S+$",
                    regexDescription="jobName must be a name without any spaces in it.",
                    allowEmptyString=False,
                ),
                StringParameter(
                    name="client",
                    description="O nome do job a ser criado/editado",
                    defaultValue="",
                    presets=clients.asPreset(),
                    presetsOnly=True,
                ),
                StringParameter(
                    name="defaultOutput",
                    description="A configuracao padrao de output do project (resolucao padrao).",
                    defaultValue=output.labels()[0],
                    presets=output.asPreset(),
                    presetsOnly=True,
                ),
                StringVectorParameter(
                    name="assets",
                    description="Entre com os assets do projeto."
                    "Para adicionar assets, clique uma vez no + ."
                    "Caso queira adicionar varias linhas de forma rapida, tecle space apos clicar no + ."
                    "Para remover shots, selecione as linhas que deseja remover e click no - .",
                    defaultValue=StringVectorData([""]),
                ),
                StringVectorParameter(
                    name="shots",
                    description="Entre com os shots do projeto."
                    "Para adicionar shots, clique uma vez no + ."
                    "Caso queira adicionar varias linhas de forma rapida, tecle space apos clicar no + ."
                    "Para remover shots, selecione as linhas que deseja remover e click no - .",
                    defaultValue=StringVectorData([""]),
                ),
            ]
        )
def use(
    custom_format: dict, video: twitch.Video
) -> Tuple[Generator[Tuple[str, dict], None, None], str]:
    # Format comments
    comments: Generator[Tuple[str, dict], None,
                        None] = comment_generator(video.comments,
                                                  custom_format['comments'])

    # Format output
    output = pipe.output(video.metadata, custom_format['output'])

    return comments, output
Beispiel #3
0
def use(video: twitch.Video) -> Tuple[Generator[dict, None, None], str]:
    # Send video through pipe to generate output
    output: str = pipe.output(video.metadata,
                              app.settings['formats']['json']['output'])

    json_object = dict()
    json_object['video']: dict = video.metadata
    json_object['comments']: List[dict] = []

    # Download every comment and add to comments list
    for comment in video.comments:

        # Draw progress
        if not app.arguments.quiet and not app.arguments.verbose:
            app.draw_progress(comment['content_offset_seconds'],
                              video.metadata['length'], 'json')

        # Append to comments
        json_object['comments'].append(comment)

    # Transform json object to a generator
    return generator(json_object), output
Beispiel #4
0
    def __init__(self):
        Op.__init__(
            self, "Create new projects.",
            Parameter(
                name="result",
                description="",
                defaultValue=StringData(),
                userData={
                    "UI": {
                        "showResult": BoolData(True),
                    },
                },
            ))

        output = pipe.output()
        self.parameters().addParameters([
            IntParameter(
                name="jobIndex",
                description="O Indice do Projeto.",
                defaultValue=self.getLastIndex() + 1,
            ),
            ValidatedStringParameter(
                name="jobName",
                description="O nome do job a ser criado/editado",
                defaultValue="",
                regex="^\S+$",
                regexDescription=
                "jobName must be a name without any spaces in it.",
                allowEmptyString=False,
            ),
            StringParameter(
                name="client",
                description="O nome do job a ser criado/editado",
                defaultValue="no client",
                presets=clients.asPreset(),
                presetsOnly=True,
            ),
            StringParameter(
                name="defaultOutput",
                description=
                "A configuracao padrao de output do project (resolucao padrao).",
                defaultValue=output.labels()[0],
                presets=output.asPreset(),
                presetsOnly=True,
            ),
            StringVectorParameter(
                name="assets",
                description="Entre com os assets do projeto."
                "Para adicionar assets, clique uma vez no + ."
                "Caso queira adicionar varias linhas de forma rapida, tecle space apos clicar no + ."
                "Para remover shots, selecione as linhas que deseja remover e click no - .",
                defaultValue=StringVectorData(['']),
            ),
            StringVectorParameter(
                name="shots",
                description="Entre com os shots do projeto."
                "Para adicionar shots, clique uma vez no + ."
                "Caso queira adicionar varias linhas de forma rapida, tecle space apos clicar no + ."
                "Para remover shots, selecione as linhas que deseja remover e click no - .",
                defaultValue=StringVectorData(['']),
            ),
        ])
Beispiel #5
0
def use(
    video: twitch.Video
) -> Tuple[Generator[Tuple[str, dict], None, None], str]:
    return subtitles(video.comments), pipe.output(video.metadata,
                                                  irc_format['output'])
def use(
    video: twitch.Video
) -> Tuple[Generator[Tuple[str, dict], None, None], str]:
    output = pipe.output(video.metadata, ssa_format['output'])

    return generator(video), output
Beispiel #7
0
    def __init__( self, prefix='', ext='', basePath='', extra_parameters=[],fileNameParameterType=None ) :
        
        class RenderFileParameter(IECore.FileNameParameter):
            def valueValid(self, *args):
        #                ret = IECore.FileNameParameter.valueValid(self, *args)
                ret = (True,'')
                if args:
                    argExt = os.path.splitext(str(args[0]))[1].lower()
                    print argExt
                    print map(lambda x: '.%s' % x, ext.split(','))
                    if argExt not in map(lambda x: '.%s' % x, ext.split(',')):
                        ret = (False, 'Extensions %s not allowed!' % argExt)
                    
                print args
                print ret
                return ret
                
        IECore.Op.__init__( self, "Publish %s assets." % self.__class__,
            IECore.Parameter(
                name = "result",
                description = "",
                defaultValue = IECore.StringData(""),
                userData = {"UI" : {
                    "showResult" : IECore.BoolData( False ),
                    "showCompletionMessage" : IECore.BoolData( True ),
                    "saveResult" : IECore.BoolData( False ),
                }},
            )
        )

        
        output = pipe.output()
        outputDefault = output.labels()[0]
        
        j = pipe.admin.job()
        jobData = j.getData()
        if jobData.has_key('output'):
            outputDefault = jobData['output']

        currentUser = pipe.admin.job.shot.user()
        
        scene = basePath
        if basePath[0] != '/':
            scene = currentUser.path(basePath)
        if m:
            scene = m.file(q=1,sn=1)
            if not scene:
                raise Exception("\nERROR: A Cena precisa ser salva antes de ser publicada!")

        
        self.parameters().addParameters(
            [
                IECore.FileNameParameter(
                    name="%sScene" % prefix,
                    description = "Scene to render. It can be Maya, Nuke or Gaffer!",
                    defaultValue = scene,
                    allowEmptyString=False,
                    check = IECore.FileNameParameter.CheckType.MustExist,
                    extensions = ext,
                    userData = {
                        'assetPath':IECore.BoolData( True ),
#                        "UI":{ "invertEnabled" : IECore.BoolData(False) },
                    }
                ),
                IECore.StringParameter(
                    name="%sOutput" % prefix,
                    description = "Configuracao do render output.",
                    defaultValue = outputDefault ,
                    presets = output.asPreset(),
                    presetsOnly = True,
#                    userData = extraUI
                ),
                IECore.StringParameter("assetType","",prefix,userData={"UI":{ "visible" : IECore.BoolData(False) }}),
            ])
        if extra_parameters:
            self.parameters().addParameters( extra_parameters )
Beispiel #8
0
    def __init__(self,
                 prefix='',
                 ext='',
                 basePath='',
                 extra_parameters=[],
                 fileNameParameterType=None):
        class RenderFileParameter(IECore.FileNameParameter):
            def valueValid(self, *args):
                #                ret = IECore.FileNameParameter.valueValid(self, *args)
                ret = (True, '')
                if args:
                    argExt = os.path.splitext(str(args[0]))[1].lower()
                    print argExt
                    print map(lambda x: '.%s' % x, ext.split(','))
                    if argExt not in map(lambda x: '.%s' % x, ext.split(',')):
                        ret = (False, 'Extensions %s not allowed!' % argExt)

                print args
                print ret
                return ret

        IECore.Op.__init__(
            self, "Publish %s assets." % self.__class__,
            IECore.Parameter(
                name="result",
                description="",
                defaultValue=IECore.StringData(""),
                userData={
                    "UI": {
                        "showResult": IECore.BoolData(False),
                        "showCompletionMessage": IECore.BoolData(True),
                        "saveResult": IECore.BoolData(False),
                    }
                },
            ))

        self.prefix = prefix
        output = pipe.output()
        outputDefault = output.labels()[0]

        j = pipe.admin.job()
        jobData = j.getData()
        if jobData.has_key('output'):
            outputDefault = jobData['output']

        currentUser = pipe.admin.job.shot.user()

        scene = basePath
        if basePath[0] != '/':
            scene = currentUser.path(basePath)

        self.parameters().addParameters([
            IECore.FileNameParameter(
                name="%sScene" % self.prefix,
                description="Scene to render. It can be Maya, Nuke or Gaffer!",
                defaultValue=scene,
                allowEmptyString=False,
                check=IECore.FileNameParameter.CheckType.MustExist,
                extensions=ext,
                userData={
                    'assetPath': IECore.BoolData(True),
                    'updateFromApp': IECore.BoolData(True),
                    #                        "UI":{ "invertEnabled" : IECore.BoolData(False) },
                }),
            IECore.StringParameter(
                name="%sOutput" % self.prefix,
                description="Configuracao do render output.",
                defaultValue=outputDefault,
                presets=output.asPreset(),
                presetsOnly=True,
                #                    userData = extraUI
            ),
            IECore.StringParameter(
                "assetType",
                "",
                prefix,
                userData={"UI": {
                    "visible": IECore.BoolData(False)
                }}),
        ])
        if extra_parameters:
            self.parameters().addParameters(extra_parameters)

        self.__updateFromMaya()