|
30 | 30 |
|
31 | 31 |
|
32 | 32 | # CREATES A NEW 'DEEP' LAYER #
|
33 |
| -#---------------------------# |
| 33 | +#----------------------------# |
34 | 34 | def addDeepLayer(app):
|
35 | 35 | depthPlane = NatronEngine.ImageLayer( "Deep" , "Deep" , "FB")
|
36 | 36 | app.addProjectLayer( depthPlane )
|
37 | 37 |
|
38 | 38 | # CREATES A NEW 'DEPTH' LAYER #
|
39 |
| -#---------------------------# |
| 39 | +#-----------------------------# |
40 | 40 | def addDepthLayer(app):
|
41 | 41 | depthPlane = NatronEngine.ImageLayer( "Depth" , "Depth" , "Z")
|
42 | 42 | app.addProjectLayer( depthPlane )
|
43 | 43 |
|
44 | 44 | # CREATES A NEW 'MASK' LAYER #
|
45 |
| -#---------------------------# |
| 45 | +#----------------------------# |
46 | 46 | def addMaskLayer(app):
|
47 | 47 | depthPlane = NatronEngine.ImageLayer( "Mask" , "Mask" , "A")
|
48 | 48 | app.addProjectLayer( depthPlane )
|
49 | 49 |
|
50 | 50 | # CREATES A NEW 'MOTION' LAYER #
|
51 |
| -#---------------------------# |
| 51 | +#------------------------------# |
52 | 52 | def addMotionLayer(app):
|
53 | 53 | depthPlane = NatronEngine.ImageLayer( "Motion" , "Motion" , "UV" )
|
54 | 54 | app.addProjectLayer( depthPlane )
|
55 | 55 |
|
56 | 56 |
|
| 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') |
57 | 66 |
|
58 | 67 |
|
59 |
| -# DEFINES WHAT HAPPENS AFTER SOME NODE CREATION # |
| 68 | +# DEFINES WHAT HAPPENS AFTER SPECIFIC NODES CREATION # |
60 | 69 | #-----------------------------------------------#
|
61 | 70 | def Node_Callback(thisNode, app, userEdited):
|
62 | 71 |
|
63 | 72 | if thisNode.getPluginID() == "net.sf.openfx.ConstantPlugin" :
|
64 | 73 | thisNode.enablePreview.setValue(1)
|
65 | 74 | thisNode.hideInputs.setValue(1)
|
66 | 75 |
|
67 |
| - elif thisNode.getPluginID() == "net.sf.openfx.Solid" : |
| 76 | + if thisNode.getPluginID() == "net.sf.openfx.Solid" : |
68 | 77 | thisNode.enablePreview.setValue(1)
|
69 | 78 | thisNode.hideInputs.setValue(1)
|
70 | 79 |
|
71 |
| - elif thisNode.getPluginID() == "net.sf.openfx.FrameHold": |
| 80 | + if thisNode.getPluginID() == "net.sf.openfx.FrameHold": |
72 | 81 | currentFrame = app.timelineGetTime()
|
73 | 82 | thisNode.firstFrame.setValue(currentFrame)
|
74 | 83 |
|
75 | 84 | #elif thisNode.getPluginID() == "net.sf.openfx.MergePlugin" :
|
76 | 85 | #thisNode.bbox.set('b')
|
77 | 86 |
|
78 |
| - elif thisNode.getPluginID() == "fr.inria.built-in.Read" : |
| 87 | + if thisNode.getPluginID() == "fr.inria.built-in.Read" : |
79 | 88 | #thisNode.outputComponents.set('RGBA')
|
80 | 89 | thisNode.hideInputs.setValue(1)
|
81 | 90 | thisNode.outputLayer.set('Color.RGBA')
|
@@ -111,12 +120,14 @@ def Project_Callback(app):
|
111 | 120 | addMaskLayer(app)
|
112 | 121 | addMotionLayer(app)
|
113 | 122 | setNodeDefaults(app)
|
| 123 | + setProjectSettings(app) |
114 | 124 |
|
115 | 125 |
|
116 | 126 | NatronEngine.natron.setOnProjectCreatedCallback("Project_Callback")
|
117 | 127 | NatronEngine.natron.setOnProjectLoadedCallback("Project_Callback")
|
118 | 128 |
|
119 | 129 |
|
| 130 | +#-----------------------------------------------------------------# |
120 | 131 | #################### STARTING CONSOLE MESSAGES ####################
|
121 | 132 | #-----------------------------------------------------------------#
|
122 | 133 |
|
|
0 commit comments