Spaces:
Runtime error
Runtime error
eliphatfs
commited on
Commit
·
d51a272
1
Parent(s):
02f3e52
Fix corner case.
Browse files- misc_utils.py +4 -0
misc_utils.py
CHANGED
@@ -44,8 +44,12 @@ def model_to_pc(mesh: trimesh.Trimesh, n_sample_points=10000):
|
|
44 |
material = material.materials[0]
|
45 |
if hasattr(material, 'image'):
|
46 |
texture = material.image
|
|
|
|
|
47 |
elif hasattr(material, 'baseColorTexture'):
|
48 |
texture = material.baseColorTexture
|
|
|
|
|
49 |
else:
|
50 |
texture = None
|
51 |
rgba = numpy.ones_like(pcd) * 0.8
|
|
|
44 |
material = material.materials[0]
|
45 |
if hasattr(material, 'image'):
|
46 |
texture = material.image
|
47 |
+
if texture is None:
|
48 |
+
rgba = numpy.zeros([len(uv), len(material.main_color)]) + material.main_color
|
49 |
elif hasattr(material, 'baseColorTexture'):
|
50 |
texture = material.baseColorTexture
|
51 |
+
if texture is None:
|
52 |
+
rgba = numpy.zeros([len(uv), len(material.main_color)]) + material.main_color
|
53 |
else:
|
54 |
texture = None
|
55 |
rgba = numpy.ones_like(pcd) * 0.8
|