-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathnodeChangeFrameRange.py
49 lines (33 loc) · 1.29 KB
/
nodeChangeFrameRange.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
48
49
#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 23/06/2019.
from NatronGui import *
from PySide.QtGui import *
# SETS FRAME RANGE FOR SELECTED 'READ' NODES #
def nodeChangeFrameRange():
app = natron.getGuiInstance(0)
dialog = app.createModalDialog()
# set dialog title #
dialog.setWindowTitle("Change frame range")
# set dialog margins #
dialog.setContentsMargins(0, 0, 10, 10)
# set window size #
dialog.resize( 240, 100 )
# create Color picker box #
firstFrame = dialog.createIntParam("firstFrame","In :")
lastFrame = dialog.createIntParam("lastFrame","Out :")
lastFrame.setAddNewLine(False)
line01 = dialog.createSeparatorParam("line01","")
dialog.refreshUserParamsGUI()
if dialog.exec_():
newFirstFrame = dialog.getParam("firstFrame").getValue()
newLastFrame = dialog.getParam("lastFrame").getValue()
selectedNodes = app.getSelectedNodes()
for n in selectedNodes:
myID = n.getPluginID()
if myID == "fr.inria.built-in.Read" :
oldFirstFrame = n.getParam("firstFrame")
oldFirstFrame.set(newFirstFrame)
oldLastFrame = n.getParam("lastFrame")
oldLastFrame.set(newLastFrame)