Blender  V3.3
collada_utils.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 #pragma once
8 
9 #include "COLLADAFWColorOrTexture.h"
10 #include "COLLADAFWFloatOrDoubleArray.h"
11 #include "COLLADAFWGeometry.h"
12 #include "COLLADAFWMeshPrimitive.h"
13 #include "COLLADAFWTypes.h"
14 #include "COLLADASWEffectProfile.h"
15 
16 #include <algorithm>
17 #include <map>
18 #include <set>
19 #include <vector>
20 
21 #include "DNA_anim_types.h"
22 #include "DNA_camera_types.h"
23 #include "DNA_constraint_types.h"
24 #include "DNA_light_types.h"
25 #include "DNA_mesh_types.h"
26 #include "DNA_object_types.h"
27 
28 #include "DNA_customdata_types.h"
29 #include "DNA_scene_types.h"
30 #include "DNA_texture_types.h"
31 
32 #include "RNA_access.h"
33 
34 #include "BLI_linklist.h"
35 #include "BLI_string.h"
36 #include "BLI_utildefines.h"
37 
38 #include "BKE_context.h"
39 #include "BKE_idprop.h"
40 #include "BKE_main.h"
41 #include "BKE_node.h"
42 #include "BKE_object.h"
43 #include "BKE_scene.h"
44 
45 #include "DEG_depsgraph_query.h"
46 
47 #include "BCSampleData.h"
48 #include "BlenderContext.h"
49 #include "ExportSettings.h"
50 #include "ImportSettings.h"
51 #include "collada_internal.h"
52 
53 constexpr int LIMITTED_PRECISION = 6;
54 
55 typedef std::map<COLLADAFW::UniqueId, Image *> UidImageMap;
56 typedef std::map<std::string, Image *> KeyImageMap;
57 typedef std::map<COLLADAFW::TextureMapId, std::vector<MTex *>> TexIndexTextureArrayMap;
58 typedef std::set<Object *> BCObjectSet;
59 
60 extern void bc_update_scene(BlenderContext &blender_context, float ctime);
61 
62 /* Action helpers */
63 
64 std::vector<bAction *> bc_getSceneActions(const bContext *C, Object *ob, bool all_actions);
65 
66 /* Action helpers */
67 
69 {
70  return (ob->adt && ob->adt->action) ? ob->adt->action : NULL;
71 }
72 
73 /* Returns Light Action or NULL */
75 {
76  if (ob->type != OB_LAMP) {
77  return NULL;
78  }
79 
80  Light *lamp = (Light *)ob->data;
81  return (lamp->adt && lamp->adt->action) ? lamp->adt->action : NULL;
82 }
83 
84 /* Return Camera Action or NULL */
86 {
87  if (ob->type != OB_CAMERA) {
88  return NULL;
89  }
90 
91  Camera *camera = (Camera *)ob->data;
92  return (camera->adt && camera->adt->action) ? camera->adt->action : NULL;
93 }
94 
95 /* returns material action or NULL */
97 {
98  if (ma == NULL) {
99  return NULL;
100  }
101 
102  return (ma->adt && ma->adt->action) ? ma->adt->action : NULL;
103 }
104 
105 std::string bc_get_action_id(std::string action_name,
106  std::string ob_name,
107  std::string channel_type,
108  std::string axis_name,
109  std::string axis_separator = "_");
110 
111 extern float bc_get_float_value(const COLLADAFW::FloatOrDoubleArray &array, unsigned int index);
112 extern int bc_test_parent_loop(Object *par, Object *ob);
113 
114 extern bool bc_validateConstraints(bConstraint *con);
115 
116 bool bc_set_parent(Object *ob, Object *par, bContext *C, bool is_parent_space = true);
117 extern Object *bc_add_object(
118  Main *bmain, Scene *scene, ViewLayer *view_layer, int type, const char *name);
119 extern Mesh *bc_get_mesh_copy(BlenderContext &blender_context,
120  Object *ob,
121  BC_export_mesh_type export_mesh_type,
122  bool apply_modifiers,
123  bool triangulate);
124 
126 extern bool bc_has_object_type(LinkNode *export_set, short obtype);
127 
128 extern char *bc_CustomData_get_layer_name(const CustomData *data, int type, int n);
129 extern char *bc_CustomData_get_active_layer_name(const CustomData *data, int type);
130 
131 extern void bc_bubble_sort_by_Object_name(LinkNode *export_set);
138 extern bool bc_is_root_bone(Bone *aBone, bool deform_bones_only);
139 extern int bc_get_active_UVLayer(Object *ob);
140 
141 inline std::string bc_string_after(const std::string &s, const std::string probe)
142 {
143  size_t i = s.rfind(probe);
144  if (i != std::string::npos) {
145  return (s.substr(i + probe.length(), s.length() - i));
146  }
147  return s;
148 }
149 
150 inline std::string bc_string_before(const std::string &s, const std::string probe)
151 {
152  size_t i = s.find(probe);
153  if (i != std::string::npos) {
154  return s.substr(0, i);
155  }
156  return s;
157 }
158 
159 inline bool bc_startswith(std::string const &value, std::string const &starting)
160 {
161  if (starting.size() > value.size()) {
162  return false;
163  }
164  return (value.substr(0, starting.size()) == starting);
165 }
166 
167 inline bool bc_endswith(const std::string &value, const std::string &ending)
168 {
169  if (ending.size() > value.size()) {
170  return false;
171  }
172 
173  return value.compare(value.size() - ending.size(), ending.size(), ending) == 0;
174 }
175 
176 #if 0 /* UNUSED */
177 inline bool bc_endswith(std::string const &value, std::string const &ending)
178 {
179  if (ending.size() > value.size()) {
180  return false;
181  }
182  return std::equal(ending.rbegin(), ending.rend(), value.rbegin());
183 }
184 #endif
185 
186 extern std::string bc_replace_string(std::string data,
187  const std::string &pattern,
188  const std::string &replacement);
189 extern std::string bc_url_encode(std::string data);
195 extern void bc_match_scale(Object *ob, UnitConverter &bc_unit, bool scale_to_scene);
196 extern void bc_match_scale(std::vector<Object *> *objects_done,
197  UnitConverter &bc_unit,
198  bool scale_to_scene);
199 
203 extern void bc_decompose(float mat[4][4], float *loc, float eul[3], float quat[4], float *size);
215 extern void bc_rotate_from_reference_quat(float quat_to[4],
216  float quat_from[4],
217  float mat_to[4][4]);
218 
219 extern void bc_triangulate_mesh(Mesh *me);
223 extern bool bc_is_leaf_bone(Bone *bone);
224 extern EditBone *bc_get_edit_bone(bArmature *armature, char *name);
225 extern int bc_set_layer(int bitfield, int layer, bool enable);
226 extern int bc_set_layer(int bitfield, int layer);
227 
228 inline bool bc_in_range(float a, float b, float range)
229 {
230  return fabsf(a - b) < range;
231 }
232 void bc_copy_m4_farray(float r[4][4], float *a);
233 void bc_copy_farray_m4(float *r, float a[4][4]);
234 void bc_copy_darray_m4d(double *r, double a[4][4]);
235 void bc_copy_m4d_v44(double (&r)[4][4], std::vector<std::vector<double>> &a);
236 void bc_copy_v44_m4d(std::vector<std::vector<double>> &r, double (&a)[4][4]);
237 
238 void bc_sanitize_v3(double v[3], int precision);
239 void bc_sanitize_v3(float v[3], int precision);
240 
245 extern IDProperty *bc_get_IDProperty(Bone *bone, std::string key);
246 extern void bc_set_IDProperty(EditBone *ebone, const char *key, float value);
250 extern void bc_set_IDPropertyMatrix(EditBone *ebone, const char *key, float mat[4][4]);
251 
256 extern float bc_get_property(Bone *bone, std::string key, float def);
260 extern void bc_get_property_vector(Bone *bone, std::string key, float val[3], const float def[3]);
269 extern bool bc_get_property_matrix(Bone *bone, std::string key, float mat[4][4]);
270 
271 extern void bc_enable_fcurves(bAction *act, char *bone_name);
272 extern bool bc_bone_matrix_local_get(Object *ob, Bone *bone, Matrix &mat, bool for_opensim);
273 extern bool bc_is_animated(BCMatrixSampleMap &values);
274 extern bool bc_has_animations(Scene *sce, LinkNode *export_set);
275 extern bool bc_has_animations(Object *ob);
276 
277 extern void bc_add_global_transform(Matrix &to_mat,
278  const Matrix &from_mat,
279  const BCMatrix &global_transform,
280  bool invert = false);
281 extern void bc_add_global_transform(Vector &to_vec,
282  const Vector &from_vec,
283  const BCMatrix &global_transform,
284  bool invert = false);
285 extern void bc_add_global_transform(Vector &to_vec,
286  const BCMatrix &global_transform,
287  bool invert = false);
288 extern void bc_add_global_transform(Matrix &to_mat,
289  const BCMatrix &global_transform,
290  bool invert = false);
291 extern void bc_apply_global_transform(Matrix &to_mat,
292  const BCMatrix &global_transform,
293  bool invert = false);
294 extern void bc_apply_global_transform(Vector &to_vec,
295  const BCMatrix &global_transform,
296  bool invert = false);
303 extern void bc_create_restpose_mat(BCExportSettings &export_settings,
304  Bone *bone,
305  float to_mat[4][4],
306  float from_mat[4][4],
307  bool use_local_space);
308 
310  private:
311  std::vector<Object *> base_objects;
312 
313  public:
314  void add(Object *ob)
315  {
316  base_objects.push_back(ob);
317  }
318 
319  bool contains(Object *ob)
320  {
321  std::vector<Object *>::iterator it = std::find(base_objects.begin(), base_objects.end(), ob);
322  return (it != base_objects.end());
323  }
324 
325  int size()
326  {
327  return base_objects.size();
328  }
329 
330  Object *get(int index)
331  {
332  return base_objects[index];
333  }
334 };
335 
337  std::vector<unsigned int> normal_indices;
338 
339  public:
340  void add_index(unsigned int index)
341  {
342  normal_indices.push_back(index);
343  }
344 
345  unsigned int operator[](unsigned int i)
346  {
347  return normal_indices[i];
348  }
349 };
350 
352 
353  private:
354  char name[MAXBONENAME];
355  int chain_length;
356  bool is_leaf;
357  float tail[3];
358  float roll;
359 
360  int bone_layers;
361  int use_connect;
362  bool has_custom_tail;
363  bool has_custom_roll;
364 
365  public:
366  BoneExtended(EditBone *aBone);
367 
368  void set_name(char *aName);
369  char *get_name();
370 
371  void set_chain_length(int aLength);
372  int get_chain_length();
373 
374  void set_leaf_bone(bool state);
375  bool is_leaf_bone();
376 
377  void set_bone_layers(std::string layers, std::vector<std::string> &layer_labels);
378  int get_bone_layers();
379  static std::string get_bone_layers(int bitfield);
380 
381  void set_roll(float roll);
382  bool has_roll();
383  float get_roll();
384 
385  void set_tail(const float vec[]);
386  float *get_tail();
387  bool has_tail();
388 
389  void set_use_connect(int use_connect);
390  int get_use_connect();
391 };
392 
393 /* a map to store bone extension maps
394  * std:string : an armature name
395  * BoneExtended * : a map that contains extra data for bones
396  */
397 typedef std::map<std::string, BoneExtended *> BoneExtensionMap;
398 
399 /*
400  * A class to organize bone extension data for multiple Armatures.
401  * this is needed for the case where a Collada file contains 2 or more
402  * separate armatures.
403  */
405  private:
406  std::map<std::string, BoneExtensionMap *> extended_bone_maps;
407 
408  public:
416 };
417 
420 
421 COLLADASW::ColorOrTexture bc_get_base_color(Material *ma);
422 COLLADASW::ColorOrTexture bc_get_emission(Material *ma);
423 COLLADASW::ColorOrTexture bc_get_ambient(Material *ma);
424 COLLADASW::ColorOrTexture bc_get_specular(Material *ma);
425 COLLADASW::ColorOrTexture bc_get_reflective(Material *ma);
426 
427 double bc_get_reflectivity(Material *ma);
428 double bc_get_alpha(Material *ma);
429 double bc_get_ior(Material *ma);
430 double bc_get_shininess(Material *ma);
431 
432 bool bc_get_float_from_shader(bNode *shader, double &val, std::string nodeid);
433 COLLADASW::ColorOrTexture bc_get_cot_from_shader(bNode *shader,
434  std::string nodeid,
435  Color &default_color,
436  bool with_alpha = true);
437 
438 COLLADASW::ColorOrTexture bc_get_cot(float r, float g, float b, float a);
439 COLLADASW::ColorOrTexture bc_get_cot(Color col, bool with_alpha = true);
std::map< int, const BCMatrix * > BCMatrixSampleMap
Definition: BCSampleData.h:48
General operations, lookup, etc. for blender objects.
#define MAXBONENAME
Object is a sort of wrapper for general info.
@ OB_CAMERA
@ OB_LAMP
BC_export_mesh_type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble GLdouble r _GL_VOID_RET _GL_VOID GLfloat GLfloat r _GL_VOID_RET _GL_VOID GLint GLint r _GL_VOID_RET _GL_VOID GLshort GLshort r _GL_VOID_RET _GL_VOID GLdouble GLdouble r
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a or normal between and object coordinate space Combine Create a color from its and value channels Color Retrieve a color or the default fallback if none is specified Separate Split a vector into its and Z components Generates normals with round corners and may slow down renders Vector Displace the surface along an arbitrary direction White Return a random value or color based on an input seed Float Map an input float to a curve and outputs a float value Separate Color
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a vector
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a or normal between camera
#define C
Definition: RandGen.cpp:25
return(oflags[bm->toolflag_index].f &oflag) !=0
ATTR_WARN_UNUSED_RESULT const BMVert * v
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition: btDbvt.cpp:52
void add_index(unsigned int index)
unsigned int operator[](unsigned int i)
void set_use_connect(int use_connect)
int get_chain_length()
void set_roll(float roll)
void set_name(char *aName)
char * get_name()
void set_tail(const float vec[])
void set_leaf_bone(bool state)
void set_bone_layers(std::string layers, std::vector< std::string > &layer_labels)
float * get_tail()
BoneExtended(EditBone *aBone)
void set_chain_length(int aLength)
BoneExtensionMap & getExtensionMap(bArmature *armature)
void add(Object *ob)
bool contains(Object *ob)
Object * get(int index)
std::set< Object * > BCObjectSet
Definition: collada_utils.h:58
bAction * bc_getSceneObjectAction(Object *ob)
Definition: collada_utils.h:68
COLLADASW::ColorOrTexture bc_get_specular(Material *ma)
COLLADASW::ColorOrTexture bc_get_ambient(Material *ma)
char * bc_CustomData_get_active_layer_name(const CustomData *data, int type)
void bc_copy_farray_m4(float *r, float a[4][4])
bool bc_is_root_bone(Bone *aBone, bool deform_bones_only)
Mesh * bc_get_mesh_copy(BlenderContext &blender_context, Object *ob, BC_export_mesh_type export_mesh_type, bool apply_modifiers, bool triangulate)
double bc_get_alpha(Material *ma)
void bc_triangulate_mesh(Mesh *me)
float bc_get_property(Bone *bone, std::string key, float def)
bool bc_set_parent(Object *ob, Object *par, bContext *C, bool is_parent_space=true)
void bc_copy_v44_m4d(std::vector< std::vector< double >> &r, double(&a)[4][4])
IDProperty * bc_get_IDProperty(Bone *bone, std::string key)
COLLADASW::ColorOrTexture bc_get_cot(float r, float g, float b, float a)
constexpr int LIMITTED_PRECISION
Definition: collada_utils.h:53
COLLADASW::ColorOrTexture bc_get_emission(Material *ma)
COLLADASW::ColorOrTexture bc_get_reflective(Material *ma)
bool bc_in_range(float a, float b, float range)
bNode * bc_get_master_shader(Material *ma)
void bc_rotate_from_reference_quat(float quat_to[4], float quat_from[4], float mat_to[4][4])
double bc_get_reflectivity(Material *ma)
EditBone * bc_get_edit_bone(bArmature *armature, char *name)
std::vector< bAction * > bc_getSceneActions(const bContext *C, Object *ob, bool all_actions)
std::map< std::string, Image * > KeyImageMap
Definition: collada_utils.h:56
bool bc_endswith(const std::string &value, const std::string &ending)
void bc_match_scale(Object *ob, UnitConverter &bc_unit, bool scale_to_scene)
void bc_get_property_vector(Bone *bone, std::string key, float val[3], const float def[3])
std::map< COLLADAFW::TextureMapId, std::vector< MTex * > > TexIndexTextureArrayMap
Definition: collada_utils.h:57
void bc_set_IDProperty(EditBone *ebone, const char *key, float value)
void bc_add_global_transform(Matrix &to_mat, const Matrix &from_mat, const BCMatrix &global_transform, bool invert=false)
std::string bc_string_after(const std::string &s, const std::string probe)
bAction * bc_getSceneLightAction(Object *ob)
Definition: collada_utils.h:74
std::string bc_string_before(const std::string &s, const std::string probe)
void bc_add_default_shader(bContext *C, Material *ma)
bool bc_startswith(std::string const &value, std::string const &starting)
void bc_set_IDPropertyMatrix(EditBone *ebone, const char *key, float mat[4][4])
bool bc_is_animated(BCMatrixSampleMap &values)
int bc_set_layer(int bitfield, int layer, bool enable)
void bc_create_restpose_mat(BCExportSettings &export_settings, Bone *bone, float to_mat[4][4], float from_mat[4][4], bool use_local_space)
bool bc_get_float_from_shader(bNode *shader, double &val, std::string nodeid)
int bc_get_active_UVLayer(Object *ob)
void bc_bubble_sort_by_Object_name(LinkNode *export_set)
bool bc_validateConstraints(bConstraint *con)
bAction * bc_getSceneMaterialAction(Material *ma)
Definition: collada_utils.h:96
std::string bc_url_encode(std::string data)
bool bc_has_animations(Scene *sce, LinkNode *export_set)
Object * bc_add_object(Main *bmain, Scene *scene, ViewLayer *view_layer, int type, const char *name)
double bc_get_shininess(Material *ma)
bool bc_get_property_matrix(Bone *bone, std::string key, float mat[4][4])
COLLADASW::ColorOrTexture bc_get_cot_from_shader(bNode *shader, std::string nodeid, Color &default_color, bool with_alpha=true)
COLLADASW::ColorOrTexture bc_get_base_color(Material *ma)
Object * bc_get_assigned_armature(Object *ob)
char * bc_CustomData_get_layer_name(const CustomData *data, int type, int n)
std::string bc_get_action_id(std::string action_name, std::string ob_name, std::string channel_type, std::string axis_name, std::string axis_separator="_")
float bc_get_float_value(const COLLADAFW::FloatOrDoubleArray &array, unsigned int index)
double bc_get_ior(Material *ma)
void bc_update_scene(BlenderContext &blender_context, float ctime)
void bc_sanitize_v3(double v[3], int precision)
bAction * bc_getSceneCameraAction(Object *ob)
Definition: collada_utils.h:85
std::string bc_replace_string(std::string data, const std::string &pattern, const std::string &replacement)
bool bc_bone_matrix_local_get(Object *ob, Bone *bone, Matrix &mat, bool for_opensim)
void bc_apply_global_transform(Matrix &to_mat, const BCMatrix &global_transform, bool invert=false)
std::map< COLLADAFW::UniqueId, Image * > UidImageMap
Definition: collada_utils.h:55
void bc_copy_darray_m4d(double *r, double a[4][4])
void bc_decompose(float mat[4][4], float *loc, float eul[3], float quat[4], float *size)
std::map< std::string, BoneExtended * > BoneExtensionMap
void bc_copy_m4_farray(float r[4][4], float *a)
bool bc_has_object_type(LinkNode *export_set, short obtype)
void bc_enable_fcurves(bAction *act, char *bone_name)
bool bc_is_leaf_bone(Bone *bone)
void bc_copy_m4d_v44(double(&r)[4][4], std::vector< std::vector< double >> &a)
int bc_test_parent_loop(Object *par, Object *ob)
Scene scene
Light lamp
uint col
CCL_NAMESPACE_BEGIN ccl_device float invert(float color, float factor)
Definition: invert.h:8
const int state
#define fabsf(x)
Definition: metal/compat.h:219
static unsigned a[3]
Definition: RandGen.cpp:78
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
static const pxr::TfToken g("g", pxr::TfToken::Immortal)
bAction * action
struct AnimData * adt
Definition: BKE_main.h:121
struct AnimData * adt
struct AnimData * adt
void * data