-
Notifications
You must be signed in to change notification settings - Fork 24
/
nodeChangeFPS.py
47 lines (32 loc) · 1.23 KB
/
nodeChangeFPS.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#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 22/06/2019.
import os
from NatronGui import *
from PySide.QtGui import *
# SETS FPS FOR SELECTED 'READ' NODES #
def nodeChangeFPS():
app = natron.getGuiInstance(0)
dialog = app.createModalDialog()
# set dialog title #
dialog.setWindowTitle("Change FPS")
# set dialog margins #
dialog.setContentsMargins(0, 0, 10, 10)
# create Color picker box #
fpsInput = dialog.createIntParam("fpsInput","New FPS : ")
fpsInput.set(25)
line01 = dialog.createSeparatorParam("line01","")
dialog.refreshUserParamsGUI()
if dialog.exec_():
newFPS = dialog.getParam("fpsInput").get()
selectedNodes = app.getSelectedNodes()
for n in selectedNodes:
myID = n.getPluginID()
if myID == "fr.inria.built-in.Read" :
nodeFramerate = n.getParam("frameRate")
nodeFramerate.set(newFPS)
print ('Read Node(s) set to : ') + str(nodeFramerate.get()) + (' fps.')
os.write(1, '\n' + 'Read Node(s) set to : ' + str(nodeFramerate.get()) + ' fps.' + '\n' )
customFPS = n.getParam("customFps")
customFPS.set(1)