Cleanup: clang-format
This commit is contained in:
@@ -46,7 +46,7 @@ CCL_NAMESPACE_BEGIN
|
|||||||
|
|
||||||
/* Geometry */
|
/* Geometry */
|
||||||
|
|
||||||
PackFlags operator |=(PackFlags &pack_flags, uint32_t value)
|
PackFlags operator|=(PackFlags &pack_flags, uint32_t value)
|
||||||
{
|
{
|
||||||
pack_flags = (PackFlags)((uint32_t)pack_flags | value);
|
pack_flags = (PackFlags)((uint32_t)pack_flags | value);
|
||||||
return pack_flags;
|
return pack_flags;
|
||||||
@@ -1325,7 +1325,8 @@ void GeometryManager::device_update_bvh(Device *device,
|
|||||||
// Iterate over scene mesh list instead of objects, since 'optix_prim_offset' was calculated
|
// Iterate over scene mesh list instead of objects, since 'optix_prim_offset' was calculated
|
||||||
// based on that list, which may be ordered differently from the object list.
|
// based on that list, which may be ordered differently from the object list.
|
||||||
foreach (Geometry *geom, scene->geometry) {
|
foreach (Geometry *geom, scene->geometry) {
|
||||||
/* Make a copy of the pack_flags so the current geometry's flags do not pollute the others'. */
|
/* Make a copy of the pack_flags so the current geometry's flags do not pollute the others'.
|
||||||
|
*/
|
||||||
PackFlags geom_pack_flags = pack_flags;
|
PackFlags geom_pack_flags = pack_flags;
|
||||||
|
|
||||||
if (geom->is_modified()) {
|
if (geom->is_modified()) {
|
||||||
@@ -1951,7 +1952,8 @@ void GeometryManager::device_update(Device *device,
|
|||||||
* Also update the BVH if the transformations change, we cannot rely on tagging the Geometry
|
* Also update the BVH if the transformations change, we cannot rely on tagging the Geometry
|
||||||
* as modified in this case, as we may accumulate displacement if the vertices do not also
|
* as modified in this case, as we may accumulate displacement if the vertices do not also
|
||||||
* change. */
|
* change. */
|
||||||
bool need_update_scene_bvh = (scene->bvh == nullptr || (update_flags & (TRANSFORM_MODIFIED | VISIBILITY_MODIFIED)) != 0);
|
bool need_update_scene_bvh = (scene->bvh == nullptr ||
|
||||||
|
(update_flags & (TRANSFORM_MODIFIED | VISIBILITY_MODIFIED)) != 0);
|
||||||
{
|
{
|
||||||
scoped_callback_timer timer([scene](double time) {
|
scoped_callback_timer timer([scene](double time) {
|
||||||
if (scene->update_stats) {
|
if (scene->update_stats) {
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ enum PackFlags : uint32_t {
|
|||||||
PACK_ALL = (PACK_GEOMETRY | PACK_VERTICES | PACK_VISIBILITY),
|
PACK_ALL = (PACK_GEOMETRY | PACK_VERTICES | PACK_VISIBILITY),
|
||||||
};
|
};
|
||||||
|
|
||||||
PackFlags operator |= (PackFlags &pack_flags, uint32_t value);
|
PackFlags operator|=(PackFlags &pack_flags, uint32_t value);
|
||||||
|
|
||||||
/* Geometry
|
/* Geometry
|
||||||
*
|
*
|
||||||
@@ -144,7 +144,10 @@ class Geometry : public Node {
|
|||||||
int n,
|
int n,
|
||||||
int total);
|
int total);
|
||||||
|
|
||||||
virtual void pack_primitives(PackedBVH *pack, int object, uint visibility, PackFlags pack_flags) = 0;
|
virtual void pack_primitives(PackedBVH *pack,
|
||||||
|
int object,
|
||||||
|
uint visibility,
|
||||||
|
PackFlags pack_flags) = 0;
|
||||||
|
|
||||||
/* Check whether the geometry should have own BVH built separately. Briefly,
|
/* Check whether the geometry should have own BVH built separately. Briefly,
|
||||||
* own BVH is needed for geometry, if:
|
* own BVH is needed for geometry, if:
|
||||||
|
|||||||
@@ -522,7 +522,8 @@ void Hair::pack_primitives(PackedBVH *pack, int object, uint visibility, PackFla
|
|||||||
uint type = has_motion_blur() ?
|
uint type = has_motion_blur() ?
|
||||||
((curve_shape == CURVE_RIBBON) ? PRIMITIVE_MOTION_CURVE_RIBBON :
|
((curve_shape == CURVE_RIBBON) ? PRIMITIVE_MOTION_CURVE_RIBBON :
|
||||||
PRIMITIVE_MOTION_CURVE_THICK) :
|
PRIMITIVE_MOTION_CURVE_THICK) :
|
||||||
((curve_shape == CURVE_RIBBON) ? PRIMITIVE_CURVE_RIBBON : PRIMITIVE_CURVE_THICK);
|
((curve_shape == CURVE_RIBBON) ? PRIMITIVE_CURVE_RIBBON :
|
||||||
|
PRIMITIVE_CURVE_THICK);
|
||||||
|
|
||||||
size_t index = 0;
|
size_t index = 0;
|
||||||
for (size_t j = 0; j < num_curves(); ++j) {
|
for (size_t j = 0; j < num_curves(); ++j) {
|
||||||
|
|||||||
@@ -146,7 +146,10 @@ class Hair : public Geometry {
|
|||||||
/* BVH */
|
/* BVH */
|
||||||
void pack_curves(Scene *scene, float4 *curve_key_co, float4 *curve_data, size_t curvekey_offset);
|
void pack_curves(Scene *scene, float4 *curve_key_co, float4 *curve_data, size_t curvekey_offset);
|
||||||
|
|
||||||
void pack_primitives(PackedBVH *pack, int object, uint visibility, PackFlags pack_flags) override;
|
void pack_primitives(PackedBVH *pack,
|
||||||
|
int object,
|
||||||
|
uint visibility,
|
||||||
|
PackFlags pack_flags) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
CCL_NAMESPACE_END
|
CCL_NAMESPACE_END
|
||||||
|
|||||||
@@ -232,7 +232,10 @@ class Mesh : public Geometry {
|
|||||||
size_t tri_offset);
|
size_t tri_offset);
|
||||||
void pack_patches(uint *patch_data, uint vert_offset, uint face_offset, uint corner_offset);
|
void pack_patches(uint *patch_data, uint vert_offset, uint face_offset, uint corner_offset);
|
||||||
|
|
||||||
void pack_primitives(PackedBVH *pack, int object, uint visibility, PackFlags pack_flags) override;
|
void pack_primitives(PackedBVH *pack,
|
||||||
|
int object,
|
||||||
|
uint visibility,
|
||||||
|
PackFlags pack_flags) override;
|
||||||
|
|
||||||
void tessellate(DiagSplit *split);
|
void tessellate(DiagSplit *split);
|
||||||
|
|
||||||
|
|||||||
@@ -30,4 +30,4 @@ double ChunkOrderHotspot::calc_distance(int x, int y)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace blender::compositor
|
} // namespace blender::compositor
|
||||||
|
|||||||
@@ -1675,7 +1675,8 @@ static void paint_cursor_draw_3d_view_brush_cursor_inactive(PaintCursorContext *
|
|||||||
GPU_matrix_mul(pcontext->vc.obact->obmat);
|
GPU_matrix_mul(pcontext->vc.obact->obmat);
|
||||||
|
|
||||||
/* Drawing Cursor overlays in 3D object space. */
|
/* Drawing Cursor overlays in 3D object space. */
|
||||||
if (is_brush_tool && brush->sculpt_tool == SCULPT_TOOL_GRAB && (brush->flag & BRUSH_GRAB_ACTIVE_VERTEX)) {
|
if (is_brush_tool && brush->sculpt_tool == SCULPT_TOOL_GRAB &&
|
||||||
|
(brush->flag & BRUSH_GRAB_ACTIVE_VERTEX)) {
|
||||||
SCULPT_geometry_preview_lines_update(pcontext->C, pcontext->ss, pcontext->radius);
|
SCULPT_geometry_preview_lines_update(pcontext->C, pcontext->ss, pcontext->radius);
|
||||||
sculpt_geometry_preview_lines_draw(
|
sculpt_geometry_preview_lines_draw(
|
||||||
pcontext->pos, pcontext->brush, pcontext->is_multires, pcontext->ss);
|
pcontext->pos, pcontext->brush, pcontext->is_multires, pcontext->ss);
|
||||||
|
|||||||
@@ -688,7 +688,7 @@ class GVArray_For_EmbeddedVArray : public GVArray_For_VArray<T> {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
template<typename... Args>
|
template<typename... Args>
|
||||||
GVArray_For_EmbeddedVArray(const int64_t size, Args &&...args)
|
GVArray_For_EmbeddedVArray(const int64_t size, Args &&... args)
|
||||||
: GVArray_For_VArray<T>(size), embedded_varray_(std::forward<Args>(args)...)
|
: GVArray_For_VArray<T>(size), embedded_varray_(std::forward<Args>(args)...)
|
||||||
{
|
{
|
||||||
this->varray_ = &embedded_varray_;
|
this->varray_ = &embedded_varray_;
|
||||||
@@ -703,7 +703,7 @@ class GVMutableArray_For_EmbeddedVMutableArray : public GVMutableArray_For_VMuta
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
template<typename... Args>
|
template<typename... Args>
|
||||||
GVMutableArray_For_EmbeddedVMutableArray(const int64_t size, Args &&...args)
|
GVMutableArray_For_EmbeddedVMutableArray(const int64_t size, Args &&... args)
|
||||||
: GVMutableArray_For_VMutableArray<T>(size), embedded_varray_(std::forward<Args>(args)...)
|
: GVMutableArray_For_VMutableArray<T>(size), embedded_varray_(std::forward<Args>(args)...)
|
||||||
{
|
{
|
||||||
this->varray_ = &embedded_varray_;
|
this->varray_ = &embedded_varray_;
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ class TestLibraryOverrides(TestHelper, unittest.TestCase):
|
|||||||
assert(override_operation.operation == 'REPLACE')
|
assert(override_operation.operation == 'REPLACE')
|
||||||
# Setting location.y overridded all elements in the location array. -1 is a wildcard.
|
# Setting location.y overridded all elements in the location array. -1 is a wildcard.
|
||||||
assert(override_operation.subitem_local_index == -1)
|
assert(override_operation.subitem_local_index == -1)
|
||||||
|
|
||||||
def test_link_permissive(self):
|
def test_link_permissive(self):
|
||||||
"""
|
"""
|
||||||
Linked assets with a permissive template.
|
Linked assets with a permissive template.
|
||||||
|
|||||||
@@ -61,4 +61,3 @@ def main():
|
|||||||
|
|
||||||
if not inside_blender and __name__ == "__main__":
|
if not inside_blender and __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|
||||||
|
|||||||
@@ -316,13 +316,13 @@ def main():
|
|||||||
# normal case
|
# normal case
|
||||||
MeshTest("CubeFaceUnsubdivide", "testCubeUnsubdivide", "expectedCubeUnsubdivide",
|
MeshTest("CubeFaceUnsubdivide", "testCubeUnsubdivide", "expectedCubeUnsubdivide",
|
||||||
[OperatorSpecEditMode("unsubdivide", {}, "FACE", {i for i in range(6)})]),
|
[OperatorSpecEditMode("unsubdivide", {}, "FACE", {i for i in range(6)})]),
|
||||||
|
|
||||||
# T87259 - test cases
|
# T87259 - test cases
|
||||||
MeshTest("CubeEdgeUnsubdivide", "testCubeEdgeUnsubdivide", "expectedCubeEdgeUnsubdivide",
|
MeshTest("CubeEdgeUnsubdivide", "testCubeEdgeUnsubdivide", "expectedCubeEdgeUnsubdivide",
|
||||||
[OperatorSpecEditMode("unsubdivide", {}, "EDGE", {i for i in range(6)})]),
|
[OperatorSpecEditMode("unsubdivide", {}, "EDGE", {i for i in range(6)})]),
|
||||||
MeshTest("UVSphereUnsubdivide", "testUVSphereUnsubdivide", "expectedUVSphereUnsubdivide",
|
MeshTest("UVSphereUnsubdivide", "testUVSphereUnsubdivide", "expectedUVSphereUnsubdivide",
|
||||||
[OperatorSpecEditMode("unsubdivide", {'iterations': 9}, "FACE", {i for i in range(512)})]),
|
[OperatorSpecEditMode("unsubdivide", {'iterations': 9}, "FACE", {i for i in range(512)})]),
|
||||||
|
|
||||||
# vert connect path
|
# vert connect path
|
||||||
# Tip: It works only if there is an already existing face or more than 2 vertices.
|
# Tip: It works only if there is an already existing face or more than 2 vertices.
|
||||||
MeshTest("CubeVertConnectPath", "testCubeVertConnectPath", "expectedCubeVertConnectPath",
|
MeshTest("CubeVertConnectPath", "testCubeVertConnectPath", "expectedCubeVertConnectPath",
|
||||||
|
|||||||
Reference in New Issue
Block a user