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:
committed by
Jesse Yurkovich
parent
62d72bd0b5
commit
fd3f8c1265
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user