Skip to main content
added 22 characters in body
Source Link
ideasman42
  • 48k
  • 10
  • 144
  • 226

Blender isn't storing these normals for each shape key, so its not simply a matter of accessing some data.

While you could calculate them yourself, this isn't very convenient.

Temporary Mesh

  • Pin the shape key so its active an no others are taken into account.
  • Read the mesh using the Object.to_mesh method.
  • Read the normals from the mesh.
  • Remove the mesh.

Existing Mesh

  • write a function that(optionally) store the vertex coordinates.
  • temporarily appliesapply the shape-key to the mesh.
  • calculate the normals.
  • read them from the mesh (can store how you like, but be sure to copy them so as not to hold a reference to the original mesh data).
  • restore the original coordinates and optionally re-calculate normals again
    (though this could be postponed until after you're done with all of the shape-keys).

Blender isn't storing these normals for each shape key, so its not simply a matter of accessing some data.

While you could calculate them yourself, this isn't very convenient.

Temporary Mesh

  • Pin the shape key so its active an no others are taken into account.
  • Read the mesh using the Object.to_mesh method.
  • Read the normals from the mesh.
  • Remove the mesh.

Existing Mesh

  • write a function that temporarily applies the shape-key to the mesh.
  • calculate the normals.
  • read them from the mesh (can store how you like, but be sure to copy them so as not to hold a reference to the original mesh data).
  • restore the original coordinates and optionally re-calculate normals again
    (though this could be postponed until after you're done with all of the shape-keys).

Blender isn't storing these normals for each shape key, so its not simply a matter of accessing some data.

While you could calculate them yourself, this isn't very convenient.

Temporary Mesh

  • Pin the shape key so its active an no others are taken into account.
  • Read the mesh using the Object.to_mesh method.
  • Read the normals from the mesh.
  • Remove the mesh.

Existing Mesh

  • (optionally) store the vertex coordinates.
  • temporarily apply the shape-key to the mesh.
  • calculate the normals.
  • read them from the mesh (can store how you like, but be sure to copy them so as not to hold a reference to the original mesh data).
  • restore the original coordinates and optionally re-calculate normals again
    (though this could be postponed until after you're done with all of the shape-keys).
Source Link
ideasman42
  • 48k
  • 10
  • 144
  • 226

Blender isn't storing these normals for each shape key, so its not simply a matter of accessing some data.

While you could calculate them yourself, this isn't very convenient.

Temporary Mesh

  • Pin the shape key so its active an no others are taken into account.
  • Read the mesh using the Object.to_mesh method.
  • Read the normals from the mesh.
  • Remove the mesh.

Existing Mesh

  • write a function that temporarily applies the shape-key to the mesh.
  • calculate the normals.
  • read them from the mesh (can store how you like, but be sure to copy them so as not to hold a reference to the original mesh data).
  • restore the original coordinates and optionally re-calculate normals again
    (though this could be postponed until after you're done with all of the shape-keys).