Generally I want to direct polygons along custom split
normals, or at least get them work in AN. Can it be done?
1 Answer
You can get access to loops normals using the following expression:
[loop.normal for loop in [obj.data.calc_normals_split(), obj][1].data.loops]
Which calculates the split normals data and returns the normals. To set vertex normals to a mesh, you can use the setVertexNormals
method, which take a single vector list representing the normals.
-
$\begingroup$ Thanks for this answer. I have been banging my head against a wall trying to get custom normals with [loop.normal for loop in obj.data.loops] and just getting an array of zero vectors, even though the object has clearly visible custom normal data. Would love to know why the normals can only be read in this way. $\endgroup$– MrFlameySep 21, 2019 at 10:13