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:
authorSergey Sharybin <sergey.vfx@gmail.com>2011-11-07 16:56:05 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2011-11-07 16:56:05 +0400
commit7b43abb90e2895292e183fcbca7140447025acd7 (patch)
tree145b1c4a94598cd0810ab999e49bdd5a331367cd /source/blender/blenloader
parent27d42c63d9b507b1771ed5a7923c389c719b877b (diff)
Camera tracking integration
=========================== Rest of changes from camera tracking gsoc project. This commit includes: - New compositor nodes: * Movie Clip input node * Movie Undistortion node * Transformation node * 2D stabilization node - Slight changes in existing node to prevent code duplication
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c26
-rw-r--r--source/blender/blenloader/intern/writefile.c2
2 files changed, 27 insertions, 1 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index ce7ff489465..9f6ce4eb79b 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -1254,6 +1254,7 @@ void blo_end_image_pointer_map(FileData *fd, Main *oldmain)
void blo_make_movieclip_pointer_map(FileData *fd, Main *oldmain)
{
MovieClip *clip= oldmain->movieclip.first;
+ Scene *sce= oldmain->scene.first;
fd->movieclipmap= oldnewmap_new();
@@ -1264,6 +1265,15 @@ void blo_make_movieclip_pointer_map(FileData *fd, Main *oldmain)
if(clip->tracking.camera.intrinsics)
oldnewmap_insert(fd->movieclipmap, clip->tracking.camera.intrinsics, clip->tracking.camera.intrinsics, 0);
}
+
+ for(; sce; sce= sce->id.next) {
+ if(sce->nodetree) {
+ bNode *node;
+ for(node= sce->nodetree->nodes.first; node; node= node->next)
+ if(node->type==CMP_NODE_MOVIEDISTORTION)
+ oldnewmap_insert(fd->movieclipmap, node->storage, node->storage, 0);
+ }
+ }
}
/* set old main movie clips caches to zero if it has been restored */
@@ -1272,6 +1282,7 @@ void blo_end_movieclip_pointer_map(FileData *fd, Main *oldmain)
{
OldNew *entry= fd->movieclipmap->entries;
MovieClip *clip= oldmain->movieclip.first;
+ Scene *sce= oldmain->scene.first;
int i;
/* used entries were restored, so we put them to zero */
@@ -1284,6 +1295,15 @@ void blo_end_movieclip_pointer_map(FileData *fd, Main *oldmain)
clip->cache= newmclipadr(fd, clip->cache);
clip->tracking.camera.intrinsics= newmclipadr(fd, clip->tracking.camera.intrinsics);
}
+
+ for(; sce; sce= sce->id.next) {
+ if(sce->nodetree) {
+ bNode *node;
+ for(node= sce->nodetree->nodes.first; node; node= node->next)
+ if(node->type==CMP_NODE_MOVIEDISTORTION)
+ node->storage= newmclipadr(fd, node->storage);
+ }
+ }
}
@@ -2273,7 +2293,11 @@ static void direct_link_nodetree(FileData *fd, bNodeTree *ntree)
link_list(fd, &node->inputs);
link_list(fd, &node->outputs);
- node->storage= newdataadr(fd, node->storage);
+ if(node->type == CMP_NODE_MOVIEDISTORTION) {
+ node->storage= newmclipadr(fd, node->storage);
+ } else
+ node->storage= newdataadr(fd, node->storage);
+
if(node->storage) {
/* could be handlerized at some point */
if(ntree->type==NTREE_SHADER && (node->type==SH_NODE_CURVE_VEC || node->type==SH_NODE_CURVE_RGB))
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index f49148342ec..021aa6a8a92 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -711,6 +711,8 @@ static void write_nodetree(WriteData *wd, bNodeTree *ntree)
write_curvemapping(wd, node->storage);
else if(ntree->type==NTREE_TEXTURE && (node->type==TEX_NODE_CURVE_RGB || node->type==TEX_NODE_CURVE_TIME) )
write_curvemapping(wd, node->storage);
+ else if(ntree->type==NTREE_COMPOSIT && node->type==CMP_NODE_MOVIEDISTORTION)
+ /* pass */ ;
else
writestruct(wd, DATA, node->typeinfo->storagename, 1, node->storage);
}