From 26f10966f966efdf826a5b9a2103b2dcb0fb2f90 Mon Sep 17 00:00:00 2001 From: cgvirus Date: Sun, 5 Jun 2022 22:39:39 +0600 Subject: [PATCH 1/3] py3 update --- Python_INIT/listNatronPath/listNatronPath.py | 2 +- Python_INIT/natronLogo/natronLogo.py | 24 ++-- init.py | 64 +++++----- initGui.py | 121 ++++++++++--------- 4 files changed, 107 insertions(+), 104 deletions(-) diff --git a/Python_INIT/listNatronPath/listNatronPath.py b/Python_INIT/listNatronPath/listNatronPath.py index 7c549f1..60f8592 100644 --- a/Python_INIT/listNatronPath/listNatronPath.py +++ b/Python_INIT/listNatronPath/listNatronPath.py @@ -15,5 +15,5 @@ def listNatronPath(): listIndex = 0 for p in myPath: - print ' ' + myPath[listIndex] + print (' ' + myPath[listIndex]) listIndex +=1 diff --git a/Python_INIT/natronLogo/natronLogo.py b/Python_INIT/natronLogo/natronLogo.py index d3af249..a1fae61 100644 --- a/Python_INIT/natronLogo/natronLogo.py +++ b/Python_INIT/natronLogo/natronLogo.py @@ -1,16 +1,16 @@ -#This Source Code Form is subject to the terms of the Mozilla Public -#License, v. 2.0. If a copy of the MPL was not distributed with this -#file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#Created by Fabrice Fernandez on 17/01/2018. +# #This Source Code Form is subject to the terms of the Mozilla Public +# #License, v. 2.0. If a copy of the MPL was not distributed with this +# #file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +# #Created by Fabrice Fernandez on 17/01/2018. -import os -import string -from NatronEngine import* -from os import* +# import os +# import string +# from NatronEngine import* +# from os import* -# LISTS NATRON PLUGINS PATHS # +# # LISTS NATRON PLUGINS PATHS # -def natronLogo(): - UserPath = os.path.expanduser('~') - print ''.join(file( str(UserPath) + '/.Natron/Python_INIT/natronLogo/logo.txt')) +# def natronLogo(): +# UserPath = os.path.expanduser('~') +# print (''.join(file( str(UserPath) + '/.Natron/Python_INIT/natronLogo/logo.txt'))) diff --git a/init.py b/init.py index e781887..c7109e9 100644 --- a/init.py +++ b/init.py @@ -114,30 +114,30 @@ def Project_Callback(app): separator = ('------------------------------------------------------------') -print '\n' + '\n' + separator -print separator -print '\n' +print ('\n' + '\n' + separator) +print (separator) +print ('\n') -natronLogo() +# natronLogo() -print '\n' + '\n' + separator -print separator -print '-------------------- INIT.PY -----------------------' -print separator -print separator +print ('\n' + '\n' + separator) +print (separator) +print ('-------------------- INIT.PY -----------------------') +print (separator) +print (separator) # loading user preferences # #--------------------------# -print '\n' +print ('\n') setPreferences() -print '\n' -print separator +print ('\n') +print (separator) # check Natron's version status, version number, x32 or x64 version # #-------------------------------------------------------------------# -print '\n' +print ('\n') NatronStatus = natron.getNatronDevelopmentStatus() NatronVersion = natron.getNatronVersionString() binary = 'x64' @@ -145,23 +145,23 @@ def Project_Callback(app): if x32_64 == 0 : binary = 'x32' -print ('- NATRON ') + 'version ' + NatronVersion + ' ' + str(NatronStatus) + ' (' + binary + ')' -print '\n' -print separator +# print ('- NATRON ') + 'version ' + NatronVersion + ' ' + str(NatronStatus) + ' (' + binary + ')' +print ('\n') +print (separator) -print '\n' +print ('\n') CPUs = natron.getNumCpus() -print ('- ') + str(CPUs) + (' CPUs available on the system') -print '\n' -print separator +# print ('- ') + str(CPUs) + (' CPUs available on the system') +print ('\n') +print (separator) -print '\n' -print '- Deep layer added to the viewer' -print '- Depth layer added to the viewer' -print '- Mask layer added to the viewer' -print '- Motion layer added to the viewer' -print '\n' -print separator +print ('\n') +print ('- Deep layer added to the viewer') +print ('- Depth layer added to the viewer') +print ('- Mask layer added to the viewer') +print ('- Motion layer added to the viewer') +print ('\n') +print (separator) ################################################################## @@ -172,14 +172,14 @@ def Project_Callback(app): #################### print NATRON search path #################### listNatronPath() -print '\n' + separator +print ('\n' + separator) PyPlugMessage = ("- PYPLUG(S) LOADED :") -print separator -print '\n' + PyPlugMessage +print (separator) +print ('\n' + PyPlugMessage) #################### print PYPLUG list #################### listPyPlugs() -print '\n' + separator -print separator \ No newline at end of file +print ('\n' + separator) +print (separator) \ No newline at end of file diff --git a/initGui.py b/initGui.py index 1bc5263..b6327d5 100644 --- a/initGui.py +++ b/initGui.py @@ -14,7 +14,10 @@ import sys from NatronEngine import * from NatronGui import * -from PySide.QtGui import * +try: + from qtpy.QtGui import * +except ImportError: + from PySide.QtGui import * ##################################################################### @@ -144,61 +147,61 @@ NatronGui.natron.addMenuCommand('Tools/Node Graph/Spread Nodes Y','spreadNodesY' ) separator = ('------------------------------------------------------------') -print '\n' + '\n' + separator -print separator -print '------------------- INITGUI.PY ---------------------' -print separator -print separator -print '\n' - -print '- \'Tools\' user menu added' -print '\n' -print ' + Tools/Channel/Auto Alpha' -print ' + Tools/Channel/Extract EXR layers' -print ' + Tools/Channel/Extract Image layers' -print ' +' -print ' + Tools/Generate/PostageStamp' -print ' + Tools/Generate/Roto to tracker' -print ' + Tools/Generate/Tracker to roto' -print ' +' -print ' + Edit/Batch rename' -print ' + Edit/Connect nodes' -print ' + Edit/Reconnect nodes' -print ' + Edit/Force caching' -print ' + Edit/Invert selection' -print ' + Edit/Node Color' -print ' + Edit/Bold node' -print ' + Edit/Italic node' -print ' + Edit/Open location' -print ' + Edit/Select similar/Class' -print ' + Edit/Select similar/Color' -print ' + Edit/Remove input' -print ' +' -print ' + Tools/Other/Blending mode+' -print ' + Tools/Other/Blending mode-' -print ' + Tools/Other/Link roto to tracker' -print ' +' -print ' + Tools/Roto/Circle' -print ' + Tools/Roto/Ellipse' -print ' + Tools/Roto/Square' -print ' + Tools/Roto/Rounded square' -print ' + Tools/Roto/Rectangle' -print ' + Tools/Roto/Rounded rectangle' -print ' + Tools/Roto/Left triangle' -print ' + Tools/Roto/Right triangle' -print ' + Tools/Roto/Top triangle' -print ' + Tools/Roto/Bottom triangle' -print ' +' -print ' + Tools/Time/Read FPS' -print ' + Tools/Time/Read frame range' -print ' +' -print ' + Tools/Utils/Collect files' -print ' + Tools/Utils/Replace paths' -print ' +' -print ' + Render/Background render' -print ' + Render/Disk cache' -print ' + Render/Flipbook' - - -print '\n' + '\n' + separator -print separator + '\n' \ No newline at end of file +print ('\n' + '\n' + separator) +print (separator) +print ('------------------- INITGUI.PY ---------------------') +print (separator) +print (separator) +print ('\n') + +print ('- \'Tools\' user menu added') +print ('\n') +print (' + Tools/Channel/Auto Alpha') +print (' + Tools/Channel/Extract EXR layers') +print (' + Tools/Channel/Extract Image layers') +print (' +') +print (' + Tools/Generate/PostageStamp') +print (' + Tools/Generate/Roto to tracker') +print (' + Tools/Generate/Tracker to roto') +print (' +') +print (' + Edit/Batch rename') +print (' + Edit/Connect nodes') +print (' + Edit/Reconnect nodes') +print (' + Edit/Force caching') +print (' + Edit/Invert selection') +print (' + Edit/Node Color') +print (' + Edit/Bold node') +print (' + Edit/Italic node') +print (' + Edit/Open location') +print (' + Edit/Select similar/Class') +print (' + Edit/Select similar/Color') +print (' + Edit/Remove input') +print (' +') +print (' + Tools/Other/Blending mode+') +print (' + Tools/Other/Blending mode-') +print (' + Tools/Other/Link roto to tracker') +print (' +') +print (' + Tools/Roto/Circle') +print (' + Tools/Roto/Ellipse') +print (' + Tools/Roto/Square') +print (' + Tools/Roto/Rounded square') +print (' + Tools/Roto/Rectangle') +print (' + Tools/Roto/Rounded rectangle') +print (' + Tools/Roto/Left triangle') +print (' + Tools/Roto/Right triangle') +print (' + Tools/Roto/Top triangle') +print (' + Tools/Roto/Bottom triangle') +print (' +') +print (' + Tools/Time/Read FPS') +print (' + Tools/Time/Read frame range') +print (' +') +print (' + Tools/Utils/Collect files') +print (' + Tools/Utils/Replace paths') +print (' +') +print (' + Render/Background render') +print (' + Render/Disk cache') +print (' + Render/Flipbook') + + +print ('\n' + '\n' + separator) +print (separator + '\n') \ No newline at end of file From 60215770f37f6f5f040222f164842bc31b128be8 Mon Sep 17 00:00:00 2001 From: cgvirus Date: Mon, 6 Jun 2022 01:05:01 +0600 Subject: [PATCH 2/3] qtpy py3 update --- Python_GUI/batchSelectedNodes/batchSelectedNodes.py | 4 ++-- Python_GUI/extractExrLayers/extractExrLayers.py | 2 +- Python_GUI/extractImageLayers/extractImageLayers.py | 2 +- Python_GUI/replacePaths/replacePaths.py | 4 ++-- Python_GUI/trackerToRoto/trackerToRoto.py | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Python_GUI/batchSelectedNodes/batchSelectedNodes.py b/Python_GUI/batchSelectedNodes/batchSelectedNodes.py index 92d2ee5..0f1cc7e 100644 --- a/Python_GUI/batchSelectedNodes/batchSelectedNodes.py +++ b/Python_GUI/batchSelectedNodes/batchSelectedNodes.py @@ -63,12 +63,12 @@ def batchSelectedNodes(): if userChoice == 0 : # disable Preview myknob = currentNode.getParam('enablePreview') myknob.setValue(False) - print 'testfalse' + print ('testfalse') currentNode.refreshUserParamsGUI() if userChoice == 1 : # enable Preview myknob = currentNode.getParam('enablePreview') myknob.setValue(True) - print 'testtrue' + print ('testtrue') currentNode.refreshUserParamsGUI() elif userChoice == 2 : # disable Node myknob = currentNode.getParam('disableNode') diff --git a/Python_GUI/extractExrLayers/extractExrLayers.py b/Python_GUI/extractExrLayers/extractExrLayers.py index 88d5964..10f3f68 100644 --- a/Python_GUI/extractExrLayers/extractExrLayers.py +++ b/Python_GUI/extractExrLayers/extractExrLayers.py @@ -137,7 +137,7 @@ def extractExrLayers(): # layer name # layerName = os.path.splitext(choice)[0] - print layerName + print (layerName) # layer channels (RGBA,RGB,XYZ,UV,A,Z) # layerChannels = os.path.splitext(choice)[1] diff --git a/Python_GUI/extractImageLayers/extractImageLayers.py b/Python_GUI/extractImageLayers/extractImageLayers.py index 0e4a36f..d3c944e 100644 --- a/Python_GUI/extractImageLayers/extractImageLayers.py +++ b/Python_GUI/extractImageLayers/extractImageLayers.py @@ -85,7 +85,7 @@ def extractImageLayers(): # layer name # layerName = choice - print layerName + print (layerName) # layer channels (RGBA,RGB,XYZ,UV,A,Z) # layerChannels = os.path.splitext(choice)[1] diff --git a/Python_GUI/replacePaths/replacePaths.py b/Python_GUI/replacePaths/replacePaths.py index aa891ba..0ef1724 100644 --- a/Python_GUI/replacePaths/replacePaths.py +++ b/Python_GUI/replacePaths/replacePaths.py @@ -80,9 +80,9 @@ def replacePaths(): newPathParamValue = newPath.getValue() currentPath = str(currentNode.getParam('filename').get()) - print 'Old path : ' + currentPath + print ('Old path : ' + currentPath) currentPath = currentPath.replace(oldPathParamValue,newPathParamValue) - print 'New path : ' + currentPath + print ('New path : ' + currentPath) oldReadPath = currentNode.getParam('filename').set(currentPath) diff --git a/Python_GUI/trackerToRoto/trackerToRoto.py b/Python_GUI/trackerToRoto/trackerToRoto.py index a07deeb..661485b 100644 --- a/Python_GUI/trackerToRoto/trackerToRoto.py +++ b/Python_GUI/trackerToRoto/trackerToRoto.py @@ -171,7 +171,7 @@ def trackerToRoto(): keyCounter = 0 print ('point ' + str(pointIndex) + ' :') - print '---------------------------------------------------------------' + print ('---------------------------------------------------------------') while keyCounter < (nXKeys): @@ -207,8 +207,8 @@ def trackerToRoto(): keyCounter += 1 - print '---------------------------------------------------------------' - print '\n' + print ('---------------------------------------------------------------') + print ('\n') #print '---------------------------------------------------------------' #print '***************************************************************' From cc5e421df9663d03ae5db38e88bd3e0cd18dd133 Mon Sep 17 00:00:00 2001 From: Fahad Hasan Pathik Date: Tue, 21 Jun 2022 02:45:44 +0600 Subject: [PATCH 3/3] changing shortcut A to default --- initGui.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/initGui.py b/initGui.py index b6327d5..d2531d9 100644 --- a/initGui.py +++ b/initGui.py @@ -139,12 +139,12 @@ NatronGui.natron.addMenuCommand('Render/Disk cache','diskCache()', QtCore.Qt.Key.Key_D, QtCore.Qt.KeyboardModifier.AltModifier) NatronGui.natron.addMenuCommand('Render/Flipbook','flipbook()', QtCore.Qt.Key.Key_F, QtCore.Qt.KeyboardModifier.AltModifier) -from Python_GUI.snapNodes.snapNodes import * -NatronGui.natron.addMenuCommand('Tools/Node Graph/snap Nodes','snapNodes', QtCore.Qt.Key.Key_A,QtCore.Qt.KeyboardModifier) -NatronGui.natron.addMenuCommand('Tools/Node Graph/Align Nodes X','alignNodesX' ) -NatronGui.natron.addMenuCommand('Tools/Node Graph/Align Nodes Y','alignNodesY' ) -NatronGui.natron.addMenuCommand('Tools/Node Graph/Spread Nodes X','spreadNodesX' ) -NatronGui.natron.addMenuCommand('Tools/Node Graph/Spread Nodes Y','spreadNodesY' ) +# from Python_GUI.snapNodes.snapNodes import * +# NatronGui.natron.addMenuCommand('Tools/Node Graph/snap Nodes','snapNodes', QtCore.Qt.Key.Key_A,QtCore.Qt.KeyboardModifier) +# NatronGui.natron.addMenuCommand('Tools/Node Graph/Align Nodes X','alignNodesX' ) +# NatronGui.natron.addMenuCommand('Tools/Node Graph/Align Nodes Y','alignNodesY' ) +# NatronGui.natron.addMenuCommand('Tools/Node Graph/Spread Nodes X','spreadNodesX' ) +# NatronGui.natron.addMenuCommand('Tools/Node Graph/Spread Nodes Y','spreadNodesY' ) separator = ('------------------------------------------------------------') print ('\n' + '\n' + separator)