Cleanup: comments (long lines) in collada
This commit is contained in:
@@ -63,7 +63,7 @@ extern "C" {
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#include "WM_api.h" // XXX hrm, see if we can do without this
|
||||
#include "WM_api.h" /* XXX hrm, see if we can do without this */
|
||||
#include "WM_types.h"
|
||||
|
||||
#include "bmesh.h"
|
||||
@@ -91,7 +91,7 @@ float bc_get_float_value(const COLLADAFW::FloatOrDoubleArray &array, unsigned in
|
||||
return array.getDoubleValues()->getData()[index];
|
||||
}
|
||||
|
||||
// copied from /editors/object/object_relations.c
|
||||
/* copied from /editors/object/object_relations.c */
|
||||
int bc_test_parent_loop(Object *par, Object *ob)
|
||||
{
|
||||
/* test if 'ob' is a parent somewhere in par's parents */
|
||||
@@ -146,8 +146,8 @@ bool bc_validateConstraints(bConstraint *con)
|
||||
return true;
|
||||
}
|
||||
|
||||
// a shortened version of parent_set_exec()
|
||||
// if is_parent_space is true then ob->obmat will be multiplied by par->obmat before parenting
|
||||
/* a shortened version of parent_set_exec()
|
||||
* if is_parent_space is true then ob->obmat will be multiplied by par->obmat before parenting */
|
||||
int bc_set_parent(Object *ob, Object *par, bContext *C, bool is_parent_space)
|
||||
{
|
||||
Object workob;
|
||||
@@ -164,18 +164,18 @@ int bc_set_parent(Object *ob, Object *par, bContext *C, bool is_parent_space)
|
||||
|
||||
if (is_parent_space) {
|
||||
float mat[4][4];
|
||||
// calc par->obmat
|
||||
/* calc par->obmat */
|
||||
BKE_object_where_is_calc(depsgraph, sce, par);
|
||||
|
||||
// move child obmat into world space
|
||||
/* move child obmat into world space */
|
||||
mul_m4_m4m4(mat, par->obmat, ob->obmat);
|
||||
copy_m4_m4(ob->obmat, mat);
|
||||
}
|
||||
|
||||
// apply child obmat (i.e. decompose it into rot/loc/size)
|
||||
/* apply child obmat (i.e. decompose it into rot/loc/size) */
|
||||
BKE_object_apply_mat4(ob, ob->obmat, 0, 0);
|
||||
|
||||
// compute parentinv
|
||||
/* compute parentinv */
|
||||
BKE_object_workob_calc_parent(depsgraph, sce, ob, &workob);
|
||||
invert_m4_m4(ob->parentinv, workob.obmat);
|
||||
|
||||
@@ -381,7 +381,7 @@ void bc_set_mark(Object *ob)
|
||||
ob->id.tag |= LIB_TAG_DOIT;
|
||||
}
|
||||
|
||||
// Use bubble sort algorithm for sorting the export set
|
||||
/* Use bubble sort algorithm for sorting the export set */
|
||||
void bc_bubble_sort_by_Object_name(LinkNode *export_set)
|
||||
{
|
||||
bool sorted = false;
|
||||
@@ -520,21 +520,22 @@ void bc_rotate_from_reference_quat(float quat_to[4], float quat_from[4], float m
|
||||
float mat_from[4][4];
|
||||
quat_to_mat4(mat_from, quat_from);
|
||||
|
||||
// Calculate the difference matrix matd between mat_from and mat_to
|
||||
/* Calculate the difference matrix matd between mat_from and mat_to */
|
||||
invert_m4_m4(mati, mat_from);
|
||||
mul_m4_m4m4(matd, mati, mat_to);
|
||||
|
||||
mat4_to_quat(qd, matd);
|
||||
|
||||
mul_qt_qtqt(quat_to, qd, quat_from); // rot is the final rotation corresponding to mat_to
|
||||
mul_qt_qtqt(quat_to, qd, quat_from); /* rot is the final rotation corresponding to mat_to */
|
||||
}
|
||||
|
||||
void bc_triangulate_mesh(Mesh *me)
|
||||
{
|
||||
bool use_beauty = false;
|
||||
bool tag_only = false;
|
||||
int quad_method =
|
||||
MOD_TRIANGULATE_QUAD_SHORTEDGE; /* XXX: The triangulation method selection could be offered in the UI */
|
||||
|
||||
/* XXX: The triangulation method selection could be offered in the UI. */
|
||||
int quad_method = MOD_TRIANGULATE_QUAD_SHORTEDGE;
|
||||
|
||||
const struct BMeshCreateParams bm_create_params = {0};
|
||||
BMesh *bm = BM_mesh_create(&bm_mesh_allocsize_default, &bm_create_params);
|
||||
@@ -774,8 +775,8 @@ std::string BoneExtended::get_bone_layers(int bitfield)
|
||||
|
||||
int BoneExtended::get_bone_layers()
|
||||
{
|
||||
return (bone_layers == 0) ? 1 :
|
||||
bone_layers; // ensure that the bone is in at least one bone layer!
|
||||
/* ensure that the bone is in at least one bone layer! */
|
||||
return (bone_layers == 0) ? 1 : bone_layers;
|
||||
}
|
||||
|
||||
void BoneExtended::set_use_connect(int use_connect)
|
||||
@@ -983,7 +984,7 @@ bool bc_is_animated(BCMatrixSampleMap &values)
|
||||
static float MIN_DISTANCE = 0.00001;
|
||||
|
||||
if (values.size() < 2)
|
||||
return false; // need at least 2 entries to be not flat
|
||||
return false; /* need at least 2 entries to be not flat */
|
||||
|
||||
BCMatrixSampleMap::iterator it;
|
||||
const BCMatrix *refmat = NULL;
|
||||
@@ -1009,7 +1010,7 @@ bool bc_has_animations(Object *ob)
|
||||
(bc_getSceneCameraAction(ob) && bc_getSceneCameraAction(ob)->curves.first))
|
||||
return true;
|
||||
|
||||
//Check Material Effect parameter animations.
|
||||
/* Check Material Effect parameter animations. */
|
||||
for (int a = 0; a < ob->totcol; a++) {
|
||||
Material *ma = give_current_material(ob, a + 1);
|
||||
if (!ma)
|
||||
@@ -1254,7 +1255,7 @@ bNode *bc_add_node(bContext *C, bNodeTree *ntree, int node_type, int locx, int l
|
||||
}
|
||||
|
||||
#if 0
|
||||
// experimental, probably not used
|
||||
/* experimental, probably not used */
|
||||
static bNodeSocket *bc_group_add_input_socket(bNodeTree *ntree,
|
||||
bNode *to_node,
|
||||
int to_index,
|
||||
@@ -1337,7 +1338,7 @@ void bc_add_default_shader(bContext *C, Material *ma)
|
||||
bc_node_add_link(ntree, nmap["transparent"], 0, nmap["mix"], 2);
|
||||
|
||||
bc_node_add_link(ntree, nmap["mix"], 0, nmap["out"], 0);
|
||||
// experimental, probably not used.
|
||||
/* experimental, probably not used. */
|
||||
bc_make_group(C, ntree, nmap);
|
||||
#else
|
||||
nmap["main"] = bc_add_node(C, ntree, SH_NODE_BSDF_PRINCIPLED, 0, 300);
|
||||
@@ -1366,7 +1367,7 @@ COLLADASW::ColorOrTexture bc_get_base_color(bNode *shader)
|
||||
return bc_get_cot(col[0], col[1], col[2], col[3]);
|
||||
}
|
||||
else {
|
||||
return bc_get_cot(0.8, 0.8, 0.8, 1.0); //default white
|
||||
return bc_get_cot(0.8, 0.8, 0.8, 1.0); /* default white */
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1383,7 +1384,7 @@ bool bc_get_reflectivity(bNode *shader, double &reflectivity)
|
||||
|
||||
double bc_get_reflectivity(Material *ma)
|
||||
{
|
||||
double reflectivity = ma->spec; // fallback if no socket found
|
||||
double reflectivity = ma->spec; /* fallback if no socket found */
|
||||
bNode *master_shader = bc_get_master_shader(ma);
|
||||
if (ma->use_nodes && master_shader) {
|
||||
bc_get_reflectivity(master_shader, reflectivity);
|
||||
|
||||
Reference in New Issue
Block a user