Blender  V2.93
ABC_alembic.h
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 #pragma once
17 
22 #include "DEG_depsgraph.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 struct CacheReader;
29 struct ListBase;
30 struct Main;
31 struct Mesh;
32 struct Object;
33 struct Scene;
34 struct bContext;
35 
36 typedef struct AbcArchiveHandle AbcArchiveHandle;
37 
38 int ABC_get_version(void);
39 
41  double frame_start;
42  double frame_end;
43 
44  unsigned int frame_samples_xform;
45  unsigned int frame_samples_shape;
46 
47  double shutter_open;
48  double shutter_close;
49 
51  bool uvs;
52  bool normals;
53  bool vcolors;
58  bool face_sets;
60  bool packuv;
67 
68  /* See MOD_TRIANGULATE_NGON_xxx and MOD_TRIANGULATE_QUAD_xxx
69  * in DNA_modifier_types.h */
72 
73  float global_scale;
74 };
75 
76 /* The ABC_export and ABC_import functions both take a as_background_job
77  * parameter, and return a boolean.
78  *
79  * When as_background_job=true, returns false immediately after scheduling
80  * a background job.
81  *
82  * When as_background_job=false, performs the export synchronously, and returns
83  * true when the export was ok, and false if there were any errors.
84  */
85 
86 bool ABC_export(struct Scene *scene,
87  struct bContext *C,
88  const char *filepath,
89  const struct AlembicExportParams *params,
90  bool as_background_job);
91 
92 bool ABC_import(struct bContext *C,
93  const char *filepath,
94  float scale,
95  bool is_sequence,
96  bool set_frame_range,
97  int sequence_len,
98  int offset,
99  bool validate_meshes,
100  bool as_background_job);
101 
103  const char *filename,
104  struct ListBase *object_paths);
105 
106 void ABC_free_handle(AbcArchiveHandle *handle);
107 
108 void ABC_get_transform(struct CacheReader *reader,
109  float r_mat_world[4][4],
110  float time,
111  float scale);
112 
113 /* Either modifies existing_mesh in-place or constructs a new mesh. */
114 struct Mesh *ABC_read_mesh(struct CacheReader *reader,
115  struct Object *ob,
116  struct Mesh *existing_mesh,
117  const float time,
118  const char **err_str,
119  int read_flags);
120 
121 bool ABC_mesh_topology_changed(struct CacheReader *reader,
122  struct Object *ob,
123  struct Mesh *existing_mesh,
124  const float time,
125  const char **err_str);
126 
127 void CacheReader_incref(struct CacheReader *reader);
128 void CacheReader_free(struct CacheReader *reader);
129 
131  struct CacheReader *reader,
132  struct Object *object,
133  const char *object_path);
134 
135 bool ABC_has_vec3_array_property_named(struct CacheReader *reader, const char *name);
136 
137 /* r_vertex_velocities should point to a preallocated array of num_vertices floats */
138 int ABC_read_velocity_cache(struct CacheReader *reader,
139  const char *velocity_name,
140  float time,
141  float velocity_scale,
142  int num_vertices,
143  float *r_vertex_velocities);
144 
145 #ifdef __cplusplus
146 }
147 #endif
struct CacheReader * CacheReader_open_alembic_object(struct AbcArchiveHandle *handle, struct CacheReader *reader, struct Object *object, const char *object_path)
int ABC_get_version(void)
AbcArchiveHandle * ABC_create_handle(struct Main *bmain, const char *filename, struct ListBase *object_paths)
void CacheReader_free(struct CacheReader *reader)
bool ABC_has_vec3_array_property_named(struct CacheReader *reader, const char *name)
int ABC_read_velocity_cache(struct CacheReader *reader, const char *velocity_name, float time, float velocity_scale, int num_vertices, float *r_vertex_velocities)
struct Mesh * ABC_read_mesh(struct CacheReader *reader, struct Object *ob, struct Mesh *existing_mesh, const float time, const char **err_str, int read_flags)
void ABC_free_handle(AbcArchiveHandle *handle)
void CacheReader_incref(struct CacheReader *reader)
bool ABC_import(struct bContext *C, const char *filepath, float scale, bool is_sequence, bool set_frame_range, int sequence_len, int offset, bool validate_meshes, bool as_background_job)
bool ABC_export(struct Scene *scene, struct bContext *C, const char *filepath, const struct AlembicExportParams *params, bool as_background_job)
bool ABC_mesh_topology_changed(struct CacheReader *reader, struct Object *ob, struct Mesh *existing_mesh, const float time, const char **err_str)
void ABC_get_transform(struct CacheReader *reader, float r_mat_world[4][4], float time, float scale)
eEvaluationMode
Definition: DEG_depsgraph.h:60
#define C
Definition: RandGen.cpp:39
double time
Scene scene
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
enum eEvaluationMode evaluation_mode
Definition: ABC_alembic.h:66
unsigned int frame_samples_xform
Definition: ABC_alembic.h:44
unsigned int frame_samples_shape
Definition: ABC_alembic.h:45
bool export_custom_properties
Definition: ABC_alembic.h:64
The CacheReader struct is only used for anonymous pointers, to interface between C and C++ code....
Definition: abc_util.h:30
Definition: BKE_main.h:116