Tests: add PointCloud datablock to IO report

Adds support for comparing PointCloud datablocks inside the IO report.

Pull Request: https://projects.blender.org/blender/blender/pulls/147490
This commit is contained in:
Jesse Yurkovich
2025-10-07 05:13:43 +02:00
committed by Jesse Yurkovich
parent 62d72bd0b5
commit fd3f8c1265
3 changed files with 52 additions and 0 deletions

View File

@@ -68,6 +68,19 @@
- (1.000, 1.000)
- (0.000, 1.000)
==== Point Clouds: 1
- PointCloud 'point_instancer' points:1
- attr 'mask' BOOLEAN POINT
- 1
- attr 'orientation' QUATERNION POINT
- (0.929, 0.301, 0.205, -0.066)
- attr 'position' FLOAT_VECTOR POINT
- (0.000, 0.000, 0.000)
- attr 'proto_index' INT POINT
- 0
- attr 'scale' FLOAT_VECTOR POINT
- (1.000, 1.000, 1.000)
==== Objects: 6
- Obj 'A' MESH data:'A'
- pos 0.000, 0.000, 0.000

View File

@@ -13,6 +13,22 @@
- attr 'sharp_face' BOOLEAN FACE
- 1 1 1 1 1 1
==== Point Clouds: 1
- PointCloud 'MainInstancer' points:2
- attr 'mask' BOOLEAN POINT
- 1 1
- attr 'orientation' QUATERNION POINT
- (1.000, 0.000, 0.000, 0.000)
- (1.000, 0.000, 0.000, 0.000)
- attr 'position' FLOAT_VECTOR POINT
- (2.000, 0.000, 0.000)
- (-2.000, 0.000, 0.000)
- attr 'proto_index' INT POINT
- 0 0
- attr 'scale' FLOAT_VECTOR POINT
- (1.000, 1.000, 1.000)
- (1.000, 1.000, 1.000)
==== Objects: 2
- Obj 'MainInstancer' POINTCLOUD data:'MainInstancer'
- pos 0.000, 0.000, 0.000

View File

@@ -266,6 +266,8 @@ integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw
return f"({fmtf(val.vector[0])}, {fmtf(val.vector[1])})"
if isinstance(val, bpy.types.FloatColorAttributeValue) or isinstance(val, bpy.types.ByteColorAttributeValue):
return f"({val.color[0]:.3f}, {val.color[1]:.3f}, {val.color[2]:.3f}, {val.color[3]:.3f})"
if isinstance(val, bpy.types.QuaternionAttributeValue):
return f"({val.value[0]:.3f}, {val.value[1]:.3f}, {val.value[2]:.3f}, {val.value[3]:.3f})"
if isinstance(val, bpy.types.Int2AttributeValue) or isinstance(val, bpy.types.Short2AttributeValue):
return f"({val.value[0]}, {val.value[1]})"
if isinstance(val, bpy.types.ID):
@@ -529,6 +531,27 @@ integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw
Report._write_custom_props(curve, desc)
desc.write(f"\n")
# pointclouds
if len(bpy.data.pointclouds):
desc.write(f"==== Point Clouds: {len(bpy.data.pointclouds)}\n")
for pointcloud in bpy.data.pointclouds:
# overview
desc.write(
f"- PointCloud '{pointcloud.name}' "
f"points:{len(pointcloud.points)}\n"
)
# attributes
for attr in sorted(pointcloud.attributes, key=lambda x: x.name):
if not attr.is_internal:
Report._write_attr(attr, desc)
# materials
if pointcloud.materials:
desc.write(f" - {len(pointcloud.materials)} materials\n")
Report._write_collection_single(pointcloud.materials, desc)
Report._write_animdata_desc(pointcloud.animation_data, desc)
Report._write_custom_props(pointcloud, desc)
desc.write(f"\n")
# objects
if len(bpy.data.objects):
desc.write(f"==== Objects: {len(bpy.data.objects)}\n")