Katana Plug-in APIs 0.1

FnAssetSuite.h

00001 // Copyright (c) 2012 The Foundry Visionmongers Ltd. All Rights Reserved.
00002 
00003 #ifndef FnAssetSuite_H
00004 #define FnAssetSuite_H
00005 
00006 #include <FnAttribute/suite/FnAttributeSuite.h>
00007 #include <cstddef>
00008 
00009 extern "C" {
00010 
00012 
00020 typedef struct FnFileSequenceStruct * FnFileSequenceHandle;
00021 
00024 typedef struct FnFileSequenceArrayStruct * FnFileSequenceArrayHandle;
00025 
00026 
00027 #define FnFileSequencePluginSuite_version 1
00028 
00045 struct FnFileSequencePluginSuite_v1
00046 {
00052     FnFileSequenceHandle (*create)(const char *fileseq, FnAttributeHandle *errorMessage);
00053 
00058     void (*destroy)(FnFileSequenceHandle handle, FnAttributeHandle *errorMessage);
00059 
00065     bool (*isFileSequence)(const char *fileseq, FnAttributeHandle *errorMessage);
00066 
00074     FnAttributeHandle (*buildFileSequenceString)(const char *prefix,
00075                                                  const char *suffix,
00076                                                  int padding,
00077                                                  FnAttributeHandle *errorMessage);
00078 
00084     FnAttributeHandle (*getAsString)(FnFileSequenceHandle handle,
00085                                      FnAttributeHandle *errorMessage);
00086 
00092     FnAttributeHandle (*getDirectory)(FnFileSequenceHandle handle,
00093                                       FnAttributeHandle *errorMessage);
00094 
00100     FnAttributeHandle (*getPrefix)(FnFileSequenceHandle handle,
00101                                    FnAttributeHandle *errorMessage);
00102 
00108     FnAttributeHandle (*getSuffix)(FnFileSequenceHandle handle,
00109                                    FnAttributeHandle *errorMessage);
00110 
00116     unsigned int (*getPadding)(FnFileSequenceHandle handle,
00117                                FnAttributeHandle *errorMessage);
00118 
00125     FnAttributeHandle (*getResolvedPath)(FnFileSequenceHandle handle, int frame,
00126                                          FnAttributeHandle *errorMessage);
00127 
00133     bool (*hasFrameSet)(FnFileSequenceHandle handle,
00134                         FnAttributeHandle *errorMessage);
00135 
00141     bool (*isFrameInFrameSet)(FnFileSequenceHandle handle, int frame,
00142                               FnAttributeHandle *errorMessage);
00143 
00149     int (*getFirstFrameInFrameSet)(FnFileSequenceHandle handle,
00150                                    FnAttributeHandle *errorMessage);
00151 
00157     int (*getLastFrameInFrameSet)(FnFileSequenceHandle handle,
00158                                   FnAttributeHandle *errorMessage);
00159 
00160     void (*getNearestFramesInFrameSet)(FnFileSequenceHandle handle, int frame,
00161         bool *hasLeft, int *nearestLeft, bool *hasRight, int *nearestRight,
00162         FnAttributeHandle *errorMessage);
00163 
00169     FnAttributeHandle (*getFrameListFromFrameSet)(FnFileSequenceHandle handle,
00170                                                   FnAttributeHandle *errorMessage);
00171 
00181     FnFileSequenceArrayHandle (*findSequence)(const char **fileList,
00182                                               unsigned int fileCount,
00183                                               FnAttributeHandle *errorMessage);
00184 
00189     void (*destroyFileSequenceArray)(FnFileSequenceArrayHandle handle,
00190                                      FnAttributeHandle *errorMessage);
00191 
00197     unsigned int (*getFileSequenceCount)(FnFileSequenceArrayHandle handle,
00198                                          FnAttributeHandle *errorMessage);
00199 
00206     FnFileSequenceHandle (*getFileSequence)(FnFileSequenceArrayHandle handle,
00207                                             unsigned int index,
00208                                             FnAttributeHandle *errorMessage);
00209 
00215     FnAttributeHandle (*getFilenames)(FnFileSequenceArrayHandle handle,
00216                                       FnAttributeHandle *errorMessage);
00217 };
00218 
00219 #define kFnAssetFieldName                  "name"
00220 #define kFnAssetFieldVersion               "version"
00221 
00222 #define kFnAssetTypeKatanaScene            "katana scene"
00223 #define kFnAssetTypeMacro                  "macro"
00224 #define kFnAssetTypeLiveGroup              "live group"
00225 #define kFnAssetTypeImage                  "image"
00226 #define kFnAssetTypeLookFile               "look file"
00227 #define kFnAssetTypeLookFileMgrSettings    "look file manager settings"
00228 #define kFnAssetTypeAlembic                "alembic"
00229 #define kFnAssetTypeCastingSheet           "casting sheet"
00230 #define kFnAssetTypeAttributeFile          "attribute file"
00231 #define kFnAssetTypeFCurveFile             "fcurve file"
00232 #define kFnAssetTypeGafferThreeRig         "gafferthree rig"
00233 #define kFnAssetTypeScenegraphBookmarks    "scenegraph bookmarks"
00234 #define kFnAssetTypeShader                 "shader"
00235 
00236 #define kFnAssetRelationArgsFile           "related args file"
00237 
00238 #define kFnAssetContextKatanaScene         "katana scene context"
00239 #define kFnAssetContextMacro               "macro context"
00240 #define kFnAssetContextLiveGroup           "live group context"
00241 #define kFnAssetContextImage               "image context"
00242 #define kFnAssetContextLookFile            "look file context"
00243 #define kFnAssetContextLookFileMgrSettings "look file manager settings context"
00244 #define kFnAssetContextAlembic             "alembic context"
00245 #define kFnAssetContextCastingSheet        "casting sheet context"
00246 #define kFnAssetContextAttributeFile       "attribute file context"
00247 #define kFnAssetContextFCurveFile          "fcurve file context"
00248 #define kFnAssetContextGafferThreeRig      "gafferthree rig context"
00249 #define kFnAssetContextScenegraphBookmarks "scenegraph bookmarks context"
00250 #define kFnAssetContextShader              "shader context"
00251 #define kFnAssetContextCatalog             "catalog context"
00252 #define kFnAssetContextFarm                "farm context"
00253 
00261 #define kFnAssetCreationOptionOutputFormat "outputFormat"
00262 
00264 #define kFnAssetOutputFormatArchive        "as archive"
00265 
00267 #define kFnAssetOutputFormatDirectory      "as directory"
00268 
00272 typedef struct FnAssetStruct * FnAssetHandle;
00273 
00276 typedef struct FnAssetTransactionStruct * FnAssetTransactionHandle;
00277 
00278 
00279 #define FnAssetPluginSuite_version 1
00280 
00301 struct FnAssetPluginSuite_v1
00302 {
00303     FnAssetHandle (*create)();
00304 
00305     void (*destroy)(FnAssetHandle handle);
00306 
00309     void (*reset)(FnAssetHandle handle, FnAttributeHandle *errorMessage);
00310 
00320     bool (*isAssetId)(FnAssetHandle handle, const char * str, FnAttributeHandle *errorMessage);
00321 
00331     bool (*containsAssetId)(FnAssetHandle handle, const char * str, FnAttributeHandle *errorMessage);
00332 
00340     bool (*checkPermissions)(FnAssetHandle handle, const char *assetId, FnAttributeHandle context,
00341                              FnAttributeHandle *errorMessage);
00342 
00351     bool (*runAssetPluginCommand)(FnAssetHandle handle, const char *assetId, const char *command,
00352                                   FnAttributeHandle commandArgs, FnAttributeHandle *errorMessage);
00353 
00361     FnAttributeHandle (*resolveAsset)(FnAssetHandle handle, const char *assetId, FnAttributeHandle *errorMessage);
00362 
00370     FnAttributeHandle (*resolveAllAssets)(FnAssetHandle handle, const char *str, FnAttributeHandle *errorMessage);
00371 
00383     FnAttributeHandle (*resolvePath)(FnAssetHandle handle, const char *path, int frame, FnAttributeHandle *errorMessage);
00384 
00392     FnAttributeHandle (*resolveAssetVersion)(FnAssetHandle handle, const char *assetId, const char *versionStr,
00393                                              FnAttributeHandle *errorMessage);
00394 
00395 
00403     FnAttributeHandle (*getAssetDisplayName)(FnAssetHandle handle, const char *assetId, FnAttributeHandle *errorMessage);
00404 
00411     FnAttributeHandle (*getAssetVersions)(FnAssetHandle handle, const char *assetId, FnAttributeHandle *errorMessage);
00412 
00422     FnAttributeHandle (*getUniqueScenegraphLocationFromAssetId)(FnAssetHandle handle, const char *assetId,
00423                                                                 bool includeVersion, FnAttributeHandle *errorMessage);
00424 
00436     FnAttributeHandle (*getRelatedAssetId)(FnAssetHandle handle, const char *assetId, const char *relation,
00437                                            FnAttributeHandle *errorMessage);
00438 
00450     FnAttributeHandle (*getAssetFields)(FnAssetHandle handle, const char *assetId, bool includeDefaults,
00451                                         FnAttributeHandle *errorMessage);
00452 
00461     FnAttributeHandle (*buildAssetId)(FnAssetHandle handle, FnAttributeHandle fields, FnAttributeHandle *errorMessage);
00462 
00473     FnAttributeHandle (*getAssetAttributes)(FnAssetHandle handle, const char *assetId, const char *scope,
00474                                             FnAttributeHandle *errorMessage);
00475 
00484     void (*setAssetAttributes)(FnAssetHandle handle, const char *assetId, const char *scope,
00485                                FnAttributeHandle attributes, FnAttributeHandle *errorMessage);
00486 
00498     FnAttributeHandle (*getAssetIdForScope)(FnAssetHandle handle, const char *assetId, const char *scope,
00499                                             FnAttributeHandle *errorMessage);
00500 
00509     FnAssetTransactionHandle (*createTransaction)(FnAssetHandle handle, FnAttributeHandle *errorMessage);
00510 
00515     void (*cancelTransaction)(FnAssetTransactionHandle handle, FnAttributeHandle *errorMessage);
00516 
00523     bool (*commitTransaction)(FnAssetTransactionHandle handle, FnAttributeHandle *errorMessage);
00524 
00538     FnAttributeHandle (*createAssetAndPath)(FnAssetHandle handle, FnAssetTransactionHandle txn,
00539             const char *assetType, FnAttributeHandle assetFields, FnAttributeHandle args,
00540             bool createDirectory, FnAttributeHandle *errorMessage);
00541 
00555     FnAttributeHandle (*postCreateAsset)(FnAssetHandle handle, FnAssetTransactionHandle txn,
00556             const char *assetType, FnAttributeHandle assetFields, FnAttributeHandle args,
00557             FnAttributeHandle *errorMessage);
00558 };
00559 
00560 #define FnDefaultAssetHostSuite_version 3
00561 
00565 struct FnDefaultAssetHostSuite_v3
00566 {
00567     bool (*isAssetId)(const char* str, FnAttributeHandle* errorMessage);
00568     bool (*containsAssetId)(const char* str, FnAttributeHandle* errorMessage);
00569     FnAttributeHandle (*resolveAsset)(const char* assetId,
00570                                       FnAttributeHandle* errorMessage);
00571     FnAttributeHandle (*resolvePath)(const char* path,
00572                                      int frame,
00573                                      FnAttributeHandle* errorMessage);
00574     bool (*isFileSequence)(const char* path, FnAttributeHandle* errorMessage);
00575     FnAttributeHandle (*buildFileSequenceString)(
00576         const char* prefix,
00577         const char* suffix,
00578         int padding,
00579         FnAttributeHandle* errorMessage);
00580     FnAttributeHandle (*resolveFileSequence)(const char* path,
00581                                              int frame,
00582                                              FnAttributeHandle* errorMessage);
00583     bool (*isFrameInFileSequence)(const char* path,
00584                                   int frame,
00585                                   FnAttributeHandle* errorMessage);
00586     FnAttributeHandle (*getUniqueScenegraphLocationFromAssetId)(
00587         const char* assetId,
00588         bool includeVersion,
00589         FnAttributeHandle* errorMessage);
00590     FnAttributeHandle (*getRelatedAssetId)(const char* assetId,
00591                                            const char* relation,
00592                                            FnAttributeHandle* errorMessage);
00593     FnAttributeHandle (*getAssetAttributes)(const char* assetId,
00594                                             const char* scope,
00595                                             FnAttributeHandle* errorMessage);
00596     bool (*checkPermissions)(const char* assetId,
00597                              const char** context,
00598                              size_t count,
00599                              FnAttributeHandle* errorMessage);
00600     FnAttributeHandle (*resolveAllAssets)(const char* assetId,
00601                                           FnAttributeHandle* errorMessage);
00602     FnAttributeHandle (*resolveAssetVersion)(const char* assetId,
00603                                              const char* versionTag,
00604                                              FnAttributeHandle* errorMessage);
00605     FnAttributeHandle (*getAssetDisplayName)(const char* assetId,
00606                                              FnAttributeHandle* errorMessage);
00607     FnAttributeHandle (*getAssetVersions)(const char* assetId,
00608                                           FnAttributeHandle* errorMessage);
00609     FnAttributeHandle (*getAssetFields)(const char* assetId,
00610                                         bool includeDefaults,
00611                                         FnAttributeHandle* errorMessage);
00612     FnAttributeHandle (*buildAssetId)(const char** fields,
00613                                       size_t fieldsCount,
00614                                       FnAttributeHandle* errorMessage);
00615     FnAttributeHandle (*getAssetIdForScope)(const char* assetId,
00616                                             const char* scope,
00617                                             FnAttributeHandle* errorMessage);
00618 };
00621 typedef FnDefaultAssetHostSuite_v3 FnDefaultAssetHostSuite;
00622 
00624 
00625 }
00626 
00627 #endif // FnAssetSuite_H
 All Classes Functions Variables Typedefs Enumerations Enumerator