StjerneIdioten / I3D-Blender-Addon

Rewriting the I3D blender addon from scratch and adding long-sought community features
GNU General Public License v3.0
66 stars 18 forks source link

fix: fixed normals calc for Blender 4.1 #205

Closed LKAMinco closed 4 months ago

StjerneIdioten commented 4 months ago

Have you tested that normals are still exported properly into GE with scaling? And not just that the exporter doesn't throw an error anymore. I can see that they've removed that function yes, but then they refer to using the normals from corner_normals to gain access to the normals cache. Given that the other call was there for a reason (the normals were messed up because of the scaling applied), I just want to make sure that it isn't the case again.

LKAMinco commented 4 months ago

Yes I have tested it and did not find any issue. Also they have mentioned in the api change that "it is automatically updated when relevant data changes" so I assume that Blender now recalculates normals automatically. Also Mesh.corner_normals is just read only collectionProp.

StjerneIdioten commented 4 months ago

Also they have mentioned in the api change that "it is automatically updated when relevant data changes" so I assume that Blender now recalculates normals automatically.

Yes, but that refers back to mesh.corner_normals automatically being updated as far as my english is concerned 😅

Also Mesh.corner_normals is just read only collectionProp.

I know. But maybe we are meant to access normals through this property instead, when we want updated values.

It can also just be the case that accessing the normals as we have done so far is fine and that this "fix" of updating the normals has been unnecessary for a while. This code is some of the first stuff back when 2.8 came out 😅

LKAMinco commented 4 months ago

I have tested it, compared and get same result in Vector for obj.data.loops.normal and obj.data.corner_normals.vector. Order was also the same. Tested on scaled, rotated, transformed mesh.