Blender Git Loki

Git Commits -> Revision 50d5050

Revision 50d5050 by Jacques Lucke (master)
March 6, 2020, 12:31 (GMT)
Nodes: fix writing socket default values to file

Previously, `writedata` was used to store `bNodeSocket->default_value`.
There are a couple of issues with that:
* Breaks if someone tries to load the file on a big endian system (afaik).
* There is a `/* do not use for structs */` comment on `writedata`.
* Depends on `MEM_allocN_len` which should be avoided in my opinion.
* Now it is more apparent, that this should be handled by callbacks as well.

The part in `readfile.c` should work just fine still. I could also do a case
distinction there, but the code would be the same for every case for now.
Just `sock->default_value = newdataadr(fd, sock->default_value);`.

This might change, if we want to store more complex socket type specific data
that does not fit into a single struct.

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

Reviewers: brecht

Commit Details:

Full Hash: 50d5050e9c4561d6528a2ac18ad3fbbaa9df6576
Parent Commit: 63bb200
Lines Changed: +35, -6

1 Modified Path:

/source/blender/blenloader/intern/writefile.c (+35, -6) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021