I have a second scene and using
scene2.objects["obj"] isn't working. The object is is another layer, and I cannot figure out how to define it. I've defined "scene2," and there is no problem with that. How do I define objects in different layers?
Layers are properties of the object see this snippet:
import bpy # create layers vector with only one layer enabled def layers(l): all = [False]*20 all[l]=True return all o = bpy.data.objects["Cube"] # set object to layer 2 only (layers from 0..19) o.layers = layers(2) # lookup scene by name scene = bpy.data.scenes["Scene2"] # link object to scene scene.objects.link(o)