Skip to content

Commit 90b2afc

Browse files
authored
Fix not handled errors when op don't have polygons
Thanks, Andreas Block for pointing it.
1 parent 2ac9af0 commit 90b2afc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/04_3d_concepts/modeling/read_write_normal_tag_r13.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ def main():
100100
if not isinstance(op, c4d.PolygonObject):
101101
raise TypeError("op is not a c4d.PolygonObject.")
102102

103+
# Checks if the selected polygon object has some polygons
104+
if op.GetPolygonCount() == 0:
105+
raise ValueError("The the selected object, don't have any polygon to host normal data.")
106+
103107
# Creates a normal tag
104108
tag = CreateNormalTag(op)
105109

@@ -123,4 +127,4 @@ def main():
123127

124128

125129
if __name__ == "__main__":
126-
main()
130+
main()

0 commit comments

Comments
 (0)