27 |
viewport = Viewport.SOUTH_WEST, lut = Lut.COLOR, cell_to_point = False, |
viewport = Viewport.SOUTH_WEST, lut = Lut.COLOR, cell_to_point = False, |
28 |
outline = True) |
outline = True) |
29 |
|
|
|
# Create a Velocity. |
|
|
vopc1 = Velocity(scene = s, data_collector = dc1, |
|
|
viewport = Viewport.SOUTH_WEST, color_mode = ColorMode.VECTOR, |
|
|
arrow = Arrow.TWO_D, lut = Lut.COLOR, cell_to_point = False, |
|
|
outline = True) |
|
|
vopc1.setScaleFactor(scale_factor = 0.07) |
|
|
vopc1.setRatio(ratio = 8) |
|
|
vopc1.setColor(color = Color.BLACK) |
|
|
|
|
|
# Create a scalar Legend. |
|
|
sb = Legend(scene = s, data_collector= dc1, viewport = Viewport.SOUTH_WEST, |
|
|
lut = Lut.COLOR, legend = LegendType.SCALAR) |
|
|
sb.setOrientationToHorizontal() |
|
|
sb.setPosition(LocalPosition(85,5)) |
|
|
sb.setScalarRange(0, 1) |
|
|
sb.setLabelColor(color = Color.BLACK) |
|
|
sb.setTitleColor(Color.BLACK) |
|
|
sb.setTitle("Temperature") |
|
|
|
|
30 |
# Create a Camera. |
# Create a Camera. |
31 |
cam1 = Camera(scene = s, viewport = Viewport.SOUTH_WEST) |
cam1 = Camera(scene = s, viewport = Viewport.SOUTH_WEST) |
32 |
|
|
33 |
# Create a movie. |
# Create a movie. |
34 |
mov = Movie() |
mov = Movie("config_temp") |
35 |
|
#lst = [] |
36 |
|
|
37 |
# Read in one file one after another and render the object. |
# Read in one file one after another and render the object. |
38 |
for i in range(938, 949): |
for i in range(938, 949): |
42 |
s.render(image_name = os.path.join(PYVISI_EXAMPLE_IMAGES_PATH, \ |
s.render(image_name = os.path.join(PYVISI_EXAMPLE_IMAGES_PATH, \ |
43 |
IMAGE_NAME + "%06d.jpg") % i) |
IMAGE_NAME + "%06d.jpg") % i) |
44 |
|
|
45 |
# Generate the movie from the rendered images. |
#lst.append(IMAGE_NAME + "%06d.jpg" % i) |
46 |
mov.makeMovie(input_directory = PYVISI_EXAMPLE_IMAGES_PATH, |
|
47 |
|
# Images (first and last inclusive) from which the movie is to be generated. |
48 |
|
mov.imageRange(input_directory = PYVISI_EXAMPLE_IMAGES_PATH, |
49 |
first_image = IMAGE_NAME + "000938.jpg", |
first_image = IMAGE_NAME + "000938.jpg", |
50 |
last_image = IMAGE_NAME + "000949.jpg", |
last_image = IMAGE_NAME + "000948.jpg") |
51 |
movie = os.path.join(PYVISI_EXAMPLE_IMAGES_PATH, "movie.mpg")) |
|
52 |
|
# Alternatively, a list of images can be specified. |
53 |
|
#mov.imageList(input_directory = PYVISI_EXAMPLE_IMAGES_PATH, image_list = lst) |
54 |
|
|
55 |
|
# Generate the movie. |
56 |
|
mov.makeMovie(os.path.join(PYVISI_EXAMPLE_IMAGES_PATH, "movie.mpg")) |
57 |
|
|