[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48799] trunk/blender: Mango request: added an input node to use track's position in compositor

Sergey Sharybin sergey.vfx at gmail.com
Tue Jul 10 13:01:25 CEST 2012


Revision: 48799
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48799
Author:   nazgul
Date:     2012-07-10 11:01:25 +0000 (Tue, 10 Jul 2012)
Log Message:
-----------
Mango request: added an input node to use track's position in compositor

--
svn merge -r48088:48089 -r48091:48092 ^/branches/soc-2011-tomato

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48088
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48091

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/BKE_node.h
    trunk/blender/source/blender/blenkernel/intern/node.c
    trunk/blender/source/blender/compositor/CMakeLists.txt
    trunk/blender/source/blender/compositor/intern/COM_Converter.cpp
    trunk/blender/source/blender/editors/space_node/drawnode.c
    trunk/blender/source/blender/makesdna/DNA_node_types.h
    trunk/blender/source/blender/makesrna/intern/rna_nodetree.c
    trunk/blender/source/blender/makesrna/intern/rna_nodetree_types.h
    trunk/blender/source/blender/nodes/CMakeLists.txt
    trunk/blender/source/blender/nodes/NOD_composite.h

Added Paths:
-----------
    trunk/blender/source/blender/compositor/nodes/COM_TrackPositionNode.cpp
    trunk/blender/source/blender/compositor/nodes/COM_TrackPositionNode.h
    trunk/blender/source/blender/compositor/operations/COM_TrackPositionOperation.cpp
    trunk/blender/source/blender/compositor/operations/COM_TrackPositionOperation.h
    trunk/blender/source/blender/nodes/composite/nodes/node_composite_trackpos.c

Property Changed:
----------------
    trunk/blender/
    trunk/blender/source/blender/editors/interface/interface.c
    trunk/blender/source/blender/editors/space_outliner/


Property changes on: trunk/blender
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/soc-2011-tomato:42376,42378-42379,42383,42385,42395,42397-42400,42407,42411,42418,42443-42444,42446,42467,42472,42486,42650-42652,42654-42655,42709-42710,42733-42734,42801,43872,44130,44141,44147-44149,44151-44152,44229-44230,45623-45625,46037,48792-48793
   + /branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/soc-2011-tomato:42376,42378-42379,42383,42385,42395,42397-42400,42407,42411,42418,42443-42444,42446,42467,42472,42486,42650-42652,42654-42655,42709-42710,42733-42734,42801,43872,44130,44141,44147-44149,44151-44152,44229-44230,45623-45625,46037,48089,48092,48792-48793

Modified: trunk/blender/source/blender/blenkernel/BKE_node.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_node.h	2012-07-10 10:36:18 UTC (rev 48798)
+++ trunk/blender/source/blender/blenkernel/BKE_node.h	2012-07-10 11:01:25 UTC (rev 48799)
@@ -660,6 +660,7 @@
 #define CMP_NODE_MASK		268
 #define CMP_NODE_KEYINGSCREEN		269
 #define CMP_NODE_KEYING			270
+#define CMP_NODE_TRACKPOS		271
 
 #define CMP_NODE_GLARE		301
 #define CMP_NODE_TONEMAP	302

Modified: trunk/blender/source/blender/blenkernel/intern/node.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/node.c	2012-07-10 10:36:18 UTC (rev 48798)
+++ trunk/blender/source/blender/blenkernel/intern/node.c	2012-07-10 11:01:25 UTC (rev 48799)
@@ -1942,6 +1942,7 @@
 	register_node_type_cmp_switch(ttype);
 
 	register_node_type_cmp_mask(ttype);
+	register_node_type_cmp_trackpos(ttype);
 }
 
 static void registerShaderNodes(bNodeTreeType *ttype) 

Modified: trunk/blender/source/blender/compositor/CMakeLists.txt
===================================================================
--- trunk/blender/source/blender/compositor/CMakeLists.txt	2012-07-10 10:36:18 UTC (rev 48798)
+++ trunk/blender/source/blender/compositor/CMakeLists.txt	2012-07-10 11:01:25 UTC (rev 48799)
@@ -338,6 +338,11 @@
 	operations/COM_KeyingScreenOperation.cpp
 	operations/COM_KeyingScreenOperation.h
 
+	nodes/COM_TrackPositionNode.cpp
+	nodes/COM_TrackPositionNode.h
+	operations/COM_TrackPositionOperation.cpp
+	operations/COM_TrackPositionOperation.h
+
 	nodes/COM_KeyingNode.cpp
 	nodes/COM_KeyingNode.h
 	operations/COM_KeyingOperation.cpp

Modified: trunk/blender/source/blender/compositor/intern/COM_Converter.cpp
===================================================================
--- trunk/blender/source/blender/compositor/intern/COM_Converter.cpp	2012-07-10 10:36:18 UTC (rev 48798)
+++ trunk/blender/source/blender/compositor/intern/COM_Converter.cpp	2012-07-10 11:01:25 UTC (rev 48799)
@@ -110,6 +110,7 @@
 #include "COM_TransformNode.h"
 #include "COM_TranslateNode.h"
 #include "COM_TranslateOperation.h"
+#include "COM_TrackPositionNode.h"
 #include "COM_ValueNode.h"
 #include "COM_VectorBlurNode.h"
 #include "COM_VectorCurveNode.h"
@@ -377,6 +378,9 @@
 		case CMP_NODE_KEYING:
 			node = new KeyingNode(b_node);
 			break;
+		case CMP_NODE_TRACKPOS:
+			node = new TrackPositionNode(b_node);
+			break;
 		/* not inplemented yet */
 		default:
 			node = new MuteNode(b_node);

Copied: trunk/blender/source/blender/compositor/nodes/COM_TrackPositionNode.cpp (from rev 48089, branches/soc-2011-tomato/source/blender/compositor/nodes/COM_TrackPositionNode.cpp)
===================================================================
--- trunk/blender/source/blender/compositor/nodes/COM_TrackPositionNode.cpp	                        (rev 0)
+++ trunk/blender/source/blender/compositor/nodes/COM_TrackPositionNode.cpp	2012-07-10 11:01:25 UTC (rev 48799)
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2012, 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
+ *		Sergey Sharybin
+ */
+
+#include "COM_TrackPositionNode.h"
+#include "COM_ExecutionSystem.h"
+#include "COM_TrackPositionOperation.h"
+
+extern "C" {
+	#include "DNA_movieclip_types.h"
+}
+
+TrackPositionNode::TrackPositionNode(bNode *editorNode) : Node(editorNode)
+{
+	/* pass */
+}
+
+void TrackPositionNode::convertToOperations(ExecutionSystem *graph, CompositorContext *context)
+{
+	OutputSocket *outputX = this->getOutputSocket(0);
+	OutputSocket *outputY = this->getOutputSocket(1);
+
+	bNode *editorNode = this->getbNode();
+	MovieClip *clip = (MovieClip *) editorNode->id;
+
+	NodeTrackPosData *trackpos_data = (NodeTrackPosData *) editorNode->storage;
+
+	TrackPositionOperation *operationX = new TrackPositionOperation();
+	TrackPositionOperation *operationY = new TrackPositionOperation();
+
+	operationX->setMovieClip(clip);
+	operationX->setTrackingObject(trackpos_data->tracking_object);
+	operationX->setTrackName(trackpos_data->track_name);
+	operationX->setFramenumber(context->getFramenumber());
+	operationX->setAxis(0);
+	operationX->setRelative(editorNode->custom1);
+
+	operationY->setMovieClip(clip);
+	operationY->setTrackingObject(trackpos_data->tracking_object);
+	operationY->setTrackName(trackpos_data->track_name);
+	operationY->setFramenumber(context->getFramenumber());
+	operationY->setAxis(1);
+	operationY->setRelative(editorNode->custom1);
+
+	outputX->relinkConnections(operationX->getOutputSocket());
+	outputY->relinkConnections(operationY->getOutputSocket());
+
+	graph->addOperation(operationX);
+}

Copied: trunk/blender/source/blender/compositor/nodes/COM_TrackPositionNode.h (from rev 48089, branches/soc-2011-tomato/source/blender/compositor/nodes/COM_TrackPositionNode.h)
===================================================================
--- trunk/blender/source/blender/compositor/nodes/COM_TrackPositionNode.h	                        (rev 0)
+++ trunk/blender/source/blender/compositor/nodes/COM_TrackPositionNode.h	2012-07-10 11:01:25 UTC (rev 48799)
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2012, 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
+ *		Sergey Sharybin
+ */
+
+#include "COM_Node.h"
+#include "DNA_node_types.h"
+
+/**
+  * @brief TrackPositionNode
+  * @ingroup Node
+  */
+class TrackPositionNode : public Node {
+public:
+	TrackPositionNode(bNode *editorNode);
+	void convertToOperations(ExecutionSystem *graph, CompositorContext *context);
+
+};

Copied: trunk/blender/source/blender/compositor/operations/COM_TrackPositionOperation.cpp (from rev 48089, branches/soc-2011-tomato/source/blender/compositor/operations/COM_TrackPositionOperation.cpp)
===================================================================
--- trunk/blender/source/blender/compositor/operations/COM_TrackPositionOperation.cpp	                        (rev 0)
+++ trunk/blender/source/blender/compositor/operations/COM_TrackPositionOperation.cpp	2012-07-10 11:01:25 UTC (rev 48799)
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2012, 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
+ *		Sergey Sharybin
+ */
+
+#include "COM_TrackPositionOperation.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_listbase.h"
+#include "BLI_math.h"
+#include "BLI_math_color.h"
+
+#include "DNA_scene_types.h"
+
+extern "C" {
+	#include "BKE_movieclip.h"
+	#include "BKE_tracking.h"
+}
+
+TrackPositionOperation::TrackPositionOperation() : NodeOperation()
+{
+	this->addOutputSocket(COM_DT_VALUE);
+	this->movieClip = NULL;
+	this->framenumber = 0;
+	this->trackingObject[0] = 0;
+	this->trackName[0] = 0;
+	this->axis = 0;
+	this->relative = false;
+}
+
+void TrackPositionOperation::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
+{
+	MovieClipUser user = {0};

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list