The case of the pass that wouldn’t duplicate


In this case, CTRL+D on a pass would appear to work, but the pass wouldn’t show up in the explorer.

The problem turned out to be in the Duplicate options (the Hierarchy pref was set to None: hat tip to Chinny for spotting that). To duplicate passes, Hierarchy has to be set to Share Parent.

We confirmed this by looking at what was logged in the script history.

The problem is the 4th argument to Duplicate. That’s the Hierarchy argument, and 0 means siNoParent.
So the Duplicate command was creating a pass with no parent, so the new pass was just sort of “floating” around in the scene, until it was discarded during a save operation.

// Duplicate a pass but don't give it a parent
var x = Duplicate("Passes.Default_Pass", null, 2, 0, 1, 0, 0, 1, 0, 1, null, null, null, null, null, null, null, null, null, null, 0);

// It was created, but not placed in the pass list:
LogMessage( x.Count );
LogMessage( x(0).FullName );
InspectObj( x(0) );

2 thoughts on “The case of the pass that wouldn’t duplicate

  1. Pingback: Finding phantom passes created with Duplicate | eX-SI

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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