Merging r39948 through r39988 from trunk into vgroup_modifiers.
This commit is contained in:
@@ -93,7 +93,8 @@ typedef unsigned long uintptr_t;
|
||||
#include <inttypes.h>
|
||||
|
||||
#elif defined(FREE_WINDOWS)
|
||||
|
||||
/* define htoln here, there must be a syntax error in winsock2.h in MinGW */
|
||||
unsigned long __attribute__((__stdcall__)) htonl(unsigned long);
|
||||
#include <stdint.h>
|
||||
|
||||
#else
|
||||
@@ -105,8 +106,14 @@ typedef unsigned long uintptr_t;
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
#ifndef FREE_WINDOWS
|
||||
#ifndef htonl
|
||||
#define htonl(x) correctByteOrder(x)
|
||||
#endif
|
||||
#ifndef ntohl
|
||||
#define ntohl(x) correctByteOrder(x)
|
||||
#endif
|
||||
#endif
|
||||
#elif defined (__FreeBSD__) || defined (__OpenBSD__)
|
||||
#include <sys/param.h>
|
||||
#elif defined (__APPLE__)
|
||||
|
||||
@@ -2217,8 +2217,9 @@ static void direct_link_nodetree(FileData *fd, bNodeTree *ntree)
|
||||
if(node->type == NODE_DYNAMIC) {
|
||||
node->custom1= 0;
|
||||
node->custom1= BSET(node->custom1, NODE_DYNAMIC_LOADED);
|
||||
node->typeinfo= NULL;
|
||||
}
|
||||
|
||||
node->typeinfo= NULL;
|
||||
|
||||
link_list(fd, &node->inputs);
|
||||
link_list(fd, &node->outputs);
|
||||
@@ -7022,6 +7023,15 @@ static void do_versions_nodetree_default_value(bNodeTree *ntree)
|
||||
do_versions_socket_default_value(sock);
|
||||
}
|
||||
|
||||
static void do_versions_nodetree_dynamic_sockets(bNodeTree *ntree)
|
||||
{
|
||||
bNodeSocket *sock;
|
||||
for (sock=ntree->inputs.first; sock; sock=sock->next)
|
||||
sock->flag |= SOCK_DYNAMIC;
|
||||
for (sock=ntree->outputs.first; sock; sock=sock->next)
|
||||
sock->flag |= SOCK_DYNAMIC;
|
||||
}
|
||||
|
||||
static void do_versions(FileData *fd, Library *lib, Main *main)
|
||||
{
|
||||
/* WATCH IT!!!: pointers from libdata have not been converted */
|
||||
@@ -11979,6 +11989,27 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
|
||||
tex->nodetree->update |= NTREE_UPDATE;
|
||||
}
|
||||
}
|
||||
|
||||
/* add SOCK_DYNAMIC flag to existing group sockets */
|
||||
{
|
||||
bNodeTree *ntree;
|
||||
/* only need to do this for trees in main, local trees are not used as groups */
|
||||
for (ntree=main->nodetree.first; ntree; ntree=ntree->id.next) {
|
||||
do_versions_nodetree_dynamic_sockets(ntree);
|
||||
ntree->update |= NTREE_UPDATE;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
/* Initialize group tree nodetypes.
|
||||
* These are used to distinguish tree types and
|
||||
* associate them with specific node types for polling.
|
||||
*/
|
||||
bNodeTree *ntree;
|
||||
/* all node trees in main->nodetree are considered groups */
|
||||
for (ntree=main->nodetree.first; ntree; ntree=ntree->id.next)
|
||||
ntree->nodetype = NODE_GROUP;
|
||||
}
|
||||
}
|
||||
|
||||
/* put compatibility code here until next subversion bump */
|
||||
|
||||
@@ -135,6 +135,7 @@ Any case: direct data is ALWAYS after the lib block
|
||||
#include "BLI_blenlib.h"
|
||||
#include "BLI_linklist.h"
|
||||
#include "BLI_bpath.h"
|
||||
#include "BLI_math.h"
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "BKE_action.h"
|
||||
@@ -645,6 +646,38 @@ static void write_curvemapping(WriteData *wd, CurveMapping *cumap)
|
||||
static void write_node_socket(WriteData *wd, bNodeSocket *sock)
|
||||
{
|
||||
bNodeSocketType *stype= ntreeGetSocketType(sock->type);
|
||||
|
||||
/* forward compatibility code, so older blenders still open */
|
||||
sock->stack_type = 1;
|
||||
|
||||
if(sock->default_value) {
|
||||
bNodeSocketValueFloat *valfloat;
|
||||
bNodeSocketValueVector *valvector;
|
||||
bNodeSocketValueRGBA *valrgba;
|
||||
|
||||
switch (sock->type) {
|
||||
case SOCK_FLOAT:
|
||||
valfloat = sock->default_value;
|
||||
sock->ns.vec[0] = valfloat->value;
|
||||
sock->ns.min = valfloat->min;
|
||||
sock->ns.max = valfloat->max;
|
||||
break;
|
||||
case SOCK_VECTOR:
|
||||
valvector = sock->default_value;
|
||||
copy_v3_v3(sock->ns.vec, valvector->value);
|
||||
sock->ns.min = valvector->min;
|
||||
sock->ns.max = valvector->max;
|
||||
break;
|
||||
case SOCK_RGBA:
|
||||
valrgba = sock->default_value;
|
||||
copy_v4_v4(sock->ns.vec, valrgba->value);
|
||||
sock->ns.min = 0.0f;
|
||||
sock->ns.max = 1.0f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* actual socket writing */
|
||||
writestruct(wd, DATA, "bNodeSocket", 1, sock);
|
||||
if (sock->default_value)
|
||||
writestruct(wd, DATA, stype->value_structname, 1, sock->default_value);
|
||||
|
||||
Reference in New Issue
Block a user