#include <xsi_shapekey.h>
A ShapeKey represents a special ClusterProperty which is used to store a specific geometry. ShapeKeys provide information about how the shape of a cluster changes by either storing its absolute value, an offset based on the object referential or values base on the local reference frame of vertices.
In the context of a ShapeKey, values returned by ClusterProperty::GetValues are automatically converted to object-based referential, which is not the case for ClusterProperty::GetElements.
You can find out the key's reference mode by getting the value of the KeyType parameter. To convert from one reference mode to the other, use the ConvertShapeReferenceMode command.
Because a ShapeKey modifies scene content when instantiated, it is an AnimationSource and as such can be accessed by using AnimationSourceItem::GetSource.
using namespace XSI;
Application app;
Model root = app.GetActiveSceneRoot();
X3DObject myCube;
root.AddGeometry( L"Cube", L"MeshSurface", L"", myCube );
// Creating the first animation source
CValueArray args(3);
CValue outArg;
args[0] = myCube;
args[1] = L"myShapeKey";
args[2] = (LONG)siShapeAbsoluteReferenceMode;
app.ExecuteCommand( L"StoreShapeKey", args, outArg );
ShapeKey myShapeKey(outArg);
app.LogMessage(L"ShapeKey " + myShapeKey.GetFullName());
Public Member Functions |
|
| ShapeKey () | |
| ~ShapeKey () | |
| ShapeKey (const CRef &in_ref) | |
| ShapeKey (const ShapeKey &in_obj) | |
| bool | IsA (siClassID in_ClassID) const |
| siClassID | GetClassID () const |
| ShapeKey & | operator= (const ShapeKey &in_obj) |
| ShapeKey & | operator= (const CRef &in_ref) |
| CString | GetShapeGroupName () const |
| CStatus | PutShapeGroupName (const CString &in_shapeGroupName) |
| ShapeKey | ( | ) |
Default constructor.
| ~ShapeKey | ( | ) |
Default destructor.
| bool IsA | ( | siClassID | in_ClassID | ) | const [virtual] |
Returns true if a given class type is compatible with this API class.
| in_ClassID | class type. |
Reimplemented from ClusterProperty.
| siClassID GetClassID | ( | ) | const [virtual] |
Creates an object from another object. The newly created object is set to empty if the input object is not compatible.
| in_obj | constant class object. |
Creates an object from a reference object. The newly created object is set to empty if the input reference object is not compatible.
| in_ref | constant class object. |
Reimplemented from ClusterProperty.
| CString GetShapeGroupName | ( | ) | const |
Returns the name of the shape group to which the shape key object belongs. Shape groups are a way to semantically organize shape keys within a given cluster. This organization is visible within the shape manager view.
Sets the name of the shape group to which the shape key object belongs. Shape groups are a way to semantically organize shape keys within a given cluster. This organization is visible within the shape manager view.
| in_shapeGroupName | name of the shape group to which you want to associate the shape key. |