Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2007-03-30 12:20:37 +0400
committerCampbell Barton <ideasman42@gmail.com>2007-03-30 12:20:37 +0400
commit1a47d71f722d04fa1040828a074673b0eeed7a3b (patch)
treebe907127ef74525e3c44032b7a165718663e21df /source/blender/python/api2_2x/Scene.c
parentf400069d34274144d75bd4df7843f6f39a46fc37 (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.c13
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 */