|
enum | MissingBehaviour { ThrowIfMissing = IndexedIO::ThrowIfMissing,
NullIfMissing = IndexedIO::NullIfMissing,
CreateIfMissing = IndexedIO::CreateIfMissing
} |
|
enum | TagFilter { DescendantTag = 1,
LocalTag = 2,
AncestorTag = 4,
EveryTag = DescendantTag | LocalTag | AncestorTag
} |
|
enum | HashType {
TransformHash,
AttributesHash,
BoundHash,
ObjectHash,
ChildNamesHash,
HierarchyHash
} |
|
typedef IndexedIO::EntryID | Name |
|
typedef IndexedIO::EntryIDList | NameList |
|
typedef IndexedIO::EntryIDList | Path |
|
typedef RefCounted | BaseClass |
| A typedef for the class this class derives from. All RunTimeTyped classes define this typedef.
|
|
typedef size_t | RefCount |
|
|
| IE_CORE_DECLARERUNTIMETYPED (SceneInterface, RunTimeTyped) |
|
virtual std::string | fileName () const =0 |
| Returns the file that this scene is mapped to. Throws exception if there's no file.
|
|
virtual Name | name () const =0 |
| Returns the name of the scene location which this instance is referring to. The root path returns "/".
|
|
virtual void | path (Path &p) const =0 |
| Returns the path scene this instance is referring to.
|
|
virtual bool | hasBound () const |
|
virtual Imath::Box3d | readBound (double time) const =0 |
|
virtual void | writeBound (const Imath::Box3d &bound, double time)=0 |
|
virtual ConstDataPtr | readTransform (double time) const =0 |
|
virtual Imath::M44d | readTransformAsMatrix (double time) const =0 |
|
virtual void | writeTransform (const Data *transform, double time)=0 |
|
virtual bool | hasAttribute (const Name &name) const =0 |
| Convenience method to determine if an attribute exists without reading it.
|
|
virtual void | attributeNames (NameList &attrs) const =0 |
| Fills attrs with the names of all attributes available in the current directory.
|
|
virtual ConstObjectPtr | readAttribute (const Name &name, double time) const =0 |
| Returns the attribute value at the given time.
|
|
virtual void | writeAttribute (const Name &name, const Object *attribute, double time)=0 |
|
virtual bool | hasTag (const Name &name, int filter=LocalTag) const =0 |
|
virtual void | readTags (NameList &tags, int filter=LocalTag) const =0 |
|
virtual void | writeTags (const NameList &tags)=0 |
| Adds tags to the current scene location.
|
|
virtual bool | hasObject () const =0 |
| Convenience method to determine if a piece of geometry exists without reading it.
|
|
virtual ConstObjectPtr | readObject (double time) const =0 |
| Reads the object stored at this path in the scene at the given time.
|
|
virtual PrimitiveVariableMap | readObjectPrimitiveVariables (const std::vector< InternedString > &primVarNames, double time) const =0 |
|
virtual void | writeObject (const Object *object, double time)=0 |
|
virtual bool | hasChild (const Name &name) const =0 |
| Convenience method to determine if a child exists.
|
|
virtual void | childNames (NameList &childNames) const =0 |
|
virtual SceneInterfacePtr | child (const Name &name, MissingBehaviour missingBehaviour=ThrowIfMissing)=0 |
|
virtual ConstSceneInterfacePtr | child (const Name &name, MissingBehaviour missingBehaviour=ThrowIfMissing) const =0 |
| Returns a read-only interface for a child location in the scene.
|
|
virtual SceneInterfacePtr | createChild (const Name &name)=0 |
|
virtual SceneInterfacePtr | scene (const Path &path, MissingBehaviour missingBehaviour=ThrowIfMissing)=0 |
| Returns a interface for querying the scene at the given path (full path).
|
|
virtual ConstSceneInterfacePtr | scene (const Path &path, MissingBehaviour missingBehaviour=ThrowIfMissing) const =0 |
| Returns a const interface for querying the scene at the given path (full path).
|
|
virtual void | hash (HashType hashType, double time, MurmurHash &h) const |
|
| IE_CORE_DECLAREMEMBERPTR (RunTimeTyped) |
|
virtual TypeId | typeId () const |
|
virtual const char * | typeName () const |
|
virtual bool | isInstanceOf (TypeId typeId) const |
|
virtual bool | isInstanceOf (const char *typeName) const |
|
| IE_CORE_DECLAREMEMBERPTR (RefCounted) |
|
void | addRef () const |
| Add a reference to the current object.
|
|
void | removeRef () const |
| Remove a reference from the current object.
|
|
RefCount | refCount () const |
| Returns the current reference count.
|
|
|
static SceneInterfacePtr | create (const std::string &path, IndexedIO::OpenMode mode) |
|
static std::vector< std::string > | supportedExtensions (IndexedIO::OpenMode modes=IndexedIO::Read|IndexedIO::Write|IndexedIO::Append) |
|
static void | pathToString (const Path &p, std::string &path) |
| Converts a internal Path to a path-like string. The root path results in "/".
|
|
static void | stringToPath (const std::string &path, Path &p) |
|
static TypeId | staticTypeId () |
| Returns the TypeId for this class, without needing an instance.
|
|
static const char * | staticTypeName () |
| Returns the type name for this class, without needing an instance.
|
|
static TypeId | baseTypeId () |
|
static const char * | baseTypeName () |
|
static bool | inheritsFrom (TypeId typeId) |
| Returns true if this class inherits from the specified type.
|
|
static bool | inheritsFrom (const char *typeName) |
| Returns true if this class inherits from the specified type.
|
|
static bool | inheritsFrom (TypeId type, TypeId baseType) |
| Returns true if type inherits from baseType.
|
|
static bool | inheritsFrom (const char *typeName, const char *baseTypeName) |
| Returns true if typeName inherits from baseTypeName.
|
|
static TypeId | baseTypeId (TypeId typeId) |
| Returns the base type of the given type, or InvalidTypeId if no such base exists.
|
|
static const std::vector< TypeId > & | baseTypeIds (TypeId typeId) |
|
static const std::set< TypeId > & | derivedTypeIds (TypeId typeId) |
|
static TypeId | typeIdFromTypeName (const char *typeName) |
|
static const char * | typeNameFromTypeId (TypeId typeId) |
|
static void | registerType (TypeId derivedTypeId, const char *derivedTypeName, TypeId baseTypeId) |
| Allows external modules to register their own type ids.
|
|
|
static CreatorMap & | fileCreators () |
|
static void | registerCreator (const std::string &extension, IndexedIO::OpenMode modes, CreatorFn f) |
|
static BaseTypeRegistryMap & | baseTypeRegistry () |
|
static DerivedTypesRegistryMap & | derivedTypesRegistry () |
|
static BaseTypesRegistryMap & | completeBaseTypesRegistry () |
|
static DerivedTypesRegistryMap & | completeDerivedTypesRegistry () |
|
static void | derivedTypeIdsWalk (TypeId typeId, std::set< TypeId > &) |
|
static TypeIdsToTypeNamesMap & | typeIdsToTypeNames () |
|
static TypeNamesToTypeIdsMap & | typeNamesToTypeIds () |
|
A pure virtual base class for navigating a hierarchical animated 3D scene. A scene is defined by a hierarchy of named 3D transforms. Each SceneInterface instance maps to a specific transform in a scene, uniquely identified by it's path. A path is an array of transform names. Using the method child, you can explore the hierarchy (and create new transforms). Each transform on the hierarchy has a unique name and contains the 3D transformation, custom attributes, tags, a bounding box, a main object and more child transforms. All of them can be animated. Animation is stored by providing the time and the value. And it's retrieved by querying it's value at any time, and if the animation is inherently sampled, interpolation will be applied for queries on attributes, objects, transforms and bounds. The path to the root transform is an empty array. The name of the root transform is "/" though. The root transform by definition cannot store transformation or an object. Attributes and Tags are allowed. Tags are string labels assigned to any location in a scene and they are propagated up and down in the hierarchy when the scene is saved to files, so they can be used for efficiently filtering the hierarchy. Check on the Maya and Houdini scene reader nodes for examples on how to filter by tag.
- Todo:
- Implement a TransformStack class that can represent any custom transformation that could be interpolated and consider using it here as the returned type as opposed to DataPtr.