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
    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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.