Cleanup: locate break statements inside the case body

Follow the convention used almost everywhere in Blender's code.
This commit is contained in:
Campbell Barton
2023-09-23 21:10:22 +10:00
parent 90f22739f7
commit d4dbbab5d9
30 changed files with 235 additions and 143 deletions

View File

@@ -2087,17 +2087,20 @@ void rand_delaunay_test(int test_kind,
case RANDOM_PTS: {
npts = size;
test_label = std::to_string(npts) + "Random points";
} break;
break;
}
case RANDOM_SEGS: {
npts = size;
nedges = npts - 1;
test_label = std::to_string(nedges) + "Random edges";
} break;
break;
}
case RANDOM_POLY: {
npts = size;
nedges = npts;
test_label = "Random poly with " + std::to_string(nedges) + " edges";
} break;
break;
}
case RANDOM_TILTED_GRID: {
/* A 'size' x 'size' grid of points, tilted by angle 'param'.
* Edges will go from left ends to right ends and tops to bottoms,
@@ -2110,7 +2113,8 @@ void rand_delaunay_test(int test_kind,
nedges = 2 * size;
test_label = "Tilted grid " + std::to_string(npts) + "x" + std::to_string(npts) +
" (tilt=" + std::to_string(param) + ")";
} break;
break;
}
case RANDOM_CIRCLE: {
/* A circle with 'size' points, a random start angle,
* and equal spacing thereafter. Will be input as one face.
@@ -2118,7 +2122,8 @@ void rand_delaunay_test(int test_kind,
npts = size;
nfaces = 1;
test_label = "Circle with " + std::to_string(npts) + " points";
} break;
break;
}
case RANDOM_TRI_BETWEEN_CIRCLES: {
/* A set of 'size' triangles, each has two random points on the unit circle,
* and the third point is a random point on the circle with radius 'param'.
@@ -2128,7 +2133,8 @@ void rand_delaunay_test(int test_kind,
nfaces = size;
test_label = "Random " + std::to_string(nfaces) +
" triangles between circles (inner radius=" + std::to_string(param) + ")";
} break;
break;
}
default:
std::cout << "unknown delaunay test type\n";
return;
@@ -2173,8 +2179,8 @@ void rand_delaunay_test(int test_kind,
in.edge[size - 1].first = size - 1;
in.edge[size - 1].second = 0;
}
} break;
break;
}
case RANDOM_TILTED_GRID: {
for (int i = 0; i < size; ++i) {
for (int j = 0; j < size; ++j) {
@@ -2190,8 +2196,8 @@ void rand_delaunay_test(int test_kind,
in.edge[size + i].first = i;
in.edge[size + i].second = (size - 1) * size + i;
}
} break;
break;
}
case RANDOM_CIRCLE: {
double start_angle = BLI_rng_get_double(rng) * 2.0 * M_PI;
double angle_delta = 2.0 * M_PI / size;
@@ -2200,8 +2206,8 @@ void rand_delaunay_test(int test_kind,
in.vert[i][1] = T(sin(start_angle + i * angle_delta));
in.face[0].append(i);
}
} break;
break;
}
case RANDOM_TRI_BETWEEN_CIRCLES: {
for (int i = 0; i < size; i++) {
/* Get three random angles in [0, 2pi). */
@@ -2229,7 +2235,8 @@ void rand_delaunay_test(int test_kind,
in.face[i].append(ib);
}
}
} break;
break;
}
}
/* Run the test. */

View File

@@ -1427,7 +1427,8 @@ GPUMaterial *EEVEE_material_get(
if (optimization_status == GPU_MAT_OPTIMIZATION_QUEUED) {
vedata->stl->g_data->queued_optimise_shaders_count++;
}
} break;
break;
}
case GPU_MAT_QUEUED: {
vedata->stl->g_data->queued_shaders_count++;
GPUMaterial *default_mat = EEVEE_material_default_get(scene, ma, options);
@@ -1435,7 +1436,8 @@ GPUMaterial *EEVEE_material_get(
GPU_material_set_default(mat, default_mat);
/* Return default material. */
mat = default_mat;
} break;
break;
}
case GPU_MAT_FAILED:
default:
ma = EEVEE_material_default_error_get();

View File

@@ -179,7 +179,8 @@ MaterialPass MaterialModule::material_pass_get(Object *ob,
if (optimization_status == GPU_MAT_OPTIMIZATION_QUEUED) {
queued_optimize_shaders_count++;
}
} break;
break;
}
case GPU_MAT_QUEUED:
queued_shaders_count++;
blender_mat = (geometry_type == MAT_GEOM_VOLUME_OBJECT) ? BKE_material_default_volume() :

View File

@@ -53,15 +53,16 @@ void emit_cap(const bool front, bool reversed, int triangle_vertex_id)
switch (triangle_vertex_id) {
case 0: {
gl_Position = (front) ? vData[0].frontPosition : vData[0].backPosition;
} break;
break;
}
case 1: {
gl_Position = (front) ? vData[idx.x].frontPosition : vData[idx.y].backPosition;
} break;
break;
}
case 2: {
gl_Position = (front) ? vData[idx.y].frontPosition : vData[idx.x].backPosition;
} break;
break;
}
}
/* Apply depth bias. Prevents Z-fighting artifacts when fast-math is enabled. */

View File

@@ -434,8 +434,8 @@ static void curves_batch_cache_fill_segments_indices(GPUPrimType prim_type,
}
GPU_indexbuf_add_primitive_restart(&elb);
}
} break;
break;
}
/* Generate curves using independent line segments. */
case GPU_PRIM_LINES: {
uint curr_point = 0;
@@ -447,8 +447,8 @@ static void curves_batch_cache_fill_segments_indices(GPUPrimType prim_type,
/* Skip to next primitive base index. */
curr_point++;
}
} break;
break;
}
/* Generate curves using independent two-triangle segments. */
case GPU_PRIM_TRIS: {
uint curr_point = 0;
@@ -461,8 +461,8 @@ static void curves_batch_cache_fill_segments_indices(GPUPrimType prim_type,
/* Skip to next primitive base index. */
curr_point += 2;
}
} break;
break;
}
default:
BLI_assert_unreachable();
break;

View File

@@ -2913,8 +2913,8 @@ void DRW_draw_depth_object(
GPU_batch_draw(batch);
GPU_uniformbuf_free(ubo);
} break;
break;
}
case OB_CURVES_LEGACY:
case OB_SURF:
break;

View File

@@ -839,7 +839,8 @@ static void ui_template_list_layout_draw(const bContext *C,
0,
"");
}
} break;
break;
}
case UILST_LAYOUT_COMPACT:
row = uiLayoutRow(layout, true);

View File

@@ -240,7 +240,7 @@ static void mball_select_similar_type_get(
case SIMMBALL_STIFFNESS: {
tree_entry[0] = ml->s;
break;
} break;
}
case SIMMBALL_ROTATION: {
float dir[3] = {1.0f, 0.0f, 0.0f};
float rmat[3][3];

View File

@@ -467,7 +467,8 @@ static void sculpt_boundary_falloff_factor_init(SculptSession *ss,
const int div = boundary_distance / radius;
const float mod = fmodf(boundary_distance, radius);
falloff_distance = div % 2 == 0 ? mod : radius - mod;
} break;
break;
}
case BRUSH_BOUNDARY_FALLOFF_LOOP_INVERT: {
const int div = boundary_distance / radius;
const float mod = fmodf(boundary_distance, radius);
@@ -476,7 +477,8 @@ static void sculpt_boundary_falloff_factor_init(SculptSession *ss,
if (((div - 1) & 2) == 0) {
direction = -1.0f;
}
} break;
break;
}
case BRUSH_BOUNDARY_FALLOFF_CONSTANT:
/* For constant falloff distances are not allocated, so this should never happen. */
BLI_assert(false);

View File

@@ -571,7 +571,8 @@ static void do_cloth_brush_apply_forces_task(Object *ob,
mul_v3_v3fl(z_disp, z_object_space, dot_v3v3(disp_center, z_object_space));
add_v3_v3v3(disp_center, x_disp, z_disp);
mul_v3_v3fl(force, disp_center, fade);
} break;
break;
}
case BRUSH_CLOTH_DEFORM_INFLATE:
mul_v3_v3fl(force, vd.no ? vd.no : vd.fno, fade);
break;
@@ -1412,7 +1413,8 @@ static void cloth_filter_apply_forces_task(Object *ob,
float normal[3];
SCULPT_vertex_normal_get(ss, vd.vertex, normal);
mul_v3_v3fl(force, normal, fade * filter_strength);
} break;
break;
}
case CLOTH_FILTER_EXPAND:
cloth_sim->length_constraint_tweak[vd.index] += fade * filter_strength * 0.01f;
zero_v3(force);

View File

@@ -1803,7 +1803,8 @@ static int sculpt_expand_modal(bContext *C, wmOperator *op, const wmEvent *event
expand_cache->snap_enabled_face_sets = std::make_unique<blender::Set<int>>();
sculpt_expand_snap_initialize_from_enabled(ss, expand_cache);
}
} break;
break;
}
case SCULPT_EXPAND_MODAL_MOVE_TOGGLE: {
if (expand_cache->move) {
expand_cache->move = false;

View File

@@ -514,7 +514,8 @@ static void mesh_filter_task(Object *ob,
case MESH_FILTER_ENHANCE_DETAILS: {
mul_v3_v3fl(disp, ss->filter_cache->detail_directions[vd.index], -fabsf(fade));
} break;
break;
}
case MESH_FILTER_ERASE_DISPLACEMENT: {
fade = clamp_f(fade, -1.0f, 1.0f);
sub_v3_v3v3(disp, ss->filter_cache->limit_surface_co[vd.index], orig_co);

View File

@@ -590,7 +590,8 @@ void ED_space_image_grid_steps(SpaceImage *sima,
BLI_assert(pixel_width > 0 && pixel_height > 0);
grid_steps_x[step] = 1.0f / pixel_width;
grid_steps_y[step] = 1.0f / pixel_height;
} break;
break;
}
default:
BLI_assert_unreachable();
}

View File

@@ -4568,21 +4568,24 @@ static float get_uv_vert_needle(const eUVSelectSimilar type,
BM_ITER_ELEM (f, &iter, vert, BM_FACES_OF_VERT) {
result += BM_face_calc_area_uv(f, offsets.uv);
}
} break;
break;
}
case UV_SSIM_AREA_3D: {
BMFace *f;
BMIter iter;
BM_ITER_ELEM (f, &iter, vert, BM_FACES_OF_VERT) {
result += BM_face_calc_area_with_mat3(f, ob_m3);
}
} break;
break;
}
case UV_SSIM_SIDES: {
BMEdge *e;
BMIter iter;
BM_ITER_ELEM (e, &iter, vert, BM_EDGES_OF_VERT) {
result += 1.0f;
}
} break;
break;
}
case UV_SSIM_PIN:
return BM_ELEM_CD_GET_BOOL(loop, offsets.pin) ? 1.0f : 0.0f;
default:
@@ -4610,19 +4613,21 @@ static float get_uv_edge_needle(const eUVSelectSimilar type,
BM_ITER_ELEM (f, &iter, edge, BM_FACES_OF_EDGE) {
result += BM_face_calc_area_uv(f, offsets.uv);
}
} break;
break;
}
case UV_SSIM_AREA_3D: {
BMFace *f;
BMIter iter;
BM_ITER_ELEM (f, &iter, edge, BM_FACES_OF_EDGE) {
result += BM_face_calc_area_with_mat3(f, ob_m3);
}
} break;
break;
}
case UV_SSIM_LENGTH_UV: {
float *luv_a = BM_ELEM_CD_GET_FLOAT_P(loop_a, offsets.uv);
float *luv_b = BM_ELEM_CD_GET_FLOAT_P(loop_b, offsets.uv);
return len_v2v2(luv_a, luv_b);
} break;
}
case UV_SSIM_LENGTH_3D:
return len_v3v3(edge->v1->co, edge->v2->co);
case UV_SSIM_SIDES: {
@@ -4631,8 +4636,9 @@ static float get_uv_edge_needle(const eUVSelectSimilar type,
BM_ITER_ELEM (e, &iter, edge, BM_FACES_OF_EDGE) {
result += 1.0f;
}
} break;
case UV_SSIM_PIN:
break;
}
case UV_SSIM_PIN: {
if (BM_ELEM_CD_GET_BOOL(loop_a, offsets.pin)) {
result += 1.0f;
}
@@ -4640,6 +4646,7 @@ static float get_uv_edge_needle(const eUVSelectSimilar type,
result += 1.0f;
}
break;
}
default:
BLI_assert_unreachable();
return false;
@@ -4674,7 +4681,8 @@ static float get_uv_face_needle(const eUVSelectSimilar type,
result += 1.0f;
}
}
} break;
break;
}
case UV_SSIM_MATERIAL:
return face->mat_nr;
case UV_SSIM_WINDING:

View File

@@ -220,23 +220,28 @@ static int FrsMaterial_mathutils_get_index(BaseMathObject *bmo, int subtype, int
case MATHUTILS_SUBTYPE_LINE: {
const float *color = self->m->line();
bmo->data[index] = color[index];
} break;
break;
}
case MATHUTILS_SUBTYPE_DIFFUSE: {
const float *color = self->m->diffuse();
bmo->data[index] = color[index];
} break;
break;
}
case MATHUTILS_SUBTYPE_SPECULAR: {
const float *color = self->m->specular();
bmo->data[index] = color[index];
} break;
break;
}
case MATHUTILS_SUBTYPE_AMBIENT: {
const float *color = self->m->ambient();
bmo->data[index] = color[index];
} break;
break;
}
case MATHUTILS_SUBTYPE_EMISSION: {
const float *color = self->m->emission();
bmo->data[index] = color[index];
} break;
break;
}
default:
return -1;
}

View File

@@ -516,12 +516,14 @@ static int StrokeAttribute_mathutils_set_index(BaseMathObject *bmo, int subtype,
float g = (index == 1) ? bmo->data[1] : self->sa->getColorG();
float b = (index == 2) ? bmo->data[2] : self->sa->getColorB();
self->sa->setColor(r, g, b);
} break;
break;
}
case MATHUTILS_SUBTYPE_THICKNESS: {
float tr = (index == 0) ? bmo->data[0] : self->sa->getThicknessR();
float tl = (index == 1) ? bmo->data[1] : self->sa->getThicknessL();
self->sa->setThickness(tr, tl);
} break;
break;
}
default:
return -1;
}

View File

@@ -177,11 +177,13 @@ static int SVertex_mathutils_set(BaseMathObject *bmo, int subtype)
case MATHUTILS_SUBTYPE_POINT3D: {
Vec3r p(bmo->data[0], bmo->data[1], bmo->data[2]);
self->sv->setPoint3D(p);
} break;
break;
}
case MATHUTILS_SUBTYPE_POINT2D: {
Vec3r p(bmo->data[0], bmo->data[1], bmo->data[2]);
self->sv->setPoint2D(p);
} break;
break;
}
default:
return -1;
}
@@ -236,12 +238,14 @@ static int SVertex_mathutils_set_index(BaseMathObject *bmo, int subtype, int ind
Vec3r p(self->sv->point3D());
p[index] = bmo->data[index];
self->sv->setPoint3D(p);
} break;
break;
}
case MATHUTILS_SUBTYPE_POINT2D: {
Vec3r p(self->sv->point2D());
p[index] = bmo->data[index];
self->sv->setPoint2D(p);
} break;
break;
}
default:
return -1;
}

View File

@@ -100,13 +100,15 @@ static int FEdgeSharp_mathutils_get(BaseMathObject *bmo, int subtype)
bmo->data[0] = p[0];
bmo->data[1] = p[1];
bmo->data[2] = p[2];
} break;
break;
}
case MATHUTILS_SUBTYPE_NORMAL_B: {
Vec3r p(self->fes->normalB());
bmo->data[0] = p[0];
bmo->data[1] = p[1];
bmo->data[2] = p[2];
} break;
break;
}
default:
return -1;
}
@@ -120,11 +122,13 @@ static int FEdgeSharp_mathutils_set(BaseMathObject *bmo, int subtype)
case MATHUTILS_SUBTYPE_NORMAL_A: {
Vec3r p(bmo->data[0], bmo->data[1], bmo->data[2]);
self->fes->setNormalA(p);
} break;
break;
}
case MATHUTILS_SUBTYPE_NORMAL_B: {
Vec3r p(bmo->data[0], bmo->data[1], bmo->data[2]);
self->fes->setNormalB(p);
} break;
break;
}
default:
return -1;
}
@@ -138,11 +142,13 @@ static int FEdgeSharp_mathutils_get_index(BaseMathObject *bmo, int subtype, int
case MATHUTILS_SUBTYPE_NORMAL_A: {
Vec3r p(self->fes->normalA());
bmo->data[index] = p[index];
} break;
break;
}
case MATHUTILS_SUBTYPE_NORMAL_B: {
Vec3r p(self->fes->normalB());
bmo->data[index] = p[index];
} break;
break;
}
default:
return -1;
}
@@ -157,12 +163,14 @@ static int FEdgeSharp_mathutils_set_index(BaseMathObject *bmo, int subtype, int
Vec3r p(self->fes->normalA());
p[index] = bmo->data[index];
self->fes->setNormalA(p);
} break;
break;
}
case MATHUTILS_SUBTYPE_NORMAL_B: {
Vec3r p(self->fes->normalB());
p[index] = bmo->data[index];
self->fes->setNormalB(p);
} break;
break;
}
default:
return -1;
}

View File

@@ -1458,7 +1458,8 @@ class ViewShape {
v->setFrontEdgeB(veFrontB, v->frontEdgeB().second);
v->setBackEdgeA(veBackA, v->backEdgeA().second);
v->setBackEdgeB(veBackB, v->backEdgeB().second);
} break;
break;
}
case Nature::NON_T_VERTEX: {
NonTVertex *v = (NonTVertex *)(*vv);
vector<ViewVertex::directedViewEdge> &vedges = (v)->viewedges();

View File

@@ -140,7 +140,8 @@ void AnimationImporter::animation_to_fcurves(COLLADAFW::AnimationCurve *curve)
fcurves.push_back(fcu);
unused_curves.push_back(fcu);
}
} break;
break;
}
default:
fprintf(stderr,
"Output dimension of %d is not yet supported (animation id = %s)\n",
@@ -601,7 +602,8 @@ void AnimationImporter::Assign_transform_animations(
else {
unused_fcurve(curves);
}
} break;
break;
}
case COLLADAFW::AnimationList::AXISANGLE:
/* TODO: convert axis-angle to quat? or XYZ? */
default:

View File

@@ -51,22 +51,27 @@ void BCAnimationCurve::init_pointer_rna(Object *ob)
case BC_ANIMATION_TYPE_BONE: {
bArmature *arm = (bArmature *)ob->data;
id_ptr = RNA_id_pointer_create(&arm->id);
} break;
break;
}
case BC_ANIMATION_TYPE_OBJECT: {
id_ptr = RNA_id_pointer_create(&ob->id);
} break;
break;
}
case BC_ANIMATION_TYPE_MATERIAL: {
Material *ma = BKE_object_material_get(ob, curve_key.get_subindex() + 1);
id_ptr = RNA_id_pointer_create(&ma->id);
} break;
break;
}
case BC_ANIMATION_TYPE_CAMERA: {
Camera *camera = (Camera *)ob->data;
id_ptr = RNA_id_pointer_create(&camera->id);
} break;
break;
}
case BC_ANIMATION_TYPE_LIGHT: {
Light *lamp = (Light *)ob->data;
id_ptr = RNA_id_pointer_create(&lamp->id);
} break;
break;
}
default:
fprintf(
stderr, "BC_animation_curve_type %d not supported", this->curve_key.get_array_index());
@@ -153,8 +158,8 @@ std::string BCAnimationCurve::get_animation_name(Object *ob) const
switch (curve_key.get_animation_type()) {
case BC_ANIMATION_TYPE_OBJECT: {
name = id_name(ob);
} break;
break;
}
case BC_ANIMATION_TYPE_BONE: {
if (fcurve == nullptr || fcurve->rna_path == nullptr) {
name = "";
@@ -168,23 +173,23 @@ std::string BCAnimationCurve::get_animation_name(Object *ob) const
name = "";
}
}
} break;
break;
}
case BC_ANIMATION_TYPE_CAMERA: {
Camera *camera = (Camera *)ob->data;
name = id_name(ob) + "-" + id_name(camera) + "-camera";
} break;
break;
}
case BC_ANIMATION_TYPE_LIGHT: {
Light *lamp = (Light *)ob->data;
name = id_name(ob) + "-" + id_name(lamp) + "-light";
} break;
break;
}
case BC_ANIMATION_TYPE_MATERIAL: {
Material *ma = BKE_object_material_get(ob, this->curve_key.get_subindex() + 1);
name = id_name(ob) + "-" + id_name(ma) + "-material";
} break;
break;
}
default: {
name = "";
}

View File

@@ -854,14 +854,17 @@ bool DocumentImporter::writeCamera(const COLLADAFW::Camera *camera)
switch (type) {
case COLLADAFW::Camera::ORTHOGRAPHIC: {
cam->type = CAM_ORTHO;
} break;
break;
}
case COLLADAFW::Camera::PERSPECTIVE: {
cam->type = CAM_PERSP;
} break;
break;
}
case COLLADAFW::Camera::UNDEFINED_CAMERATYPE: {
fprintf(stderr, "Current camera type is not supported.\n");
cam->type = CAM_PERSP;
} break;
break;
}
}
switch (camera->getDescriptionType()) {
@@ -872,7 +875,8 @@ bool DocumentImporter::writeCamera(const COLLADAFW::Camera *camera)
double aspect = camera->getAspectRatio().getValue();
double xmag = aspect * ymag;
cam->ortho_scale = float(xmag);
} break;
break;
}
case CAM_PERSP:
default: {
double yfov = camera->getYFov().getValue();
@@ -882,9 +886,11 @@ bool DocumentImporter::writeCamera(const COLLADAFW::Camera *camera)
double xfov = 2.0f * atanf(aspect * tanf(DEG2RADF(yfov) * 0.5f));
cam->lens = fov_to_focallength(xfov, cam->sensor_x);
} break;
break;
}
}
} break;
break;
}
/* XXX correct way to do following four is probably to get also render
* size and determine proper settings from that somehow */
case COLLADAFW::Camera::ASPECTRATIO_AND_X:
@@ -899,9 +905,11 @@ bool DocumentImporter::writeCamera(const COLLADAFW::Camera *camera)
double x = camera->getXFov().getValue();
/* X is in degrees, cam->lens is in millimeters. */
cam->lens = fov_to_focallength(DEG2RADF(x), cam->sensor_x);
} break;
break;
}
}
} break;
break;
}
case COLLADAFW::Camera::SINGLE_Y: {
switch (cam->type) {
case CAM_ORTHO:
@@ -912,9 +920,11 @@ bool DocumentImporter::writeCamera(const COLLADAFW::Camera *camera)
double yfov = camera->getYFov().getValue();
/* yfov is in degrees, cam->lens is in millimeters. */
cam->lens = fov_to_focallength(DEG2RADF(yfov), cam->sensor_x);
} break;
break;
}
}
} break;
break;
}
case COLLADAFW::Camera::UNDEFINED:
/* read nothing, use blender defaults. */
break;
@@ -1036,23 +1046,28 @@ bool DocumentImporter::writeLight(const COLLADAFW::Light *light)
switch (light->getLightType()) {
case COLLADAFW::Light::AMBIENT_LIGHT: {
lamp->type = LA_SUN; /* TODO: needs more thoughts. */
} break;
break;
}
case COLLADAFW::Light::SPOT_LIGHT: {
lamp->type = LA_SPOT;
lamp->spotsize = DEG2RADF(light->getFallOffAngle().getValue());
lamp->spotblend = light->getFallOffExponent().getValue();
} break;
break;
}
case COLLADAFW::Light::DIRECTIONAL_LIGHT: {
/* our sun is very strong, so pick a smaller energy level */
lamp->type = LA_SUN;
} break;
break;
}
case COLLADAFW::Light::POINT_LIGHT: {
lamp->type = LA_LOCAL;
} break;
break;
}
case COLLADAFW::Light::UNDEFINED: {
fprintf(stderr, "Current light type is not supported.\n");
lamp->type = LA_LOCAL;
} break;
break;
}
}
}

View File

@@ -97,7 +97,8 @@ void WVDataWrapper::print()
fprintf(stderr, "%.1f, %.1f\n", (*values)[i], (*values)[i + 1]);
}
}
} break;
break;
}
case COLLADAFW::MeshVertexData::DATA_TYPE_DOUBLE: {
COLLADAFW::ArrayPrimitiveType<double> *values = mVData->getDoubleValues();
if (values->getCount()) {
@@ -105,7 +106,8 @@ void WVDataWrapper::print()
fprintf(stderr, "%.1f, %.1f\n", float((*values)[i]), float((*values)[i + 1]));
}
}
} break;
break;
}
}
fprintf(stderr, "\n");
}
@@ -126,8 +128,8 @@ void UVDataWrapper::getUV(int uv_index, float *uv)
}
uv[0] = (*values)[uv_index * stride];
uv[1] = (*values)[uv_index * stride + 1];
} break;
break;
}
case COLLADAFW::MeshVertexData::DATA_TYPE_DOUBLE: {
COLLADAFW::ArrayPrimitiveType<double> *values = mVData->getDoubleValues();
if (values->empty()) {
@@ -135,8 +137,8 @@ void UVDataWrapper::getUV(int uv_index, float *uv)
}
uv[0] = float((*values)[uv_index * stride]);
uv[1] = float((*values)[uv_index * stride + 1]);
} break;
break;
}
case COLLADAFW::MeshVertexData::DATA_TYPE_UNKNOWN:
default:
fprintf(stderr, "MeshImporter.getUV(): unknown data type\n");
@@ -177,13 +179,13 @@ void VCOLDataWrapper::get_vcol(int v_index, MLoopCol *mloopcol)
case COLLADAFW::MeshVertexData::DATA_TYPE_FLOAT: {
COLLADAFW::ArrayPrimitiveType<float> *values = mVData->getFloatValues();
colladaAddColor<COLLADAFW::ArrayPrimitiveType<float> *>(values, mloopcol, v_index, stride);
} break;
break;
}
case COLLADAFW::MeshVertexData::DATA_TYPE_DOUBLE: {
COLLADAFW::ArrayPrimitiveType<double> *values = mVData->getDoubleValues();
colladaAddColor<COLLADAFW::ArrayPrimitiveType<double> *>(values, mloopcol, v_index, stride);
} break;
break;
}
default:
fprintf(stderr, "VCOLDataWrapper.getvcol(): unknown data type\n");
}
@@ -818,8 +820,8 @@ void MeshImporter::get_vector(float v[3], COLLADAFW::MeshVertexData &arr, int i,
else {
v[2] = 0.0f;
}
} break;
break;
}
case COLLADAFW::MeshVertexData::DATA_TYPE_DOUBLE: {
COLLADAFW::ArrayPrimitiveType<double> *values = arr.getDoubleValues();
if (values->empty()) {
@@ -834,7 +836,8 @@ void MeshImporter::get_vector(float v[3], COLLADAFW::MeshVertexData &arr, int i,
else {
v[2] = 0.0f;
}
} break;
break;
}
default:
break;
}

View File

@@ -385,21 +385,21 @@ void HydraSceneDelegate::check_updates()
switch (GS(id->name)) {
case ID_OB: {
do_update_collection = true;
} break;
break;
}
case ID_MA: {
MaterialData *mat_data = material_data(material_prim_id((Material *)id));
if (mat_data) {
mat_data->update();
}
} break;
break;
}
case ID_WO: {
if (shading_settings.use_scene_world && id->recalc & ID_RECALC_SHADING) {
do_update_world = true;
}
} break;
break;
}
case ID_SCE: {
if ((id->recalc & ID_RECALC_COPY_ON_WRITE && !(id->recalc & ID_RECALC_SELECT)) ||
id->recalc & (ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_BASE_FLAGS))
@@ -411,7 +411,8 @@ void HydraSceneDelegate::check_updates()
{
do_update_world = true;
}
} break;
break;
}
default:
break;

View File

@@ -210,15 +210,18 @@ static void create_usd_preview_surface_material(const USDExporterContext &usd_ex
case SOCK_FLOAT: {
create_input<bNodeSocketValueFloat, float>(
preview_surface, input_spec, sock->default_value);
} break;
break;
}
case SOCK_VECTOR: {
create_input<bNodeSocketValueVector, pxr::GfVec3f>(
preview_surface, input_spec, sock->default_value);
} break;
break;
}
case SOCK_RGBA: {
create_input<bNodeSocketValueRGBA, pxr::GfVec3f>(
preview_surface, input_spec, sock->default_value);
} break;
break;
}
default:
break;
}

View File

@@ -1121,7 +1121,7 @@ const char *WM_key_event_string(const short type, const bool compact)
font_id, IFACE_("Win"), BLI_STR_UTF8_BLACK_DIAMOND_MINUS_WHITE_X);
}
return IFACE_("OS");
} break;
}
case EVT_TABKEY:
return key_event_glyph_or_text(
font_id, CTX_N_(BLT_I18NCONTEXT_UI_EVENTS, "Tab"), BLI_STR_UTF8_HORIZONTAL_TAB_KEY);