Blender V5.3
usd.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2019 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
7#include <string>
8
10
11#include "DEG_depsgraph.hh"
12
13#include "DNA_modifier_types.h"
14
15namespace blender {
16
17struct bContext;
18struct Mesh;
19struct Object;
20struct ReportList;
22
23namespace io::usd {
24
33
34/* Enums specifying the USD material purpose,
35 * corresponding to #pxr::UsdShadeTokens 'allPurpose',
36 * 'preview', and 'render', respectively. */
37enum class MtlPurpose { All = 0, Preview = 1, Full = 2 };
38
45 None = 0,
46 User = 1,
47 All = 2,
48};
49
54enum class TexImportMode {
55 None = 0,
58};
59
68
69enum class SubdivExportMode {
71 Ignore = 0,
78 Match = 2,
79};
80
81enum class XformOpMode {
82 TRS = 0,
83 TOS = 1,
84 MAT = 2,
85};
86
88 Custom = -1,
89 Keep = 0,
90 Size256 = 256,
91 Size512 = 512,
92 Size1024 = 1024,
93 Size2048 = 2048,
94 Size4096 = 4096
95};
96
100enum class TexExportMode {
101 Keep = 0,
104};
105
116
119
120 bool export_meshes = true;
121 bool export_lights = true;
122 bool export_cameras = true;
123 bool export_curves = true;
124 bool export_points = true;
125 bool export_volumes = true;
126 bool export_hair = true;
127 bool export_uvmaps = true;
128 bool rename_uvmaps = true;
129 bool export_normals = true;
131 bool export_materials = true;
132
133 bool export_armatures = true;
134 bool export_shapekeys = true;
135 bool only_deform_bones = false;
136
138 bool merge_parent_xform = false;
139
140 bool use_instancing = false;
143 bool allow_unicode = true;
144
145 bool export_animation = false;
147
150
153 bool export_textures = false;
155 bool relative_paths = true;
156 bool use_original_paths = false;
157
158 bool triangulate_meshes = false;
161
166
169
170 std::string root_prim_path = "";
171 char collection[MAX_ID_NAME - 2] = "";
173
174 std::string accessibility_label = "";
176
179
185};
186
244
254bool USD_export(const bContext *C,
255 const char *filepath,
256 const USDExportParams *params,
257 bool as_background_job,
258 ReportList *reports);
259
260bool USD_import(bContext *C,
261 const char *filepath,
262 const USDImportParams *params,
263 bool as_background_job,
264 ReportList *reports);
265
266int USD_get_version();
267
268/* Similar to BLI_path_abs(), but also invokes the USD asset resolver
269 * to determine the absolute path. This is necessary for resolving
270 * paths with URIs that BLI_path_abs() would otherwise alter when
271 * attempting to normalize the path. */
272void USD_path_abs(char *path, const char *basepath, bool for_import);
273
274double get_meters_per_unit(const USDExportParams &params);
275
276}; // namespace io::usd
277
278} // namespace blender
#define MAX_ID_NAME
Definition DNA_ID.h:367
#define MAX_IDPROP_NAME
Definition DNA_ID.h:174
#define C
Definition RandGen.cpp:29
bool USD_import(bContext *C, const char *filepath, const USDImportParams *params, bool as_background_job, ReportList *reports)
void USD_path_abs(char *path, const char *basepath, bool for_import)
bool USD_export(const bContext *C, const char *filepath, const USDExportParams *params, bool as_background_job, ReportList *reports)
double get_meters_per_unit(const USDExportParams &params)
BMesh Iterators.
@ DAG_EVAL_VIEWPORT
@ MOD_TRIANGULATE_QUAD_SHORTEDGE
TextureDownscaleSize usdz_downscale_size
Definition usd.hh:167
char collection[MAX_ID_NAME - 2]
Definition usd.hh:171
char custom_properties_namespace[MAX_IDPROP_NAME]
Definition usd.hh:172
enum eEvaluationMode evaluation_mode
Definition usd.hh:149
SubdivExportMode export_subdiv
Definition usd.hh:148
wmJobWorkerStatus * worker_status
Definition usd.hh:184
std::string accessibility_description
Definition usd.hh:175
MtlNameCollisionMode mtl_name_collision_mode
Definition usd.hh:230
TexImportMode import_textures_mode
Definition usd.hh:231
PropertyImportMode property_import_mode
Definition usd.hh:236
TexNameCollisionMode tex_name_collision_mode
Definition usd.hh:235
wmJobWorkerStatus * worker_status
Definition usd.hh:242
MeshSeqCacheModifierReadFlag mesh_read_flag
Definition usd.hh:192