blenderproc.python.writer.GifWriterUtility module

Allows to write a set of rendering as a gif animation for quick visualization.

class blenderproc.python.writer.GifWriterUtility._GifWriterUtility[source]

Bases: object

static cache_png(keys_to_use, output_data_dict)[source]

Builds temporary folders with .png collections and returns the locations as dictionary.

Return type:

Dict[str, List[str]]

static look_for_existing_output(output_dir_path, append_to_existing_output, name_ending)[source]

Looks for the highest existing #.gif number and adapts respectively

Return type:

int

static provide_directory(output_dir_path)[source]

Generates subdirectory for .gif files if not existent

Return type:

str

static select_keys(output_data_dict)[source]

Sorts out keys which are just metadata and not plottable

Return type:

List[str]

static write_to_gif(to_animate, output_dir_path, append_to_existing_output, frame_duration_in_ms, reverse_animation)[source]

Loads all .png files from each specific temporary folder and concatenates them to a single gif file respectively

Return type:

None

blenderproc.python.writer.GifWriterUtility.write_gif_animation(output_dir_path, output_data_dict, append_to_existing_output=False, frame_duration_in_ms=50, reverse_animation=False)[source]

Generates a .gif file animation out of rendered frames

Parameters:
  • output_dir_path (str) – The directory path in which the gif animation folder will be saved

  • output_data_dict (Dict[str, List[Union[ndarray, list, dict]]]) – The data dictionary which was produced by the render method.

  • append_to_existing_output (bool) – If this is True, the output_dir_path folder will be scanned for pre-existing files of the name #_animation.gif and the number of newly added files will start right where the last run left off.

  • frame_duration_in_ms (int) – Duration of each frame in the animation in milliseconds.

  • reverse_animation (bool) – If this is True, the order of the frames will be reversed.