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:
authorTon Roosendaal <ton@blender.org>2009-01-04 17:14:06 +0300
committerTon Roosendaal <ton@blender.org>2009-01-04 17:14:06 +0300
commitf7cb86df3a9ceccc4d649e42735732a608169157 (patch)
tree558a9ba43708a2213b1afa8f46d79f5daa140bc6 /source/blender/editors/space_node/drawnode.c
parent74f9e98c828c17910405092785633373d4ae88e8 (diff)
2.5
Think global, act local! The old favorite G.scene gone! Man... that took almost 2 days. Also removed G.curscreen and G.edbo. Not everything could get solved; here's some notes. - modifiers now store current scene in ModifierData. This is not meant for permanent, but it can probably stick there until we cleaned the anim system and depsgraph to cope better with timing issues. - Game engine G.scene should become an argument for staring it. Didn't solve this yet. - Texture nodes should get scene cfra, but the current implementation is too tightly wrapped to do it easily.
Diffstat (limited to 'source/blender/editors/space_node/drawnode.c')
-rw-r--r--source/blender/editors/space_node/drawnode.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index 61c53fb58d3..2dd0fec126b 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -899,8 +899,9 @@ static char *layer_menu(RenderResult *rr)
static void image_layer_cb(bContext *C, void *ima_v, void *iuser_v)
{
+ Scene *scene= CTX_data_scene(C);
- ntreeCompositForceHidden(G.scene->nodetree);
+ ntreeCompositForceHidden(scene->nodetree, scene);
BKE_image_multilayer_index(ima_v, iuser_v);
// allqueue(REDRAWNODE, 0);
}
@@ -1030,7 +1031,7 @@ static void set_render_layers_title(bContext *C, void *node_v, void *unused)
}
else {
str[0]= 0;
- sce= G.scene;
+ sce= CTX_data_scene(C);
}
srl= BLI_findlink(&sce->r.layers, node->custom1);
if(srl==NULL) {
@@ -1071,7 +1072,7 @@ static void node_browse_scene_cb(bContext *C, void *ntree_v, void *node_v)
node->id= NULL;
}
sce= BLI_findlink(&G.main->scene, node->menunr-1);
- if(sce!=G.scene) {
+ if(sce!=CTX_data_scene(C)) {
node->id= &sce->id;
id_us_plus(node->id);
}
@@ -1090,6 +1091,7 @@ static void node_browse_scene_cb(bContext *C, void *ntree_v, void *node_v)
static int node_composit_buts_renderlayers(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
{
if(block) {
+ Scene *scene= NULL; // XXX CTX_data_scene(C) can't work here. node->id has to be set default (ton)
uiBut *bt;
char *strp;
@@ -1104,7 +1106,7 @@ static int node_composit_buts_renderlayers(uiBlock *block, bNodeTree *ntree, bNo
if(strp) MEM_freeN(strp);
/* browse button layer */
- strp= scene_layer_menu(node->id?(Scene *)node->id:G.scene);
+ strp= scene_layer_menu(node->id?(Scene *)node->id:scene);
if(node->id)
bt= uiDefIconTextButS(block, MENU, B_NODE_EXEC+node->nr, ICON_SCENE_DEHLT, strp,
butr->xmin+20, butr->ymin, (butr->xmax-butr->xmin)-40, 19,
@@ -1958,9 +1960,9 @@ static void node_scale_cb(bContext *C, void *node_v, void *unused_v)
nsock->ns.vec[0]= 1.0;
else {
if(nsock->next==NULL)
- nsock->ns.vec[0]= (float)G.scene->r.ysch;
+ nsock->ns.vec[0]= (float)CTX_data_scene(C)->r.ysch;
else
- nsock->ns.vec[0]= (float)G.scene->r.xsch;
+ nsock->ns.vec[0]= (float)CTX_data_scene(C)->r.xsch;
}
}
}