Blender 2.6 UV coordinate export

Hey everyone,

I’m just wondering - is there a way to export the UV coordinates from one object and import them onto another object? I know 3ds Max can do this, so long as the topology is the same between the two meshes. Can Blender do something similar?

Cheers!

I have never seen such a feature in Blender 2.5. If I remember correctly 2.49 had something like that. Have you already asked that question in the Blender Artists Forum?

It should be pretty simple to write an addon that will transfer UV coordinates. What exactly are you trying to do? If you want to post a blend file I could probably whip one up for you.

Thanks guys,

Dantus, I hadn’t posted over at the Blender Artists Forum, but I have now: Export / Import UV Coordinates - Modeling - Blender Artists Community

niosop, I have two meshes, both with exactly the same structure. The only thing that differs between both meshes is that one of them has some adjusted vertices, and the UV layouts have been moved around a bit. If you like I could create a test case for you, but I wouldn’t want you to go out of your way to write a script if it is going to be a bother :wink:

This might do it - http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/3D_interaction/Copy_Attributes_Menu . If not, go ahead and send me a test case and I’ll see if I can find either an existing method or write an addon to do it.

It looks like the “Copy Texture Space” from that script is what I’m looking for.

I don’t seem to have that option when I install, though. I have these options:

Copy Location
Copy Rotation
Copy Scale
Copy Visual Location
Copy Visual Rotation
Copy Visual Scale
Copy Draw Options
Copy Time Offset
Copy Dupli
Copy Object Color
Copy Mass
Copy Protected Transform
Copy Object Constraints
Copy Pass Index
Copy Modifiers
Copy Vertex Weights
Copy Selected Constraints
Copy Selected Modifiers

Hmm, yeah I don’t see it either. I did find a copy UV menu item lying around, but didn’t see a way to paste them. Anyways, a simple script shouldn’t be hard to whip up. This helps a lot:

Basically you’d just iterate over all the faces of the source mesh, get the 4 UV coordinates (if it’s a tri then only 3 will be in use) and set the corresponding face in the destination mesh to use the same UV coordinates. Of course this will only work if there are the same number of verts/faces in both meshes and their order is the same.

I got it to work in the console (copy UVs from selected->active mesh), but haven’t written up the scaffolding to make it into an installable addon. Let me know if you need me to do so.

Thanks niosop, that sounds just like what I need. The meshes I’m using have the same number of verts/faces and unless something has gone wrong along the way, the ordering should be the same.

I haven’t used the console before… is it as simple as copy/pasting the code and running it?

Here you go. Extract this then go to File->User Preferences then the Addons tab, then at the bottom choose Install Addon. Browse to the .py file and click Install Addon. It should show up in the list, searching for “transfer” should help. Click the checkbox to activate it. Close the addon window.

Now in your scene, right click to select the source mesh, then shift-right click to select the destination mesh. Once two meshes are selected the Transfer UV Coordinate section and button should appear in your toolbar on the left. Just click the button and it should do it for you.

Let me know if you have any problems with it. Right now it doesn’t do any checking to make sure that the meshes are actually the same, so it will attempt to transfer from any mesh to any other.

784341–28694–$uvtransfer.zip (873 Bytes)

Wow, that seems to have worked! Thanks! :smile:

It will still throw out an error if you try and transfer from a mesh that doesn’t have the same topology. I made a cut between two quads on one of my meshes and that was enough to stop the script from working.

Thanks again!

Someone over at the Blender Artist forum posted the built in solution for this problem. You select the mesh with the obsolete UVs first, then shift select the mesh with the updated UVs, hit Ctrl-L and select “Join as UVs”!

Damn, it’s hard to find some things in Blender!

Its under object>join as UVs

Hi all !

yes, CTRL+L is your friend for what you want to do.
Be advices that the copy script just dont work at all with blender 2.63. BMeshes make the py script unable to work properly on triangles.
Moreover be adviced that the 2.63 also messed up the built-in UV coordinates handling. As BMesh is useless crap ( what i use to call ‘developper handjob’ ) it’s not without effects on UV handling. for seeing the pitfall, just make a 4 or 5 verts surface, unwrap it and move the UVs. Now spam the TAB key for going in out edit mode… you’ll see the map on the surface slightly moving as blender recalculates triangulation for the mesh.
Back to the UV copy, it’s really a ‘must have’ capability missing in blender. It now can do motion tracking, and will prolly make coffee in
2.63b. but forget about what you easily made with the good old 2.49b.
However the good point on 2.63 is that vertices, edges and surface snapping is really a BIG enhancement !!. What i just hope is that it will
easy rig&anim much more than the 2.49.
now let’s pray for some complete efficient update…

have a nice blend !