Skip to content

Commit 96e1e5b

Browse files
author
Jonathan Feinberg
committed
Use "wrapped python objects" to obviate setting special Processing variables all the time.
1 parent e1bac37 commit 96e1e5b

File tree

4 files changed

+193
-89
lines changed

4 files changed

+193
-89
lines changed

buildtime/py/processing_parser.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,5 @@ def emit(self):
281281
bindings = {}
282282
for m in WANTED_METHODS:
283283
bindings.setdefault(m.getName(), Binding(m.getName())).add_method(m)
284-
for f in WANTED_FIELDS:
285-
bindings.setdefault(f.getName(), Binding(f.getName())).set_field(f)
286284

287285
simple_method_bindings = [b for b in bindings.values() if not b.field]
288-
field_bindings = [b for b in bindings.values() if b.field]

buildtime/template/DriverImpl.java.cog

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,4 @@ public class DriverImpl extends PAppletJythonDriver {
4444
]]]*/
4545
/*[[[end]]]*/
4646
}
47-
48-
@Override
49-
protected void setFields() {
50-
/*[[[cog
51-
for b in p.field_bindings:
52-
b.emit()
53-
]]]*/
54-
/*[[[end]]] */
55-
super.setFields();
56-
}
5747
}

examples.py/3D/Form/Toroid.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ def draw():
7878
background(50, 64, 42)
7979
# basic lighting setup
8080
lights()
81+
8182
# 2 rendering styles
8283
# wireframe or solid
8384
if isWireFrame:
@@ -87,6 +88,7 @@ def draw():
8788
noStroke()
8889
fill(150, 195, 125)
8990

91+
text("%s" % frameRate, 20, 40)
9092
#center and spin toroid
9193
translate(width / 2, height / 2, -100)
9294
rotateX(frameCount * PI / 150)
@@ -100,6 +102,7 @@ def draw():
100102
vertex(v[0], v[1], v[2])
101103
endShape()
102104

105+
103106
"""
104107
left/right arrow keys control ellipse detail
105108
up/down arrow keys control segment detail.
@@ -110,7 +113,7 @@ def draw():
110113
"""
111114
def keyPressed():
112115
global pts, segments, isHelix, isWireFrame, latheRadius, radius
113-
116+
gnarble()
114117
# clear the list of strips, to force a re-evaluation
115118
del strips[:]
116119

0 commit comments

Comments
 (0)