Skip to content
Snippets Groups Projects
Commit 65ca8918 authored by Campbell Barton's avatar Campbell Barton
Browse files

fix [#28227] join_uv and bake work wrong

added back ability to unwrap all selected mesh objects.
parent ae884d2e
Branches
Tags
No related merge requests found
......@@ -813,39 +813,26 @@ def main(context,
global RotMatStepRotation
main_consts()
# TODO, all selected meshes
'''
# objects = context.selected_editable_objects
objects = []
# we can will tag them later.
obList = [ob for ob in objects if ob.type == 'MESH']
# Face select object may not be selected.
ob = context.active_object
if ob and (not ob.select) and ob.type == 'MESH':
# Add to the list
obList =[ob]
del objects
'''
# Create the variables.
USER_PROJECTION_LIMIT = projection_limit
USER_ONLY_SELECTED_FACES = True
USER_SHARE_SPACE = 1 # Only for hole filling.
USER_STRETCH_ASPECT = 1 # Only for hole filling.
USER_ISLAND_MARGIN = island_margin # Only for hole filling.
USER_FILL_HOLES = 0
USER_FILL_HOLES_QUALITY = 50 # Only for hole filling.
USER_VIEW_INIT = 0 # Only for hole filling.
# quick workaround
is_editmode = (context.active_object.mode == 'EDIT')
if is_editmode:
obList = [ob for ob in [context.active_object] if ob and ob.type == 'MESH']
else:
obList = [ob for ob in context.selected_editable_objects if ob and ob.type == 'MESH']
USER_ONLY_SELECTED_FACES = False
if not obList:
raise('error, no selected mesh objects')
# Create the variables.
USER_PROJECTION_LIMIT = projection_limit
USER_ONLY_SELECTED_FACES = (1)
USER_SHARE_SPACE = (1) # Only for hole filling.
USER_STRETCH_ASPECT = (1) # Only for hole filling.
USER_ISLAND_MARGIN = island_margin # Only for hole filling.
USER_FILL_HOLES = (0)
USER_FILL_HOLES_QUALITY = (50) # Only for hole filling.
USER_VIEW_INIT = (0) # Only for hole filling.
# Reuse variable
if len(obList) == 1:
ob = "Unwrap %i Selected Mesh"
......@@ -906,8 +893,8 @@ def main(context,
if USER_ONLY_SELECTED_FACES:
meshFaces = [thickface(f, uv_layer[i], me_verts) for i, f in enumerate(me.faces) if f.select]
#else:
# meshFaces = map(thickface, me.faces)
else:
meshFaces = [thickface(f, uv_layer[i], me_verts) for i, f in enumerate(me.faces)]
if not meshFaces:
continue
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment