Blender V5.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
15namespace blender {
16
18struct CacheFileLayer;
19struct CacheObjectPath;
20struct CacheReader;
21struct Main;
22struct Mesh;
23struct Object;
24struct Scene;
25struct bContext;
26
27int ABC_get_version();
28
31 double frame_end;
32
33 unsigned int frame_samples_xform;
34 unsigned int frame_samples_shape;
35
38
40 bool uvs;
41 bool normals;
42 bool vcolors;
43 bool orcos;
49 bool packuv;
56
57 /* See MOD_TRIANGULATE_NGON_xxx and MOD_TRIANGULATE_QUAD_xxx
58 * in DNA_modifier_types.h */
61
63
64 char collection[MAX_ID_NAME - 2] = "";
65};
66
68 /* Multiplier for the cached data scale. Mostly useful if the data is stored in a different unit
69 * as what Blender expects (e.g. centimeters instead of meters). */
71
73
74 /* Last frame number of consecutive files to expect if the cached animation is split in a
75 * sequence. */
77 /* Start frame of the sequence, offset from 0. */
79 /* True if the cache is split in multiple files. */
81
82 /* True if the importer should set the current scene's start and end frame based on the start and
83 * end frames of the cached animation. */
85 /* True if imported meshes should be validated. Error messages are sent to the console. */
87 /* True if a cache reader should be added regardless of whether there is animated data in the
88 * cached file. */
90};
91
92/* The ABC_export and ABC_import functions both take a as_background_job
93 * parameter, and return a boolean.
94 *
95 * When as_background_job=true, returns false immediately after scheduling
96 * a background job.
97 *
98 * When as_background_job=false, performs the export synchronously, and returns
99 * true when the export was ok, and false if there were any errors.
100 */
101
102bool ABC_export(struct Scene *scene,
103 struct bContext *C,
104 const char *filepath,
105 const struct AlembicExportParams *params,
106 bool as_background_job);
107
108bool ABC_import(struct bContext *C,
109 const struct AlembicImportParams *params,
110 bool as_background_job);
111
112struct CacheArchiveHandle *ABC_create_handle(const struct Main *bmain,
113 const char *filepath,
114 const struct CacheFileLayer *layers,
115 ListBaseT<CacheObjectPath> *object_paths);
116
117void ABC_free_handle(struct CacheArchiveHandle *handle);
118
119void ABC_get_transform(struct CacheReader *reader,
120 float r_mat_world[4][4],
121 double time,
122 float scale);
123
125 double time;
127 const char *velocity_name;
129};
130
131namespace 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 bke::GeometrySet &geometry_set,
139 const ABCReadParams *params,
140 const char **r_err_str);
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);
155
156} // namespace blender
#define MAX_ID_NAME
Definition DNA_ID.h:367
#define C
Definition RandGen.cpp:29
float3x3 scale(float3x3 mat, float2 scale)
BMesh Iterators.
void ABC_get_transform(struct CacheReader *reader, float r_mat_world[4][4], double time, float scale)
struct CacheArchiveHandle * ABC_create_handle(const struct Main *bmain, const char *filepath, const struct CacheFileLayer *layers, ListBaseT< CacheObjectPath > *object_paths)
void ABC_free_handle(struct CacheArchiveHandle *handle)
void ABC_CacheReader_free(struct CacheReader *reader)
void ABC_read_geometry(CacheReader *reader, Object *ob, bke::GeometrySet &geometry_set, const ABCReadParams *params, const char **r_err_str)
bool ABC_mesh_topology_changed(struct CacheReader *reader, struct Object *ob, const struct Mesh *existing_mesh, double time, const char **r_err_str)
int ABC_get_version()
bool ABC_import(struct bContext *C, const struct AlembicImportParams *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)
bool ABC_export(struct Scene *scene, struct bContext *C, const char *filepath, const struct AlembicExportParams *params, bool as_background_job)
const char * velocity_name
char collection[MAX_ID_NAME - 2]
Definition ABC_alembic.h:64
enum eEvaluationMode evaluation_mode
Definition ABC_alembic.h:55
Vector< std::string > paths
Definition ABC_alembic.h:72