[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [44485] branches/tile/source/blender/ compositor: TileBranch
Jeroen Bakker
j.bakker at atmind.nl
Mon Feb 27 15:56:27 CET 2012
Revision: 44485
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=44485
Author: jbakker
Date: 2012-02-27 14:56:21 +0000 (Mon, 27 Feb 2012)
Log Message:
-----------
TileBranch
* Added transform node
* Fixed rounding issue in MovieClipOperation
* Initial version of Stabilize2d node (not working ATM; Memory rewrites occurs)
* Added MovieClipAttributeOperation, to read movieclip attributes, like frame stabilization offset, angle, scale
- At Mind -
Modified Paths:
--------------
branches/tile/source/blender/compositor/CMakeLists.txt
branches/tile/source/blender/compositor/intern/COM_Converter.cpp
branches/tile/source/blender/compositor/nodes/COM_RenderLayersNode.cpp
branches/tile/source/blender/compositor/nodes/COM_RotateNode.cpp
branches/tile/source/blender/compositor/operations/COM_MovieClipOperation.cpp
branches/tile/source/blender/compositor/operations/COM_RotateOperation.cpp
branches/tile/source/blender/compositor/operations/COM_RotateOperation.h
branches/tile/source/blender/compositor/operations/COM_TranslateOperation.cpp
Added Paths:
-----------
branches/tile/source/blender/compositor/nodes/COM_Stabilize2dNode.cpp
branches/tile/source/blender/compositor/nodes/COM_Stabilize2dNode.h
branches/tile/source/blender/compositor/nodes/COM_TransformNode.cpp
branches/tile/source/blender/compositor/nodes/COM_TransformNode.h
branches/tile/source/blender/compositor/operations/COM_MovieClipAttributeOperation.cpp
branches/tile/source/blender/compositor/operations/COM_MovieClipAttributeOperation.h
Modified: branches/tile/source/blender/compositor/CMakeLists.txt
===================================================================
--- branches/tile/source/blender/compositor/CMakeLists.txt 2012-02-27 14:07:19 UTC (rev 44484)
+++ branches/tile/source/blender/compositor/CMakeLists.txt 2012-02-27 14:56:21 UTC (rev 44485)
@@ -183,8 +183,11 @@
operations/COM_LensGlowOperation.h
operations/COM_LensGhostOperation.cpp
operations/COM_LensGhostOperation.h
+ nodes/COM_TransformNode.cpp
+ nodes/COM_TransformNode.h
+ nodes/COM_Stabilize2dNode.cpp
+ nodes/COM_Stabilize2dNode.h
-
# color nodes
nodes/COM_VectorCurveNode.cpp
nodes/COM_VectorCurveNode.h
@@ -284,7 +287,8 @@
operations/COM_BlurBaseOperation.h
operations/COM_DirectionalBlurOperation.cpp
operations/COM_DirectionalBlurOperation.h
-
+ operations/COM_MovieClipAttributeOperation.cpp
+ operations/COM_MovieClipAttributeOperation.h
# Matte nodes
nodes/COM_BoxMaskNode.cpp
nodes/COM_BoxMaskNode.h
Modified: branches/tile/source/blender/compositor/intern/COM_Converter.cpp
===================================================================
--- branches/tile/source/blender/compositor/intern/COM_Converter.cpp 2012-02-27 14:07:19 UTC (rev 44484)
+++ branches/tile/source/blender/compositor/intern/COM_Converter.cpp 2012-02-27 14:56:21 UTC (rev 44485)
@@ -105,6 +105,8 @@
#include "COM_ColorSpillNode.h"
#include "COM_OutputFileNode.h"
#include "COM_MapValueNode.h"
+#include "COM_TransformNode.h"
+#include "COM_Stabilize2dNode.h"
Node* Converter::convert(bNode *bNode) {
Node * node;
@@ -320,6 +322,12 @@
case CMP_NODE_MAP_VALUE:
node = new MapValueNode(bNode);
break;
+ case CMP_NODE_TRANSFORM:
+ node = new TransformNode(bNode);
+ break;
+ case CMP_NODE_STABILIZE2D:
+ node = new Stabilize2dNode(bNode);
+ break;
/* not inplemented yet */
case CMP_NODE_VECBLUR:
case CMP_NODE_DOUBLEEDGEMASK:
@@ -328,8 +336,6 @@
case CMP_NODE_BILATERALBLUR:
case CMP_NODE_PREMULKEY:
case CMP_NODE_VIEW_LEVELS:
- case CMP_NODE_TRANSFORM:
- case CMP_NODE_STABILIZE2D:
case CMP_NODE_MOVIEDISTORTION:
default:
node = new MuteNode(bNode);
Modified: branches/tile/source/blender/compositor/nodes/COM_RenderLayersNode.cpp
===================================================================
--- branches/tile/source/blender/compositor/nodes/COM_RenderLayersNode.cpp 2012-02-27 14:07:19 UTC (rev 44484)
+++ branches/tile/source/blender/compositor/nodes/COM_RenderLayersNode.cpp 2012-02-27 14:56:21 UTC (rev 44485)
@@ -82,12 +82,15 @@
}
if (data->angle != 0.0) {
RotateOperation * rotate = new RotateOperation();
- rotate->setDegree(data->angle);
+ SetValueOperation * valueangle = new SetValueOperation();
+ valueangle->setValue(data->angle);
lastConnection->getOutputSocket()->relinkConnections(rotate->getOutputSocket());
+ addLink(system, valueangle->getOutputSocket(), rotate->getInputSocket(1));
addLink(system, lastConnection->getOutputSocket(), rotate->getInputSocket(0));
lastConnection = rotate;
system->addOperation(rotate);
+ system->addOperation(valueangle);
}
if (data->offsetx != 0 || data->offsety != 0) {
TranslateOperation * translate = new TranslateOperation();
Modified: branches/tile/source/blender/compositor/nodes/COM_RotateNode.cpp
===================================================================
--- branches/tile/source/blender/compositor/nodes/COM_RotateNode.cpp 2012-02-27 14:07:19 UTC (rev 44484)
+++ branches/tile/source/blender/compositor/nodes/COM_RotateNode.cpp 2012-02-27 14:56:21 UTC (rev 44485)
@@ -28,15 +28,14 @@
RotateNode::RotateNode(bNode *editorNode) : Node(editorNode) {
}
-void RotateNode::convertToOperations(ExecutionSystem *graph, CompositorContext * context) {
- InputSocket *inputSocket = this->getInputSocket(0);
- InputSocket *inputDegreeSocket = this->getInputSocket(1);
- OutputSocket *outputSocket = this->getOutputSocket(0);
- RotateOperation *operation = new RotateOperation();
-
- inputSocket->relinkConnections(operation->getInputSocket(0), true, 0, graph);
- operation->setDegree(inputDegreeSocket->getStaticValues()[0]);
- inputDegreeSocket->relinkConnections(operation->getInputSocket(1), true, 1, graph);
- outputSocket->relinkConnections(operation->getOutputSocket(0));
- graph->addOperation(operation);
+void RotateNode::convertToOperations(ExecutionSystem *system, CompositorContext * context) {
+ InputSocket *inputSocket = this->getInputSocket(0);
+ InputSocket *inputDegreeSocket = this->getInputSocket(1);
+ OutputSocket *outputSocket = this->getOutputSocket(0);
+ RotateOperation *operation = new RotateOperation();
+
+ inputSocket->relinkConnections(operation->getInputSocket(0), true, 0, system);
+ inputDegreeSocket->relinkConnections(operation->getInputSocket(1), true, 1, system);
+ outputSocket->relinkConnections(operation->getOutputSocket(0));
+ system->addOperation(operation);
}
Added: branches/tile/source/blender/compositor/nodes/COM_Stabilize2dNode.cpp
===================================================================
--- branches/tile/source/blender/compositor/nodes/COM_Stabilize2dNode.cpp (rev 0)
+++ branches/tile/source/blender/compositor/nodes/COM_Stabilize2dNode.cpp 2012-02-27 14:56:21 UTC (rev 44485)
@@ -0,0 +1,87 @@
+/*
+ * Copyright 2011, Blender Foundation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor:
+ * Jeroen Bakker
+ * Monique Dewanchand
+ */
+
+#include "COM_Stabilize2dNode.h"
+#include "COM_ExecutionSystem.h"
+#include "COM_TranslateOperation.h"
+#include "COM_RotateOperation.h"
+#include "COM_ScaleOperation.h"
+#include "COM_MovieClipAttributeOperation.h"
+
+extern "C" {
+ #include "DNA_movieclip_types.h"
+ #include "BKE_tracking.h"
+}
+
+Stabilize2dNode::Stabilize2dNode(bNode *editorNode): Node(editorNode) {
+}
+
+void Stabilize2dNode::convertToOperations(ExecutionSystem *graph, CompositorContext * context) {
+ InputSocket *imageInput = this->getInputSocket(0);
+ MovieClip *clip= (MovieClip *)getbNode()->id;
+
+ ScaleOperation * scaleOperation = new ScaleOperation();
+ RotateOperation * rotateOperation = new RotateOperation();
+ TranslateOperation * translateOperation = new TranslateOperation();
+ MovieClipAttributeOperation *scaleAttribute = new MovieClipAttributeOperation();
+ MovieClipAttributeOperation *angleAttribute = new MovieClipAttributeOperation();
+ MovieClipAttributeOperation *xAttribute = new MovieClipAttributeOperation();
+ MovieClipAttributeOperation *yAttribute = new MovieClipAttributeOperation();
+
+ scaleAttribute->setAttribute(MCA_SCALE);
+ scaleAttribute->setFramenumber(context->getFramenumber());
+ scaleAttribute->setMovieClip(clip);
+
+ angleAttribute->setAttribute(MCA_ANGLE);
+ angleAttribute->setFramenumber(context->getFramenumber());
+ angleAttribute->setMovieClip(clip);
+
+ xAttribute->setAttribute(MCA_X);
+ xAttribute->setFramenumber(context->getFramenumber());
+ xAttribute->setMovieClip(clip);
+
+ yAttribute->setAttribute(MCA_Y);
+ yAttribute->setFramenumber(context->getFramenumber());
+ yAttribute->setMovieClip(clip);
+
+ imageInput->relinkConnections(scaleOperation->getInputSocket(0), true, 0, graph);
+ addLink(graph, scaleAttribute->getOutputSocket(), scaleOperation->getInputSocket(1));
+ addLink(graph, scaleAttribute->getOutputSocket(), scaleOperation->getInputSocket(2));
+
+ addLink(graph, scaleOperation->getOutputSocket(), rotateOperation->getInputSocket(0));
+ addLink(graph, angleAttribute->getOutputSocket(), rotateOperation->getInputSocket(1));
+ rotateOperation->setDoDegree2RadConversion(false);
+
+ addLink(graph, rotateOperation->getOutputSocket(), translateOperation->getInputSocket(0));
+ addLink(graph, xAttribute->getOutputSocket(), translateOperation->getInputSocket(1));
+ addLink(graph, yAttribute->getOutputSocket(), translateOperation->getInputSocket(2));
+
+ this->getOutputSocket()->relinkConnections(translateOperation->getOutputSocket());
+
+ graph->addOperation(scaleAttribute);
+ graph->addOperation(angleAttribute);
+ graph->addOperation(xAttribute);
+ graph->addOperation(yAttribute);
+ graph->addOperation(scaleOperation);
+ graph->addOperation(translateOperation);
+ graph->addOperation(rotateOperation);
+}
Added: branches/tile/source/blender/compositor/nodes/COM_Stabilize2dNode.h
===================================================================
--- branches/tile/source/blender/compositor/nodes/COM_Stabilize2dNode.h (rev 0)
+++ branches/tile/source/blender/compositor/nodes/COM_Stabilize2dNode.h 2012-02-27 14:56:21 UTC (rev 44485)
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2011, Blender Foundation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor:
+ * Jeroen Bakker
+ * Monique Dewanchand
+ */
+
+#include "COM_Node.h"
+#include "DNA_node_types.h"
+
+/**
+ * @brief Stabilize2dNode
+ * @ingroup Node
+ */
+class Stabilize2dNode : public Node {
+public:
+ Stabilize2dNode(bNode* editorNode);
+ void convertToOperations(ExecutionSystem *graph, CompositorContext * context);
+};
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list