Guest User

Untitled

a guest
Jul 22nd, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. for ( var i = 0; i < geometry.vertices.length; i ++ ) {
  2.  
  3. // Imaginary functions to calculate the indices and weights
  4. // This part will need to be changed depending your skeleton and model
  5. var skinIndex = calculateSkinIndex( geometry.vertices, i );
  6. var skinWeight = calculateSkinWeight( geometry.vertices, i );
  7.  
  8. // Ease between each bone
  9. geometry.skinIndices.push( new THREE.Vector4( skinIndex, skinIndex + 1, 0, 0 ) );
  10. geometry.skinWeights.push( new THREE.Vector4( 1 - skinWeight, skinWeight, 0, 0 ) );
  11.  
  12. }
  13.  
  14. mesh = bpy.data.meshes.new('Mesh')
  15. mesh.from_pydata(self.verts, [], self.faces)
  16. mesh_object = bpy.data.objects.new('Mesh_Object', mesh)
  17. bpy.context.scene.objects.link(mesh_object)
  18. # How to add in vertex weights and indices?
Add Comment
Please, Sign In to add comment