Exemplo n.º 1
0
    def importAsset(self, iAObj=None):

        start, end = HelpFunctions.getFileSequenceStartEnd(iAObj.filePath)

        nuke.nodePaste(iAObj.filePath % start)

        if iAObj.options["importSettings"]:

            component = ftrack.Component(iAObj.componentId)
            parent = component.getVersion().getAsset().getParent()

            # Setup fps
            nuke.root()['fps'].setValue(parent.get('fps'))

            # Setup frame range
            nuke.root()['first_frame'].setValue(parent.get('fstart'))
            nuke.root()['last_frame'].setValue(parent.get('fend'))

            # Setup resolution
            width = parent.get("width")
            height = parent.get("height")
            fmt = None
            for f in nuke.formats():
                if f.width() == width and f.height() == height:
                    fmt = f

            if fmt:
                nuke.root()['format'].setValue(fmt.name())

        return
Exemplo n.º 2
0
    def getStartEndFrames(self, component, iAObj):
        """Return start and end from *iAObj*."""

        if component.getSystemType() == "sequence":
            # Find out frame start and end from members if component
            # system type is sequence.
            members = component.getMembers(location=None)
            frames = [int(member.getName()) for member in members]
            start = min(frames)
            end = max(frames)
        else:
            start, end = HelpFunctions.getFileSequenceStartEnd(iAObj.filePath)

        return start, end