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
@@ -68,6 +68,19 @@
|
|||||||
- (1.000, 1.000)
|
- (1.000, 1.000)
|
||||||
- (0.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
|
==== Objects: 6
|
||||||
- Obj 'A' MESH data:'A'
|
- Obj 'A' MESH data:'A'
|
||||||
- pos 0.000, 0.000, 0.000
|
- pos 0.000, 0.000, 0.000
|
||||||
|
|||||||
@@ -13,6 +13,22 @@
|
|||||||
- attr 'sharp_face' BOOLEAN FACE
|
- attr 'sharp_face' BOOLEAN FACE
|
||||||
- 1 1 1 1 1 1
|
- 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
|
==== Objects: 2
|
||||||
- Obj 'MainInstancer' POINTCLOUD data:'MainInstancer'
|
- Obj 'MainInstancer' POINTCLOUD data:'MainInstancer'
|
||||||
- pos 0.000, 0.000, 0.000
|
- pos 0.000, 0.000, 0.000
|
||||||
|
|||||||
@@ -266,6 +266,8 @@ integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw
|
|||||||
return f"({fmtf(val.vector[0])}, {fmtf(val.vector[1])})"
|
return f"({fmtf(val.vector[0])}, {fmtf(val.vector[1])})"
|
||||||
if isinstance(val, bpy.types.FloatColorAttributeValue) or isinstance(val, bpy.types.ByteColorAttributeValue):
|
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})"
|
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):
|
if isinstance(val, bpy.types.Int2AttributeValue) or isinstance(val, bpy.types.Short2AttributeValue):
|
||||||
return f"({val.value[0]}, {val.value[1]})"
|
return f"({val.value[0]}, {val.value[1]})"
|
||||||
if isinstance(val, bpy.types.ID):
|
if isinstance(val, bpy.types.ID):
|
||||||
@@ -529,6 +531,27 @@ integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw
|
|||||||
Report._write_custom_props(curve, desc)
|
Report._write_custom_props(curve, desc)
|
||||||
desc.write(f"\n")
|
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
|
# objects
|
||||||
if len(bpy.data.objects):
|
if len(bpy.data.objects):
|
||||||
desc.write(f"==== Objects: {len(bpy.data.objects)}\n")
|
desc.write(f"==== Objects: {len(bpy.data.objects)}\n")
|
||||||
|
|||||||
Reference in New Issue
Block a user