The dirty count

You can read more about the dirty count in the Softimage KB article Scripting – Understanding the dirty count parameter.

This example JScript uses the dirty count to determine whether or not the current scene has been saved.

function IsSceneSaved()
	var dirtycount = Dictionary.GetObject( "Project.dirtycount" ).Value;
	var models = FindObjects( null, "{0496EAB0-0ECF-11d1-ABF1-00A02485CECB}" )
	oEnum = new Enumerator( models ) ;
	for (;!oEnum.atEnd();oEnum.moveNext() )
		var model = oEnum.item() ;
		dirtycount += Dictionary.GetObject( model.FullName + ".dirty_count" ).Value

	LogMessage( dirtycount );
	return( dirtycount );
LogMessage( IsSceneSaved() == 0 ? "Scene is clean" : "Scene is dirty" );

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s