@@ -104,7 +104,7 @@ def create_or_retrieve_attribute(mesh, k, v):
104104 if len (v .shape ) == 2 :
105105 dim = v .shape [1 ]
106106 if dim > 3 :
107- show_message_box ('higher than 3 dimensional attribue, ignored' )
107+ # show_message_box('higher than 3 dimensional attribue, ignored')
108108 return None
109109 if dim == 1 :
110110 return mesh .attributes .new (k , "FLOAT" , "POINT" )
@@ -113,7 +113,7 @@ def create_or_retrieve_attribute(mesh, k, v):
113113 if dim == 3 :
114114 return mesh .attributes .new (k , "FLOAT_VECTOR" , "POINT" )
115115 if len (v .shape ) > 2 :
116- show_message_box ('more than 2 dimensional tensor, ignored' )
116+ # show_message_box('more than 2 dimensional tensor, ignored')
117117 return None
118118 else :
119119 return mesh .attributes [k ]
@@ -192,6 +192,8 @@ def update_mesh(meshio_mesh, mesh):
192192 for k , v in meshio_mesh .point_data .items ():
193193 k = "bseq_" + k
194194 attribute = create_or_retrieve_attribute (mesh , k , v )
195+ if attribute is None :
196+ continue
195197 name_string = None
196198 if attribute .data_type == "FLOAT" :
197199 name_string = "value"
@@ -202,7 +204,11 @@ def update_mesh(meshio_mesh, mesh):
202204
203205 # set as split normal per vertex
204206 if mesh .BSEQ .split_norm_att_name and mesh .BSEQ .split_norm_att_name == k :
205- mesh .use_auto_smooth = True
207+ # If blender version is less than 4.1.0, then dont set auto smooth.
208+ # It has been removed and normals will be used automatically if they are set.
209+ # https://developer.blender.org/docs/release_notes/4.1/python_api/#mesh
210+ if bpy .app .version < (4 , 1 , 0 ):
211+ mesh .use_auto_smooth = True
206212 mesh .normals_split_custom_set_from_vertices (v )
207213
208214 for k , v in meshio_mesh .field_data .items ():
0 commit comments