Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for ( var i = 0; i < geometry.vertices.length; i ++ ) {
- // Imaginary functions to calculate the indices and weights
- // This part will need to be changed depending your skeleton and model
- var skinIndex = calculateSkinIndex( geometry.vertices, i );
- var skinWeight = calculateSkinWeight( geometry.vertices, i );
- // Ease between each bone
- geometry.skinIndices.push( new THREE.Vector4( skinIndex, skinIndex + 1, 0, 0 ) );
- geometry.skinWeights.push( new THREE.Vector4( 1 - skinWeight, skinWeight, 0, 0 ) );
- }
- mesh = bpy.data.meshes.new('Mesh')
- mesh.from_pydata(self.verts, [], self.faces)
- mesh_object = bpy.data.objects.new('Mesh_Object', mesh)
- bpy.context.scene.objects.link(mesh_object)
- # How to add in vertex weights and indices?
Add Comment
Please, Sign In to add comment