I have a very specific question. I’ve done a ton of research and didn’t find anything useful. So, as the Title suggests, I’m trying to export UV layout without all the edges inside of the UV Islands. Coming from 3DS Max, this is an essential part of my workflow and it’s missing from Blender’s built-in capabilities.
What I’ve tried:
I tried hiding the boundary loops and dissolving all verts and edges in the middle. This kind of works but still messes up some of the objects that have smaller parts with fewer verts. Also - it’s really slow, especially with higher-poly objects. Tried a few sub-methods doing this and non of them work properly.
I also tried exporting the standard UV Layout, then importing it into Fotoshop → Layer fill = 0, then stroking it. This method works great except for cases that have UV islands that only have their border edges overlaped, but are still separate islands.In these cases the stroke can’t detect the edge between the 2 islands so it’s unusable for my situation. There are some cases in the workflow where uv islands must be touching (not overlaping).
I also tried using the Fill option in the texture paint with the object selected and a brand new texture created. This sort of works but has its own set of problems and in the end the result is quite bad.
Since my workflow includes a DXF file with every object, I tried the DXF import-export addons. That was a big train wreck, they are quite buggy and even if they weren’t, I can’t find a way to use the imported DXF to export a PNG or JPG file to use as a UV Layout.
I also went through some method of creating a Python program that imports a DXF file, cleans it up and exports it in JPG file. I think I kind of found a way to do all this (so I’ll be able to implement it into a blender script and expose it as a button) but the problem is that in some cases I need to also be able to import .eps files AND perform some boolean operations and then export them into JPG file as well and this is where I think it all gets extremely complicated for my level.
I looked at the .py file responsible for the UV Layout export. It gets the data for every face and its surrounding edges and prints that. So if there’s a way to “trick” this and rewrite it so that it doesn’t get the data for every edge but just the border edges (the outlines of the UV islands) - this could be an actual solution. So if anyone has any ideas - I’m all ears!
The last thing is - I tried examining the Render UVW Template in Max. Now, things in Max are significantly differet. First, when you put an Unwrap UVW modifier, it automatically detects and visualises all UV boundary edges (in green). With that said, I understand that Max reads these as “Seam” edges and I already have a method to automatically set all UV boundary edges as seams in Blender so the question that remains is how to only export them, without all the other edges. The second difference is the “Render” part of this option. I’m not really sure exactly how this thing works and I can’t find any actual information, but if it uses Rendering - this could be another way to do it in Blender. Somehow detecting all UV edge bounds and put a 2-3 pixel stroke on then and then save the image as a PNG or a JPG file.
At the moment I have a workaround that actually uses Illustrator. If I export the UV Layout in Blender (fill = 0) as a .eps file and then import it into Illustrator. I can then use boolean operations in Illustrator to get rid of all the extra edges in the middle and then export a PNG or a JPG file. The problem is that it’s a workaround and uses an additional software. The other problem is that with higher-poly meshes this could be slow. It is acceptable however IF I can do it all in Blender.
So, a bit long, but there it is. If you have ANY other suggestions or ideas on how I can improve some of the methods above so that it actually works - please share your thoughts. Thank you in advance!
P.S: In order to clarify I'm giving an example. So with the stroke method you can get this:
But instead, I'd like to get the actual result I would get in 3ds Max:
This is the code for the edge selection process. It's fully commented:
import bpy import bmesh def export_uv(): op = bpy.ops # Turn on UV Sync mode sync_mode = bpy.context.scene.tool_settings if sync_mode.use_uv_select_sync == False: sync_mode.use_uv_select_sync = True # Select all faces op.mesh.select_all(action="SELECT") # Switch context window to UV Editor bpy.context.area.type = 'IMAGE_EDITOR' bpy.context.area.ui_type = 'UV' # Set mesh seams according to island setup in the UV Editor op.uv.seams_from_islands() # Switch context window to 3D view window bpy.context.area.type = 'VIEW_3D' # Select all faces op.mesh.select_all(action="SELECT") # Convert the selection to only the borders op.mesh.region_to_loop() # Mark the new selection as Seams op.mesh.mark_seam() # Deselect all faces op.mesh.select_all(action="DESELECT") # Go to OBJECT mode op.object.mode_set(mode='OBJECT') # Itterate through the edges of the object for edge in bpy.context.object.data.edges: if edge.use_seam == True: edge.select = True # Select the first found SEAM edge op.object.mode_set(mode='EDIT') # Go to Edit mode op.mesh.select_mode(type='EDGE') # Switch to Edge selection op.mesh.select_similar(type="SEAM") # Select all the edges that are seams break export_uv()
uvs = tuple(tuple(uv.uv) for uv in uv_layer[start:end])by
uvs = tuple(tuple(uv.uv) for uv in uv_layer[start:end]) if uv.select)(line 218) in the exporter. If so, you just have to find a way to select the outline of each island. Alternatively, it should be straight forward and just a few lines to save the selection to a svg file I guess, open source and well documented: w3.org/TR/SVG11 $\endgroup$