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:
Diffstat (limited to 'source/blender/editors/space_node/drawnode.c')
-rw-r--r--source/blender/editors/space_node/drawnode.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index 082f3f97dfd..01992d225c7 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -190,6 +190,7 @@ static void node_buts_normal(uiLayout *layout, bContext *C, PointerRNA *ptr)
#if 0 // not used in 2.5x yet
static void node_browse_tex_cb(bContext *C, void *ntree_v, void *node_v)
{
+ Main *bmain= CTX_data_main(C);
bNodeTree *ntree= ntree_v;
bNode *node= node_v;
Tex *tex;
@@ -200,7 +201,7 @@ static void node_browse_tex_cb(bContext *C, void *ntree_v, void *node_v)
node->id->us--;
node->id= NULL;
}
- tex= BLI_findlink(&G.main->tex, node->menunr-1);
+ tex= BLI_findlink(&bmain->tex, node->menunr-1);
node->id= &tex->id;
id_us_plus(node->id);
@@ -220,6 +221,7 @@ static void node_browse_tex_cb(bContext *C, void *ntree_v, void *node_v)
#endif
static void node_dynamic_update_cb(bContext *C, void *ntree_v, void *node_v)
{
+ Main *bmain= CTX_data_main(C);
Material *ma;
bNode *node= (bNode *)node_v;
ID *id= node->id;
@@ -229,7 +231,7 @@ static void node_dynamic_update_cb(bContext *C, void *ntree_v, void *node_v)
/* Users only have to press the "update" button in one pynode
* and we also update all others sharing the same script */
- for (ma= G.main->mat.first; ma; ma= ma->id.next) {
+ for (ma= bmain->mat.first; ma; ma= ma->id.next) {
if (ma->nodetree) {
bNode *nd;
for (nd= ma->nodetree->nodes.first; nd; nd= nd->next) {
@@ -277,6 +279,7 @@ static void node_buts_math(uiLayout *layout, bContext *C, PointerRNA *ptr)
static void node_browse_text_cb(bContext *C, void *ntree_v, void *node_v)
{
+ Main *bmain= CTX_data_main(C);
bNodeTree *ntree= ntree_v;
bNode *node= node_v;
ID *oldid;
@@ -287,7 +290,7 @@ static void node_browse_text_cb(bContext *C, void *ntree_v, void *node_v)
node->id->us--;
}
oldid= node->id;
- node->id= BLI_findlink(&G.main->text, node->menunr-1);
+ node->id= BLI_findlink(&bmain->text, node->menunr-1);
id_us_plus(node->id);
BLI_strncpy(node->name, node->id->name+2, 21); /* huh? why 21? */
@@ -368,6 +371,7 @@ static void node_shader_buts_geometry(uiLayout *layout, bContext *C, PointerRNA
static void node_shader_buts_dynamic(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
+ Main *bmain= CTX_data_main(C);
uiBlock *block= uiLayoutAbsoluteBlock(layout);
bNode *node= ptr->data;
bNodeTree *ntree= ptr->id.data;
@@ -380,7 +384,7 @@ static void node_shader_buts_dynamic(uiLayout *layout, bContext *C, PointerRNA *
/* B_NODE_EXEC is handled in butspace.c do_node_buts */
if(!node->id) {
char *strp;
- IDnames_to_pupstring(&strp, NULL, "", &(G.main->text), NULL, NULL);
+ IDnames_to_pupstring(&strp, NULL, "", &(bmain->text), NULL, NULL);
node->menunr= 0;
bt= uiDefButS(block, MENU, B_NODE_EXEC/*+node->nr*/, strp,
butr->xmin, dy, 19, 19,