Skip to content

Commit 5187a58

Browse files
committed
update
1 parent 534de04 commit 5187a58

File tree

16 files changed

+271
-16
lines changed

16 files changed

+271
-16
lines changed

Python_GUI/bottomTriangle/README.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# bottomTriangle
2+
3+
Create a top aligned triangle.
4+
5+
### HOW TO USE IT
6+
7+
* Tools -> Roto -> Bottom triangle
8+
9+
### RESULT
10+
11+
* A Roto node with a bottom aligned triangle is created.
12+
13+
### INSTALLATION
14+
15+
* Copy 'bottomTriangle' folder in your .Natron folder.
16+
* Add following lines to your 'initGui.py' file, where ``<path>`` is the location of 'bottomTriangle' folder.
17+
18+
```
19+
from <path>.bottomTriangle.bottomTriangle import *
20+
NatronGui.natron.addMenuCommand('Tools/Roto/Bottom Triangle','bottomTriangle()')
21+
```

Python_GUI/bottomTriangle/__init__.py

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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 22/07/2019.
5+
6+
import string
7+
import NatronEngine
8+
from NatronGui import *
9+
10+
11+
# CREATE A BOTTOM ALIGNED TRIANGLE #
12+
13+
def bottomTriangle():
14+
15+
# get current Natron instance running in memory
16+
app = natron.getGuiInstance(0)
17+
18+
# create a 'Roto' node
19+
myRoto = app.createNode("fr.inria.built-in.Roto")
20+
21+
# set 'Roto' label
22+
myRoto.setLabel('bottom_Triangle1')
23+
24+
# get input image size
25+
imageWidth = myRoto.getOutputFormat().width()
26+
27+
imageHeight = myRoto.getOutputFormat().height()
28+
29+
30+
31+
32+
# get roto context
33+
rotoContext = myRoto.getRotoContext()
34+
35+
# get 'Base Layer'
36+
rootLayer = rotoContext.getBaseLayer()
37+
38+
39+
40+
41+
# create one point bezier curve at frame 1
42+
newTriangle = rotoContext.createBezier( 0.0 , 0.0 , 1 )
43+
44+
newTriangle.setScriptName("bottom_Triangle1")
45+
newTriangle.setLabel("bottom_Triangle1")
46+
newTriangle.setLocked(False)
47+
newTriangle.setVisible(True)
48+
49+
50+
# add created bezier to 'Base Layer'
51+
rootLayer.addItem(newTriangle)
52+
53+
newTriangle.addControlPoint( imageWidth , 0.0 )
54+
newTriangle.addControlPoint( imageWidth/2 , imageHeight/2 )
55+
newTriangle.setCurveFinished(1)

Python_GUI/fullCircle/fullCircle.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def fullCircle():
2525

2626

2727
# set 'Roto' label
28-
myRoto.setLabel('full_Circle')
28+
myRoto.setLabel('full_Circle1')
2929

3030
# get roto context
3131
rotoContext = myRoto.getRotoContext()
@@ -35,7 +35,7 @@ def fullCircle():
3535

3636
# create square
3737
fullCircle = rotoContext.createEllipse(imageWidth/2,imageHeight/2,imageHeight,True,1)
38-
fullCircle.setLabel('full_Circle')
38+
fullCircle.setLabel('full_Circle1')
3939

4040
# set center position
4141
myRoto.getParam('center').setValue(imageWidth/2,0)

Python_GUI/fullEllipse/fullEllipse.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def fullEllipse():
2424
imageHeight = myRoto.getOutputFormat().height()
2525

2626
# set 'Roto' label
27-
myRoto.setLabel('full_Ellipse')
27+
myRoto.setLabel('full_Ellipse1')
2828

2929
# get roto context
3030
rotoContext = myRoto.getRotoContext()
@@ -36,7 +36,7 @@ def fullEllipse():
3636

3737
# create ellipse
3838
fullEllipse = rotoContext.createEllipse(imageWidth/2, imageHeight/2, imageWidth, True, 1)
39-
fullEllipse.setLabel('full_Ellipse')
39+
fullEllipse.setLabel('full_Ellipse1')
4040

4141
# set center position
4242
myRoto.getParam('center').setValue(imageWidth/2,0)

Python_GUI/fullRectangle/fullRectangle.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def fullRectangle():
2525

2626

2727
# set 'Roto' label
28-
myRoto.setLabel('full_Rectangle')
28+
myRoto.setLabel('full_Rectangle1')
2929

3030
# get roto context
3131
rotoContext = myRoto.getRotoContext()
@@ -39,7 +39,7 @@ def fullRectangle():
3939
# 3rd parameter : size
4040
# 4th parameter : frame
4141
fullRectangle = rotoContext.createRectangle(0,0,10,1)
42-
fullRectangle.setLabel('full_Rectangle')
42+
fullRectangle.setLabel('full_Rectangle1')
4343

4444
# set 1st point position
4545
fullRectangle.setPointAtIndex(0,1,0,imageHeight,0,imageHeight,0,imageHeight)

Python_GUI/fullSquare/fullSquare.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def fullSquare():
2525

2626

2727
# set 'Roto' label
28-
myRoto.setLabel('full_Square')
28+
myRoto.setLabel('full_Square1')
2929

3030
# get roto context
3131
rotoContext = myRoto.getRotoContext()
@@ -39,7 +39,7 @@ def fullSquare():
3939
# 3rd parameter : size
4040
# 4th parameter : frame
4141
fullSquare = rotoContext.createRectangle(0,0,10,1)
42-
fullSquare.setLabel('full_Square')
42+
fullSquare.setLabel('full_Square1')
4343

4444
# set 1st point position
4545
fullSquare.setPointAtIndex(0,1,(imageWidth/2)-(imageHeight/2),imageHeight,(imageWidth/2)-(imageHeight/2),imageHeight,(imageWidth/2)-(imageHeight/2),imageHeight)

Python_GUI/leftTriangle/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ Create a left aligned triangle.
44

55
### HOW TO USE IT
66

7-
* Tools -> Roto -> Full rectangle
7+
* Tools -> Roto -> Left triangle
88

99
### RESULT
1010

11-
* A Roto node with a full frame size rectangle is created.
11+
* A Roto node with a left aligned triangle is created.
1212

1313
### INSTALLATION
1414

Python_GUI/leftTriangle/leftTriangle.py

+20-6
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,38 @@ def leftTriangle():
1818
# create a 'Roto' node
1919
myRoto = app.createNode("fr.inria.built-in.Roto")
2020

21+
# set 'Roto' label
22+
myRoto.setLabel('left_Triangle1')
23+
2124
# get input image size
2225
imageWidth = myRoto.getOutputFormat().width()
2326

2427
imageHeight = myRoto.getOutputFormat().height()
2528

2629

27-
# set 'Roto' label
28-
myRoto.setLabel('full_Rectangle')
30+
2931

3032
# get roto context
3133
rotoContext = myRoto.getRotoContext()
3234

3335
# get 'Base Layer'
34-
Layer1_layer = rotoContext.getBaseLayer()
36+
rootLayer = rotoContext.getBaseLayer()
37+
38+
39+
40+
41+
# create one point bezier curve at frame 1
42+
newTriangle = rotoContext.createBezier( 0.0 , 0.0 , 1 )
3543

36-
# create one point bezier curve at frame 1 #
37-
newTriangle = rotoContext.createBezier(0.0,0.0,1)
44+
newTriangle.setScriptName("left_Triangle1")
45+
newTriangle.setLabel("left_Triangle1")
46+
newTriangle.setLocked(False)
47+
newTriangle.setVisible(True)
3848

3949

40-
leftTriangle()
50+
# add created bezier to 'Base Layer'
51+
rootLayer.addItem(newTriangle)
4152

53+
newTriangle.addControlPoint( 0.0 , imageHeight )
54+
newTriangle.addControlPoint( imageWidth/2 , imageHeight/2 )
55+
newTriangle.setCurveFinished(1)

Python_GUI/rightTriangle/README.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# rightTriangle
2+
3+
Create a right aligned triangle.
4+
5+
### HOW TO USE IT
6+
7+
* Tools -> Roto -> Right triangle
8+
9+
### RESULT
10+
11+
* A Roto node with a right aligned triangle is created.
12+
13+
### INSTALLATION
14+
15+
* Copy 'rightTriangle' folder in your .Natron folder.
16+
* Add following lines to your 'initGui.py' file, where ``<path>`` is the location of 'rightTriangle' folder.
17+
18+
```
19+
from <path>.rightTriangle.rightTriangle import *
20+
NatronGui.natron.addMenuCommand('Tools/Roto/Right Triangle','rightTriangle()')
21+
```

Python_GUI/rightTriangle/__init__.py

Whitespace-only changes.
+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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 22/07/2019.
5+
6+
import string
7+
import NatronEngine
8+
from NatronGui import *
9+
10+
11+
# CREATE A RIGHT ALIGNED TRIANGLE #
12+
13+
def rightTriangle():
14+
15+
# get current Natron instance running in memory
16+
app = natron.getGuiInstance(0)
17+
18+
# create a 'Roto' node
19+
myRoto = app.createNode("fr.inria.built-in.Roto")
20+
21+
# set 'Roto' label
22+
myRoto.setLabel('right_Triangle1')
23+
24+
# get input image size
25+
imageWidth = myRoto.getOutputFormat().width()
26+
27+
imageHeight = myRoto.getOutputFormat().height()
28+
29+
30+
31+
32+
# get roto context
33+
rotoContext = myRoto.getRotoContext()
34+
35+
# get 'Base Layer'
36+
rootLayer = rotoContext.getBaseLayer()
37+
38+
39+
40+
41+
# create one point bezier curve at frame 1
42+
newTriangle = rotoContext.createBezier( imageWidth , imageHeight , 1 )
43+
44+
newTriangle.setScriptName("right_Triangle1")
45+
newTriangle.setLabel("right_Triangle1")
46+
newTriangle.setLocked(False)
47+
newTriangle.setVisible(True)
48+
49+
50+
# add created bezier to 'Base Layer'
51+
rootLayer.addItem(newTriangle)
52+
53+
newTriangle.addControlPoint( imageWidth , 0.0 )
54+
newTriangle.addControlPoint( imageWidth/2 , imageHeight/2 )
55+
newTriangle.setCurveFinished(1)

Python_GUI/topTriangle/README.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# topTriangle
2+
3+
Create a top aligned triangle.
4+
5+
### HOW TO USE IT
6+
7+
* Tools -> Roto -> Top triangle
8+
9+
### RESULT
10+
11+
* A Roto node with a top aligned triangle is created.
12+
13+
### INSTALLATION
14+
15+
* Copy 'topTriangle' folder in your .Natron folder.
16+
* Add following lines to your 'initGui.py' file, where ``<path>`` is the location of 'topTriangle' folder.
17+
18+
```
19+
from <path>.topTriangle.topTriangle import *
20+
NatronGui.natron.addMenuCommand('Tools/Roto/Top Triangle','topTriangle()')
21+
```

Python_GUI/topTriangle/__init__.py

Whitespace-only changes.

Python_GUI/topTriangle/topTriangle.py

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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 22/07/2019.
5+
6+
import string
7+
import NatronEngine
8+
from NatronGui import *
9+
10+
11+
# CREATE A TOP ALIGNED TRIANGLE #
12+
13+
def topTriangle():
14+
15+
# get current Natron instance running in memory
16+
app = natron.getGuiInstance(0)
17+
18+
# create a 'Roto' node
19+
myRoto = app.createNode("fr.inria.built-in.Roto")
20+
21+
# set 'Roto' label
22+
myRoto.setLabel('top_Triangle1')
23+
24+
# get input image size
25+
imageWidth = myRoto.getOutputFormat().width()
26+
27+
imageHeight = myRoto.getOutputFormat().height()
28+
29+
30+
31+
32+
# get roto context
33+
rotoContext = myRoto.getRotoContext()
34+
35+
# get 'Base Layer'
36+
rootLayer = rotoContext.getBaseLayer()
37+
38+
39+
40+
41+
# create one point bezier curve at frame 1
42+
newTriangle = rotoContext.createBezier( 0.0 , imageHeight , 1 )
43+
44+
newTriangle.setScriptName("top_Triangle1")
45+
newTriangle.setLabel("top_Triangle1")
46+
newTriangle.setLocked(False)
47+
newTriangle.setVisible(True)
48+
49+
50+
# add created bezier to 'Base Layer'
51+
rootLayer.addItem(newTriangle)
52+
53+
newTriangle.addControlPoint( imageWidth , imageHeight )
54+
newTriangle.addControlPoint( imageWidth/2 , imageHeight/2 )
55+
newTriangle.setCurveFinished(1)

0 commit comments

Comments
 (0)