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:
authorAlexander Gavrilov <angavrilov@gmail.com>2019-08-22 15:40:10 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2019-08-22 15:46:37 +0300
commit8f578150eaf494a03bed7389046e44f2bdf7d748 (patch)
tree5370042609d04907eff0a154e8a4b6ae858af182 /source/blender/editors/space_node/node_edit.c
parent443586f34d3a0730c67b5d8787e519bec2af3656 (diff)
Fix T68971: Copy As New Driver from Material node creates a bad reference.
NodeTree structures of materials and some other data blocks are effectively node group data block objects that are contained inside the parent block. Thus, direct references to them are only valid while blender is running, and are lost on save. Fix Copy As New Driver to create a reference that goes through the owner data block, by adding a new runtime field to bNodeTree.
Diffstat (limited to 'source/blender/editors/space_node/node_edit.c')
-rw-r--r--source/blender/editors/space_node/node_edit.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c
index d31256a1425..46dfa65e73c 100644
--- a/source/blender/editors/space_node/node_edit.c
+++ b/source/blender/editors/space_node/node_edit.c
@@ -448,7 +448,7 @@ void ED_node_shader_default(const bContext *C, ID *id)
int output_type, shader_type;
float color[4] = {0.0f, 0.0f, 0.0f, 1.0f}, strength = 1.0f;
- ntree = ntreeAddTree(NULL, "Shader Nodetree", ntreeType_Shader->idname);
+ ntree = ntreeAddTree(NULL, "Shader Nodetree", ntreeType_Shader->idname, id);
switch (GS(id->name)) {
case ID_MA: {
@@ -534,7 +534,7 @@ void ED_node_composit_default(const bContext *C, struct Scene *sce)
return;
}
- sce->nodetree = ntreeAddTree(NULL, "Compositing Nodetree", ntreeType_Composite->idname);
+ sce->nodetree = ntreeAddTree(NULL, "Compositing Nodetree", ntreeType_Composite->idname, &sce->id);
sce->nodetree->chunksize = 256;
sce->nodetree->edit_quality = NTREE_QUALITY_HIGH;
@@ -572,7 +572,7 @@ void ED_node_texture_default(const bContext *C, Tex *tx)
return;
}
- tx->nodetree = ntreeAddTree(NULL, "Texture Nodetree", ntreeType_Texture->idname);
+ tx->nodetree = ntreeAddTree(NULL, "Texture Nodetree", ntreeType_Texture->idname, &tx->id);
out = nodeAddStaticNode(C, tx->nodetree, TEX_NODE_OUTPUT);
out->locx = 300.0f;