def __init__(self, shots, *args, **kwargs): super(ShotsPreviewModel, self).__init__(*args, **kwargs) self.shots = shots self.assetType = AssetType.recordByName("Shot") self.fileType = FileType.recordByAssetTypeAndId( self.assetType, "Playblast" )
def getPresets(self): aType = AssetType.recordByName("Project") fType = FileType.recordByAssetTypeAndId(aType, "Blast::Prefs") prefsPath = fType.fullPath(self.project) if not os.path.exists(prefsPath): # Use the prefs stored in _virtual_project as a default to fall back on # if the current project doesn't have a prefs file. prefsPath = fType.fullPath(Project.recordByName('_virtual_project')) presetsPath = os.path.normpath( os.path.join(prefsPath, "presets.json") ) with open(presetsPath, "r") as fileinfo: filesdata = fileinfo.read() presets = json.loads(filesdata) return presets