well i know about export svg , but i want to know how to use UV as a mesh then use it for shape key ? because vertex ids change after export and import svg , and can't be used for shape key , (For unfolding a mesh ) , is there any addon to do that ?
(See Update, below, for Blender 3.0b)
Nowadays, this is quite simple with Geometry Nodes:
To separate any UV islands, duplicating seam vertices, you can split the edges first, and then re-weld them:
For this kind of transition, when you take the modifier's 'Fac' from 0 to 1:
If you would prefer to animate the transition with shape-keys, you could apply the modifiers at the start and end states on copies of your object, without the Weld, to maintain the vertex-count and order.
Then you can 'Join as Shapes' the copies, and edit other in-between keys as you wish. You would have to take care not to separate vertices which are not on seams, but seam verts and non-seam verts could be stashed as vertex groups, to make selection easier.
In Geometry Nodes (Fields) the tree can be something more along these lines:
- Access to the UV Map is now through the modifier's interface
- Edges can be split inside the node tree
(As far as I can see, re-welding still has to be done further down the modifier stack.)
To make a UV map mesh from a mesh's UVs
Nostalgic method, via some scripting
can make a "UV mesh" in the $XY$ plane using the UV coordinates of the active UV map.
import bpy import numpy as np ob = bpy.context.object me = ob.data uv_layer = me.uv_layers.active # get uv values uvs = np.empty((2 * len(me.loops), 1)) uv_layer.data.foreach_get("uv", uvs) x, y = uvs.reshape((-1, 2)).T z = np.zeros((len(x))) uvme = bpy.data.meshes.new("UVMesh") verts = np.array((x, y, z)).T #verts -= (0.5, 0.5, 0) faces = [p.loop_indices for p in me.polygons] uvme.from_pydata( verts, , faces ) bpy.context.collection.objects.link(bpy.data.objects.new("UVMesh", uvme))
A matching face loop mesh
Equivalent of splitting all edges, to create a mesh from original with no connected faces (to match the UV loops)
import bpy import numpy as np ob = bpy.context.object me = ob.data coords = np.empty(3 * len(me.vertices)) me.vertices.foreach_get("co", coords) idxs = np.empty(len(me.loops), dtype=int) me.loops.foreach_get("vertex_index", idxs) uvme = bpy.data.meshes.new("UVMesh") verts = coords.reshape((-1, 3)) faces = [p.loop_indices for p in me.polygons] uvme.from_pydata( verts[idxs], , faces ) bpy.context.collection.objects.link(bpy.data.objects.new("UVMesh", uvme))
Join as Shapes.
Since the results of running both scripts above will have the same face and vertex counts they can be joined as shapes. To get a similar result shown as obtained by RobinBetts move the origin of UV to (0.5, 0.5, 0) and scale by 2.74 before joining.
- Create your object, rip it (V) along the seam you want to create, open the N panel > Extended Tools, click on Create UV Shape, it will create a shape key for this object:
- Back to Object mode, go into the Shape Key panel, select the second one and put the Value to 1 to "unwrap" the object. If you want to stick an object on the surface, create it, then select it, shift select your first object and press on Bind to Surface then Scene Update:
To bring back the object to its original shape, bring back the shape key Value to 0, the other object will follow: