Blender Git Loki

Git Commits -> Revision d6e2210

Revision d6e2210 by Bastien Montagne (master)
November 8, 2021, 11:24 (GMT)
Fix inconsistent creation of `NodeTreeTypeUndefined` type of node tree

Currently, when creating a new node tree ID, its `typeinfo` is set to
`NodeTreeTypeUndefined`, but its `type` enum value is left to `0`,
aka `NTREE_SHADER`.

This patch adds a new `NTREE_UNDIFINED` value, and use it for
`NodeTreeTypeUndefined` types of node trees.

NOTE: While it is not clear whether that actually fixes issues currently,
quite a bit of code still relies on the value of `type`, so think it
makes sense to sanitize this.

NOTE: Would have been ideal to reserve `0` value to undefined type,
but at this point this is not possible anymore, so chose to use `-2` instead.

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D13123

Commit Details:

Full Hash: d6e22109353cf9920284f3f84dee9b8cfd125669
Parent Commit: fc373af
Lines Changed: +12, -4

3 Modified Paths:

/source/blender/blenkernel/intern/node.cc (+4, -3) (Diff)
/source/blender/makesdna/DNA_node_types.h (+3, -1) (Diff)
/source/blender/makesrna/intern/rna_nodetree.c (+5, -0) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021