Revision: 45423
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=45423
Author:   jbakker
Date:     2012-04-05 12:44:59 +0000 (Thu, 05 Apr 2012)
Log Message:
-----------
TileBranch
 * Added sampler operation to the Rotate node
 * Added sampler operation to the Transform node

Effect:
 * Bilinear, Bicubic, nearest filtering should work on MovieClips

Modified Paths:
--------------
    branches/tile/source/blender/compositor/nodes/COM_RotateNode.cpp
    branches/tile/source/blender/compositor/nodes/COM_TransformNode.cpp

Modified: branches/tile/source/blender/compositor/nodes/COM_RotateNode.cpp
===================================================================
--- branches/tile/source/blender/compositor/nodes/COM_RotateNode.cpp    
2012-04-05 12:32:49 UTC (rev 45422)
+++ branches/tile/source/blender/compositor/nodes/COM_RotateNode.cpp    
2012-04-05 12:44:59 UTC (rev 45423)
@@ -24,6 +24,7 @@
 
 #include "COM_RotateOperation.h"
 #include "COM_ExecutionSystem.h"
+#include "COM_SetSamplerOperation.h"
 
 RotateNode::RotateNode(bNode *editorNode) : Node(editorNode) {
 }
@@ -33,9 +34,27 @@
        InputSocket *inputDegreeSocket = this->getInputSocket(1);
        OutputSocket *outputSocket = this->getOutputSocket(0);
        RotateOperation *operation = new RotateOperation();
+       SetSamplerOperation *sampler = new SetSamplerOperation();
+
+       switch (this->getbNode()->custom1) {
+       case 0:
+               sampler->setSampler(COM_PS_NEAREST);
+               break ;
+       case 1:
+               sampler->setSampler(COM_PS_BILINEAR);
+               break;
+       case 2:
+               sampler->setSampler(COM_PS_BICUBIC);
+               break;
        
-       inputSocket->relinkConnections(operation->getInputSocket(0), true, 0, 
system);
+       }
+
+       addLink(system, sampler->getOutputSocket(), 
operation->getInputSocket(0));
+       
+       inputSocket->relinkConnections(sampler->getInputSocket(0), true, 0, 
system);
        inputDegreeSocket->relinkConnections(operation->getInputSocket(1), 
true, 1, system);
        outputSocket->relinkConnections(operation->getOutputSocket(0));
+       system->addOperation(sampler);
        system->addOperation(operation);
+       
 }

Modified: branches/tile/source/blender/compositor/nodes/COM_TransformNode.cpp
===================================================================
--- branches/tile/source/blender/compositor/nodes/COM_TransformNode.cpp 
2012-04-05 12:32:49 UTC (rev 45422)
+++ branches/tile/source/blender/compositor/nodes/COM_TransformNode.cpp 
2012-04-05 12:44:59 UTC (rev 45423)
@@ -26,6 +26,7 @@
 #include "COM_RotateOperation.h"
 #include "COM_ScaleOperation.h"
 #include "COM_SetValueOperation.h"
+#include "COM_SetSamplerOperation.h"
 
 TransformNode::TransformNode(bNode *editorNode): Node(editorNode) {
 }
@@ -40,8 +41,22 @@
        ScaleOperation * scaleOperation = new ScaleOperation();
        RotateOperation * rotateOperation = new RotateOperation();
        TranslateOperation * translateOperation = new TranslateOperation();
+       SetSamplerOperation *sampler = new SetSamplerOperation();
+
+       switch (this->getbNode()->custom1) {
+       case 0:
+               sampler->setSampler(COM_PS_NEAREST);
+               break ;
+       case 1:
+               sampler->setSampler(COM_PS_BILINEAR);
+               break;
+       case 2:
+               sampler->setSampler(COM_PS_BICUBIC);
+               break;
+       }
        
-       imageInput->relinkConnections(scaleOperation->getInputSocket(0), true, 
0, graph);
+       imageInput->relinkConnections(sampler->getInputSocket(0), true, 0, 
graph);
+       addLink(graph, sampler->getOutputSocket(), 
scaleOperation->getInputSocket(0));
        scaleInput->relinkConnections(scaleOperation->getInputSocket(1), true, 
4, graph);
        addLink(graph, 
scaleOperation->getInputSocket(1)->getConnection()->getFromSocket(), 
scaleOperation->getInputSocket(2)); // xscale = yscale
        
@@ -55,6 +70,7 @@
        
        
this->getOutputSocket()->relinkConnections(translateOperation->getOutputSocket());
        
+       graph->addOperation(sampler);
        graph->addOperation(scaleOperation);
        graph->addOperation(rotateOperation);
        graph->addOperation(translateOperation);

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to