Added DNA_DEPRECATED attribute to some old data in bNodeSocket. DNA_DEPRECATED is disabled in writefile.c now to allow forward compatibility code writing to deprecated member data.

This commit is contained in:
Lukas Toenne 2012-01-21 11:15:01 +00:00
parent c5d7f8e416
commit 2c9f5f1f7c
2 changed files with 10 additions and 5 deletions

@ -89,6 +89,9 @@ Any case: direct data is ALWAYS after the lib block
#include "BLI_winstuff.h" #include "BLI_winstuff.h"
#endif #endif
/* allow writefile to use deprecated functionality (for forward compatibility code) */
#define DNA_DEPRECATED_ALLOW
#include "DNA_anim_types.h" #include "DNA_anim_types.h"
#include "DNA_armature_types.h" #include "DNA_armature_types.h"
#include "DNA_actuator_types.h" #include "DNA_actuator_types.h"
@ -653,7 +656,7 @@ static void write_node_socket(WriteData *wd, bNodeSocket *sock)
/* forward compatibility code, so older blenders still open */ /* forward compatibility code, so older blenders still open */
sock->stack_type = 1; sock->stack_type = 1;
if(sock->default_value) { if(sock->default_value) {
bNodeSocketValueFloat *valfloat; bNodeSocketValueFloat *valfloat;
bNodeSocketValueVector *valvector; bNodeSocketValueVector *valvector;

@ -85,19 +85,21 @@ typedef struct bNodeSocket {
/* execution data */ /* execution data */
short stack_index; /* local stack index */ short stack_index; /* local stack index */
short stack_type; /* deprecated, kept for forward compatibility */ /* XXX deprecated, kept for forward compatibility */
short stack_type DNA_DEPRECATED;
int pad3; int pad3;
void *cache; /* cached data from execution */ void *cache; /* cached data from execution */
/* internal data to retrieve relations and groups */ /* internal data to retrieve relations and groups */
int own_index; /* group socket identifiers, to find matching pairs after reading files */ int own_index; /* group socket identifiers, to find matching pairs after reading files */
int to_index DNA_DEPRECATED; /* XXX deprecated, only used for restoring old group node links */ /* XXX deprecated, only used for restoring old group node links */
int to_index DNA_DEPRECATED;
struct bNodeSocket *groupsock; struct bNodeSocket *groupsock;
struct bNodeLink *link; /* a link pointer, set in ntreeUpdateTree */ struct bNodeLink *link; /* a link pointer, set in ntreeUpdateTree */
/* DEPRECATED only needed for do_versions */ /* XXX deprecated, socket input values are stored in default_value now. kept for forward compatibility */
bNodeStack ns; /* custom data for inputs, only UI writes in this */ bNodeStack ns DNA_DEPRECATED; /* custom data for inputs, only UI writes in this */
} bNodeSocket; } bNodeSocket;
/* sock->type */ /* sock->type */