diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-03-30 12:20:37 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-03-30 12:20:37 +0400 |
commit | 1a47d71f722d04fa1040828a074673b0eeed7a3b (patch) | |
tree | be907127ef74525e3c44032b7a165718663e21df /source/blender/python/api2_2x/Scene.c | |
parent | f400069d34274144d75bd4df7843f6f39a46fc37 (diff) |
added Window.Get/SetActiveLayer() and changed how scn.objects.new() works, if scn is the active scene it uses the 3d views active layer to create the object in.
Diffstat (limited to 'source/blender/python/api2_2x/Scene.c')
-rw-r--r-- | source/blender/python/api2_2x/Scene.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/python/api2_2x/Scene.c b/source/blender/python/api2_2x/Scene.c index ea470a32911..8556208dffb 100644 --- a/source/blender/python/api2_2x/Scene.c +++ b/source/blender/python/api2_2x/Scene.c @@ -1522,7 +1522,18 @@ typeError: "couldn't allocate new Base for object" ); base->object = object; /* link object to the new base */ - base->lay= object->lay = scene->lay & ((1<<20)-1); /* Layer, by default visible*/ + + if (scene == G.scene && G.vd) { + if (G.vd->localview) { + object->lay= G.vd->layact + G.vd->lay; + } else { + object->lay= G.vd->layact; + } + } else { + base->lay= object->lay = scene->lay & ((1<<20)-1); /* Layer, by default visible*/ + } + + base->lay= object->lay; base->flag = SELECT; object->id.us = 1; /* we will exist once in this scene */ |