path = arg elif arg in ["--force", "-f"]: force = True elif arg in ["--auto", "-a"]: auto_id = True elif arg in ["--lights", "-l"]: skip_lights = True elif arg in ["--shaders", "-s"]: skip_shaders = True elif arg in ["--crop", "-c"]: crop = [640, 480] if not FileSystem.valid(path): dbg("ERROR : invalid scene {0}", path) sys.exit(1) exr, rgb, png, ids = gen_pick_img(path, force, crop, auto_id, skip_lights, skip_shaders) if ids: tmp = generate_object_colors(max(ids.values())) mapping = dict() for k, v in tmp.iteritems(): mapping[v] = k else: mapping = dict() app = QtGui.QApplication.instance() win = PickWindow(png, rgb, exr, ids, mapping) sys.exit(app.exec_())
import scramble # @UnusedImport from cgev.common import log from cgev.vray import generate_object_colors, color_id_to_rbg if __name__ == "__main__": max_id = 1000 * 1000 log.debug("... generate {0} ids", max_id) mapping = generate_object_colors(max_id) log.debug("... generation done") if max_id <= 1000: for k, v in mapping.iteritems(): r, g, b = color_id_to_rbg(v) tok = "{0:3d}, {1:3d}, {2:3d}".format(r, g, b) print "{0:5d} = ( {1} ) {2:10d}".format(k, tok, v)