Cleanup: Use const, make format

This commit is contained in:
Hans Goudey 2022-06-04 16:51:20 +02:00
parent a5190dce9d
commit 6572ad8620
2 changed files with 11 additions and 7 deletions

View File

@ -290,7 +290,7 @@ void OBJMesh::store_uv_coords_and_indices()
const MLoop *mloop = export_mesh_eval_->mloop;
const int totpoly = export_mesh_eval_->totpoly;
const int totvert = export_mesh_eval_->totvert;
const MLoopUV *mloopuv = static_cast<MLoopUV *>(
const MLoopUV *mloopuv = static_cast<const MLoopUV *>(
CustomData_get_layer(&export_mesh_eval_->ldata, CD_MLOOPUV));
if (!mloopuv) {
tot_uv_vertices_ = 0;
@ -382,8 +382,8 @@ void OBJMesh::store_normal_coords_and_indices()
normal_to_index.reserve(export_mesh_eval_->totpoly);
loop_to_normal_index_.resize(export_mesh_eval_->totloop);
loop_to_normal_index_.fill(-1);
const float(
*lnors)[3] = (const float(*)[3])(CustomData_get_layer(&export_mesh_eval_->ldata, CD_NORMAL));
const float(*lnors)[3] = static_cast<const float(*)[3]>(
CustomData_get_layer(&export_mesh_eval_->ldata, CD_NORMAL));
for (int poly_index = 0; poly_index < export_mesh_eval_->totpoly; ++poly_index) {
const MPoly &mpoly = export_mesh_eval_->mpoly[poly_index];
bool need_per_loop_normals = lnors != nullptr || (mpoly.flag & ME_SMOOTH);

View File

@ -330,12 +330,16 @@ def main():
{"solver": 'FAST', "operation": 'DIFFERENCE', "operand_type": 'OBJECT',
"object": bpy.data.objects["test" + boolean_basename + "Operand"]})]))
boolean_basename = "CubeBooleanDiffBMeshCollection"
tests.append(SpecMeshTest("BooleandDiffBMeshCollection", "test" + boolean_basename, "expected" + boolean_basename,
[ModifierSpec("boolean", 'BOOLEAN',
{"solver": 'FAST', "operation": 'DIFFERENCE', "operand_type": 'COLLECTION',
tests.append(SpecMeshTest("BooleandDiffBMeshCollection",
"test" + boolean_basename,
"expected" + boolean_basename,
[ModifierSpec("boolean",
'BOOLEAN',
{"solver": 'FAST',
"operation": 'DIFFERENCE',
"operand_type": 'COLLECTION',
"collection": bpy.data.collections["test" + boolean_basename + "Operands"]})]))
modifiers_test = RunTest(tests)
command = list(sys.argv)