Using a hidden parameter to store values


Here’s a simple self-installing property that shows how to use a “hidden” parameter to store a collection as a comma-separated string. I say the parameter is “hidden” because it is not shown on the property page (PPG).

function XSILoadPlugin( in_reg )
{
	in_reg.Author = "blairs";
	in_reg.Name = "SaveCollectionPlugin";
	in_reg.Major = 1;
	in_reg.Minor = 0;

	in_reg.RegisterProperty("SaveCollection");

	return true;
}

function XSIUnloadPlugin( in_reg )
{
	var strPluginName;
	strPluginName = in_reg.Name;
	Application.LogMessage(strPluginName + " has been unloaded.",siVerbose);
	return true;
}

function SaveCollection_Define( in_ctxt )
{
	var oCustomProperty;
	oCustomProperty = in_ctxt.Source;
	
	// Used to store the list of passes as a comma-separated string
	oCustomProperty.AddParameter2("Passes",siString,"",null,null,null,null,siClassifUnknown,siPersistable | siKeyable);
	
	return true;
}

function SaveCollection_DefineLayout( in_ctxt )
{
	var oLayout,oItem;
	oLayout = in_ctxt.Source;
	oLayout.Clear();
	oLayout.AddButton("Set");
	oLayout.AddButton("Get");
	return true;
}

// Save a list of passes in the Passes parameter
function SaveCollection_Set_OnClicked( )
{
	Application.LogMessage("SaveCollection_Test_OnClicked called",siVerbose);
	PPG.Passes.Value = ActiveProject.ActiveScene.Passes.GetAsText();
}

// Get the list of passes from the Passes parameter
function SaveCollection_Get_OnClicked( )
{
	Application.LogMessage("SaveCollection_Test_OnClicked called",siVerbose);

	// Split the string into an array
	var x = PPG.Passes.Value.split(",");
	for ( var i = 0; i < x.length; i++ )
	{
		LogMessage( x[i] );
	}

}

The strange case of error 211005: timeout waiting for finished rectangles


In this case, Softimage 2010SP1 stopped rendering one day (but strangely, 7.5 and 2011 still worked). If you drew a render region, nothing would happen for a long time, and then you would get this error:

' ERROR : DISP 0.4  error  211005: timeout waiting for finished rectangles

If you tried to render a frame to file, you’d get the same error, and a truncated image file that couldn’t be read. The mental ray diagnostics looked like this:

' INFO : JOB  0.8  progr:    99.4%    rendered on Example.8
' INFO : JOB  0.9  progr:    99.7%    rendered on Example.9
' INFO : JOB  0.14 progr:   100.0%    rendered on Example.14
' ERROR : DISP 0.4  error  211005: timeout waiting for finished rectangles
' INFO : RC   0.4  info : rendering statistics
' INFO : RC   0.4  info :   type                           number   per eye ray
' INFO : RC   0.4  info :   eye rays                        32900          1.00
' INFO : PHEN 0.4  progr: calling output shaders
' INFO : PHEN 0.4  progr: Writing image file 'C:\Softimage\Softimage_2010_SP1\Data\XSI_SAMPLES\Render_Pictures\Default_Pass_Main.1.pic' (Channel 'Main').
' ERROR : DISP 0.4  error  211005: timeout waiting for finished rectangles
' INFO : RC   0.4  progr: rendering finished
' INFO : RC   0.4  info : wallclock  0:03:59.65 for rendering
' INFO : RC   0.4  info : allocated 17 MB, max resident 18 MB
' INFO : GAPM 0.4  info : triangle count (including retessellation) :         112
' ERROR : 21000-REND-RenderPasses - Unspecified failure
RenderPasses "Passes.Default_Pass", 1, 1, 1, siRenderVerbosityDefault
Command failed, returned -2147467259

Softimage would stop responding shortly afterwards.

Eventually we tracked this down to a conflict with the OGRE Exporter.
We removed the exporter, and Softimage 2010 SP1 was able to render again. We then reinstalled the OGRE addon, and Softimage 2010 SP1 still rendered.

I suspected some sort of application conflict all along, but it took awhile to find the root cause of the problem.