Blender  V3.3
usd.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2019 Blender Foundation. All rights reserved. */
3 
4 #pragma once
5 
6 #include "DEG_depsgraph.h"
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
12 struct CacheArchiveHandle;
13 struct CacheFile;
14 struct CacheReader;
15 struct Object;
16 struct bContext;
17 
18 /* Behavior when the name of an imported material
19  * conflicts with an existing material. */
24 
39 };
40 
42  float scale;
46  int offset;
68 };
69 
70 /* The USD_export takes a as_background_job parameter, and returns a boolean.
71  *
72  * When as_background_job=true, returns false immediately after scheduling
73  * a background job.
74  *
75  * When as_background_job=false, performs the export synchronously, and returns
76  * true when the export was ok, and false if there were any errors.
77  */
78 
79 bool USD_export(struct bContext *C,
80  const char *filepath,
81  const struct USDExportParams *params,
82  bool as_background_job);
83 
84 bool USD_import(struct bContext *C,
85  const char *filepath,
86  const struct USDImportParams *params,
87  bool as_background_job);
88 
89 int USD_get_version(void);
90 
91 /* USD Import and Mesh Cache interface. */
92 
93 struct CacheArchiveHandle *USD_create_handle(struct Main *bmain,
94  const char *filepath,
95  struct ListBase *object_paths);
96 
97 void USD_free_handle(struct CacheArchiveHandle *handle);
98 
99 void USD_get_transform(struct CacheReader *reader, float r_mat[4][4], float time, float scale);
100 
101 /* Either modifies current_mesh in-place or constructs a new mesh. */
102 struct Mesh *USD_read_mesh(struct CacheReader *reader,
103  struct Object *ob,
104  struct Mesh *existing_mesh,
105  double time,
106  const char **err_str,
107  int read_flag);
108 
109 bool USD_mesh_topology_changed(struct CacheReader *reader,
110  struct Object *ob,
111  struct Mesh *existing_mesh,
112  double time,
113  const char **err_str);
114 
116  struct CacheReader *reader,
117  struct Object *object,
118  const char *object_path);
119 
120 void USD_CacheReader_incref(struct CacheReader *reader);
121 void USD_CacheReader_free(struct CacheReader *reader);
122 
123 #ifdef __cplusplus
124 }
125 #endif
eEvaluationMode
Definition: DEG_depsgraph.h:44
#define C
Definition: RandGen.cpp:25
double time
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
Definition: BKE_main.h:121
bool export_animation
Definition: usd.h:26
enum eEvaluationMode evaluation_mode
Definition: usd.h:34
bool export_materials
Definition: usd.h:30
bool selected_objects_only
Definition: usd.h:31
bool visible_objects_only
Definition: usd.h:32
bool generate_preview_surface
Definition: usd.h:35
bool relative_paths
Definition: usd.h:38
bool export_textures
Definition: usd.h:36
bool export_normals
Definition: usd.h:29
bool export_hair
Definition: usd.h:27
bool overwrite_textures
Definition: usd.h:37
bool use_instancing
Definition: usd.h:33
bool export_uvmaps
Definition: usd.h:28
bool import_subdiv
Definition: usd.h:56
bool create_collection
Definition: usd.h:58
bool set_frame_range
Definition: usd.h:44
char * prim_path_mask
Definition: usd.h:55
bool set_material_blend
Definition: usd.h:65
bool validate_meshes
Definition: usd.h:47
bool is_sequence
Definition: usd.h:43
float light_intensity_scale
Definition: usd.h:66
int offset
Definition: usd.h:46
bool import_render
Definition: usd.h:61
bool import_usd_preview
Definition: usd.h:64
bool import_visible_only
Definition: usd.h:62
char mesh_read_flag
Definition: usd.h:48
bool import_volumes
Definition: usd.h:54
bool import_lights
Definition: usd.h:51
bool import_instance_proxies
Definition: usd.h:57
bool import_materials
Definition: usd.h:52
bool import_guide
Definition: usd.h:59
bool import_meshes
Definition: usd.h:53
bool use_instancing
Definition: usd.h:63
int sequence_len
Definition: usd.h:45
bool import_cameras
Definition: usd.h:49
bool import_proxy
Definition: usd.h:60
eUSDMtlNameCollisionMode mtl_name_collision_mode
Definition: usd.h:67
bool import_curves
Definition: usd.h:50
float scale
Definition: usd.h:42
void USD_get_transform(struct CacheReader *reader, float r_mat[4][4], float time, float scale)
bool USD_import(struct bContext *C, const char *filepath, const struct USDImportParams *params, bool as_background_job)
void USD_free_handle(struct CacheArchiveHandle *handle)
void USD_CacheReader_free(struct CacheReader *reader)
eUSDMtlNameCollisionMode
Definition: usd.h:20
@ USD_MTL_NAME_COLLISION_REFERENCE_EXISTING
Definition: usd.h:22
@ USD_MTL_NAME_COLLISION_MAKE_UNIQUE
Definition: usd.h:21
void USD_CacheReader_incref(struct CacheReader *reader)
struct CacheArchiveHandle * USD_create_handle(struct Main *bmain, const char *filepath, struct ListBase *object_paths)
struct Mesh * USD_read_mesh(struct CacheReader *reader, struct Object *ob, struct Mesh *existing_mesh, double time, const char **err_str, int read_flag)
struct CacheReader * CacheReader_open_usd_object(struct CacheArchiveHandle *handle, struct CacheReader *reader, struct Object *object, const char *object_path)
bool USD_mesh_topology_changed(struct CacheReader *reader, struct Object *ob, struct Mesh *existing_mesh, double time, const char **err_str)
int USD_get_version(void)
bool USD_export(struct bContext *C, const char *filepath, const struct USDExportParams *params, bool as_background_job)