Skip to content

Instantly share code, notes, and snippets.

@justintaylor-dev
Created June 28, 2019 16:10
Show Gist options
  • Save justintaylor-dev/bcd7a2e1b99c7fddfd400c3ae01b45c7 to your computer and use it in GitHub Desktop.
Save justintaylor-dev/bcd7a2e1b99c7fddfd400c3ae01b45c7 to your computer and use it in GitHub Desktop.
Get Parent Bin #code_ppro
// Gets the parent bin of a project item
// Example: getParentBin(app.project.activeSequence.projectItem, app.project.rootItem)
function getParentBin(item, base){
var path = item.treePath;
for(var i = 0; i < base.children.numItems; i++){
if(base.children[i].type == ProjectItemType.BIN){
var foundItem = getParent(item, base.children[i]);
if(foundItem){
return foundItem;
}
}
else if(base.children[i].nodeId === item.nodeId)
return base;
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment