Posted By: ventilator
for as in self.ANIMATIONSEQUENCES: if as[1].find(":") != -1: start, end, step = as[1].split(":") frames = range(int(start), int(end)+1, int(step)) else: frames = as[1].split() i = 0 for f in frames: self.framelist.append([as[0] + str(i), int(f), as[2]]) # name, number, type i += 1
#!BPY """ Name: 'bleed' Blender: 249 Group: 'Image' Tooltip: 'extend pixels at uv-borders' """ import Blender from Blender import Image background = [1.0,1.0,1.0,1.0] # white #-------------------------------------------------------------------------------- def clamp(x, a, b): if x < a: return a if x > b: return b return x #-------------------------------------------------------------------------------- def bleed(image, passes): print "extending pixels..." width, height = image.getMaxXY() def processpixel(x, y, ox, oy, image, original): ox = clamp(x + ox, 0, width - 1) oy = clamp(y + oy, 0, height - 1) c = image.getPixelF(ox, oy) if original[oy*width+ox] and c != background: image.setPixelF(x, y, c) return True return False for p in range(passes): print " pass", p original = [] for y in range(height): for x in range(width): if image.getPixelF(x, y) == background: original.append(False) else: original.append(True) for y in range(height): for x in range(width): if image.getPixelF(x, y) == background: if processpixel(x, y, 1, 0, image, original): continue if processpixel(x, y, 0, -1, image, original): continue if processpixel(x, y, -1, 0, image, original): continue if processpixel(x, y, 0, 1, image, original): continue bleed(Image.GetCurrent(), 8) Blender.Redraw()
rtsp://darwin02.engagetv.com/debalie.sdp