Fix T89260: Eevee crashes with custom node sockets.
Cause of this issue is that Custom Node Sockets info type was initialized as SOCK_FLOAT when registering. Areas within the core that would ignore custom socket types by checking its type would use the socket as being a float type. When custom node sockets have a property called default_value blender tries to store it as an internal default value what failed in debug builds. This patch will set the socket type to SOCK_CUSTOM when registering a custom socket type and allow, but skip storage of custom default values. In this case the default values should already be stored as custom properies. Reviewed By: campbellbarton, JacquesLucke Maniphest Tasks: T89260 Differential Revision: https://developer.blender.org/D13174
This commit is contained in:
parent
215a6f1c10
commit
419b4e0b00
Notes:
blender-bot
2023-11-20 12:14:32 +01:00
Referenced by issue #88449: Blender LTS: Maintenance Task 2.93 Referenced by issue #88449, Blender LTS: Maintenance Task 2.93 Referenced by issue #89260, Eevee instant crash with a custom node from template example
|
@ -434,8 +434,10 @@ static void write_node_socket_default_value(BlendWriter *writer, bNodeSocket *so
|
|||
case SOCK_COLLECTION:
|
||||
BLO_write_struct(writer, bNodeSocketValueCollection, sock->default_value);
|
||||
break;
|
||||
case __SOCK_MESH:
|
||||
case SOCK_CUSTOM:
|
||||
/* Custom node sockets where default_value is defined uses custom properties for storage. */
|
||||
break;
|
||||
case __SOCK_MESH:
|
||||
case SOCK_SHADER:
|
||||
case SOCK_GEOMETRY:
|
||||
BLI_assert_unreachable();
|
||||
|
|
|
@ -2613,6 +2613,7 @@ static StructRNA *rna_NodeSocket_register(Main *UNUSED(bmain),
|
|||
|
||||
/* setup dummy socket & socket type to store static properties in */
|
||||
memset(&dummyst, 0, sizeof(bNodeSocketType));
|
||||
dummyst.type = SOCK_CUSTOM;
|
||||
|
||||
memset(&dummysock, 0, sizeof(bNodeSocket));
|
||||
dummysock.typeinfo = &dummyst;
|
||||
|
|
Loading…
Reference in New Issue