Blender V5.0
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();
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;
47 bool packuv;
54
55 /* See MOD_TRIANGULATE_NGON_xxx and MOD_TRIANGULATE_QUAD_xxx
56 * in DNA_modifier_types.h */
59
61
62 char collection[MAX_ID_NAME - 2] = "";
63};
64
66 /* Multiplier for the cached data scale. Mostly useful if the data is stored in a different unit
67 * as what Blender expects (e.g. centimeters instead of meters). */
69
71
72 /* Last frame number of consecutive files to expect if the cached animation is split in a
73 * sequence. */
75 /* Start frame of the sequence, offset from 0. */
77 /* True if the cache is split in multiple files. */
79
80 /* True if the importer should set the current scene's start and end frame based on the start and
81 * end frames of the cached animation. */
83 /* True if imported meshes should be validated. Error messages are sent to the console. */
85 /* True if a cache reader should be added regardless of whether there is animated data in the
86 * cached file. */
88};
89
90/* The ABC_export and ABC_import functions both take a as_background_job
91 * parameter, and return a boolean.
92 *
93 * When as_background_job=true, returns false immediately after scheduling
94 * a background job.
95 *
96 * When as_background_job=false, performs the export synchronously, and returns
97 * true when the export was ok, and false if there were any errors.
98 */
99
100bool ABC_export(struct Scene *scene,
101 struct bContext *C,
102 const char *filepath,
103 const struct AlembicExportParams *params,
104 bool as_background_job);
105
106bool ABC_import(struct bContext *C,
107 const struct AlembicImportParams *params,
108 bool as_background_job);
109
110struct CacheArchiveHandle *ABC_create_handle(const struct Main *bmain,
111 const char *filepath,
112 const struct CacheFileLayer *layers,
113 struct ListBase *object_paths);
114
115void ABC_free_handle(struct CacheArchiveHandle *handle);
116
117void ABC_get_transform(struct CacheReader *reader,
118 float r_mat_world[4][4],
119 double time,
120 float scale);
121
123 double time;
125 const char *velocity_name;
127};
128
129#ifdef __cplusplus
130namespace blender::bke {
131struct GeometrySet;
132}
133
134/* Either modifies the existing geometry component, or create a new one. */
135void ABC_read_geometry(CacheReader *reader,
136 Object *ob,
137 blender::bke::GeometrySet &geometry_set,
138 const ABCReadParams *params,
139 const char **r_err_str);
140#endif
141
143 struct Object *ob,
144 const struct Mesh *existing_mesh,
145 double time,
146 const char **r_err_str);
147
148void ABC_CacheReader_free(struct CacheReader *reader);
149
151 struct CacheReader *reader,
152 struct Object *object,
153 const char *object_path,
154 bool is_sequence);
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)
int ABC_get_version()
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_ID_NAME
Definition DNA_ID.h:373
#define C
Definition RandGen.cpp:29
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:53
unsigned int frame_samples_xform
Definition ABC_alembic.h:31
char collection[MAX_ID_NAME - 2]
Definition ABC_alembic.h:62
unsigned int frame_samples_shape
Definition ABC_alembic.h:32
blender::Vector< std::string > paths
Definition ABC_alembic.h:70