Blender  V2.93
collada_utils.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
21 #pragma once
22 
23 #include "COLLADAFWColorOrTexture.h"
24 #include "COLLADAFWFloatOrDoubleArray.h"
25 #include "COLLADAFWGeometry.h"
26 #include "COLLADAFWMeshPrimitive.h"
27 #include "COLLADAFWTypes.h"
28 #include "COLLADASWEffectProfile.h"
29 
30 #include <algorithm>
31 #include <map>
32 #include <set>
33 #include <vector>
34 
35 #include "DNA_anim_types.h"
36 #include "DNA_camera_types.h"
37 #include "DNA_constraint_types.h"
38 #include "DNA_light_types.h"
39 #include "DNA_mesh_types.h"
40 #include "DNA_object_types.h"
41 
42 #include "DNA_customdata_types.h"
43 #include "DNA_scene_types.h"
44 #include "DNA_texture_types.h"
45 
46 #include "RNA_access.h"
47 
48 #include "BLI_linklist.h"
49 #include "BLI_string.h"
50 #include "BLI_utildefines.h"
51 
52 #include "BKE_context.h"
53 #include "BKE_idprop.h"
54 #include "BKE_main.h"
55 #include "BKE_node.h"
56 #include "BKE_object.h"
57 #include "BKE_scene.h"
58 
59 #include "DEG_depsgraph_query.h"
60 
61 #include "BCSampleData.h"
62 #include "BlenderContext.h"
63 #include "ExportSettings.h"
64 #include "ImportSettings.h"
65 #include "collada_internal.h"
66 
67 constexpr int LIMITTED_PRECISION = 6;
68 
69 typedef std::map<COLLADAFW::UniqueId, Image *> UidImageMap;
70 typedef std::map<std::string, Image *> KeyImageMap;
71 typedef std::map<COLLADAFW::TextureMapId, std::vector<MTex *>> TexIndexTextureArrayMap;
72 typedef std::set<Object *> BCObjectSet;
73 
74 extern void bc_update_scene(BlenderContext &blender_context, float ctime);
75 
76 /* Action helpers */
77 
78 std::vector<bAction *> bc_getSceneActions(const bContext *C, Object *ob, bool all_actions);
79 
80 /* Action helpers */
81 
83 {
84  return (ob->adt && ob->adt->action) ? ob->adt->action : NULL;
85 }
86 
87 /* Returns Light Action or NULL */
89 {
90  if (ob->type != OB_LAMP) {
91  return NULL;
92  }
93 
94  Light *lamp = (Light *)ob->data;
95  return (lamp->adt && lamp->adt->action) ? lamp->adt->action : NULL;
96 }
97 
98 /* Return Camera Action or NULL */
100 {
101  if (ob->type != OB_CAMERA) {
102  return NULL;
103  }
104 
105  Camera *camera = (Camera *)ob->data;
106  return (camera->adt && camera->adt->action) ? camera->adt->action : NULL;
107 }
108 
109 /* returns material action or NULL */
111 {
112  if (ma == NULL) {
113  return NULL;
114  }
115 
116  return (ma->adt && ma->adt->action) ? ma->adt->action : NULL;
117 }
118 
119 std::string bc_get_action_id(std::string action_name,
120  std::string ob_name,
121  std::string channel_type,
122  std::string axis_name,
123  std::string axis_separator = "_");
124 
125 extern float bc_get_float_value(const COLLADAFW::FloatOrDoubleArray &array, unsigned int index);
126 extern int bc_test_parent_loop(Object *par, Object *ob);
127 
128 extern bool bc_validateConstraints(bConstraint *con);
129 
130 bool bc_set_parent(Object *ob, Object *par, bContext *C, bool is_parent_space = true);
131 extern Object *bc_add_object(
132  Main *bmain, Scene *scene, ViewLayer *view_layer, int type, const char *name);
133 extern Mesh *bc_get_mesh_copy(BlenderContext &blender_context,
134  Object *ob,
135  BC_export_mesh_type export_mesh_type,
136  bool apply_modifiers,
137  bool triangulate);
138 
140 extern bool bc_has_object_type(LinkNode *export_set, short obtype);
141 
142 extern char *bc_CustomData_get_layer_name(const CustomData *data, int type, int n);
143 extern char *bc_CustomData_get_active_layer_name(const CustomData *data, int type);
144 
145 extern void bc_bubble_sort_by_Object_name(LinkNode *export_set);
146 extern bool bc_is_root_bone(Bone *aBone, bool deform_bones_only);
147 extern int bc_get_active_UVLayer(Object *ob);
148 
149 inline std::string bc_string_after(const std::string &s, const std::string probe)
150 {
151  size_t i = s.rfind(probe);
152  if (i != std::string::npos) {
153  return (s.substr(i + probe.length(), s.length() - i));
154  }
155  return s;
156 }
157 
158 inline std::string bc_string_before(const std::string &s, const std::string probe)
159 {
160  size_t i = s.find(probe);
161  if (i != std::string::npos) {
162  return s.substr(0, i);
163  }
164  return s;
165 }
166 
167 inline bool bc_startswith(std::string const &value, std::string const &starting)
168 {
169  if (starting.size() > value.size()) {
170  return false;
171  }
172  return (value.substr(0, starting.size()) == starting);
173 }
174 
175 inline bool bc_endswith(const std::string &value, const std::string &ending)
176 {
177  if (ending.size() > value.size()) {
178  return false;
179  }
180 
181  return value.compare(value.size() - ending.size(), ending.size(), ending) == 0;
182 }
183 
184 #if 0 /* UNUSED */
185 inline bool bc_endswith(std::string const &value, std::string const &ending)
186 {
187  if (ending.size() > value.size()) {
188  return false;
189  }
190  return std::equal(ending.rbegin(), ending.rend(), value.rbegin());
191 }
192 #endif
193 
194 extern std::string bc_replace_string(std::string data,
195  const std::string &pattern,
196  const std::string &replacement);
197 extern std::string bc_url_encode(std::string data);
198 extern void bc_match_scale(Object *ob, UnitConverter &bc_unit, bool scale_to_scene);
199 extern void bc_match_scale(std::vector<Object *> *objects_done,
200  UnitConverter &bc_unit,
201  bool scale_to_scene);
202 
203 extern void bc_decompose(float mat[4][4], float *loc, float eul[3], float quat[4], float *size);
204 extern void bc_rotate_from_reference_quat(float quat_to[4],
205  float quat_from[4],
206  float mat_to[4][4]);
207 
208 extern void bc_triangulate_mesh(Mesh *me);
209 extern bool bc_is_leaf_bone(Bone *bone);
210 extern EditBone *bc_get_edit_bone(bArmature *armature, char *name);
211 extern int bc_set_layer(int bitfield, int layer, bool enable);
212 extern int bc_set_layer(int bitfield, int layer);
213 
214 inline bool bc_in_range(float a, float b, float range)
215 {
216  return fabsf(a - b) < range;
217 }
218 void bc_copy_m4_farray(float r[4][4], float *a);
219 void bc_copy_farray_m4(float *r, float a[4][4]);
220 void bc_copy_darray_m4d(double *r, double a[4][4]);
221 void bc_copy_m4d_v44(double (&r)[4][4], std::vector<std::vector<double>> &a);
222 void bc_copy_v44_m4d(std::vector<std::vector<double>> &r, double (&a)[4][4]);
223 
224 void bc_sanitize_v3(double v[3], int precision);
225 void bc_sanitize_v3(float v[3], int precision);
226 
227 extern IDProperty *bc_get_IDProperty(Bone *bone, std::string key);
228 extern void bc_set_IDProperty(EditBone *ebone, const char *key, float value);
229 extern void bc_set_IDPropertyMatrix(EditBone *ebone, const char *key, float mat[4][4]);
230 
231 extern float bc_get_property(Bone *bone, std::string key, float def);
232 extern void bc_get_property_vector(Bone *bone, std::string key, float val[3], const float def[3]);
233 extern bool bc_get_property_matrix(Bone *bone, std::string key, float mat[4][4]);
234 
235 extern void bc_enable_fcurves(bAction *act, char *bone_name);
236 extern bool bc_bone_matrix_local_get(Object *ob, Bone *bone, Matrix &mat, bool for_opensim);
237 extern bool bc_is_animated(BCMatrixSampleMap &values);
238 extern bool bc_has_animations(Scene *sce, LinkNode *export_set);
239 extern bool bc_has_animations(Object *ob);
240 
241 extern void bc_add_global_transform(Matrix &to_mat,
242  const Matrix &from_mat,
243  const BCMatrix &global_transform,
244  const bool invert = false);
245 extern void bc_add_global_transform(Vector &to_vec,
246  const Vector &from_vec,
247  const BCMatrix &global_transform,
248  const bool invert = false);
249 extern void bc_add_global_transform(Vector &to_vec,
250  const BCMatrix &global_transform,
251  const bool invert = false);
252 extern void bc_add_global_transform(Matrix &to_mat,
253  const BCMatrix &global_transform,
254  const bool invert = false);
255 extern void bc_apply_global_transform(Matrix &to_mat,
256  const BCMatrix &global_transform,
257  const bool invert = false);
258 extern void bc_apply_global_transform(Vector &to_vec,
259  const BCMatrix &global_transform,
260  const bool invert = false);
261 extern void bc_create_restpose_mat(BCExportSettings &export_settings,
262  Bone *bone,
263  float to_mat[4][4],
264  float from_mat[4][4],
265  bool use_local_space);
266 
268  private:
269  std::vector<Object *> base_objects;
270 
271  public:
272  void add(Object *ob)
273  {
274  base_objects.push_back(ob);
275  }
276 
277  bool contains(Object *ob)
278  {
279  std::vector<Object *>::iterator it = std::find(base_objects.begin(), base_objects.end(), ob);
280  return (it != base_objects.end());
281  }
282 
283  int size()
284  {
285  return base_objects.size();
286  }
287 
288  Object *get(int index)
289  {
290  return base_objects[index];
291  }
292 };
293 
295  std::vector<unsigned int> normal_indices;
296 
297  public:
298  void add_index(unsigned int index)
299  {
300  normal_indices.push_back(index);
301  }
302 
303  unsigned int operator[](unsigned int i)
304  {
305  return normal_indices[i];
306  }
307 };
308 
310 
311  private:
312  char name[MAXBONENAME];
313  int chain_length;
314  bool is_leaf;
315  float tail[3];
316  float roll;
317 
318  int bone_layers;
319  int use_connect;
320  bool has_custom_tail;
321  bool has_custom_roll;
322 
323  public:
324  BoneExtended(EditBone *aBone);
325 
326  void set_name(char *aName);
327  char *get_name();
328 
329  void set_chain_length(const int aLength);
330  int get_chain_length();
331 
332  void set_leaf_bone(bool state);
333  bool is_leaf_bone();
334 
335  void set_bone_layers(std::string layers, std::vector<std::string> &layer_labels);
336  int get_bone_layers();
337  static std::string get_bone_layers(int bitfield);
338 
339  void set_roll(float roll);
340  bool has_roll();
341  float get_roll();
342 
343  void set_tail(const float vec[]);
344  float *get_tail();
345  bool has_tail();
346 
347  void set_use_connect(int use_connect);
348  int get_use_connect();
349 };
350 
351 /* a map to store bone extension maps
352  * std:string : an armature name
353  * BoneExtended * : a map that contains extra data for bones
354  */
355 typedef std::map<std::string, BoneExtended *> BoneExtensionMap;
356 
357 /*
358  * A class to organize bone extension data for multiple Armatures.
359  * this is needed for the case where a Collada file contains 2 or more
360  * separate armatures.
361  */
363  private:
364  std::map<std::string, BoneExtensionMap *> extended_bone_maps;
365 
366  public:
369 };
370 
373 
374 COLLADASW::ColorOrTexture bc_get_base_color(Material *ma);
375 COLLADASW::ColorOrTexture bc_get_emission(Material *ma);
376 COLLADASW::ColorOrTexture bc_get_ambient(Material *ma);
377 COLLADASW::ColorOrTexture bc_get_specular(Material *ma);
378 COLLADASW::ColorOrTexture bc_get_reflective(Material *ma);
379 
380 double bc_get_reflectivity(Material *ma);
381 double bc_get_alpha(Material *ma);
382 double bc_get_ior(Material *ma);
383 double bc_get_shininess(Material *ma);
384 
385 bool bc_get_float_from_shader(bNode *shader, double &val, std::string nodeid);
386 COLLADASW::ColorOrTexture bc_get_cot_from_shader(bNode *shader,
387  std::string nodeid,
388  Color &default_color,
389  bool with_alpha = true);
390 
391 COLLADASW::ColorOrTexture bc_get_cot(float r, float g, float b, float a);
392 COLLADASW::ColorOrTexture bc_get_cot(Color col, bool with_alpha = true);
std::map< int, const BCMatrix * > BCMatrixSampleMap
Definition: BCSampleData.h:63
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
Group RGB to Bright Vector Camera Vector Combine Material Light Line Style Layer Add Ambient Diffuse Glossy Refraction Transparent Toon Principled Hair Volume Principled Light Particle Volume Image Sky Noise Wave Voronoi Brick Texture Vector Combine Vertex Color
#define C
Definition: RandGen.cpp:39
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_chain_length(const int aLength)
void set_bone_layers(std::string layers, std::vector< std::string > &layer_labels)
float * get_tail()
BoneExtended(EditBone *aBone)
BoneExtensionMap & getExtensionMap(bArmature *armature)
void add(Object *ob)
bool contains(Object *ob)
Object * get(int index)
std::set< Object * > BCObjectSet
Definition: collada_utils.h:72
bAction * bc_getSceneObjectAction(Object *ob)
Definition: collada_utils.h:82
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)
void bc_apply_global_transform(Matrix &to_mat, const BCMatrix &global_transform, const bool invert=false)
constexpr int LIMITTED_PRECISION
Definition: collada_utils.h:67
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:70
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:71
void bc_set_IDProperty(EditBone *ebone, const char *key, float value)
std::string bc_string_after(const std::string &s, const std::string probe)
bAction * bc_getSceneLightAction(Object *ob)
Definition: collada_utils.h:88
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)
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:99
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)
std::map< COLLADAFW::UniqueId, Image * > UidImageMap
Definition: collada_utils.h:69
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_add_global_transform(Matrix &to_mat, const Matrix &from_mat, const BCMatrix &global_transform, const bool invert=false)
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
#define fabsf(x)
void KERNEL_FUNCTION_FULL_NAME() shader(KernelGlobals *kg, uint4 *input, float4 *output, int type, int filter, int i, int offset, int sample)
static ulong state[N]
static unsigned a[3]
Definition: RandGen.cpp:92
std::vector< ElementType, Eigen::aligned_allocator< ElementType > > vector
Definition: vector.h:39
bAction * action
struct AnimData * adt
struct AnimData * adt
Definition: BKE_main.h:116
struct AnimData * adt
struct AnimData * adt
void * data
CCL_NAMESPACE_BEGIN ccl_device float invert(float color, float factor)
Definition: svm_invert.h:19