@@ -104,7 +104,7 @@ def create_or_retrieve_attribute(mesh, k, v):
104
104
if len (v .shape ) == 2 :
105
105
dim = v .shape [1 ]
106
106
if dim > 3 :
107
- show_message_box ('higher than 3 dimensional attribue, ignored' )
107
+ # show_message_box('higher than 3 dimensional attribue, ignored')
108
108
return None
109
109
if dim == 1 :
110
110
return mesh .attributes .new (k , "FLOAT" , "POINT" )
@@ -113,7 +113,7 @@ def create_or_retrieve_attribute(mesh, k, v):
113
113
if dim == 3 :
114
114
return mesh .attributes .new (k , "FLOAT_VECTOR" , "POINT" )
115
115
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')
117
117
return None
118
118
else :
119
119
return mesh .attributes [k ]
@@ -192,6 +192,8 @@ def update_mesh(meshio_mesh, mesh):
192
192
for k , v in meshio_mesh .point_data .items ():
193
193
k = "bseq_" + k
194
194
attribute = create_or_retrieve_attribute (mesh , k , v )
195
+ if attribute is None :
196
+ continue
195
197
name_string = None
196
198
if attribute .data_type == "FLOAT" :
197
199
name_string = "value"
@@ -202,7 +204,11 @@ def update_mesh(meshio_mesh, mesh):
202
204
203
205
# set as split normal per vertex
204
206
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
206
212
mesh .normals_split_custom_set_from_vertices (v )
207
213
208
214
for k , v in meshio_mesh .field_data .items ():
0 commit comments