This patch adds a new Media Type option to image format settings, which is used in the Render Output panel, File Output node, and Image Saving operation. The option does not provide any new functionality, but improves the UX of selecting file types by categorizing the existing file type option into: - Image. - Multi-Layer EXR. - Video. Each option would then list only the file types that fit that media type. For Multi-Layer and Video, the file type option is no longer drawn for now since only one option exist for now, OpenEXR Multi-Layer and FFMPEG respectively. This also improves the experience by not listing technical terms like FFMPEG in the UI, but rather use "Video" instead. The original motivation for introducing this option is the recent redesign of the File Output node. The problem is that the distinction between images and multi-layers images is not at all clear, while the behavior of the node changes quite a bit when multi-layer is chosen. While now with the new option, the distinction is quite clear. Implementation-wise, the new option is mostly a UI layer that controls the available enum items for the file format and callbacks to set a default format if the existing format doesn't match the media type. However, core code is unaffected and still transparently reads the image format only. Pull Request: https://projects.blender.org/blender/blender/pulls/142955
68 lines
2.3 KiB
C
68 lines
2.3 KiB
C
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
#pragma once
|
|
|
|
#include <stddef.h>
|
|
|
|
/** \file
|
|
* \ingroup bke
|
|
*/
|
|
|
|
/**
|
|
* The lines below use regex from scripts to extract their values,
|
|
* Keep this in mind when modifying this file and keep this comment above the defines.
|
|
*
|
|
* \note Use #STRINGIFY() rather than defining with quotes.
|
|
*/
|
|
|
|
/** Blender major and minor version. */
|
|
#define BLENDER_VERSION 500
|
|
/** Blender patch version for bug-fix releases. */
|
|
#define BLENDER_VERSION_PATCH 0
|
|
/** Blender release cycle stage: alpha/beta/rc/release. */
|
|
#define BLENDER_VERSION_CYCLE alpha
|
|
/** Blender release type suffix. LTS or blank. */
|
|
#define BLENDER_VERSION_SUFFIX
|
|
|
|
/* Blender file format version. */
|
|
#define BLENDER_FILE_VERSION BLENDER_VERSION
|
|
#define BLENDER_FILE_SUBVERSION 42
|
|
|
|
/* Minimum Blender version that supports reading file written with the current
|
|
* version. Older Blender versions will test this and cancel loading the file, showing a warning to
|
|
* the user.
|
|
*
|
|
* See
|
|
* https://developer.blender.org/docs/handbook/guidelines/compatibility_handling_for_blend_files/
|
|
* for details. */
|
|
#define BLENDER_FILE_MIN_VERSION 405
|
|
#define BLENDER_FILE_MIN_SUBVERSION 85
|
|
|
|
/** User readable version string. */
|
|
const char *BKE_blender_version_string(void);
|
|
|
|
/** As above but does not show patch version. */
|
|
const char *BKE_blender_version_string_compact(void);
|
|
|
|
/** Returns true when version cycle is alpha, otherwise (beta, rc) returns false. */
|
|
bool BKE_blender_version_is_alpha(void);
|
|
|
|
/** Returns true when version suffix is LTS, otherwise returns false. */
|
|
bool BKE_blender_version_is_lts(void);
|
|
|
|
/**
|
|
* Fill in given string buffer with user-readable formatted file version and subversion (if
|
|
* provided).
|
|
*
|
|
* \param str_buff: a char buffer where the formatted string is written,
|
|
* minimal recommended size is 8, or 16 if subversion is provided.
|
|
*
|
|
* \param file_subversion: the file subversion, if given value < 0, it is ignored, and only the
|
|
* `file_version` is used.
|
|
*/
|
|
void BKE_blender_version_blendfile_string_from_values(char *str_buff,
|
|
const size_t str_buff_maxncpy,
|
|
const short file_version,
|
|
const short file_subversion);
|