Ejemplo n.º 1
0
 def getCurrentColorNode(self):
     check = commands.nodesOfType('RVSource')
     if check:
         sourceNode = extra_commands.sourceMetaInfoAtFrame(commands.frame(), commands.viewNode())
         nodes = commands.nodesOfType('RVColor')
         for node in nodes:
             if node.startswith(sourceNode.get('node','').split('_')[0]):
                 _log.info('found %s' % node)
                 return node
     else:
         return
Ejemplo n.º 2
0
    def load(self):
        nodes = []
        for sequence in self.parent.edit["sequences"]:
            for shot in self.parent.edit[sequence]["shots"]:
                editShot = self.parent.edit[sequence][shot]
                storyboard = []
                animatic = []

                spec = ueSpec.Spec(os.getenv("PROJ"), sequence, shot, "sb",
                                   "storyboard", "master")

                storyboard = ueAssetUtils.getVersions(spec)

                if storyboard:
                    path = os.path.join(storyboard[-1]["path"],
                                        storyboard[-1]["file_name"] + ".jpg")
                    spec.eltype = "animatic"
                    spec.elclass = "an"
                    animatic = ueAssetUtils.getVersions(spec)
                    if animatic:
                        path = os.path.join(
                            animatic[-1]["path"],
                            animatic[-1]["file_name"] + ".####.jpeg")
                elif shot == "black":
                    path = os.path.join(os.getenv("UE_PATH"), "lib",
                                        "placeholders", "black.png")
                elif shot == "white":
                    path = os.path.join(os.getenv("UE_PATH"), "lib",
                                        "placeholders", "white.png")
                else:
                    path = os.path.join(os.getenv("UE_PATH"), "lib",
                                        "placeholders", "nuke.png")

                commands.addSource(path, None)

                sourceNode = commands.nodesOfType("RVSourceGroup")[-1]

                if storyboard and not animatic:
                    retimeNode = commands.newNode(
                        "RVRetimeGroup", "%s_%sRetime" % (sequence, shot))
                    commands.setNodeInputs(retimeNode, [sourceNode])
                    time = float(editShot["endFrame"]) - float(
                        editShot["startFrame"]) + 1
                    commands.setFloatProperty(
                        "%s_retime.visual.scale" % retimeNode, [float(time)],
                        False)
                    node = retimeNode
                else:
                    node = sourceNode

                nodes.append(node)

        commands.setNodeInputs("defaultSequence", nodes)
        commands.setViewNode("defaultSequence")
 def _set_display_to_no_correction(self, event):
     """
     Makes sure we have No Correction set in the View menu by
     disabling sRGB and Rec709 for all DisplayColor nodes.
     
     This is less confusing for users than setting up a display
     profile, so we do this here.
     """
     display_nodes = commands.nodesOfType("RVDisplayColor")
     for display_node in display_nodes:
         commands.setIntProperty("%s.color.sRGB" % display_node, [0], True)
         commands.setIntProperty("%s.color.Rec709" % display_node, [0], True)
Ejemplo n.º 4
0
	def addLayer(self):
		"""docstring for fname"""
		stacks = commands.nodesOfType("RVStackGroup")
		commands.setViewNode( stacks[0] )
		layer = self._selectedRender
		version = self._selectedVersion
		sqfFil = sqf.sequenceFile( layer + '/' + version + '/' + self._selectedLayer + '.exr' )
		asd = commands.addSourceVerbose( [layer + '/' + version + '/' + self._selectedLayer + '.' + str(sqfFil.start) + '-' + str(sqfFil.end) + '#.exr'], None )
		assGroup = commands.nodeGroup(asd)
		commands.setStringProperty(assGroup + '.ui.name', [self._selectedShot.name + ' - ' + self._selectedLayer + ' - ' + version])
		item = QtGui.QListWidgetItem(self._selectedShot.name + ' - ' + self._selectedLayer + ' - ' + version )
		item.setCheckState( QtCore.Qt.Checked )
		item.setData(32, [asd, [sqfFil, self._selectedShot, self._selectedLayer, version ]] )
		self.viewLayers_lw.addItem( item )
Ejemplo n.º 5
0
 def propagateToAllRvColor(self):
     '''
     sets the current settings to all rvcolor nodes found 
     '''
     nodes = commands.nodesOfType('RVColor')
     propList = ['gamma','scale','offset','exposure','saturation']
     for node in nodes:
         for prop in propList:
             correction = getattr(self,prop)
             if prop == 'saturation':
                 values =  [self.saturation.value()]
             else:
                 values = self.getValuesFromList(correction)
             try:
                 commands.setFloatProperty("%s.color.%s" % (node,prop), values, True)
             except Exception, e:
                 print e
Ejemplo n.º 6
0
Archivo: EditUI.py Proyecto: hdd/ue
    def load(self):
        nodes = []
        for sequence in self.parent.edit["sequences"]:
            for shot in self.parent.edit[sequence]["shots"]:
                editShot = self.parent.edit[sequence][shot]
                storyboard = []
                animatic = []

                spec = ueSpec.Spec(os.getenv("PROJ"), sequence, shot, "sb", "storyboard", "master")

                storyboard = ueAssetUtils.getVersions(spec)

                if storyboard:
                    path = os.path.join(storyboard[-1]["path"], storyboard[-1]["file_name"]+".jpg")
                    spec.eltype = "animatic"
                    spec.elclass = "an"
                    animatic = ueAssetUtils.getVersions(spec)
                    if animatic:
                        path = os.path.join(animatic[-1]["path"], animatic[-1]["file_name"]+".####.jpeg")
                elif shot == "black":
                    path = os.path.join(os.getenv("UE_PATH"), "lib", "placeholders", "black.png")
                elif shot == "white":
                    path = os.path.join(os.getenv("UE_PATH"), "lib", "placeholders", "white.png")
                else:
                    path = os.path.join(os.getenv("UE_PATH"), "lib", "placeholders", "nuke.png")

                commands.addSource(path, None)

                sourceNode = commands.nodesOfType("RVSourceGroup")[-1]

                if storyboard and not animatic:
                    retimeNode = commands.newNode("RVRetimeGroup", "%s_%sRetime" % (sequence, shot))
                    commands.setNodeInputs(retimeNode, [sourceNode])
                    time = float(editShot["endFrame"])-float(editShot["startFrame"])+1
                    commands.setFloatProperty("%s_retime.visual.scale" % retimeNode, [float(time)], False)
                    node = retimeNode
                else:
                    node = sourceNode

                nodes.append(node)

        commands.setNodeInputs("defaultSequence", nodes)
        commands.setViewNode("defaultSequence")
Ejemplo n.º 7
0
    def expand_sources(self):
        """
        Expand any movie movieproc otioFile sources.
        """
        # disable caching for load speed
        cache_mode = commands.cacheMode()
        commands.setCacheMode(commands.CacheOff)

        try:
            # find sources with a movieproc with an otioFile=foo.otio tag
            default_inputs, _ = commands.nodeConnections('defaultSequence')
            for src in commands.nodesOfType('RVSource'):
                src_group = commands.nodeGroup(src)
                if src_group not in default_inputs:
                    # not in default sequence, already processed
                    continue

                # get the source file name
                paths = [
                    info['file'] for info in commands.sourceMediaInfoList(src)
                    if 'file' in info
                ]
                for info_path in paths:
                    # Looking for: 'blank,otioFile=/foo.otio.movieproc'
                    parts = info_path.split("=", 1)
                    itype = parts[0]
                    if not itype.startswith('blank,otioFile'):
                        continue
                    # remove the .movieproc extension
                    path, _ = os.path.splitext(parts[1])

                    # remove temp movieproc source from current view, and all
                    # the default views
                    _remove_source_from_views(src_group)

                    result = otio_reader.read_otio_file(path)
                    commands.setViewNode(result)
                    break
        finally:
            # turn cache mode back on and go back to sleep
            commands.setCacheMode(cache_mode)
            self.mode = Mode.sleeping