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))
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)
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))
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)
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)
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)