コード例 #1
0
    def render(self, start, end, progress, out):
        start[self.mask] = (0.0, 0.0, 0.0)
        end[np.invert(self.mask)] = (0.0, 0.0, 0.0)

        idx = int(progress * len(self.rand_index))

        if idx >= self.last_idx:
            for i in range(self.last_idx, idx):
                fix = self.fixtures[self.rand_index[i]]
                self._strobing.append(fix)
                self._time[fix] = progress
                self._on[fix] = True
        else:
            for i in range(idx, self.last_idx):
                fix = self.fixtures[self.rand_index[i]]
                if fix in self._strobing:
                    self._strobing.remove(fix)
                pix_start, pix_end = BufferUtils.get_fixture_extents(fix.strand, fix.address)
                self.mask[pix_start:pix_end] = False
                self._on[fix] = False
        self.last_idx = idx

        for fix in self._strobing:
            pix_start, pix_end = BufferUtils.get_fixture_extents(fix.strand, fix.address)
            self.mask[pix_start:pix_end] = self._on[fix]
            self._on[fix] = not self._on[fix]
            if progress > self._time[fix] + self._duration:
                self._strobing.remove(fix)
                self.mask[pix_start:pix_end][:] = True

        np.add(struct_flat(start), struct_flat(end), struct_flat(out))
コード例 #2
0
    def get(self, start, end, progress):
        start[self.mask] = 0.0
        end[np.invert(self.mask)] = 0.0

        idx = int(progress * len(self.rand_index))

        if idx >= self.last_idx:
            for i in range(self.last_idx, idx):
                fix = self.fixtures[self.rand_index[i]]
                self._strobing.append(fix)
                self._time[fix] = progress
                self._on[fix] = True
        else:
            for i in range(idx, self.last_idx):
                fix = self.fixtures[self.rand_index[i]]
                if fix in self._strobing:
                    self._strobing.remove(fix)
                pix_start, pix_end = BufferUtils.get_fixture_extents(fix.strand, fix.address)
                self.mask[pix_start:pix_end][:] = False
                self._on[fix] = False
        self.last_idx = idx

        for fix in self._strobing:
            pix_start, pix_end = BufferUtils.get_fixture_extents(fix.strand, fix.address)
            self.mask[pix_start:pix_end][:] = self._on[fix]
            self._on[fix] = not self._on[fix]
            if progress > self._time[fix] + self._duration:
                self._strobing.remove(fix)
                self.mask[pix_start:pix_end][:] = True

        return (start) + (end)
コード例 #3
0
ファイル: fixture_step.py プロジェクト: yazici/firemix
    def render(self, start, end, progress, out):
        start[self.mask] = (0.0, 0.0, 0.0)
        end[np.invert(self.mask)] = (0.0, 0.0, 0.0)

        idx = int(progress * len(self.rand_index))

        if idx >= self.last_idx:
            for i in range(self.last_idx, idx):
                fix = self.fixtures[self.rand_index[i]]
                pix_start, pix_end = BufferUtils.get_fixture_extents(fix.strand, fix.address)
                self.mask[pix_start:pix_end] = True
        else:
            for i in range(idx, self.last_idx):
                fix = self.fixtures[self.rand_index[i]]
                pix_start, pix_end = BufferUtils.get_fixture_extents(fix.strand, fix.address)
                self.mask[pix_start:pix_end]= False

        self.last_idx = idx

        np.add(struct_flat(start), struct_flat(end), struct_flat(out))
コード例 #4
0
ファイル: fixture_step.py プロジェクト: tibbon/firemix
    def get(self, start, end, progress):
        start[self.mask] = 0.0
        end[np.invert(self.mask)] = 0.0

        idx = int(progress * len(self.rand_index))
        for i in range(self.last_idx, idx):
            fix = self.fixtures[self.rand_index[i]]
            pix_start, pix_end = BufferUtils.get_fixture_extents(fix.strand, fix.address)
            self.mask[pix_start:pix_end][:] = True
        self.last_idx = idx

        return (start) + (end)
コード例 #5
0
    def get(self, start, end, progress):
        start[self.mask] = 0.0
        end[np.invert(self.mask)] = 0.0

        idx = int(progress * len(self.rand_index))
        for i in range(self.last_idx, idx):
            fix = self.fixtures[self.rand_index[i]]
            pix_start, pix_end = BufferUtils.get_fixture_extents(
                fix.strand, fix.address)
            self.mask[pix_start:pix_end][:] = True
        self.last_idx = idx

        return (start) + (end)
コード例 #6
0
ファイル: fixture_strobe.py プロジェクト: nyarasha/firemix
    def get(self, start, end, progress):
        start[self.mask] = 0.0
        end[np.invert(self.mask)] = 0.0

        idx = int(progress * len(self.rand_index))
        for i in range(self.last_idx, idx):
            fix = self.fixtures[self.rand_index[i]]
            self._strobing.append(fix)
            self._time[fix] = progress
            self._on[fix] = True
        self.last_idx = idx

        for fix in self._strobing:
            pix_start, pix_end = BufferUtils.get_fixture_extents(
                fix.strand, fix.address)
            self.mask[pix_start:pix_end][:] = self._on[fix]
            self._on[fix] = not self._on[fix]
            if progress > self._time[fix] + self._duration:
                self._strobing.remove(fix)
                self.mask[pix_start:pix_end][:] = True

        return (start) + (end)