# import os import basicCaraTestClass as BCTC ''' Written by Thomas Rice Research QA - Any Questions Please Ask - [email protected] 27/07/2016 ''' #CameraSolver creation and solve node = BCTC.createNode('C_CameraSolver1_0') BCTC.loadImages(node) BCTC.CS_matchCameras(node) BCTC.CS_solveCameras(node) #ColourMatcher creation and solve Snode = BCTC.createNode('C_Stitcher1_0') BCTC.setExportOption(Snode, 0) BCTC.exportSelection(Snode) nodeConnectionSet = BCTC.checkNodeConnections("C_Stitcher1", "STMap2") #The Format and connections that should be present originalNodes = set([('Grade8', 'Exposure1'), ('STMap2', ), ('BlackOutside1', 'STMap2')]) result = nodeConnectionSet.difference(originalNodes) if result != set([]): nuke.tprint( 'Test failed as the there was a difference in the node connections, they were .. ', result) sys.exit(1) else: nuke.tprint('Test passed as there were no differences in the two sets')
# import os import basicCaraTestClass as BCTC ''' Written by Thomas Rice Research QA - Any Questions Please Ask - [email protected] 27/07/2016 ''' #CameraSolver creation and solve node = BCTC.createNode('C_CameraSolver1_0') BCTC.loadImages(node) BCTC.CS_matchCameras(node) BCTC.CS_solveCameras(node) #ColourMatcher creation and solve CMnode = BCTC.createNode('C_ColourMatcher1_0') BCTC.CM_Analyse(CMnode) BCTC.setExportOption(CMnode, 0) BCTC.exportSelection(CMnode) nodeConnectionSet = BCTC.checkNodeConnections("C_ColourMatcher1", "Exposure1") #The Format and connections that should be present originalNodes = set([ ('Grade7', 'Exposure1') ]) result = nodeConnectionSet.difference(originalNodes) if result != set([]): nuke.tprint('Test failed as the there was a difference in the node connections, they were .. ' , result )
# import os # os.chdir("/Users/Tom/Desktop/Python/nuketests/Tests/Apps/Nuke/TestUnits/CaraVR/Tests") import basicCaraTestClass as BCTC ''' Written by Thomas Rice Research QA - Any Questions Please Ask - [email protected] 27/07/2016 To Do: - Find a way to get into the group and list the nodes ''' node = BCTC.createNode('C_CameraSolver1_0') BCTC.loadImages(node) BCTC.CS_matchCameras(node) BCTC.CS_solveCameras(node) BCTC.setExportOption(node, 3) BCTC.exportSelection(node) nodeConnectionSet = set() #As we create groups of nodes with this operation we will need to go into it to check what's in there. goIntoGroup = nuke.toNode("RigWorkflow2D") with goIntoGroup: #Get all of the inputs so we can check their connections inputGroup = nuke.allNodes('Input') for node in inputGroup: nodeConnectionSet.update( BCTC.checkNodeConnections(node.name(), "Output1")) # The Format and connections that should be present originalNodes = set([('AlphaMaskGenerator', 'C_SphericalTransform7', 'JoinViews1', 'C_Blender1', 'Output1'), ('AlphaMaskGenerator5', 'C_SphericalTransform5',
# import os import basicCaraTestClass as BCTC ''' Written by Thomas Rice Research QA - Any Questions Please Ask - [email protected] 27/07/2016 ''' #CameraSolver creation and solve node = BCTC.createNode('C_CameraSolver1_0') BCTC.loadImages(node) BCTC.CS_matchCameras(node) BCTC.CS_solveCameras(node) #ColourMatcher creation and solve Tnode = BCTC.createNode('C_Tracker1_0') BCTC.setExportOption(Tnode, 0) BCTC.exportSelection(Tnode) nodeConnectionSet = BCTC.checkNodeConnections( "C_CameraSolver1", "C_SphericalTransform_Stabilize1") #The Format and connections that should be present originalNodes = set([('C_SphericalTransform_Stabilize1', ), ('C_Tracker1', 'C_SphericalTransform_Stabilize1')]) result = nodeConnectionSet.difference(originalNodes) if result != set([]): nuke.tprint( 'Test failed as the there was a difference in the node connections, they were .. ', result) sys.exit(1) else:
import stitcherTemplate as CST import basicCaraTestClass as BCTC #Setup a cameraSolver and readnodes all connected from the template class CS = CST.stitcherTemplate(__file__) #Return the node created - In this case C_CameraSolver stitcher = CS.returnNode() stitcher['enableStereo'].setValue(1) OneView = nuke.createNode("OneView") OneView['view'].setValue('right') ''' Variables ''' # Create the blender joinViews = BCTC.createAndConnectJoinViews(stitcher) joinViews.connectInput(7, OneView) blender = BCTC.createNode('C_Blender1_0') #Write out the result and then compare that with the reference images CS.compare()
import nuke import basicCaraTestClass as BCTC fileName = BCTC.getFileName(__file__) comparePath = ( '/Volumes/netqa/netqa/Testing/TestHarness/Research/CaraVR/Stitcher/{}.%V.exr' ).format(fileName) node = BCTC.createNode('C_CameraSolver1_0') BCTC.loadImages(node) BCTC.CS_matchCameras(node) BCTC.CS_solveCameras(node) stitcher = BCTC.createNode("C_Stitcher1_0") stitcher['enableStereo'].setValue(1) stitcher['vectorDetail'].setValue(0.6) ''' WRITE OUT ''' write = BCTC.createNode('Write') write.connectInput(1, stitcher) #Set the generic stuff BCTC.setWriteNode(write) filePath = ('[getenv TEST_TEMP]/{}.%V.exr').format(fileName) write['file'].setValue(filePath) nuke.execute(write, 1, 1) compareNode = BCTC.createCompareNode(0.001, 0.001) readNode = BCTC.createReadNode(comparePath) readNode2 = BCTC.createReadNode(filePath) compareNode.connectInput(1, readNode)
# import os import basicCaraTestClass as BCTC ''' Written by Thomas Rice Research QA - Any Questions Please Ask - [email protected] 27/07/2016 ''' #CameraSolver creation and solve node = BCTC.createNode('C_CameraSolver1_0') BCTC.loadImages(node) BCTC.CS_matchCameras(node) BCTC.CS_solveCameras(node) #ColourMatcher creation and solve STnode = BCTC.createNode('C_SphericalTransform1_0') BCTC.setExportOption(STnode, 0) BCTC.exportSelection(STnode) nodeConnectionSet = BCTC.checkNodeConnections("C_CameraSolver1", "C_SphericalTransform2") #The Format and connections that should be present originalNodes = set([('C_SphericalTransform1', 'C_SphericalTransform2'), ('C_SphericalTransform2', )]) result = nodeConnectionSet.difference(originalNodes) if result != set([]): nuke.tprint( 'Test failed as the there was a difference in the node connections, they were .. ', result) sys.exit(1) else:
filesToMake = set() path = '/Volumes/netqa/Testing/TestHarness/Research/CaraVR/Import_Presets/' # Get all directories in this directory [1] is the directory part of the tuple [0] is the root and [2] is files files = os.walk(path).next()[2] #Get a list of all the images that are currently created for file in files: #remove the .py result = file.rsplit('.', 2) filesToMake.add(result[0]) #CameraSolver creation and solve node = BCTC.createNode('C_CameraSolver1_0') BCTC.loadImages(node) #Create a write node write = BCTC.createNode('Write') #Set the generic stuff setWriteNode(write) #Get all the presets in the cameraSolver node rigPresetList = [] for i in node['rigPreset'].values(): rigPresetList.append(i) for preset in rigPresetList: print preset #Ignore all the presets that need inputs if 'Custom' in preset: