[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [53310] trunk/blender/source/blender/ compositor/intern: Fix #33650: Compositor locks up when input is an unrendered render layer.

Sergey Sharybin sergey.vfx at gmail.com
Mon Dec 24 14:33:50 CET 2012


Revision: 53310
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=53310
Author:   nazgul
Date:     2012-12-24 13:33:47 +0000 (Mon, 24 Dec 2012)
Log Message:
-----------
Fix #33650: Compositor locks up when input is an unrendered render layer.

Issue was caused by resolution detecting which assumed zero resolution is
undefined one and should be re-evaluated. It doesn't work in cases when
there's a missing input, causing lots of unneeded resolution re-calculation.

It wasn't so much issue in average sized node trees, but it was a real
problem in generated tree from the report.

Currently used pretty simple solution which added a boolean flag to the
node operation which signal whether resolution was ever set or not.

There're probably smarter solutions here but can not think about them.

Modified Paths:
--------------
    trunk/blender/source/blender/compositor/intern/COM_NodeOperation.cpp
    trunk/blender/source/blender/compositor/intern/COM_NodeOperation.h

Modified: trunk/blender/source/blender/compositor/intern/COM_NodeOperation.cpp
===================================================================
--- trunk/blender/source/blender/compositor/intern/COM_NodeOperation.cpp	2012-12-24 08:34:03 UTC (rev 53309)
+++ trunk/blender/source/blender/compositor/intern/COM_NodeOperation.cpp	2012-12-24 13:33:47 UTC (rev 53310)
@@ -34,6 +34,7 @@
 	this->m_complex = false;
 	this->m_width = 0;
 	this->m_height = 0;
+	this->m_isResolutionSet = false;
 	this->m_openCL = false;
 	this->m_btree = NULL;
 }

Modified: trunk/blender/source/blender/compositor/intern/COM_NodeOperation.h
===================================================================
--- trunk/blender/source/blender/compositor/intern/COM_NodeOperation.h	2012-12-24 08:34:03 UTC (rev 53309)
+++ trunk/blender/source/blender/compositor/intern/COM_NodeOperation.h	2012-12-24 13:33:47 UTC (rev 53310)
@@ -81,6 +81,7 @@
 	 */
 	const bNodeTree *m_btree;
 
+	bool m_isResolutionSet;
 public:
 	/**
 	 * @brief is this node an operation?
@@ -170,7 +171,7 @@
 	virtual void deinitExecution();
 
 	bool isResolutionSet() {
-		return this->m_width != 0 && this->m_height != 0;
+		return this->m_isResolutionSet;
 	}
 
 	/**
@@ -181,6 +182,7 @@
 		if (!isResolutionSet()) {
 			this->m_width = resolution[0];
 			this->m_height = resolution[1];
+			this->m_isResolutionSet = true;
 		}
 	}
 	
@@ -254,8 +256,8 @@
 protected:
 	NodeOperation();
 
-	void setWidth(unsigned int width) { this->m_width = width; }
-	void setHeight(unsigned int height) { this->m_height = height; }
+	void setWidth(unsigned int width) { this->m_width = width; this->m_isResolutionSet = true; }
+	void setHeight(unsigned int height) { this->m_height = height; this->m_isResolutionSet = true; }
 	SocketReader *getInputSocketReader(unsigned int inputSocketindex);
 	NodeOperation *getInputOperation(unsigned int inputSocketindex);
 




More information about the Bf-blender-cvs mailing list