1. NodeBox 1
    1. Homepage
    2. NodeBox 3Node-based app for generative design and data visualization
    3. NodeBox OpenGLHardware-accelerated cross-platform graphics library
    4. NodeBox 1Generate 2D visuals using Python code (Mac OS X only)
  2. Gallery
  3. Documentation
  4. Forum
  5. Blog

photobot.Layer.duplicate()

Syntax

canvas.layers[i].duplicate()

Description

Creates a copy of layer i. This copy becomes the top layer on the canvas, and retains the same position, blend mode and opacity as the original layer.

The name of the duplicate is identical to the name of the original layer.

Example

photobot = ximport("photobot")
canvas = photobot.canvas(100,100)
canvas.layer("robot.jpg", name="robot")
for i in range(2,50):
  canvas.layers[1].duplicate()
  canvas.layers[i].name += " " + str(i)
  print canvas.layers[i].name
  canvas.layers[i].translate(0,i)