Skip to content

Instantly share code, notes, and snippets.

@retorillo
Last active August 7, 2018 14:21
Show Gist options
  • Save retorillo/5198fb5c3a253fcf039c30c7d8cced56 to your computer and use it in GitHub Desktop.
Save retorillo/5198fb5c3a253fcf039c30c7d8cced56 to your computer and use it in GitHub Desktop.
[Blender] Duplicate background images from first one
# Duplicate background images from first one
# Paste to Blender Python Console, and press ENTER twice
# Authored by Retorillo
# CC0 License, No Rights Reserved
# <START>
for a in bpy.data.screens['Default'].areas:
if a.spaces[0].type != 'VIEW_3D':
continue
bkg = a.spaces[0].background_images
if len(bkg) == 0:
raise Exception('background_images is empty')
bkg[0].view_axis = 'FRONT'
for axis in ['RIGHT', 'TOP']:
bi = bkg.new()
bi.view_axis = axis
bi.image = bkg[0].image
bi.offset_x = bkg[0].offset_x
bi.offset_y = bkg[0].offset_y
bi.size = bkg[0].size
bi.use_flip_x = bkg[0].use_flip_x
bi.use_flip_y = bkg[0].use_flip_y
bi.rotation = bkg[0].rotation
break
# <END>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment