|
Katana Plug-in APIs 0.1
|
Primary class to derive from when implementing file sequence plugin. More...
#include <FnFileSequence.h>
Public Member Functions | |
| virtual bool | isValid () const =0 |
| Return whether this instance contains a valid file sequence. | |
| virtual FileSequence * | clone () const =0 |
| Return new copy of this class instance. | |
| virtual void | getAsString (std::string &retValue)=0 |
| Get string representation of the file sequence. | |
| virtual void | getDirectory (std::string &retValue)=0 |
| Get the directory portion of file sequence. | |
| virtual void | getPrefix (std::string &retValue)=0 |
| Get the portion of file sequence before the frame number. | |
| virtual void | getSuffix (std::string &retValue)=0 |
| Get the portion of file sequence after the frame number. | |
| virtual unsigned int | getPadding ()=0 |
| Get the padding of the file sequence frame number. | |
| virtual void | getResolvedPath (const int frame, std::string &retValue)=0 |
| Get the filename for file sequence with sequence portion replaced by correctly padded frame. | |
| virtual bool | hasFrameSet ()=0 |
| Return whether file sequence has explicit frame set. | |
| virtual bool | isFrameInFrameSet (const int frame)=0 |
| Test whether frame is within explicit frame set. | |
| virtual int | getFirstFrameInFrameSet ()=0 |
| Return first frame in explicit frame set. | |
| virtual int | getLastFrameInFrameSet ()=0 |
| Return last frame in explicit frame set. | |
| virtual void | getNearestFramesInFrameSet (int frame, bool *hasLeft, int *nearestLeft, bool *hasRight, int *nearestRight)=0 |
| Return nearest frame to left and right of frame. | |
| virtual void | getFrameListFromFrameSet (std::vector< int > &returnList)=0 |
| Get frame set as list of integers. | |
Primary class to derive from when implementing file sequence plugin.
File sequences are closely related to the asset system. A file sequence spec is a file path that contains tokens to be substituted with the current frame number. Some file sequence specs may also specify the frame range of the sequence.
An example from the FileSeq plugin: /path/to/image.1-10#.exr
This example references a sequence of images, frames 1 through 10, with the frame number zero-padded to length 4.
Resolving this sequence at frame 5 would result in: /path/to/image.0005.exr
In addition to implementing all the pure virtual functions in this class, you must also implement static methods in your derived class:
// return a new instance of your derived class, owned by caller. static FileSequence * create(const char *); // return true if string is a valid file sequence static bool isFileSequence(const char*); // return a valid file sequence string built from input prefix/suffix/padding std::string buildFileSequenceString(const std::string &prefix, const std::string &suffix, int padding); // return a new FileSequenceArray instance containing sequences and non-sequence file paths found // in input file path list FileSequenceArray* findSequence(const char** fileList, unsigned int fileCount);
To indicate an error to the caller, your implemntation may throw an exception derived from std::exception.
| virtual void Foundry::Katana::FileSequence::getAsString | ( | std::string & | retValue | ) | [pure virtual] |
Get string representation of the file sequence.
| retValue | Set to file sequence string. |
Implemented in FileSeq.
| virtual void Foundry::Katana::FileSequence::getDirectory | ( | std::string & | retValue | ) | [pure virtual] |
Get the directory portion of file sequence.
| retValue | Set to directory portion of file sequence (e.g. "/a/b/c" for fileseq "/a/b/c/d.#.exr"). |
Implemented in FileSeq.
| virtual int Foundry::Katana::FileSequence::getFirstFrameInFrameSet | ( | ) | [pure virtual] |
Return first frame in explicit frame set.
Implemented in FileSeq.
| virtual void Foundry::Katana::FileSequence::getFrameListFromFrameSet | ( | std::vector< int > & | returnList | ) | [pure virtual] |
Get frame set as list of integers.
| returnList | Fill with integer frame numbers (e.g. [1,2,3,4,5] for "image.1-5#.exr"). |
Implemented in FileSeq.
| virtual int Foundry::Katana::FileSequence::getLastFrameInFrameSet | ( | ) | [pure virtual] |
Return last frame in explicit frame set.
Implemented in FileSeq.
| virtual void Foundry::Katana::FileSequence::getNearestFramesInFrameSet | ( | int | frame, |
| bool * | hasLeft, | ||
| int * | nearestLeft, | ||
| bool * | hasRight, | ||
| int * | nearestRight | ||
| ) | [pure virtual] |
Return nearest frame to left and right of frame.
| frame | Frame number to return nearest frames of. |
| hasLeft | Set to true if frame exists in list to left of specified frame. |
| nearestLeft | Set to nearest frame in list to left of specified frame. |
| hasRight | Set to true if frame exists in list to right of specified frame. |
| nearestRight | Set to nearest frame in list to right of specified frame. |
Set return values to (false, 0, false, 0) if file sequence does not have explicit fram set.
Implemented in FileSeq.
| virtual unsigned int Foundry::Katana::FileSequence::getPadding | ( | ) | [pure virtual] |
Get the padding of the file sequence frame number.
Implemented in FileSeq.
| virtual void Foundry::Katana::FileSequence::getPrefix | ( | std::string & | retValue | ) | [pure virtual] |
Get the portion of file sequence before the frame number.
| retValue | Set to prefix portion of file sequence (e.g. "/a/b/c/d." for fileseq "/a/b/c/d.#.exr"). |
Implemented in FileSeq.
| virtual void Foundry::Katana::FileSequence::getResolvedPath | ( | const int | frame, |
| std::string & | retValue | ||
| ) | [pure virtual] |
Get the filename for file sequence with sequence portion replaced by correctly padded frame.
| frame | The frame to get the filename. |
| retValue | Set to resolved filename. |
Implemented in FileSeq.
| virtual void Foundry::Katana::FileSequence::getSuffix | ( | std::string & | retValue | ) | [pure virtual] |
Get the portion of file sequence after the frame number.
| retValue | Set to suffix portion of file sequence (e.g. ".exr" for fileseq "/a/b/c/d.#.exr"). |
Implemented in FileSeq.
| virtual bool Foundry::Katana::FileSequence::hasFrameSet | ( | ) | [pure virtual] |
Return whether file sequence has explicit frame set.
Implemented in FileSeq.
| virtual bool Foundry::Katana::FileSequence::isFrameInFrameSet | ( | const int | frame | ) | [pure virtual] |
Test whether frame is within explicit frame set.
Implemented in FileSeq.
1.7.3