Blender V4.3
ABC_alembic.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4#pragma once
5
9#include <string>
10
11#include "BLI_vector.hh"
12
13#include "DEG_depsgraph.hh"
14
16struct CacheFileLayer;
17struct CacheReader;
18struct ListBase;
19struct Main;
20struct Mesh;
21struct Object;
22struct Scene;
23struct bContext;
24
25int ABC_get_version(void);
26
29 double frame_end;
30
31 unsigned int frame_samples_xform;
32 unsigned int frame_samples_shape;
33
36
38 bool uvs;
39 bool normals;
40 bool vcolors;
41 bool orcos;
48 bool packuv;
55
56 /* See MOD_TRIANGULATE_NGON_xxx and MOD_TRIANGULATE_QUAD_xxx
57 * in DNA_modifier_types.h */
60
62
63 char collection[MAX_IDPROP_NAME] = "";
64};
65
67 /* Multiplier for the cached data scale. Mostly useful if the data is stored in a different unit
68 * as what Blender expects (e.g. centimeters instead of meters). */
70
72
73 /* Last frame number of consecutive files to expect if the cached animation is split in a
74 * sequence. */
76 /* Start frame of the sequence, offset from 0. */
78 /* True if the cache is split in multiple files. */
80
81 /* True if the importer should set the current scene's start and end frame based on the start and
82 * end frames of the cached animation. */
84 /* True if imported meshes should be validated. Error messages are sent to the console. */
86 /* True if a cache reader should be added regardless of whether there is animated data in the
87 * cached file. */
89};
90
91/* The ABC_export and ABC_import functions both take a as_background_job
92 * parameter, and return a boolean.
93 *
94 * When as_background_job=true, returns false immediately after scheduling
95 * a background job.
96 *
97 * When as_background_job=false, performs the export synchronously, and returns
98 * true when the export was ok, and false if there were any errors.
99 */
100
101bool ABC_export(struct Scene *scene,
102 struct bContext *C,
103 const char *filepath,
104 const struct AlembicExportParams *params,
105 bool as_background_job);
106
107bool ABC_import(struct bContext *C,
108 const struct AlembicImportParams *params,
109 bool as_background_job);
110
111struct CacheArchiveHandle *ABC_create_handle(const struct Main *bmain,
112 const char *filepath,
113 const struct CacheFileLayer *layers,
114 struct ListBase *object_paths);
115
116void ABC_free_handle(struct CacheArchiveHandle *handle);
117
118void ABC_get_transform(struct CacheReader *reader,
119 float r_mat_world[4][4],
120 double time,
121 float scale);
122
129
130#ifdef __cplusplus
131namespace blender::bke {
132struct GeometrySet;
133}
134
135/* Either modifies the existing geometry component, or create a new one. */
136void ABC_read_geometry(CacheReader *reader,
137 Object *ob,
138 blender::bke::GeometrySet &geometry_set,
139 const ABCReadParams *params,
140 const char **r_err_str);
141#endif
142
144 struct Object *ob,
145 const struct Mesh *existing_mesh,
146 double time,
147 const char **r_err_str);
148
149void ABC_CacheReader_free(struct CacheReader *reader);
150
152 struct CacheReader *reader,
153 struct Object *object,
154 const char *object_path,
155 bool is_sequence);
struct ABCReadParams ABCReadParams
int ABC_get_version(void)
void ABC_CacheReader_free(struct CacheReader *reader)
void ABC_get_transform(struct CacheReader *reader, float r_mat_world[4][4], double time, float scale)
bool ABC_import(struct bContext *C, const struct AlembicImportParams *params, bool as_background_job)
void ABC_free_handle(struct CacheArchiveHandle *handle)
bool ABC_mesh_topology_changed(struct CacheReader *reader, struct Object *ob, const struct Mesh *existing_mesh, double time, const char **r_err_str)
bool ABC_export(struct Scene *scene, struct bContext *C, const char *filepath, const struct AlembicExportParams *params, bool as_background_job)
struct CacheReader * CacheReader_open_alembic_object(struct CacheArchiveHandle *handle, struct CacheReader *reader, struct Object *object, const char *object_path, bool is_sequence)
struct CacheArchiveHandle * ABC_create_handle(const struct Main *bmain, const char *filepath, const struct CacheFileLayer *layers, struct ListBase *object_paths)
eEvaluationMode
#define MAX_IDPROP_NAME
Definition DNA_ID.h:185
void ABC_read_geometry(CacheReader *reader, Object *ob, blender::bke::GeometrySet &geometry_set, const ABCReadParams *params, const char **r_err_str)
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
float velocity_scale
const char * velocity_name
enum eEvaluationMode evaluation_mode
Definition ABC_alembic.h:54
unsigned int frame_samples_xform
Definition ABC_alembic.h:31
unsigned int frame_samples_shape
Definition ABC_alembic.h:32
blender::Vector< std::string > paths
Definition ABC_alembic.h:71