Created
June 28, 2019 16:10
-
-
Save justintaylor-dev/bcd7a2e1b99c7fddfd400c3ae01b45c7 to your computer and use it in GitHub Desktop.
Get Parent Bin #code_ppro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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