From 792dd4d7139f9080bf6d3d760efe763b8b3f60cc Mon Sep 17 00:00:00 2001 From: dxiao Date: Sun, 20 Feb 2011 16:18:43 -0500 Subject: Added LocationMask, which limits affected pixels to a specified region of the screen --- behaviors/LocationMask.py | 19 +++++++++++++++++++ config/C5Sign.xml | 8 ++++++++ pixelmappers/C5SignMapper.py | 11 +++++++++-- 3 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 behaviors/LocationMask.py diff --git a/behaviors/LocationMask.py b/behaviors/LocationMask.py new file mode 100644 index 0000000..51eafeb --- /dev/null +++ b/behaviors/LocationMask.py @@ -0,0 +1,19 @@ +from operationscore.Behavior import * + +class LocationMask (Behavior): + """Modifies Pixels such that only ones in the pixels specified by the "location" + argument will show""" + + def processResponse(self, inputs, state): + + ret = [] + inputs = list(inputs) + + for inputset in inputs: + inputset = dict(inputset) + + inputset['Location'] += '@' + self['Location'] + + ret.append(inputset) + + return (ret, []) diff --git a/config/C5Sign.xml b/config/C5Sign.xml index 8039c07..6d7de20 100644 --- a/config/C5Sign.xml +++ b/config/C5Sign.xml @@ -124,6 +124,7 @@ colorchange mover slowdecay + wordsonly {'mover':'bar_move'} False @@ -179,6 +180,13 @@ {y}<2 or {y}>24 + + behaviors.LocationMask + + wordsonly + wt.all cl.all c5.all + + behaviors.BehaviorChain diff --git a/pixelmappers/C5SignMapper.py b/pixelmappers/C5SignMapper.py index 24631c4..6d5163d 100644 --- a/pixelmappers/C5SignMapper.py +++ b/pixelmappers/C5SignMapper.py @@ -98,8 +98,15 @@ class C5SignMapper(PixelMapper): eventLocSplit = eventLocation.split('@') if len(eventLocSplit) == 2: [eventLocation, signPart] = eventLocSplit - signParts = signPart.split('.') - pixelLocs = signPosition[signParts[0]][signParts[1]] + signParts = signPart.split(' ') + #print "*******************" + #print signParts + pixelLocs = [] + for part in signParts: + if len(part) > 0: + parts = part.split('.') + pixelLocs.extend(self.signPosition[parts[0]][parts[1]]) + #print pixelLocs screenPixels = [p for p in screen if (p.location in pixelLocs)] else: screenPixels = [p for p in screen] -- cgit v1.2.3 From 68c1d8f443421ca0fdc7dbd7562ff0d4cf5aa4ac Mon Sep 17 00:00:00 2001 From: lalpert Date: Sun, 20 Feb 2011 18:05:59 -0500 Subject: Added C5Sign-Leah to make rain --- config/C5Sign-Leah.xml | 301 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 301 insertions(+) create mode 100644 config/C5Sign-Leah.xml diff --git a/config/C5Sign-Leah.xml b/config/C5Sign-Leah.xml new file mode 100644 index 0000000..dc7305e --- /dev/null +++ b/config/C5Sign-Leah.xml @@ -0,0 +1,301 @@ + + + + + gaussmap + + + + layouts/C5SignLayout.xml + + + + pixelmappers.C5SignMapper + + simplemap + 20 + + + + pixelmappers.GaussianMapper + + gaussmap + 4 + 0.1 + 1 + 1 + + + + pixelmappers.C5SignMapper + + c5signmapper + 20 + + + + + + renderers/C5Renderer.xml + + + + + inputs.ParametricLocationInput + + random_top + center + top + random.random() + 0 + 500 + + + + inputs.OSCInput + + osc + 1234 + 10 + + + + inputs.UDPInput + + udp + 3344 + 50 + + + + inputs.ContinuousCenterInput + + center + 700 + + + + + + + touchosc + + behaviors.TouchOSC + + + behaviors/PixelDecay.xml + + .001 + + + + + behaviors.XYMove + + xymove + 0 + 2 + + + + + behaviors.ModifyParam + + modifyY + Sensor + YStep + {val}+.5 + + + + + behaviors.BehaviorChain + + point_move + + xymove + modifyY + recursivedecay + + + + + behaviors.BehaviorChain + + falling_points + + random_top + + + colorchange + mover + slowdecay + + {'mover':'point_move'} + True + + + + + behaviors.BehaviorChain + + OSCTouchChase + + osc + + + touchosc + decay + + gaussmap + False + + + + behaviors/PixelDecay.xml + + + behaviors/SingleFrame.xml + + + behaviors.RestrictLocation + + xbounce + {val}*-1 + XStep + {x}<2 or {x}>48 + + + + behaviors.RestrictLocation + + ybounce + {val}*-1 + YStep + {y}<2 or {y}>24 + + + + behaviors.BehaviorChain + + movebounce + + xymove + ybounce + xbounce + longrecursivedecay + + + + + behaviors.TimeSwitch + + main + + centerleft + center + + {'scanningbars':10} + {'scanningbars':'centerleft'} + + False + + + + behaviors.DebugBehavior + + debug + 0 + + pygamekey + udp + + + + + behaviors.AllPixels + + square + 20 + + + + behaviors/LoopAndDie.xml + + + behaviors/LoopAndDie.xml + + + behaviors/RandomColor.xml + + + (0,0,255) + + + + + + behaviors.BehaviorChain + + runcolordecay + + colorchanger + mover + + decay + + {'mover':'movebounce'} + False + gaussmap + + + + behaviors.ResponseMover + + mover + + + + behaviors.ModifyParam + + incrinner + {val}+.6 + innercircleRadius + + + + behaviors.ModifyParam + + incrouter + {val}+.6 + outercircleRadius + + + + behaviors.BehaviorChain + + circle_expand + + innercircle + outercircle + incrinner + incrouter + recursivedecay + + + + + behaviors.BehaviorChain + + expandingcircles + + colorchange + mover + decay + + + {'mover':'circle_expand'} + + + + -- cgit v1.2.3