[Bf-blender-cvs] [6f80c60ce65] master: Fix T100850: Regression: Gpencil: crash on material color and other properties change.

Bastien Montagne noreply at git.blender.org
Tue Sep 6 16:23:11 CEST 2022


Commit: 6f80c60ce658b8877dce9af4544eee1578fac452
Author: Bastien Montagne
Date:   Tue Sep 6 14:55:39 2022 +0200
Branches: master
https://developer.blender.org/rB6f80c60ce658b8877dce9af4544eee1578fac452

Fix T100850: Regression: Gpencil: crash on material color and other properties change.

rBcd49fee74114 forgot to add proper support for calls to `ntreeAddTree`
with a NULL Main (which should generate `NO_MAIN` ntrees).

===================================================================

M	source/blender/blenkernel/intern/node.cc

===================================================================

diff --git a/source/blender/blenkernel/intern/node.cc b/source/blender/blenkernel/intern/node.cc
index 3cb2b80813f..e648d9577d2 100644
--- a/source/blender/blenkernel/intern/node.cc
+++ b/source/blender/blenkernel/intern/node.cc
@@ -2569,7 +2569,7 @@ static bNodeTree *ntreeAddTree_do(
    * node groups and other tree types are created as library data.
    */
   int flag = 0;
-  if (is_embedded) {
+  if (is_embedded || bmain == nullptr) {
     flag |= LIB_ID_CREATE_NO_MAIN;
   }
   bNodeTree *ntree = (bNodeTree *)BKE_libblock_alloc(bmain, ID_NT, name, flag);



More information about the Bf-blender-cvs mailing list