Skip to content

Commit d30e62b

Browse files
authored
Merge pull request #13 from NatronGitHub/py3-qtpy
Py3 qtpy
2 parents c28288b + cbc9c83 commit d30e62b

File tree

9 files changed

+126
-123
lines changed

9 files changed

+126
-123
lines changed

Python_GUI/batchSelectedNodes/batchSelectedNodes.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ def batchSelectedNodes():
6363
if userChoice == 0 : # disable Preview
6464
myknob = currentNode.getParam('enablePreview')
6565
myknob.setValue(False)
66-
print 'testfalse'
66+
print ('testfalse')
6767
currentNode.refreshUserParamsGUI()
6868
if userChoice == 1 : # enable Preview
6969
myknob = currentNode.getParam('enablePreview')
7070
myknob.setValue(True)
71-
print 'testtrue'
71+
print ('testtrue')
7272
currentNode.refreshUserParamsGUI()
7373
elif userChoice == 2 : # disable Node
7474
myknob = currentNode.getParam('disableNode')

Python_GUI/extractExrLayers/extractExrLayers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def extractExrLayers():
137137
# layer name #
138138
layerName = os.path.splitext(choice)[0]
139139

140-
print layerName
140+
print (layerName)
141141

142142
# layer channels (RGBA,RGB,XYZ,UV,A,Z) #
143143
layerChannels = os.path.splitext(choice)[1]

Python_GUI/extractImageLayers/extractImageLayers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def extractImageLayers():
8585
# layer name #
8686
layerName = choice
8787

88-
print layerName
88+
print (layerName)
8989

9090
# layer channels (RGBA,RGB,XYZ,UV,A,Z) #
9191
layerChannels = os.path.splitext(choice)[1]

Python_GUI/replacePaths/replacePaths.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ def replacePaths():
8080
newPathParamValue = newPath.getValue()
8181

8282
currentPath = str(currentNode.getParam('filename').get())
83-
print 'Old path : ' + currentPath
83+
print ('Old path : ' + currentPath)
8484

8585
currentPath = currentPath.replace(oldPathParamValue,newPathParamValue)
86-
print 'New path : ' + currentPath
86+
print ('New path : ' + currentPath)
8787

8888
oldReadPath = currentNode.getParam('filename').set(currentPath)

Python_GUI/trackerToRoto/trackerToRoto.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def trackerToRoto():
171171
keyCounter = 0
172172

173173
print ('point ' + str(pointIndex) + ' :')
174-
print '---------------------------------------------------------------'
174+
print ('---------------------------------------------------------------')
175175

176176
while keyCounter < (nXKeys):
177177

@@ -207,8 +207,8 @@ def trackerToRoto():
207207

208208
keyCounter += 1
209209

210-
print '---------------------------------------------------------------'
211-
print '\n'
210+
print ('---------------------------------------------------------------')
211+
print ('\n')
212212
#print '---------------------------------------------------------------'
213213
#print '***************************************************************'
214214

Python_INIT/listNatronPath/listNatronPath.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ def listNatronPath():
1515
listIndex = 0
1616

1717
for p in myPath:
18-
print ' ' + myPath[listIndex]
18+
print (' ' + myPath[listIndex])
1919
listIndex +=1

Python_INIT/natronLogo/natronLogo.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
#This Source Code Form is subject to the terms of the Mozilla Public
2-
#License, v. 2.0. If a copy of the MPL was not distributed with this
3-
#file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4-
#Created by Fabrice Fernandez on 17/01/2018.
1+
# #This Source Code Form is subject to the terms of the Mozilla Public
2+
# #License, v. 2.0. If a copy of the MPL was not distributed with this
3+
# #file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4+
# #Created by Fabrice Fernandez on 17/01/2018.
55

6-
import os
7-
import string
8-
from NatronEngine import*
9-
from os import*
6+
# import os
7+
# import string
8+
# from NatronEngine import*
9+
# from os import*
1010

11-
# LISTS NATRON PLUGINS PATHS #
11+
# # LISTS NATRON PLUGINS PATHS #
1212

1313

14-
def natronLogo():
15-
UserPath = os.path.expanduser('~')
16-
print ''.join(file( str(UserPath) + '/.Natron/Python_INIT/natronLogo/logo.txt'))
14+
# def natronLogo():
15+
# UserPath = os.path.expanduser('~')
16+
# print (''.join(file( str(UserPath) + '/.Natron/Python_INIT/natronLogo/logo.txt')))

init.py

+32-32
Original file line numberDiff line numberDiff line change
@@ -114,54 +114,54 @@ def Project_Callback(app):
114114

115115

116116
separator = ('------------------------------------------------------------')
117-
print '\n' + '\n' + separator
118-
print separator
119-
print '\n'
117+
print ('\n' + '\n' + separator)
118+
print (separator)
119+
print ('\n')
120120

121-
natronLogo()
121+
# natronLogo()
122122

123123

124-
print '\n' + '\n' + separator
125-
print separator
126-
print '-------------------- INIT.PY -----------------------'
127-
print separator
128-
print separator
124+
print ('\n' + '\n' + separator)
125+
print (separator)
126+
print ('-------------------- INIT.PY -----------------------')
127+
print (separator)
128+
print (separator)
129129

130130
# loading user preferences #
131131
#--------------------------#
132132

133-
print '\n'
133+
print ('\n')
134134
setPreferences()
135-
print '\n'
136-
print separator
135+
print ('\n')
136+
print (separator)
137137

138138
# check Natron's version status, version number, x32 or x64 version #
139139
#-------------------------------------------------------------------#
140-
print '\n'
140+
print ('\n')
141141
NatronStatus = natron.getNatronDevelopmentStatus()
142142
NatronVersion = natron.getNatronVersionString()
143143
binary = 'x64'
144144
x32_64 = natron.is64Bit()
145145
if x32_64 == 0 :
146146
binary = 'x32'
147147

148-
print ('- NATRON ') + 'version ' + NatronVersion + ' ' + str(NatronStatus) + ' (' + binary + ')'
149-
print '\n'
150-
print separator
148+
# print ('- NATRON ') + 'version ' + NatronVersion + ' ' + str(NatronStatus) + ' (' + binary + ')'
149+
print ('\n')
150+
print (separator)
151151

152-
print '\n'
152+
print ('\n')
153153
CPUs = natron.getNumCpus()
154-
print ('- ') + str(CPUs) + (' CPUs available on the system')
155-
print '\n'
156-
print separator
154+
# print ('- ') + str(CPUs) + (' CPUs available on the system')
155+
print ('\n')
156+
print (separator)
157157

158-
print '\n'
159-
print '- Deep layer added to the viewer'
160-
print '- Depth layer added to the viewer'
161-
print '- Mask layer added to the viewer'
162-
print '- Motion layer added to the viewer'
163-
print '\n'
164-
print separator
158+
print ('\n')
159+
print ('- Deep layer added to the viewer')
160+
print ('- Depth layer added to the viewer')
161+
print ('- Mask layer added to the viewer')
162+
print ('- Motion layer added to the viewer')
163+
print ('\n')
164+
print (separator)
165165

166166

167167
##################################################################
@@ -172,14 +172,14 @@ def Project_Callback(app):
172172
#################### print NATRON search path ####################
173173
listNatronPath()
174174

175-
print '\n' + separator
175+
print ('\n' + separator)
176176

177177
PyPlugMessage = ("- PYPLUG(S) LOADED :")
178-
print separator
179-
print '\n' + PyPlugMessage
178+
print (separator)
179+
print ('\n' + PyPlugMessage)
180180

181181
#################### print PYPLUG list ####################
182182
listPyPlugs()
183183

184-
print '\n' + separator
185-
print separator
184+
print ('\n' + separator)
185+
print (separator)

initGui.py

+72-69
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414
import sys
1515
from NatronEngine import *
1616
from NatronGui import *
17-
from PySide.QtGui import *
17+
try:
18+
from qtpy.QtGui import *
19+
except ImportError:
20+
from PySide.QtGui import *
1821

1922

2023
#####################################################################
@@ -91,7 +94,7 @@
9194
NatronGui.natron.addMenuCommand('Tools/Channel/Extract EXR layers','extractExrLayers')
9295
NatronGui.natron.addMenuCommand('Tools/Channel/Extract Image layers','extractImageLayers')
9396

94-
NatronGui.natron.addMenuCommand('Tools/Generate/PostageStamp','postageStamp', QtCore.Qt.Key.Key_P, QtCore.Qt.KeyboardModifier.ControlModifier | QtCore.Qt.AltModifier)
97+
NatronGui.natron.addMenuCommand('Tools/Generate/PostageStamp','postageStamp', QtCore.Qt.Key.Key_P, QtCore.Qt.KeyboardModifier.AltModifier)
9598
NatronGui.natron.addMenuCommand('Tools/Generate/Roto to tracker','rotoToTracker')
9699
NatronGui.natron.addMenuCommand('Tools/Generate/Tracker to roto','trackerToRoto')
97100

@@ -100,18 +103,18 @@
100103
NatronGui.natron.addMenuCommand('Edit/Reconnect nodes','reconnectNodes', QtCore.Qt.Key.Key_Y, QtCore.Qt.KeyboardModifier.AltModifier)
101104
NatronGui.natron.addMenuCommand('Edit/auto Reconnect Nodes','autoReconnect', QtCore.Qt.Key.Key_Y, QtCore.Qt.KeyboardModifier.ShiftModifier)
102105
NatronGui.natron.addMenuCommand('Edit/Force caching','forceCaching', QtCore.Qt.Key.Key_B, QtCore.Qt.KeyboardModifier.ControlModifier)
103-
NatronGui.natron.addMenuCommand('Edit/Color...','nodeChangeColor', QtCore.Qt.Key.Key_C, QtCore.Qt.KeyboardModifier.ControlModifier | QtCore.Qt.ShiftModifier)
106+
NatronGui.natron.addMenuCommand('Edit/Color...','nodeChangeColor', QtCore.Qt.Key.Key_C, QtCore.Qt.KeyboardModifier.ShiftModifier)
104107
NatronGui.natron.addMenuCommand('Edit/Bold node','nodeBold_HTML')
105108
NatronGui.natron.addMenuCommand('Edit/Italic node','nodeItalic_HTML')
106109
NatronGui.natron.addMenuCommand('Edit/Open location','openLocation', QtCore.Qt.Key.Key_O, QtCore.Qt.KeyboardModifier.AltModifier)
107110
NatronGui.natron.addMenuCommand('Edit/Select similar/Class','selectSimilarByClass')
108111
NatronGui.natron.addMenuCommand('Edit/Select similar/Color','selectSimilarByColor')
109-
NatronGui.natron.addMenuCommand('Edit/Invert selection','invertSelection', QtCore.Qt.Key.Key_I, QtCore.Qt.KeyboardModifier.ControlModifier | QtCore.Qt.ShiftModifier)
112+
NatronGui.natron.addMenuCommand('Edit/Invert selection','invertSelection', QtCore.Qt.Key.Key_I, QtCore.Qt.KeyboardModifier.ShiftModifier)
110113
NatronGui.natron.addMenuCommand('Edit/Remove input','removeInput', QtCore.Qt.Key.Key_D, QtCore.Qt.KeyboardModifier.ControlModifier)
111114

112115
NatronGui.natron.addMenuCommand('Tools/Other/Blending mode+','mergeBlendingDown', QtCore.Qt.Key.Key_Down, QtCore.Qt.AltModifier)
113116
NatronGui.natron.addMenuCommand('Tools/Other/Blending mode-','mergeBlendingUp', QtCore.Qt.Key.Key_Up, QtCore.Qt.AltModifier)
114-
NatronGui.natron.addMenuCommand('Tools/Other/Link roto to tracker','rotoLink', QtCore.Qt.Key.Key_L, QtCore.Qt.KeyboardModifier.ControlModifier | QtCore.Qt.ShiftModifier)
117+
NatronGui.natron.addMenuCommand('Tools/Other/Link roto to tracker','rotoLink', QtCore.Qt.Key.Key_L, QtCore.Qt.KeyboardModifier.ShiftModifier)
115118

116119
NatronGui.natron.addMenuCommand('Tools/Roto/Circle','fullCircle()')
117120
NatronGui.natron.addMenuCommand('Tools/Roto/Ellipse','fullEllipse()')
@@ -136,69 +139,69 @@
136139
NatronGui.natron.addMenuCommand('Render/Disk cache','diskCache()', QtCore.Qt.Key.Key_D, QtCore.Qt.KeyboardModifier.AltModifier)
137140
NatronGui.natron.addMenuCommand('Render/Flipbook','flipbook()', QtCore.Qt.Key.Key_F, QtCore.Qt.KeyboardModifier.AltModifier)
138141

139-
from Python_GUI.snapNodes.snapNodes import *
140-
NatronGui.natron.addMenuCommand('Tools/Node Graph/snap Nodes','snapNodes', QtCore.Qt.Key.Key_A,QtCore.Qt.KeyboardModifier)
141-
NatronGui.natron.addMenuCommand('Tools/Node Graph/Align Nodes X','alignNodesX' )
142-
NatronGui.natron.addMenuCommand('Tools/Node Graph/Align Nodes Y','alignNodesY' )
143-
NatronGui.natron.addMenuCommand('Tools/Node Graph/Spread Nodes X','spreadNodesX' )
144-
NatronGui.natron.addMenuCommand('Tools/Node Graph/Spread Nodes Y','spreadNodesY' )
142+
# from Python_GUI.snapNodes.snapNodes import *
143+
# NatronGui.natron.addMenuCommand('Tools/Node Graph/snap Nodes','snapNodes', QtCore.Qt.Key.Key_A,QtCore.Qt.KeyboardModifier)
144+
# NatronGui.natron.addMenuCommand('Tools/Node Graph/Align Nodes X','alignNodesX' )
145+
# NatronGui.natron.addMenuCommand('Tools/Node Graph/Align Nodes Y','alignNodesY' )
146+
# NatronGui.natron.addMenuCommand('Tools/Node Graph/Spread Nodes X','spreadNodesX' )
147+
# NatronGui.natron.addMenuCommand('Tools/Node Graph/Spread Nodes Y','spreadNodesY' )
145148

146149
separator = ('------------------------------------------------------------')
147-
print '\n' + '\n' + separator
148-
print separator
149-
print '------------------- INITGUI.PY ---------------------'
150-
print separator
151-
print separator
152-
print '\n'
153-
154-
print '- \'Tools\' user menu added'
155-
print '\n'
156-
print ' + Tools/Channel/Auto Alpha'
157-
print ' + Tools/Channel/Extract EXR layers'
158-
print ' + Tools/Channel/Extract Image layers'
159-
print ' +'
160-
print ' + Tools/Generate/PostageStamp'
161-
print ' + Tools/Generate/Roto to tracker'
162-
print ' + Tools/Generate/Tracker to roto'
163-
print ' +'
164-
print ' + Edit/Batch rename'
165-
print ' + Edit/Connect nodes'
166-
print ' + Edit/Reconnect nodes'
167-
print ' + Edit/Force caching'
168-
print ' + Edit/Invert selection'
169-
print ' + Edit/Node Color'
170-
print ' + Edit/Bold node'
171-
print ' + Edit/Italic node'
172-
print ' + Edit/Open location'
173-
print ' + Edit/Select similar/Class'
174-
print ' + Edit/Select similar/Color'
175-
print ' + Edit/Remove input'
176-
print ' +'
177-
print ' + Tools/Other/Blending mode+'
178-
print ' + Tools/Other/Blending mode-'
179-
print ' + Tools/Other/Link roto to tracker'
180-
print ' +'
181-
print ' + Tools/Roto/Circle'
182-
print ' + Tools/Roto/Ellipse'
183-
print ' + Tools/Roto/Square'
184-
print ' + Tools/Roto/Rounded square'
185-
print ' + Tools/Roto/Rectangle'
186-
print ' + Tools/Roto/Rounded rectangle'
187-
print ' + Tools/Roto/Left triangle'
188-
print ' + Tools/Roto/Right triangle'
189-
print ' + Tools/Roto/Top triangle'
190-
print ' + Tools/Roto/Bottom triangle'
191-
print ' +'
192-
print ' + Tools/Time/Read FPS'
193-
print ' + Tools/Time/Read frame range'
194-
print ' +'
195-
print ' + Tools/Utils/Collect files'
196-
print ' + Tools/Utils/Replace paths'
197-
print ' +'
198-
print ' + Render/Background render'
199-
print ' + Render/Disk cache'
200-
print ' + Render/Flipbook'
201-
202-
203-
print '\n' + '\n' + separator
204-
print separator + '\n'
150+
print ('\n' + '\n' + separator)
151+
print (separator)
152+
print ('------------------- INITGUI.PY ---------------------')
153+
print (separator)
154+
print (separator)
155+
print ('\n')
156+
157+
print ('- \'Tools\' user menu added')
158+
print ('\n')
159+
print (' + Tools/Channel/Auto Alpha')
160+
print (' + Tools/Channel/Extract EXR layers')
161+
print (' + Tools/Channel/Extract Image layers')
162+
print (' +')
163+
print (' + Tools/Generate/PostageStamp')
164+
print (' + Tools/Generate/Roto to tracker')
165+
print (' + Tools/Generate/Tracker to roto')
166+
print (' +')
167+
print (' + Edit/Batch rename')
168+
print (' + Edit/Connect nodes')
169+
print (' + Edit/Reconnect nodes')
170+
print (' + Edit/Force caching')
171+
print (' + Edit/Invert selection')
172+
print (' + Edit/Node Color')
173+
print (' + Edit/Bold node')
174+
print (' + Edit/Italic node')
175+
print (' + Edit/Open location')
176+
print (' + Edit/Select similar/Class')
177+
print (' + Edit/Select similar/Color')
178+
print (' + Edit/Remove input')
179+
print (' +')
180+
print (' + Tools/Other/Blending mode+')
181+
print (' + Tools/Other/Blending mode-')
182+
print (' + Tools/Other/Link roto to tracker')
183+
print (' +')
184+
print (' + Tools/Roto/Circle')
185+
print (' + Tools/Roto/Ellipse')
186+
print (' + Tools/Roto/Square')
187+
print (' + Tools/Roto/Rounded square')
188+
print (' + Tools/Roto/Rectangle')
189+
print (' + Tools/Roto/Rounded rectangle')
190+
print (' + Tools/Roto/Left triangle')
191+
print (' + Tools/Roto/Right triangle')
192+
print (' + Tools/Roto/Top triangle')
193+
print (' + Tools/Roto/Bottom triangle')
194+
print (' +')
195+
print (' + Tools/Time/Read FPS')
196+
print (' + Tools/Time/Read frame range')
197+
print (' +')
198+
print (' + Tools/Utils/Collect files')
199+
print (' + Tools/Utils/Replace paths')
200+
print (' +')
201+
print (' + Render/Background render')
202+
print (' + Render/Disk cache')
203+
print (' + Render/Flipbook')
204+
205+
206+
print ('\n' + '\n' + separator)
207+
print (separator + '\n')

0 commit comments

Comments
 (0)