def setValue2(self, value): if (self.getDefaultValue2() != value): self.setValue2HasChanged(True) if value != self.getValue2(): # Set the command cmdUpdate = CmdSetParamND(self, (self.getValue1(), value)) cmdManager = CommandManager() cmdManager.push(cmdUpdate)
def deleteConnection(self, connection): """ Removes a connection. Pushes a command in the CommandManager. """ cmdDeleteConnection = CmdDeleteConnection(self, connection) cmdManager = CommandManager() cmdManager.push(cmdDeleteConnection)
def deleteNodes(self, nodes): """ Removes a node in the node list when a node is deleted. Pushes a command in the CommandManager. """ cmdDeleteNodes = CmdDeleteNodes(self, nodes) cmdManager = CommandManager() cmdManager.push(cmdDeleteNodes)
def setValue1(self, value): if(self.getDefaultValue1() != value): self.setValue1HasChanged(True) if value != self.getValue1(): # Push the command cmdUpdate = CmdSetParamND(self, (value, self.getValue2())) cmdManager = CommandManager() cmdManager.push(cmdUpdate)
def deleteConnection(self, connection): """ Removes a connection. Pushes a command in the CommandManager. """ cmdDeleteConnection = CmdDeleteConnection(self, connection) cmdManager = CommandManager() cmdManager.push(cmdDeleteConnection)
def deleteNodes(self, nodes): """ Removes a node in the node list when a node is deleted. Pushes a command in the CommandManager. """ cmdDeleteNodes = CmdDeleteNodes(self, nodes) cmdManager = CommandManager() cmdManager.push(cmdDeleteNodes)
def setValue1(self, value): # if the value which is setting is different of the default value, # so the value has changed and title of param is displayed in bold in qml if(self.getDefaultValue1() != value): self.setValue1HasChanged(True) if value != self.getValue1(): # Push the command cmdUpdate = CmdSetParamND(self, (value, self.getValue2(), self.getValue3())) cmdManager = CommandManager() cmdManager.push(cmdUpdate)
def setValue1(self, value): # if the value which is setting is different of the default value, # so the value has changed and title of param is displayed in bold in qml if (self.getDefaultValue1() != value): self.setValue1HasChanged(True) if value != self.getValue1(): # Push the command cmdUpdate = CmdSetParamND(self, (value, self.getValue2())) cmdManager = CommandManager() cmdManager.push(cmdUpdate)
def createNode(self, nodeType, x=20, y=20): """ Adds a node from the node list when a node is created. """ cmdCreateNode = CmdCreateNode(self, nodeType, x, y) cmdManager = CommandManager() return cmdManager.push(cmdCreateNode)
def createNode(self, nodeType, x = 20, y = 20): """ Adds a node from the node list when a node is created. """ cmdCreateNode = CmdCreateNode(self, nodeType, x, y) cmdManager = CommandManager() return cmdManager.push(cmdCreateNode)
def createReaderNode(self, url, x, y): """ Creates a reader node when an image has been dropped in the graph. """ extension = url.split(".")[-1].lower() if extension in ['jpeg', 'jpg', 'jpe', 'jfif', 'jfi']: nodeType = 'tuttle.jpegreader' elif extension == 'png': nodeType = 'tuttle.pngreader' elif extension in ['mkv', 'mpeg', 'mp4', 'avi', 'mov', 'aac', 'ac3', 'adf', 'adx', 'aea', 'ape', 'apl', 'mac', 'bin', 'bit', 'bmv', 'cdg', 'cdxl', 'xl', '302', 'daud', 'dts', 'dv', 'dif', 'cdata', 'eac3', 'flm', 'flac', 'flv', 'g722', '722', 'tco', 'rco', 'g723_1', 'g729', 'gsm', 'h261', 'h26l', 'h264', '264', 'idf', 'cgi', 'latm', 'm4v', 'mjpg', 'mjpeg', 'mpo', 'mlp', 'mp2', 'mp3', 'm2a', 'mpc', 'mvi', 'mxg', 'v', 'nut', 'ogg', 'oma', 'omg', 'aa3', 'al', 'ul', 'sw', 'sb', 'uw', 'ub', 'yuv', 'cif', 'qcif', 'rgb', 'rt', 'rso', 'smi', 'sami', 'sbg', 'shn', 'vb', 'son', 'mjpg', 'sub', 'thd', 'tta', 'ans', 'art', 'asc', 'diz', 'ice', 'nfo', 'txt', 'vt', 'vc1', 'vqf', 'vql', 'vqe', 'vtt', 'yop', 'y4m']: nodeType = 'tuttle.ffmpegreader' elif extension in ['3fr', 'ari', 'arw', 'bay', 'crw', 'cr2', 'cap', 'dng', 'dcs', 'dcr', 'dng', 'drf', 'eip', 'erf', 'fff', 'iiq', 'k25', 'kdc', 'mef', 'mos', 'mrw', 'nef', 'nrw', 'obm', 'orf', 'pef', 'ptx', 'pxn', 'r3d', 'rad', 'raf', 'rw2', 'raw', 'rwl', 'rwz', 'srf', 'sr2', 'srw', 'x3f']: nodeType = 'tuttle.rawreader' elif extension in ['aai', 'art', 'arw', 'avi', 'avs', 'bmp', 'bmp2', 'bmp3', 'cals', 'cgm', 'cin', 'cmyk', 'cmyka', 'cr2', 'crw', 'cur', 'cut', 'dcm', 'dcr', 'dcx', 'dib', 'djvu', 'dng', 'dot', 'dpx', 'emf', 'epdf', 'epi', 'eps', 'eps2', 'eps3', 'epsf', 'epsi', 'ept', 'exr', 'fax', 'fig', 'fits', 'fpx', 'gif', 'gplt', 'gray', 'hdr', 'hpgl', 'hrz', 'html', 'ico', 'info', 'inline', 'jbig', 'jng', 'jp2', 'jpc', 'jpg', 'jpeg', 'man', 'mat', 'miff', 'mono', 'mng', 'm2v', 'mpeg', 'mpc', 'mpr', 'mrw', 'msl', 'mtv', 'mvg', 'nef', 'orf', 'otb', 'p7', 'palm', 'pam', 'pbm', 'pcd', 'pcds', 'pcl', 'pcx', 'pdb', 'pdf', 'pef', 'pfa', 'pfb', 'pfm', 'pgm', 'picon', 'pict', 'pix', 'png', 'png8', 'png16', 'png32', 'pnm', 'ppm', 'ps', 'ps2', 'ps3', 'psb', 'psd', 'ptif', 'pwp', 'rad', 'rgb', 'rgba', 'rla', 'rle', 'sct', 'sfw', 'sgi', 'shtml', 'sid', 'mrsid', 'sun', 'svg', 'tga', 'tiff', 'tim', 'tif', 'txt', 'uil', 'uyvy', 'vicar', 'viff', 'wbmp', 'webp', 'wmf', 'wpg', 'x', 'xbm', 'xcf', 'xpm', 'xwd', 'x3f', 'ycbcr', 'ycbcra', 'yuv']: nodeType = 'tuttle.imagemagickreader' elif extension in ['bmp', 'cin', 'dds', 'dpx', 'exr', 'fits', 'hdr', 'ico', 'j2k', 'j2c', 'jp2', 'jpeg', 'jpg', 'jpe', 'jfif', 'jfi', 'pbm', 'pgm', 'png', 'pnm', 'ppm', 'pic', 'psd', 'rgbe', 'sgi', 'tga', 'tif', 'tiff', 'tpic', 'tx', 'webp']: nodeType = 'tuttle.oiioreader' else: logging.debug("Unknown format. Can't create reader node.") return #use exception ! # We create the node. # We can't use a group of commands because we need the tuttle node to set the value, and this tuttle node is created in the function doCmd() of the cmdCreateNode. # So we use a special command CmdCreateReaderNode which creates a new node and set its value with the correct url. # See the definition of the class CmdCreateReaderNode. cmdCreateReaderNode = CmdCreateReaderNode(self, nodeType, x, y, url) cmdManager = CommandManager() return cmdManager.push(cmdCreateReaderNode)
def createConnection(self, clipOut, clipIn): """ Adds a connection in the connection list when a connection is created. Pushes a command in the CommandManager. """ cmdCreateConnection = CmdCreateConnection(self, clipOut, clipIn) cmdManager = CommandManager() return cmdManager.push(cmdCreateConnection)
def createConnection(self, clipOut, clipIn): """ Adds a connection in the connection list when a connection is created. Pushes a command in the CommandManager. """ cmdCreateConnection = CmdCreateConnection(self, clipOut, clipIn) cmdManager = CommandManager() return cmdManager.push(cmdCreateConnection)
def pushValue(self, value): if value != self.getOldValue(): # push the command cmdUpdate = CmdSetParamChoice(self, str(value)) cmdManager = CommandManager() cmdManager.push(cmdUpdate)
def pushValue(self, newValue): if newValue != self.getOldValue(): # Push the command cmdUpdate = CmdSetParamInt(self, int(newValue)) cmdManager = CommandManager() cmdManager.push(cmdUpdate)
def createReaderNode(self, url, x, y): """ Creates a reader node when an image has been dropped in the graph. """ extension = url.split(".")[-1].lower() if extension in ['jpeg', 'jpg', 'jpe', 'jfif', 'jfi']: nodeType = 'tuttle.jpegreader' elif extension == 'png': nodeType = 'tuttle.pngreader' elif extension in [ 'mkv', 'mpeg', 'mp4', 'avi', 'mov', 'aac', 'ac3', 'adf', 'adx', 'aea', 'ape', 'apl', 'mac', 'bin', 'bit', 'bmv', 'cdg', 'cdxl', 'xl', '302', 'daud', 'dts', 'dv', 'dif', 'cdata', 'eac3', 'flm', 'flac', 'flv', 'g722', '722', 'tco', 'rco', 'g723_1', 'g729', 'gsm', 'h261', 'h26l', 'h264', '264', 'idf', 'cgi', 'latm', 'm4v', 'mjpg', 'mjpeg', 'mpo', 'mlp', 'mp2', 'mp3', 'm2a', 'mpc', 'mvi', 'mxg', 'v', 'nut', 'ogg', 'oma', 'omg', 'aa3', 'al', 'ul', 'sw', 'sb', 'uw', 'ub', 'yuv', 'cif', 'qcif', 'rgb', 'rt', 'rso', 'smi', 'sami', 'sbg', 'shn', 'vb', 'son', 'mjpg', 'sub', 'thd', 'tta', 'ans', 'art', 'asc', 'diz', 'ice', 'nfo', 'txt', 'vt', 'vc1', 'vqf', 'vql', 'vqe', 'vtt', 'yop', 'y4m' ]: nodeType = 'tuttle.ffmpegreader' elif extension in [ '3fr', 'ari', 'arw', 'bay', 'crw', 'cr2', 'cap', 'dng', 'dcs', 'dcr', 'dng', 'drf', 'eip', 'erf', 'fff', 'iiq', 'k25', 'kdc', 'mef', 'mos', 'mrw', 'nef', 'nrw', 'obm', 'orf', 'pef', 'ptx', 'pxn', 'r3d', 'rad', 'raf', 'rw2', 'raw', 'rwl', 'rwz', 'srf', 'sr2', 'srw', 'x3f' ]: nodeType = 'tuttle.rawreader' elif extension in [ 'aai', 'art', 'arw', 'avi', 'avs', 'bmp', 'bmp2', 'bmp3', 'cals', 'cgm', 'cin', 'cmyk', 'cmyka', 'cr2', 'crw', 'cur', 'cut', 'dcm', 'dcr', 'dcx', 'dib', 'djvu', 'dng', 'dot', 'dpx', 'emf', 'epdf', 'epi', 'eps', 'eps2', 'eps3', 'epsf', 'epsi', 'ept', 'exr', 'fax', 'fig', 'fits', 'fpx', 'gif', 'gplt', 'gray', 'hdr', 'hpgl', 'hrz', 'html', 'ico', 'info', 'inline', 'jbig', 'jng', 'jp2', 'jpc', 'jpg', 'jpeg', 'man', 'mat', 'miff', 'mono', 'mng', 'm2v', 'mpeg', 'mpc', 'mpr', 'mrw', 'msl', 'mtv', 'mvg', 'nef', 'orf', 'otb', 'p7', 'palm', 'pam', 'pbm', 'pcd', 'pcds', 'pcl', 'pcx', 'pdb', 'pdf', 'pef', 'pfa', 'pfb', 'pfm', 'pgm', 'picon', 'pict', 'pix', 'png', 'png8', 'png16', 'png32', 'pnm', 'ppm', 'ps', 'ps2', 'ps3', 'psb', 'psd', 'ptif', 'pwp', 'rad', 'rgb', 'rgba', 'rla', 'rle', 'sct', 'sfw', 'sgi', 'shtml', 'sid', 'mrsid', 'sun', 'svg', 'tga', 'tiff', 'tim', 'tif', 'txt', 'uil', 'uyvy', 'vicar', 'viff', 'wbmp', 'webp', 'wmf', 'wpg', 'x', 'xbm', 'xcf', 'xpm', 'xwd', 'x3f', 'ycbcr', 'ycbcra', 'yuv' ]: nodeType = 'tuttle.imagemagickreader' elif extension in [ 'bmp', 'cin', 'dds', 'dpx', 'exr', 'fits', 'hdr', 'ico', 'j2k', 'j2c', 'jp2', 'jpeg', 'jpg', 'jpe', 'jfif', 'jfi', 'pbm', 'pgm', 'png', 'pnm', 'ppm', 'pic', 'psd', 'rgbe', 'sgi', 'tga', 'tif', 'tiff', 'tpic', 'tx', 'webp' ]: nodeType = 'tuttle.oiioreader' else: logging.debug("Unknown format. Can't create reader node.") return #use exception ! # We create the node. # We can't use a group of commands because we need the tuttle node to set the value, and this tuttle node is created in the function doCmd() of the cmdCreateNode. # So we use a special command CmdCreateReaderNode which creates a new node and set its value with the correct url. # See the definition of the class CmdCreateReaderNode. cmdCreateReaderNode = CmdCreateReaderNode(self, nodeType, x, y, url) cmdManager = CommandManager() return cmdManager.push(cmdCreateReaderNode)
def pushValue(self, newValue): if newValue != self.getOldValue(): # push the command cmdUpdate = CmdSetParamString(self, str(newValue)) cmdManager = CommandManager() cmdManager.push(cmdUpdate)
def pushValue(self, newValue): if newValue != self.getOldValue(): # push the command cmdUpdate = CmdSetParamDouble(self, float(newValue)) cmdManager = CommandManager() cmdManager.push(cmdUpdate)
def pushValue(self, value): # Push the command cmdUpdate = CmdSetParamBoolean(self, value) cmdManager = CommandManager() cmdManager.push(cmdUpdate)
def pushValue(self, newValue): if newValue != self.getOldValue(): # push the command cmdUpdate = CmdSetParamDouble(self, float(newValue)) cmdManager = CommandManager() cmdManager.push(cmdUpdate)
def pushValue(self, value): # Push the command cmdUpdate = CmdSetParamBoolean(self, value) cmdManager = CommandManager() cmdManager.push(cmdUpdate)
def pushValue(self, value): if value != self.getOldValue(): # push the command cmdUpdate = CmdSetParamChoice(self, str(value)) cmdManager = CommandManager() cmdManager.push(cmdUpdate)
def pushValue(self, newValue): if newValue != self.getOldValue(): # push the command cmdUpdate = CmdSetParamString(self, str(newValue)) cmdManager = CommandManager() cmdManager.push(cmdUpdate)