[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48583] trunk/blender: Highlight nodes that are being processed
Jeroen Bakker
j.bakker at atmind.nl
Wed Jul 4 12:01:45 CEST 2012
Revision: 48583
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48583
Author: jbakker
Date: 2012-07-04 10:01:45 +0000 (Wed, 04 Jul 2012)
Log Message:
-----------
Highlight nodes that are being processed
Modified Paths:
--------------
trunk/blender/release/scripts/startup/bl_ui/space_node.py
trunk/blender/source/blender/compositor/intern/COM_ExecutionGroup.cpp
trunk/blender/source/blender/compositor/intern/COM_Node.cpp
trunk/blender/source/blender/compositor/intern/COM_Node.h
trunk/blender/source/blender/compositor/intern/COM_NodeBase.cpp
trunk/blender/source/blender/compositor/intern/COM_NodeBase.h
trunk/blender/source/blender/compositor/intern/COM_NodeOperation.cpp
trunk/blender/source/blender/compositor/nodes/COM_BlurNode.cpp
trunk/blender/source/blender/compositor/nodes/COM_BokehBlurNode.cpp
trunk/blender/source/blender/compositor/nodes/COM_DefocusNode.cpp
trunk/blender/source/blender/compositor/nodes/COM_DilateErodeNode.cpp
trunk/blender/source/blender/compositor/nodes/COM_DoubleEdgeMaskNode.cpp
trunk/blender/source/blender/compositor/nodes/COM_FilterNode.cpp
trunk/blender/source/blender/compositor/nodes/COM_GlareNode.cpp
trunk/blender/source/blender/compositor/nodes/COM_KeyingNode.cpp
trunk/blender/source/blender/compositor/nodes/COM_KeyingScreenNode.cpp
trunk/blender/source/blender/compositor/nodes/COM_LensDistortionNode.cpp
trunk/blender/source/blender/compositor/nodes/COM_MaskNode.cpp
trunk/blender/source/blender/compositor/nodes/COM_TonemapNode.cpp
trunk/blender/source/blender/compositor/nodes/COM_VectorBlurNode.cpp
trunk/blender/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp
trunk/blender/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.h
trunk/blender/source/blender/compositor/operations/COM_WriteBufferOperation.cpp
trunk/blender/source/blender/editors/space_node/node_draw.c
trunk/blender/source/blender/makesdna/DNA_node_types.h
trunk/blender/source/blender/makesdna/DNA_space_types.h
trunk/blender/source/blender/makesrna/intern/rna_space.c
trunk/blender/source/blender/nodes/composite/node_composite_tree.c
Modified: trunk/blender/release/scripts/startup/bl_ui/space_node.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_node.py 2012-07-04 09:41:57 UTC (rev 48582)
+++ trunk/blender/release/scripts/startup/bl_ui/space_node.py 2012-07-04 10:01:45 UTC (rev 48583)
@@ -217,7 +217,7 @@
class NODE_PT_quality(bpy.types.Panel):
bl_space_type = 'NODE_EDITOR'
bl_region_type = 'UI'
- bl_label = "Quality"
+ bl_label = "Performance"
@classmethod
def poll(cls, context):
@@ -233,6 +233,7 @@
layout.prop(tree, "edit_quality", text="Edit")
layout.prop(tree, "chunk_size")
layout.prop(tree, "use_opencl")
+ layout.prop(snode, "show_highlight")
class NODE_MT_node_color_presets(Menu):
Modified: trunk/blender/source/blender/compositor/intern/COM_ExecutionGroup.cpp
===================================================================
--- trunk/blender/source/blender/compositor/intern/COM_ExecutionGroup.cpp 2012-07-04 09:41:57 UTC (rev 48582)
+++ trunk/blender/source/blender/compositor/intern/COM_ExecutionGroup.cpp 2012-07-04 10:01:45 UTC (rev 48583)
@@ -27,6 +27,8 @@
#include "BLI_math.h"
#include "PIL_time.h"
+#include "WM_api.h"
+#include "WM_types.h"
#include "COM_ExecutionGroup.h"
#include "COM_InputSocket.h"
@@ -347,6 +349,8 @@
finished = false;
startEvaluated = true;
numberEvaluated++;
+
+ WM_main_add_notifier(NC_WINDOW | ND_DRAW, NULL);
}
else if (state == COM_ES_SCHEDULED) {
finished = false;
Modified: trunk/blender/source/blender/compositor/intern/COM_Node.cpp
===================================================================
--- trunk/blender/source/blender/compositor/intern/COM_Node.cpp 2012-07-04 09:41:57 UTC (rev 48582)
+++ trunk/blender/source/blender/compositor/intern/COM_Node.cpp 2012-07-04 10:01:45 UTC (rev 48583)
@@ -39,9 +39,9 @@
//#include <stdio.h>
#include "COM_defines.h"
-Node::Node(bNode *editorNode, bool create_sockets)
+Node::Node(bNode *editorNode, bool create_sockets): NodeBase()
{
- this->m_editorNode = editorNode;
+ setbNode(editorNode);
if (create_sockets) {
bNodeSocket *input = (bNodeSocket *)editorNode->inputs.first;
@@ -64,16 +64,7 @@
}
}
}
-Node::Node()
-{
- this->m_editorNode = NULL;
-}
-bNode *Node::getbNode()
-{
- return this->m_editorNode;
-}
-
void Node::addSetValueOperation(ExecutionSystem *graph, InputSocket *inputsocket, int editorNodeInputSocketIndex)
{
bNodeSocket *bSock = (bNodeSocket *)this->getEditorInputSocket(editorNodeInputSocketIndex);
Modified: trunk/blender/source/blender/compositor/intern/COM_Node.h
===================================================================
--- trunk/blender/source/blender/compositor/intern/COM_Node.h 2012-07-04 09:41:57 UTC (rev 48582)
+++ trunk/blender/source/blender/compositor/intern/COM_Node.h 2012-07-04 10:01:45 UTC (rev 48583)
@@ -48,10 +48,6 @@
*/
class Node : public NodeBase {
private:
- /**
- * @brief stores the reference to the SDNA bNode struct
- */
- bNode *m_editorNode;
/**
* @brief Is this node part of the active group
@@ -60,13 +56,8 @@
public:
Node(bNode *editorNode, bool create_sockets = true);
-
+
/**
- * @brief get the reference to the SDNA bNode struct
- */
- bNode *getbNode();
-
- /**
* @brief Is this node in the active group (the group that is being edited)
* @param isInActiveGroup
*/
@@ -137,9 +128,6 @@
*/
OutputSocket *findOutputSocketBybNodeSocket(bNodeSocket *socket);
protected:
-
- Node();
-
void addPreviewOperation(ExecutionSystem *system, InputSocket *inputSocket);
void addPreviewOperation(ExecutionSystem *system, OutputSocket *outputSocket);
Modified: trunk/blender/source/blender/compositor/intern/COM_NodeBase.cpp
===================================================================
--- trunk/blender/source/blender/compositor/intern/COM_NodeBase.cpp 2012-07-04 09:41:57 UTC (rev 48582)
+++ trunk/blender/source/blender/compositor/intern/COM_NodeBase.cpp 2012-07-04 10:01:45 UTC (rev 48583)
@@ -33,7 +33,7 @@
NodeBase::NodeBase()
{
- /* pass */
+ this->m_editorNode = NULL;
}
Modified: trunk/blender/source/blender/compositor/intern/COM_NodeBase.h
===================================================================
--- trunk/blender/source/blender/compositor/intern/COM_NodeBase.h 2012-07-04 09:41:57 UTC (rev 48582)
+++ trunk/blender/source/blender/compositor/intern/COM_NodeBase.h 2012-07-04 10:01:45 UTC (rev 48583)
@@ -54,6 +54,11 @@
*/
vector<OutputSocket *> m_outputsockets;
+ /**
+ * @brief stores the reference to the SDNA bNode struct
+ */
+ bNode *m_editorNode;
+
protected:
/**
* @brief get access to the vector of input sockets
@@ -74,6 +79,18 @@
virtual ~NodeBase();
/**
+ * @brief get the reference to the SDNA bNode struct
+ */
+ bNode *getbNode() {return m_editorNode;}
+
+ /**
+ * @brief set the reference to the bNode
+ * @note used in Node instances to receive the storage/settings and complex node for highlight during execution
+ * @param bNode
+ */
+ void setbNode(bNode *bNode) {this->m_editorNode = bNode;}
+
+ /**
* @brief is this node an operation?
* This is true when the instance is of the subclass NodeOperation.
* @return [true:false]
Modified: trunk/blender/source/blender/compositor/intern/COM_NodeOperation.cpp
===================================================================
--- trunk/blender/source/blender/compositor/intern/COM_NodeOperation.cpp 2012-07-04 09:41:57 UTC (rev 48582)
+++ trunk/blender/source/blender/compositor/intern/COM_NodeOperation.cpp 2012-07-04 10:01:45 UTC (rev 48583)
@@ -28,7 +28,7 @@
#include "COM_SocketConnection.h"
#include "COM_defines.h"
-NodeOperation::NodeOperation()
+NodeOperation::NodeOperation() : NodeBase()
{
this->m_resolutionInputSocketIndex = 0;
this->m_complex = false;
Modified: trunk/blender/source/blender/compositor/nodes/COM_BlurNode.cpp
===================================================================
--- trunk/blender/source/blender/compositor/nodes/COM_BlurNode.cpp 2012-07-04 09:41:57 UTC (rev 48582)
+++ trunk/blender/source/blender/compositor/nodes/COM_BlurNode.cpp 2012-07-04 10:01:45 UTC (rev 48583)
@@ -49,6 +49,7 @@
if (data->filtertype == R_FILTER_FAST_GAUSS) {
FastGaussianBlurOperation *operationfgb = new FastGaussianBlurOperation();
operationfgb->setData(data);
+ operationfgb->setbNode(editorNode);
this->getInputSocket(0)->relinkConnections(operationfgb->getInputSocket(0), 0, graph);
this->getInputSocket(1)->relinkConnections(operationfgb->getInputSocket(1), 1, graph);
this->getOutputSocket(0)->relinkConnections(operationfgb->getOutputSocket(0));
@@ -58,12 +59,14 @@
else if (!data->bokeh) {
GaussianXBlurOperation *operationx = new GaussianXBlurOperation();
operationx->setData(data);
+ operationx->setbNode(editorNode);
operationx->setQuality(quality);
this->getInputSocket(0)->relinkConnections(operationx->getInputSocket(0), 0, graph);
this->getInputSocket(1)->relinkConnections(operationx->getInputSocket(1), 1, graph);
graph->addOperation(operationx);
GaussianYBlurOperation *operationy = new GaussianYBlurOperation();
operationy->setData(data);
+ operationy->setbNode(editorNode);
operationy->setQuality(quality);
this->getOutputSocket(0)->relinkConnections(operationy->getOutputSocket());
graph->addOperation(operationy);
@@ -79,6 +82,7 @@
else {
GaussianBokehBlurOperation *operation = new GaussianBokehBlurOperation();
operation->setData(data);
+ operation->setbNode(editorNode);
this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, graph);
this->getInputSocket(1)->relinkConnections(operation->getInputSocket(1), 1, graph);
operation->setQuality(quality);
Modified: trunk/blender/source/blender/compositor/nodes/COM_BokehBlurNode.cpp
===================================================================
--- trunk/blender/source/blender/compositor/nodes/COM_BokehBlurNode.cpp 2012-07-04 09:41:57 UTC (rev 48582)
+++ trunk/blender/source/blender/compositor/nodes/COM_BokehBlurNode.cpp 2012-07-04 10:01:45 UTC (rev 48583)
@@ -61,6 +61,7 @@
this->getInputSocket(3)->relinkConnections(operation->getInputSocket(2), 3, graph);
operation->setSize(((bNodeSocketValueFloat *)this->getInputSocket(2)->getbNodeSocket()->default_value)->value);
operation->setQuality(context->getQuality());
+ operation->setbNode(this->getbNode());
graph->addOperation(operation);
this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket());
// }
Modified: trunk/blender/source/blender/compositor/nodes/COM_DefocusNode.cpp
===================================================================
--- trunk/blender/source/blender/compositor/nodes/COM_DefocusNode.cpp 2012-07-04 09:41:57 UTC (rev 48582)
+++ trunk/blender/source/blender/compositor/nodes/COM_DefocusNode.cpp 2012-07-04 10:01:45 UTC (rev 48583)
@@ -46,6 +46,7 @@
NodeDefocus *data = (NodeDefocus *)node->storage;
NodeOperation *radiusOperation;
+ OutputSocket * depthOperation;
if (data->no_zbuf) {
MathMultiplyOperation *multiply = new MathMultiplyOperation();
SetValueOperation *multiplier = new SetValueOperation();
@@ -63,6 +64,7 @@
graph->addOperation(maxRadius);
graph->addOperation(minimize);
radiusOperation = minimize;
+ depthOperation = minimize->getOutputSocket(0);
}
else {
ConvertDepthToRadiusOperation *converter = new ConvertDepthToRadiusOperation();
@@ -72,6 +74,7 @@
this->getInputSocket(1)->relinkConnections(converter->getInputSocket(0), 1, graph);
graph->addOperation(converter);
radiusOperation = converter;
+ depthOperation = converter->getInputSocket(0)->getConnection()->getFromSocket();
}
BokehImageOperation *bokeh = new BokehImageOperation();
@@ -89,7 +92,15 @@
bokeh->setData(bokehdata);
bokeh->deleteDataOnFinish();
graph->addOperation(bokeh);
-
+
+#ifdef COM_DEFOCUS_SEARCH
+ InverseSearchRadiusOperation *search = new InverseSearchRadiusOperation();
+ addLink(graph, radiusOperation->getOutputSocket(0), search->getInputSocket(0));
+ addLink(graph, depthOperation, search->getInputSocket(1));
+ search->setMaxBlur(data->maxblur);
+ search->setThreshold(data->bthresh);
+ graph->addOperation(search);
+#endif
VariableSizeBokehBlurOperation *operation = new VariableSizeBokehBlurOperation();
if (data->preview) {
operation->setQuality(COM_QUALITY_LOW);
@@ -97,10 +108,14 @@
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list