Developer Documentation
SkeletalAnimationPlugin Class Reference

The skeletal animation plugin is used to interact with the skeleton. More...

#include <Plugin-SkeletalAnimation/SkeletalAnimationPlugin.hh>

Inheritance diagram for SkeletalAnimationPlugin:
BaseInterface ToolboxInterface LoggingInterface LoadSaveInterface RPCInterface

Public Slots

void slotAllCleared ()
 clear all occurred More...
 
void slotObjectUpdated (int _id, const UpdateType &_type)
 Check activePose if a skeleton was updated. More...
 
void slotObjectSelectionChanged (int _id)
 Update ui when the object selection changes. More...
 
void fileOpened (int _id)
 Update ui when the object is loaded. More...
 
void addedEmptyObject (int _id)
 Update ui when the object is added. More...
 
void objectDeleted (int _id)
 Update ui when the object is deleted. More...
 

Signals

void updateView ()
 
void log (Logtype _type, QString _message)
 
void log (QString _message)
 
void addEmptyObject (DataType _type, int &_id)
 
void updatedObject (int _id, const UpdateType &_type)
 
void pluginExists (QString _pluginName, bool &_exists)
 
void functionExists (QString _pluginName, QString _functionName, bool &_exists)
 
void addToolbox (QString _name, QWidget *_widget, QIcon *_icon)
 
- Signals inherited from BaseInterface
virtual void updateView ()
 Update current view in Main Application. More...
 
virtual void setSlotDescription (QString _slotName, QString _slotDescription, QStringList _parameters, QStringList _descriptions)
 Set a description for a public slot. More...
 
virtual void setRenderer (unsigned int _viewer, QString _rendererName)
 Set a renderer for the given viewer. More...
 
- Signals inherited from ToolboxInterface
virtual void addToolbox (QString _name, QWidget *_widget)
 Add a toolbox widget to the gui with the given name. More...
 
- Signals inherited from LoggingInterface
virtual void log (Logtype _type, QString _message)=0
 
virtual void log (QString _message)=0
 
- Signals inherited from LoadSaveInterface
virtual void save (int _id, QString _filename)
 Save object to a file. More...
 
virtual void load (QString _filename, DataType _type, int &_id)
 Load object from file with a specific DataType. More...
 
- Signals inherited from RPCInterface
virtual void pluginExists (QString _pluginName, bool &_exists)
 

Skin management

AnimationToolboxWidgetpToolbox_
 A pointer to the toolbox widget. More...
 
QIcon * toolIcon_
 A pointer to the toolbox widget. More...
 
Blending::Method method_
 The current blending method for the skin. More...
 
bool bGuiUpdating_
 Used to drop a few messages while the gui is being updated. More...
 
QTimer animationTimer_
 Timer used to control animations. More...
 
QElapsedTimer animationTime_
 Time since the animation was started, used to meet the given fps. More...
 
int animationOffset_
 This frame was selected as the animation was started. More...
 
std::vector< int > activeSkeletons_
 A pointer to the toolbox widget. More...
 
void attachSkin (BaseObjectData *pSkin, BaseObjectData *pSkeleton)
 A pointer to the toolbox widget. More...
 
void detachSkin (BaseObjectData *pSkin, BaseObjectData *pSkeleton)
 A pointer to the toolbox widget. More...
 
void clearSkins (BaseObjectData *_pSkeleton)
 A pointer to the toolbox widget. More...
 

Scripting interface

Use these methods in the script editor.

int getNumberOfFrames ()
 Returns the number of frames in the currently active animation. More...
 
bool attachSkin (int skeletonId, int skinId)
 Returns the number of frames in the currently active animation. More...
 
bool detachSkin (int skeletonId, int skinId)
 Returns the number of frames in the currently active animation. More...
 
bool clearSkins (int skeletonId)
 Returns the number of frames in the currently active animation. More...
 
void setFrame (int _iFrame)
 Displays the given frame from the current animation and updates the view. More...
 
int getFrame ()
 Gets the current frame number. More...
 
void changeFPS (int _fps)
 Change the frames per second (FPS) More...
 
void playAnimation ()
 Called by the ui and starts an automatic animation. More...
 
void pauseAnimation ()
 Called by the ui and stops the current animation. More...
 
void stopAnimation ()
 Called by the ui and stops the current animation. More...
 
void nextFrame ()
 Called by the ui and goes to next frame of the current animation. More...
 
void prevFrame ()
 Called by the ui and goes to previous frame of the current animation. More...
 
void updateSkins ()
 Returns the number of frames in the currently active animation. More...
 
void UpdateUI ()
 Called when the active object changes and the interface needs to be updated. More...
 
void setComboBoxPosition (unsigned int _animationIndex)
 Sets the animations combo box to the right entry. More...
 
void checkObjectSelection (const int _objectId)
 Check source/target selection of objects. More...
 
void slotAnimationNameChanged ()
 Returns the number of frames in the currently active animation. More...
 
void setDescriptions ()
 Returns the number of frames in the currently active animation. More...
 
void initializePlugin ()
 initialize the plugin More...
 
void pluginsInitialized ()
 final initializations More...
 
void exit ()
 Plugin gets closed. More...
 
void slotAttachSkin ()
 Called by Qt as the user is trying to connect a mesh to a skeleton. More...
 
void slotClearSkins ()
 Called by Qt as the user is trying to unbind a mesh from as a skeleton. More...
 
void slotMethodChanged (int _index)
 Called as the skin deformation method changed. More...
 
void slotAnimationIndexChanged (int)
 Called by the framework when the animation index changed. More...
 
void slotFrameChanged (int)
 Called by the framework when a different frame was selected. More...
 
void slotSkipFramesChanged (int _state)
 Called as the skip frames check box changes state. More...
 
void slotAddAnimation ()
 Returns the number of frames in the currently active animation. More...
 
void slotDeleteAnimation ()
 Returns the number of frames in the currently active animation. More...
 
void animate ()
 Iterates the animation. More...
 
 SkeletalAnimationPlugin ()
 Constructor. More...
 
 ~SkeletalAnimationPlugin ()
 Returns the number of frames in the currently active animation. More...
 
QString name ()
 returns the plugin name More...
 
QString description ()
 returns a plugin description More...
 
AnimationHandle currentAnimationHandle ()
 Returns a handle describing the current frame in the active animation. More...
 
void UpdateSkins (BaseObjectData *_pSkeletonObject, AnimationHandle &_hAni)
 Changes the mesh's pose to represent the frame given by the animation handle. More...
 

Additional Inherited Members

- Private Slots inherited from BaseInterface
virtual void exit ()
 
virtual QString version ()
 Return a version string for your plugin. More...
 
- Private Member Functions inherited from BaseInterface
virtual void noguiSupported ()
 
virtual ~BaseInterface ()
 Destructor. More...
 
virtual void blockScenegraphUpdates (bool _block)
 Tell the core to prevent scenegraph updates. More...
 
virtual void updatedObject (int _objectId)
 An object has been changed or added by this plugin. More...
 
virtual void updatedObject (int _identifier, const UpdateType &_type)
 An object has been changed or added by this plugin. More...
 
virtual void nodeVisibilityChanged (int _identifier)
 A scenegraph node has been shown or hidden. More...
 
virtual void getCurrentRenderer (unsigned int _viewer, QString &_rendererName)
 Get the current renderer for the given viewer. More...
 
- Private Member Functions inherited from ToolboxInterface
virtual ~ToolboxInterface ()
 Destructor. More...
 
virtual void addToolbox (QString _name, QWidget *_widget, QIcon *_icon)
 Add a toolbox widget to the gui with the given name and an icon. More...
 
virtual void addToolbox (QString _name, QWidget *_widget, QIcon *_icon, QWidget *_headerAreaWidget)
 Add a toolbox widget to the gui with the given name, icon and header area widget. More...
 
- Private Member Functions inherited from LoggingInterface
virtual ~LoggingInterface ()
 Destructor. More...
 
- Private Member Functions inherited from LoadSaveInterface
virtual ~LoadSaveInterface ()
 Destructor. More...
 
virtual void addEmptyObject (DataType _type, int &_id)
 
virtual void copyObject (int _oldId, int &_newId)
 
virtual void emptyObjectAdded (int _id)
 DEPRECATED HERE (Moved to Type Interface)! Emit this signal if an empty object has been created. More...
 
virtual void deleteObject (int _id)
 Delete an object
This signal can be called from any thread.
. More...
 
virtual void deleteAllObjects ()
 Delete all Objects. More...
 
virtual void getAllFileFilters (QStringList &_filters)
 Get all file filters that are registered. More...
 
- Private Member Functions inherited from RPCInterface
virtual ~RPCInterface ()
 Destructor. More...
 
virtual void functionExists (QString _pluginName, QString _functionName, bool &_exists)
 

Detailed Description

The skeletal animation plugin is used to interact with the skeleton.

this plugin controls the playback of skeletal animations

Definition at line 64 of file SkeletalAnimationPlugin.hh.

Constructor & Destructor Documentation

◆ SkeletalAnimationPlugin()

SkeletalAnimationPlugin::SkeletalAnimationPlugin ( )

Constructor.

Definition at line 62 of file SkeletalAnimationPlugin.cc.

◆ ~SkeletalAnimationPlugin()

SkeletalAnimationPlugin::~SkeletalAnimationPlugin ( )

Returns the number of frames in the currently active animation.

Definition at line 70 of file SkeletalAnimationPlugin.cc.

Member Function Documentation

◆ addedEmptyObject

void SkeletalAnimationPlugin::addedEmptyObject ( int  _id)
slot

Update ui when the object is added.

Definition at line 194 of file SkeletalAnimationPlugin.cc.

◆ animate

void SkeletalAnimationPlugin::animate ( void  )
privateslot

Iterates the animation.

If frame skipping is disabled, the next frame will be drawn. Otherwise, the next frame is determined by the time that passed since the last call.

Definition at line 596 of file SkeletalAnimationPlugin.cc.

◆ attachSkin() [1/2]

void SkeletalAnimationPlugin::attachSkin ( BaseObjectData pSkin,
BaseObjectData pSkeleton 
)
private

A pointer to the toolbox widget.

Definition at line 799 of file SkeletalAnimationPlugin.cc.

◆ attachSkin [2/2]

bool SkeletalAnimationPlugin::attachSkin ( int  skeletonId,
int  skinId 
)
slot

Returns the number of frames in the currently active animation.

Definition at line 63 of file SkeletalAnimationScripting.cc.

◆ changeFPS

void SkeletalAnimationPlugin::changeFPS ( int  _fps)
slot

Change the frames per second (FPS)

Definition at line 361 of file SkeletalAnimationPlugin.cc.

◆ checkObjectSelection

void SkeletalAnimationPlugin::checkObjectSelection ( const int  _objectId)
slot

Check source/target selection of objects.

Definition at line 239 of file SkeletalAnimationPlugin.cc.

◆ clearSkins() [1/2]

void SkeletalAnimationPlugin::clearSkins ( BaseObjectData _pSkeleton)
private

A pointer to the toolbox widget.

Definition at line 880 of file SkeletalAnimationPlugin.cc.

◆ clearSkins [2/2]

bool SkeletalAnimationPlugin::clearSkins ( int  skeletonId)
slot

Returns the number of frames in the currently active animation.

Definition at line 100 of file SkeletalAnimationScripting.cc.

◆ currentAnimationHandle()

AnimationHandle SkeletalAnimationPlugin::currentAnimationHandle ( )
protected

Returns a handle describing the current frame in the active animation.

This information is derived from the corresponding combo box and slider.

Definition at line 1043 of file SkeletalAnimationPlugin.cc.

◆ description()

QString SkeletalAnimationPlugin::description ( )
virtual

returns a plugin description

Implements BaseInterface.

Definition at line 90 of file SkeletalAnimationPlugin.cc.

◆ detachSkin() [1/2]

void SkeletalAnimationPlugin::detachSkin ( BaseObjectData pSkin,
BaseObjectData pSkeleton 
)
private

A pointer to the toolbox widget.

Definition at line 906 of file SkeletalAnimationPlugin.cc.

◆ detachSkin [2/2]

bool SkeletalAnimationPlugin::detachSkin ( int  skeletonId,
int  skinId 
)
slot

Returns the number of frames in the currently active animation.

Definition at line 81 of file SkeletalAnimationScripting.cc.

◆ exit

void SkeletalAnimationPlugin::exit ( )
privateslot

Plugin gets closed.

Definition at line 154 of file SkeletalAnimationPlugin.cc.

◆ fileOpened

void SkeletalAnimationPlugin::fileOpened ( int  _id)
slot

Update ui when the object is loaded.

Definition at line 185 of file SkeletalAnimationPlugin.cc.

◆ getFrame

int SkeletalAnimationPlugin::getFrame ( )
slot

Gets the current frame number.

Definition at line 352 of file SkeletalAnimationPlugin.cc.

◆ getNumberOfFrames

int SkeletalAnimationPlugin::getNumberOfFrames ( )
slot

Returns the number of frames in the currently active animation.

Definition at line 315 of file SkeletalAnimationPlugin.cc.

◆ initializePlugin

void SkeletalAnimationPlugin::initializePlugin ( )
privateslot

initialize the plugin

Definition at line 100 of file SkeletalAnimationPlugin.cc.

◆ name()

QString SkeletalAnimationPlugin::name ( void  )
virtual

returns the plugin name

Implements BaseInterface.

Definition at line 80 of file SkeletalAnimationPlugin.cc.

◆ nextFrame

void SkeletalAnimationPlugin::nextFrame ( )
slot

Called by the ui and goes to next frame of the current animation.

Definition at line 583 of file SkeletalAnimationPlugin.cc.

◆ objectDeleted

void SkeletalAnimationPlugin::objectDeleted ( int  _id)
slot

Update ui when the object is deleted.

Definition at line 204 of file SkeletalAnimationPlugin.cc.

◆ pauseAnimation

void SkeletalAnimationPlugin::pauseAnimation ( )
slot

Called by the ui and stops the current animation.

Definition at line 551 of file SkeletalAnimationPlugin.cc.

◆ playAnimation

void SkeletalAnimationPlugin::playAnimation ( )
slot

Called by the ui and starts an automatic animation.

Definition at line 532 of file SkeletalAnimationPlugin.cc.

◆ pluginsInitialized

void SkeletalAnimationPlugin::pluginsInitialized ( )
privateslot

final initializations

Definition at line 144 of file SkeletalAnimationPlugin.cc.

◆ prevFrame

void SkeletalAnimationPlugin::prevFrame ( )
slot

Called by the ui and goes to previous frame of the current animation.

Definition at line 573 of file SkeletalAnimationPlugin.cc.

◆ setComboBoxPosition

void SkeletalAnimationPlugin::setComboBoxPosition ( unsigned int  _animationIndex)
slot

Sets the animations combo box to the right entry.

Definition at line 1061 of file SkeletalAnimationPlugin.cc.

◆ setDescriptions

void SkeletalAnimationPlugin::setDescriptions ( )
privateslot

Returns the number of frames in the currently active animation.

Definition at line 49 of file SkeletalAnimationScripting.cc.

◆ setFrame

void SkeletalAnimationPlugin::setFrame ( int  _iFrame)
slot

Displays the given frame from the current animation and updates the view.

Definition at line 342 of file SkeletalAnimationPlugin.cc.

◆ slotAddAnimation

void SkeletalAnimationPlugin::slotAddAnimation ( )
privateslot

Returns the number of frames in the currently active animation.

Definition at line 949 of file SkeletalAnimationPlugin.cc.

◆ slotAllCleared

void SkeletalAnimationPlugin::slotAllCleared ( )
slot

clear all occurred

Definition at line 163 of file SkeletalAnimationPlugin.cc.

◆ slotAnimationIndexChanged

void SkeletalAnimationPlugin::slotAnimationIndexChanged ( int  )
privateslot

Called by the framework when the animation index changed.

Definition at line 449 of file SkeletalAnimationPlugin.cc.

◆ slotAnimationNameChanged

void SkeletalAnimationPlugin::slotAnimationNameChanged ( )
slot

Returns the number of frames in the currently active animation.

Definition at line 272 of file SkeletalAnimationPlugin.cc.

◆ slotAttachSkin

void SkeletalAnimationPlugin::slotAttachSkin ( )
privateslot

Called by Qt as the user is trying to connect a mesh to a skeleton.

Definition at line 775 of file SkeletalAnimationPlugin.cc.

◆ slotClearSkins

void SkeletalAnimationPlugin::slotClearSkins ( )
privateslot

Called by Qt as the user is trying to unbind a mesh from as a skeleton.

Definition at line 872 of file SkeletalAnimationPlugin.cc.

◆ slotDeleteAnimation

void SkeletalAnimationPlugin::slotDeleteAnimation ( )
privateslot

Returns the number of frames in the currently active animation.

Definition at line 1013 of file SkeletalAnimationPlugin.cc.

◆ slotFrameChanged

void SkeletalAnimationPlugin::slotFrameChanged ( int  )
privateslot

Called by the framework when a different frame was selected.

Definition at line 501 of file SkeletalAnimationPlugin.cc.

◆ slotMethodChanged

void SkeletalAnimationPlugin::slotMethodChanged ( int  _index)
privateslot

Called as the skin deformation method changed.

The spherical skin blending appears to be buggy, so it is recommended not to use it.

Definition at line 643 of file SkeletalAnimationPlugin.cc.

◆ slotObjectSelectionChanged

void SkeletalAnimationPlugin::slotObjectSelectionChanged ( int  _id)
slot

Update ui when the object selection changes.

Definition at line 175 of file SkeletalAnimationPlugin.cc.

◆ slotObjectUpdated

void SkeletalAnimationPlugin::slotObjectUpdated ( int  _id,
const UpdateType _type 
)
slot

Check activePose if a skeleton was updated.

Definition at line 413 of file SkeletalAnimationPlugin.cc.

◆ slotSkipFramesChanged

void SkeletalAnimationPlugin::slotSkipFramesChanged ( int  _state)
privateslot

Called as the skip frames check box changes state.

To prevent the animation playback from jumping, the animation timer is restarted here.

Definition at line 624 of file SkeletalAnimationPlugin.cc.

◆ stopAnimation

void SkeletalAnimationPlugin::stopAnimation ( )
slot

Called by the ui and stops the current animation.

Definition at line 563 of file SkeletalAnimationPlugin.cc.

◆ updateSkins

void SkeletalAnimationPlugin::updateSkins ( )
slot

Returns the number of frames in the currently active animation.

Definition at line 112 of file SkeletalAnimationScripting.cc.

◆ UpdateSkins()

void SkeletalAnimationPlugin::UpdateSkins ( BaseObjectData _skeletonObject,
AnimationHandle _hAni 
)
protected

Changes the mesh's pose to represent the frame given by the animation handle.

Parameters
_skeletonObjectThe object holding the skeleton, it is holding the pointer to the skin object
_hAniA handle of the new animation/pose

Definition at line 377 of file SkeletalAnimationPlugin.cc.

◆ UpdateUI

void SkeletalAnimationPlugin::UpdateUI ( )
slot

Called when the active object changes and the interface needs to be updated.

Definition at line 694 of file SkeletalAnimationPlugin.cc.

Member Data Documentation

◆ activeSkeletons_

std::vector< int > SkeletalAnimationPlugin::activeSkeletons_
private

A pointer to the toolbox widget.

Definition at line 185 of file SkeletalAnimationPlugin.hh.

◆ animationOffset_

int SkeletalAnimationPlugin::animationOffset_
private

This frame was selected as the animation was started.

Definition at line 183 of file SkeletalAnimationPlugin.hh.

◆ animationTime_

QElapsedTimer SkeletalAnimationPlugin::animationTime_
private

Time since the animation was started, used to meet the given fps.

Definition at line 182 of file SkeletalAnimationPlugin.hh.

◆ animationTimer_

QTimer SkeletalAnimationPlugin::animationTimer_
private

Timer used to control animations.

Definition at line 181 of file SkeletalAnimationPlugin.hh.

◆ bGuiUpdating_

bool SkeletalAnimationPlugin::bGuiUpdating_
private

Used to drop a few messages while the gui is being updated.

Definition at line 180 of file SkeletalAnimationPlugin.hh.

◆ method_

Blending::Method SkeletalAnimationPlugin::method_
private

The current blending method for the skin.

Definition at line 178 of file SkeletalAnimationPlugin.hh.

◆ pToolbox_

AnimationToolboxWidget* SkeletalAnimationPlugin::pToolbox_
protected

A pointer to the toolbox widget.

Definition at line 174 of file SkeletalAnimationPlugin.hh.

◆ toolIcon_

QIcon* SkeletalAnimationPlugin::toolIcon_
protected

A pointer to the toolbox widget.

Definition at line 175 of file SkeletalAnimationPlugin.hh.


The documentation for this class was generated from the following files: