Closed bartteunis closed 1 month ago
As far as it looks, the call to Mesh.calc_normals_split()
can be simply left out, since MeshLoop.normal
is now updated automatically. Comparing Blender 4.0's MeshLoop.normal to Blender 4.2's Meshloop.normal shows that it was necessary before to update custom split normals explicitly. In Blender 4.0's docs:
normal Local space unit length split normal vector of this vertex for this face (must be computed beforehand using calc_normals_split or calc_tangents)
In Blender 4.1's docs and up:
normal The normal direction of the face corner, taking into account sharp faces, sharp edges, and custom normal data
It should be safe to leave out the call to Mesh.calc_normals_split()
when the value contained in bpy.app.version
>= 4.1.
Exporter docs should also mention this change to custom split normals and refer to official Blender docs to provide more clarity.
Tested with a basic cube model in Blender 3.4 and 4.1. Normal and tangent values can be found in the mBuff
buffer (debugged by setting a breakpoint in smf_model_load_from_buffer()
).
Look into the changes that have been introduced with the Blender 4.X Python API. This appears to include mesh properties and functions related to smooth normals, such as
auto_smooth_angle
andcalc_normals_split()
and may include other changes. See Blender 4.1: Python API for the changes to the smooth normals. Also check the others.It looks like the call to
Mesh.calc_normals_split()
throws an error, starting from Blender release 4.1. Also happens in Blender 4.2.