Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Toenne <lukas.toenne@googlemail.com>2012-05-22 18:13:33 +0400
committerLukas Toenne <lukas.toenne@googlemail.com>2012-05-22 18:13:33 +0400
commit53b01d90023a850b17ded5deb9cace354c8e298a (patch)
treeab8ce43ddf8046dc54e2cacc5ff46cbc5806910b /source/blender/blenloader
parent85923aff288da072750447b44e492ebe5c59bcce (diff)
A number of new features for the node editor in general and the Frame node in particular.
For an detailed user-level description of new features see the following blogpost: http://code.blender.org/index.php/2012/05/node-editing-tweaks/ TL;DR: * Frame node gets more usable bounding-box behavior * Node resizing has helpful mouse cursor indicators and works on all borders * Node selection/active colors are themeable independently * Customizable background colors for nodes (useful for frames visual distinction).
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c57
1 files changed, 57 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index c1942144ece..54b68e2828e 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -6795,6 +6795,29 @@ static void do_versions_nodetree_image_layer_2_64_5(bNodeTree *ntree)
}
}
+static void do_versions_nodetree_frame_2_64_6(bNodeTree *ntree)
+{
+ bNode *node;
+
+ for (node=ntree->nodes.first; node; node=node->next) {
+ if (node->type==NODE_FRAME) {
+ /* initialize frame node storage data */
+ if (node->storage == NULL) {
+ NodeFrame *data = (NodeFrame *)MEM_callocN(sizeof(NodeFrame), "frame node storage");
+ node->storage = data;
+
+ /* copy current flags */
+ data->flag = node->custom1;
+
+ data->label_size = 20;
+ }
+ }
+
+ /* initialize custom node color */
+ node->color[0] = node->color[1] = node->color[2] = 0.608; /* default theme color */
+ }
+}
+
static void do_versions(FileData *fd, Library *lib, Main *main)
{
/* WATCH IT!!!: pointers from libdata have not been converted */
@@ -7441,6 +7464,40 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
}
+
+ if (main->versionfile < 263 || (main->versionfile == 263 && main->subversionfile < 6))
+ {
+ /* update use flags for node sockets (was only temporary before) */
+ Scene *sce;
+ Material *mat;
+ Tex *tex;
+ Lamp *lamp;
+ World *world;
+ bNodeTree *ntree;
+
+ for (sce=main->scene.first; sce; sce=sce->id.next)
+ if (sce->nodetree)
+ do_versions_nodetree_frame_2_64_6(sce->nodetree);
+
+ for (mat=main->mat.first; mat; mat=mat->id.next)
+ if (mat->nodetree)
+ do_versions_nodetree_frame_2_64_6(mat->nodetree);
+
+ for (tex=main->tex.first; tex; tex=tex->id.next)
+ if (tex->nodetree)
+ do_versions_nodetree_frame_2_64_6(tex->nodetree);
+
+ for (lamp=main->lamp.first; lamp; lamp=lamp->id.next)
+ if (lamp->nodetree)
+ do_versions_nodetree_frame_2_64_6(lamp->nodetree);
+
+ for (world=main->world.first; world; world=world->id.next)
+ if (world->nodetree)
+ do_versions_nodetree_frame_2_64_6(world->nodetree);
+
+ for (ntree=main->nodetree.first; ntree; ntree=ntree->id.next)
+ do_versions_nodetree_frame_2_64_6(ntree);
+ }
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */
/* WATCH IT 2!: Userdef struct init has to be in editors/interface/resources.c! */