Cleanup: clang-format

This commit is contained in:
Campbell Barton 2022-04-07 14:34:51 +10:00
parent 81ec3dce65
commit 792a481bee
12 changed files with 31 additions and 20 deletions

View File

@ -88,9 +88,9 @@ void HdCyclesCamera::Sync(HdSceneDelegate *sceneDelegate,
if (!value.IsEmpty()) {
_projectionMatrix = value.Get<GfMatrix4d>();
const float focalLength = _data.GetFocalLength(); // Get default focal length
#if PXR_VERSION >= 2102
# if PXR_VERSION >= 2102
_data.SetFromViewAndProjectionMatrix(GetViewMatrix(), _projectionMatrix, focalLength);
#else
# else
if (_projectionMatrix[2][3] < -0.5) {
_data.SetProjection(GfCamera::Perspective);
@ -120,7 +120,7 @@ void HdCyclesCamera::Sync(HdSceneDelegate *sceneDelegate,
_data.SetClippingRange(
GfRange1f(nearPlusFarHalf + nearMinusFarHalf, nearPlusFarHalf - nearMinusFarHalf));
}
#endif
# endif
}
}
#endif
@ -150,9 +150,8 @@ void HdCyclesCamera::Sync(HdSceneDelegate *sceneDelegate,
#else
value = sceneDelegate->GetCameraParamValue(id, _tokens->projection);
if (!value.IsEmpty()) {
_data.SetProjection(value.Get<TfToken>() != _tokens->orthographic ?
GfCamera::Perspective :
GfCamera::Orthographic);
_data.SetProjection(value.Get<TfToken>() != _tokens->orthographic ? GfCamera::Perspective :
GfCamera::Orthographic);
}
#endif

View File

@ -273,7 +273,8 @@ template<typename MatrixArray> array<Transform> convertToCyclesTransformArray(co
array<Transform> cyclesArray;
cyclesArray.reserve(valueData.size());
for (const auto &element : valueData) {
cyclesArray.push_back_reserved(convertMatrixToCycles<typename MatrixArray::value_type>(element));
cyclesArray.push_back_reserved(
convertMatrixToCycles<typename MatrixArray::value_type>(element));
}
return cyclesArray;
}

View File

@ -179,8 +179,12 @@ bool Geometry::has_true_displacement() const
return false;
}
void Geometry::compute_bvh(
Device *device, DeviceScene *dscene, SceneParams *params, Progress *progress, size_t n, size_t total)
void Geometry::compute_bvh(Device *device,
DeviceScene *dscene,
SceneParams *params,
Progress *progress,
size_t n,
size_t total)
{
if (progress->get_cancel())
return;

View File

@ -383,7 +383,7 @@ std::unique_ptr<CurveEval> curves_to_curve_eval(const Curves &curves)
curves.geometry);
VArray<int> resolution = geometry.resolution();
VArray_Span<float> nurbs_weights{
src_component.attribute_get_for_read<float>("nurbs_weight", ATTR_DOMAIN_POINT, 0.0f)};
VArray_Span<int> nurbs_orders{

View File

@ -1836,7 +1836,7 @@ void BKE_sculpt_color_layer_create_if_needed(struct Object *object)
CustomData_add_layer(&orig_me->vdata, CD_PROP_COLOR, CD_DEFAULT, NULL, orig_me->totvert);
CustomDataLayer *layer = orig_me->vdata.layers +
CustomData_get_layer_index(&orig_me->vdata, CD_PROP_COLOR);
CustomData_get_layer_index(&orig_me->vdata, CD_PROP_COLOR);
BKE_mesh_update_customdata_pointers(orig_me, true);

View File

@ -564,7 +564,8 @@ static void bmo_get_loop_color_ref(BMesh *bm,
{
Mesh me_query;
BKE_id_attribute_copy_domains_temp(ID_ME, &bm->vdata, NULL, &bm->ldata, NULL, NULL, &me_query.id);
BKE_id_attribute_copy_domains_temp(
ID_ME, &bm->vdata, NULL, &bm->ldata, NULL, NULL, &me_query.id);
CustomDataLayer *layer = BKE_id_attribute_from_index(
&me_query.id, index, ATTR_DOMAIN_MASK_COLOR, CD_MASK_COLOR_ALL);

View File

@ -798,7 +798,8 @@ static void drw_shgroup_bone_ik_no_target_lines(ArmatureDrawContext *ctx,
const float start[3],
const float end[3])
{
drw_shgroup_bone_relationship_lines_ex(ctx, start, end, G_draw.block.color_bone_ik_line_no_target);
drw_shgroup_bone_relationship_lines_ex(
ctx, start, end, G_draw.block.color_bone_ik_line_no_target);
}
static void drw_shgroup_bone_ik_spline_lines(ArmatureDrawContext *ctx,

View File

@ -524,7 +524,8 @@ void WM_OT_usd_import(struct wmOperatorType *ot)
RNA_def_boolean(ot->srna, "read_mesh_uvs", true, "UV Coordinates", "Read mesh UV coordinates");
RNA_def_boolean(ot->srna, "read_mesh_colors", false, "Color Attributes", "Read mesh color attributes");
RNA_def_boolean(
ot->srna, "read_mesh_colors", false, "Color Attributes", "Read mesh color attributes");
RNA_def_string(ot->srna,
"prim_path_mask",

View File

@ -3153,8 +3153,10 @@ static int edbm_reverse_colors_exec(bContext *C, wmOperator *op)
BMOperator bmop;
int color_index = BKE_id_attribute_to_index(&me->id, layer, ATTR_DOMAIN_MASK_COLOR, CD_MASK_COLOR_ALL);
EDBM_op_init(em, &bmop, op, "reverse_colors faces=%hf color_index=%i", BM_ELEM_SELECT, color_index);
int color_index = BKE_id_attribute_to_index(
&me->id, layer, ATTR_DOMAIN_MASK_COLOR, CD_MASK_COLOR_ALL);
EDBM_op_init(
em, &bmop, op, "reverse_colors faces=%hf color_index=%i", BM_ELEM_SELECT, color_index);
BMO_op_exec(em->bm, &bmop);

View File

@ -158,7 +158,7 @@ static void do_paint_brush_task_cb_ex(void *__restrict userdata,
float noise = 1.0f;
const float density = ss->cache->paint_brush.density;
if (density < 1.0f) {
const float hash_noise = (float) BLI_hash_int_01(ss->cache->density_seed * 1000 * vd.index);
const float hash_noise = (float)BLI_hash_int_01(ss->cache->density_seed * 1000 * vd.index);
if (hash_noise > density) {
noise = density * hash_noise;
fade = fade * noise;
@ -251,7 +251,7 @@ void SCULPT_do_paint_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode
if (SCULPT_stroke_is_first_brush_step_of_symmetry_pass(ss->cache)) {
if (SCULPT_stroke_is_first_brush_step(ss->cache)) {
ss->cache->density_seed = (float) BLI_hash_int_01(ss->cache->location[0] * 1000);
ss->cache->density_seed = (float)BLI_hash_int_01(ss->cache->location[0] * 1000);
}
return;
}

View File

@ -526,7 +526,9 @@ static void rna_AttributeGroup_active_color_index_range(
*softmax = *max;
}
static void rna_AttributeGroup_update_active_color(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
static void rna_AttributeGroup_update_active_color(Main *UNUSED(bmain),
Scene *UNUSED(scene),
PointerRNA *ptr)
{
ID *id = ptr->owner_id;

View File

@ -141,7 +141,7 @@ void SEQ_animation_duplicate(Scene *scene, Sequence *seq, ListBase *list)
}
if (seq->type == SEQ_TYPE_META) {
LISTBASE_FOREACH (Sequence*, meta_child, &seq->seqbase){
LISTBASE_FOREACH (Sequence *, meta_child, &seq->seqbase) {
SEQ_animation_duplicate(scene, meta_child, list);
}
}