Blender  V2.93
multiview.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
17  * All rights reserved.
18  *
19  * - Blender Foundation, 2003-2009
20  * - Peter Schlaile <peter [at] schlaile [dot] de> 2005/2006
21  */
22 
27 #include "DNA_scene_types.h"
28 
29 #include "BLI_string.h"
30 
31 #include "BKE_scene.h"
32 
33 #include "IMB_imbuf.h"
34 
35 #include "multiview.h"
36 
37 void seq_anim_add_suffix(Scene *scene, struct anim *anim, const int view_id)
38 {
39  const char *suffix = BKE_scene_multiview_view_id_suffix_get(&scene->r, view_id);
40  IMB_suffix_anim(anim, suffix);
41 }
42 
43 /* the number of files will vary according to the stereo format */
44 int seq_num_files(Scene *scene, char views_format, const bool is_multiview)
45 {
46  if (!is_multiview) {
47  return 1;
48  }
49  if (views_format == R_IMF_VIEWS_STEREO_3D) {
50  return 1;
51  }
52  /* R_IMF_VIEWS_INDIVIDUAL */
53 
55 }
56 
58  const int view_id,
59  const char *prefix,
60  const char *ext,
61  char *r_path,
62  size_t r_size)
63 {
64  const char *suffix = BKE_scene_multiview_view_id_suffix_get(&scene->r, view_id);
65  BLI_assert(ext != NULL && suffix != NULL && prefix != NULL);
66  BLI_snprintf(r_path, r_size, "%s%s%s", prefix, suffix, ext);
67 }
const char * BKE_scene_multiview_view_id_suffix_get(const struct RenderData *rd, const int view_id)
int BKE_scene_multiview_num_views_get(const struct RenderData *rd)
#define BLI_assert(a)
Definition: BLI_assert.h:58
size_t BLI_snprintf(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
@ R_IMF_VIEWS_STEREO_3D
void IMB_suffix_anim(struct anim *anim, const char *suffix)
Definition: anim_movie.c:328
Scene scene
int seq_num_files(Scene *scene, char views_format, const bool is_multiview)
Definition: multiview.c:44
void seq_anim_add_suffix(Scene *scene, struct anim *anim, const int view_id)
Definition: multiview.c:37
void seq_multiview_name(Scene *scene, const int view_id, const char *prefix, const char *ext, char *r_path, size_t r_size)
Definition: multiview.c:57
struct RenderData r
Definition: IMB_anim.h:87