Skip to content

Commit 283c3da

Browse files
committed
update
1 parent 1b052f5 commit 283c3da

File tree

12 files changed

+79
-16
lines changed

12 files changed

+79
-16
lines changed

Python_INIT/addDeepLayer/README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
# addDepthLayer
22

3-
Adds 'Deep' layer to Natron.
3+
Adds 'Deep' layer to Natron.
4+
5+
### USAGE
6+
7+
* Copy code in the init.py file.

Python_INIT/addDeepLayer/addDeepLayer.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@
1212

1313
def addDeepLayer(app):
1414
depthPlane = NatronEngine.ImageLayer( "Deep" , "Deep" , "FB")
15-
app.addProjectLayer( depthPlane )
15+
app.addProjectLayer( depthPlane )
16+
17+
addDeepLayer(app)

Python_INIT/addDepthLayer/README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
# addDepthLayer
22

3-
Adds 'Depth' layer to Natron.
3+
Adds 'Depth' layer to Natron.
4+
5+
### USAGE
6+
7+
* Copy code in the init.py file.

Python_INIT/addDepthLayer/addDepthLayer.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@
1212

1313
def addDepthLayer(app):
1414
depthPlane = NatronEngine.ImageLayer( "Depth" , "Depth" , "Z")
15-
app.addProjectLayer( depthPlane )
15+
app.addProjectLayer( depthPlane )
16+
17+
addDepthLayer(app)

Python_INIT/addMaskLayer/README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
# addMaskLayer
22

3-
Adds 'Mask' layer to Natron.
3+
Adds 'Mask' layer to Natron.
4+
5+
### USAGE
6+
7+
* Copy code in the init.py file.

Python_INIT/addMaskLayer/addMaskLayer.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@
1212

1313
def addMaskLayer(app):
1414
depthPlane = NatronEngine.ImageLayer( "Mask" , "Mask" , "A")
15-
app.addProjectLayer( depthPlane )
15+
app.addProjectLayer( depthPlane )
16+
17+
addMaskLayer(app)

Python_INIT/addMotionLayer/README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
# addMotionLayer
22

3-
Adds 'Motion' layer to Natron.
3+
Adds 'Motion' layer to Natron.
4+
5+
### USAGE
6+
7+
* Copy code in the init.py file.

Python_INIT/addMotionLayer/addMotionLayer.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@
1212

1313
def addMotionLayer(app):
1414
depthPlane = NatronEngine.ImageLayer( "Motion" , "Motion" , "UV" )
15-
app.addProjectLayer( depthPlane )
15+
app.addProjectLayer( depthPlane )
16+
17+
addMotionLayer(app)
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# setProjectSettings
2+
3+
Set up default project settings.
4+
5+
### USAGE
6+
7+
* Copy code in the init.py file.

Python_INIT/setProjectSettings/__init__.py

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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.
5+
6+
import os
7+
import string
8+
from NatronEngine import*
9+
from os import*
10+
11+
# SET UP DEFAULT PROJECT SETTINGS #
12+
13+
def setProjectSettings(app):
14+
app.getProjectParam('outputFormat').setValue("HD 1920x1080")
15+
app.getProjectParam('autoPreviews').setValue(True)
16+
app.getProjectParam('frameRange').setValue(1, 25)
17+
app.getProjectParam('lockRange').setValue(True)
18+
app.getProjectParam('frameRate').setValue(25)
19+
app.getProjectParam('gpuRendering').setValue('Enabled')
20+
21+
setProjectSettings(app)

init.py

+19-8
Original file line numberDiff line numberDiff line change
@@ -30,52 +30,61 @@
3030

3131

3232
# CREATES A NEW 'DEEP' LAYER #
33-
#---------------------------#
33+
#----------------------------#
3434
def addDeepLayer(app):
3535
depthPlane = NatronEngine.ImageLayer( "Deep" , "Deep" , "FB")
3636
app.addProjectLayer( depthPlane )
3737

3838
# CREATES A NEW 'DEPTH' LAYER #
39-
#---------------------------#
39+
#-----------------------------#
4040
def addDepthLayer(app):
4141
depthPlane = NatronEngine.ImageLayer( "Depth" , "Depth" , "Z")
4242
app.addProjectLayer( depthPlane )
4343

4444
# CREATES A NEW 'MASK' LAYER #
45-
#---------------------------#
45+
#----------------------------#
4646
def addMaskLayer(app):
4747
depthPlane = NatronEngine.ImageLayer( "Mask" , "Mask" , "A")
4848
app.addProjectLayer( depthPlane )
4949

5050
# CREATES A NEW 'MOTION' LAYER #
51-
#---------------------------#
51+
#------------------------------#
5252
def addMotionLayer(app):
5353
depthPlane = NatronEngine.ImageLayer( "Motion" , "Motion" , "UV" )
5454
app.addProjectLayer( depthPlane )
5555

5656

57+
# SET UP DEFAULT PROJECT SETTINGS #
58+
#------------------------------#
59+
def setProjectSettings(app):
60+
app.getProjectParam('outputFormat').setValue("HD 1920x1080")
61+
app.getProjectParam('autoPreviews').setValue(True)
62+
app.getProjectParam('frameRange').setValue(1, 25)
63+
app.getProjectParam('lockRange').setValue(True)
64+
app.getProjectParam('frameRate').setValue(25)
65+
app.getProjectParam('gpuRendering').setValue('Enabled')
5766

5867

59-
# DEFINES WHAT HAPPENS AFTER SOME NODE CREATION #
68+
# DEFINES WHAT HAPPENS AFTER SPECIFIC NODES CREATION #
6069
#-----------------------------------------------#
6170
def Node_Callback(thisNode, app, userEdited):
6271

6372
if thisNode.getPluginID() == "net.sf.openfx.ConstantPlugin" :
6473
thisNode.enablePreview.setValue(1)
6574
thisNode.hideInputs.setValue(1)
6675

67-
elif thisNode.getPluginID() == "net.sf.openfx.Solid" :
76+
if thisNode.getPluginID() == "net.sf.openfx.Solid" :
6877
thisNode.enablePreview.setValue(1)
6978
thisNode.hideInputs.setValue(1)
7079

71-
elif thisNode.getPluginID() == "net.sf.openfx.FrameHold":
80+
if thisNode.getPluginID() == "net.sf.openfx.FrameHold":
7281
currentFrame = app.timelineGetTime()
7382
thisNode.firstFrame.setValue(currentFrame)
7483

7584
#elif thisNode.getPluginID() == "net.sf.openfx.MergePlugin" :
7685
#thisNode.bbox.set('b')
7786

78-
elif thisNode.getPluginID() == "fr.inria.built-in.Read" :
87+
if thisNode.getPluginID() == "fr.inria.built-in.Read" :
7988
#thisNode.outputComponents.set('RGBA')
8089
thisNode.hideInputs.setValue(1)
8190
thisNode.outputLayer.set('Color.RGBA')
@@ -111,12 +120,14 @@ def Project_Callback(app):
111120
addMaskLayer(app)
112121
addMotionLayer(app)
113122
setNodeDefaults(app)
123+
setProjectSettings(app)
114124

115125

116126
NatronEngine.natron.setOnProjectCreatedCallback("Project_Callback")
117127
NatronEngine.natron.setOnProjectLoadedCallback("Project_Callback")
118128

119129

130+
#-----------------------------------------------------------------#
120131
#################### STARTING CONSOLE MESSAGES ####################
121132
#-----------------------------------------------------------------#
122133

0 commit comments

Comments
 (0)