From fd60b73b7bf7387cc54a5a1ac8c4b30488fb7903 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 24 Jun 2011 04:12:01 +0000 Subject: [PATCH] fix [#27742] Smart UV project no longer works in 2.58 failed with active, unselected objects. --- .../startup/bl_operators/uvcalc_smart_project.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/release/scripts/startup/bl_operators/uvcalc_smart_project.py b/release/scripts/startup/bl_operators/uvcalc_smart_project.py index c70b9071985..3e1ce621ec2 100644 --- a/release/scripts/startup/bl_operators/uvcalc_smart_project.py +++ b/release/scripts/startup/bl_operators/uvcalc_smart_project.py @@ -812,21 +812,25 @@ def main(context, island_margin, projection_limit): global RotMatStepRotation main_consts() -#XXX objects= bpy.data.scenes.active.objects - objects = context.selected_editable_objects - + # 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. -#XXX ob = objects.active - ob= objects[0] + ob = context.active_object if ob and (not ob.select) and ob.type == 'MESH': # Add to the list obList =[ob] del objects + ''' + + # quick workaround + obList = [ob for ob in [context.active_object] if ob and ob.type == 'MESH'] if not obList: raise('error, no selected mesh objects')