Fix T44989: Crash on linking external OSL material

Issue was caused by passing NULL bmain to the path remap function when
localizing the node tree.

Paths are to be remapped, otherwise mapping of paths to OSL scripts
might happen in a wrong way.
This commit is contained in:
Sergey Sharybin 2015-06-07 21:38:46 +02:00
parent 0589a814ba
commit 546a0e2d96
Notes: blender-bot 2023-02-14 09:02:38 +01:00
Referenced by issue #44989, Crash on linking external OSL material
1 changed files with 1 additions and 1 deletions

View File

@ -1980,7 +1980,7 @@ bNodeTree *ntreeLocalize(bNodeTree *ntree)
/* Make full copy.
* Note: previews are not copied here.
*/
ltree = ntreeCopyTree_internal(ntree, NULL, false, false, false);
ltree = ntreeCopyTree_internal(ntree, G.main, false, false, false);
ltree->flag |= NTREE_IS_LOCALIZED;
for (node = ltree->nodes.first; node; node = node->next) {