[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [42532] branches/tile/source/blender/ compositor/intern/COM_Node.cpp: Use the default_value data in bNodeSocket for input constants instead of the deprecated bNodeStack ns member .
Lukas Toenne
lukas.toenne at googlemail.com
Fri Dec 9 10:39:55 CET 2011
Revision: 42532
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=42532
Author: lukastoenne
Date: 2011-12-09 09:39:50 +0000 (Fri, 09 Dec 2011)
Log Message:
-----------
Use the default_value data in bNodeSocket for input constants instead of the deprecated bNodeStack ns member. The ns member only still works partially since it is updated back from the actual default_value on each file write and also undo pushes (for forward compatibility).
Modified Paths:
--------------
branches/tile/source/blender/compositor/intern/COM_Node.cpp
Modified: branches/tile/source/blender/compositor/intern/COM_Node.cpp
===================================================================
--- branches/tile/source/blender/compositor/intern/COM_Node.cpp 2011-12-09 08:20:27 UTC (rev 42531)
+++ branches/tile/source/blender/compositor/intern/COM_Node.cpp 2011-12-09 09:39:50 UTC (rev 42532)
@@ -67,7 +67,8 @@
void Node::addSetValueOperation(ExecutionSystem *graph, InputSocket* inputsocket, int editorNodeInputSocketIndex) {
bNodeSocket *bSock = (bNodeSocket*)this->getEditorInputSocket(editorNodeInputSocketIndex);
SetValueOperation *operation = new SetValueOperation();
- operation->setValue(bSock->ns.vec[0]);
+ bNodeSocketValueFloat *val = (bNodeSocketValueFloat*)bSock->default_value;
+ operation->setValue(val->value);
this->addLink(graph, operation->getOutputSocket(), inputsocket);
graph->addOperation(operation);
}
@@ -104,21 +105,23 @@
void Node::addSetColorOperation(ExecutionSystem *graph, InputSocket* inputsocket, int editorNodeInputSocketIndex) {
bNodeSocket *bSock = (bNodeSocket*)this->getEditorInputSocket(editorNodeInputSocketIndex);
SetColorOperation *operation = new SetColorOperation();
- operation->setChannel1(bSock->ns.vec[0]);
- operation->setChannel2(bSock->ns.vec[1]);
- operation->setChannel3(bSock->ns.vec[2]);
- operation->setChannel4(bSock->ns.vec[3]);
+ bNodeSocketValueRGBA *val = (bNodeSocketValueRGBA*)bSock->default_value;
+ operation->setChannel1(val->value[0]);
+ operation->setChannel2(val->value[1]);
+ operation->setChannel3(val->value[2]);
+ operation->setChannel4(val->value[3]);
this->addLink(graph, operation->getOutputSocket(), inputsocket);
graph->addOperation(operation);
}
void Node::addSetVectorOperation(ExecutionSystem *graph, InputSocket* inputsocket, int editorNodeInputSocketIndex) {
bNodeSocket *bSock = (bNodeSocket*)this->getEditorInputSocket(editorNodeInputSocketIndex);
+ bNodeSocketValueVector *val = (bNodeSocketValueVector*)bSock->default_value;
SetVectorOperation *operation = new SetVectorOperation();
- operation->setX(bSock->ns.vec[0]);
- operation->setY(bSock->ns.vec[1]);
- operation->setZ(bSock->ns.vec[2]);
- operation->setW(bSock->ns.vec[3]);
+ operation->setX(val->value[0]);
+ operation->setY(val->value[1]);
+ operation->setZ(val->value[2]);
+ operation->setW(val->value[3]);
this->addLink(graph, operation->getOutputSocket(), inputsocket);
graph->addOperation(operation);
}
More information about the Bf-blender-cvs
mailing list