Commit c4a2740a authored by Dirk Wilden's avatar Dirk Wilden
Browse files

removed skeleton stuff

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@10510 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 79fec49a
......@@ -8,8 +8,4 @@ if (EXISTS ${CMAKE_SOURCE_DIR}/ObjectTypes/TSplineMesh)
add_definitions (-DENABLE_TSPLINEMESH_SUPPORT)
endif ()
if (EXISTS ${CMAKE_SOURCE_DIR}/ObjectTypes/Skeleton)
add_definitions (-DENABLE_SKELETON_SUPPORT)
endif ()
openflipper_plugin ( TSplineMesh TRANSLATION_LANGUAGES de_DE INSTALLDATA Icons )
......@@ -75,10 +75,7 @@ MovePlugin::MovePlugin() :
manMode_(QtTranslationManipulatorNode::TranslationRotation),
contextAction_(0),
toAllTargets_(0),
placeMode_(false),
recursiveJointTransformation_(true),
transformRefPose_(false),
transformCurrentPose_(false)
placeMode_(false)
{
manip_size_ = 1.0;
manip_size_modifier_ = 1.0;
......@@ -131,11 +128,6 @@ void MovePlugin::pluginsInitialized() {
emit setPickModeMouseTracking ("Move", true);
emit addHiddenPickMode("MoveSelection");
emit setPickModeMouseTracking ("MoveSelection", true);
#ifdef ENABLE_SKELETON_SUPPORT
emit addHiddenPickMode("MoveSkeleton");
emit setPickModeMouseTracking ("MoveSkeleton", true);
#endif
//KEYS
emit registerKey (Qt::Key_Shift, Qt::ShiftModifier, tr("Manipulator rotation"), true);
......@@ -186,15 +178,6 @@ void MovePlugin::pluginsInitialized() {
moveSelectionAction_->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"move-selections.png") );
moveSelectionAction_->setCheckable(true);
toolbar_->addAction(moveSelectionAction_);
#ifdef ENABLE_SKELETON_SUPPORT
moveSkeletonAction_ = new QAction(tr("<B>Move Skeleton</B><br>Move joints of a skeleton"), toolBarActions_);
moveSkeletonAction_->setStatusTip(tr("Move joints of a skeleton."));
moveSkeletonAction_->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"move-skeleton.png") );
moveSkeletonAction_->setCheckable(true);
toolbar_->addAction(moveSkeletonAction_);
#endif
connect(toolBarActions_, SIGNAL(triggered(QAction*)), this, SLOT(slotSetMoveMode(QAction*)) );
......@@ -257,43 +240,11 @@ void MovePlugin::pluginsInitialized() {
biggerManipAction_->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"move-manipbig.png") );
biggerManipAction_->setCheckable(false);
pickToolbar_->addAction(biggerManipAction_);
#ifdef ENABLE_SKELETON_SUPPORT
pickToolbar_->addSeparator();
fixChildManipAction_ = new QAction(tr("Keep child joints fixed"), pickToolBarActions_);
fixChildManipAction_->setStatusTip(tr("Do not apply transformations to all child joints"));
fixChildManipAction_->setToolTip(tr("Do not apply transformations to all child joints"));
fixChildManipAction_->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"move-manipfix.png") );
fixChildManipAction_->setCheckable(true);
fixChildManipAction_->setChecked(recursiveJointTransformation_);
pickToolbar_->addAction(fixChildManipAction_);
transformRefPoseManipAction_ = new QAction(tr("Apply to Reference Pose"), pickToolBarActions_);
transformRefPoseManipAction_->setStatusTip(tr("Apply the transformation to the reference pose"));
transformRefPoseManipAction_->setToolTip(tr("Apply the transformation to the reference pose"));
transformRefPoseManipAction_->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"move-manipRefPose.png") );
transformRefPoseManipAction_->setCheckable(true);
transformRefPoseManipAction_->setChecked(transformRefPose_);
pickToolbar_->addAction(transformRefPoseManipAction_);
currentPoseManipAction_ = new QAction(tr("Transform only current pose"), pickToolBarActions_);
currentPoseManipAction_->setStatusTip(tr("Apply the transformation only to the current pose"));
currentPoseManipAction_->setToolTip(tr("Apply the transformation only to the current pose"));
currentPoseManipAction_->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"move-manipCurrentPose.png") );
currentPoseManipAction_->setCheckable(true);
currentPoseManipAction_->setChecked(transformCurrentPose_);
pickToolbar_->addAction(currentPoseManipAction_);
#endif
connect(pickToolBarActions_, SIGNAL(triggered(QAction*)), this, SLOT(slotPickToolbarAction(QAction*)) );
emit setPickModeToolbar ("Move", pickToolbar_);
emit setPickModeToolbar ("MoveSelection", pickToolbar_);
#ifdef ENABLE_SKELETON_SUPPORT
emit setPickModeToolbar ("MoveSkeleton", pickToolbar_);
#endif
}
......@@ -333,8 +284,7 @@ void MovePlugin::slotMouseWheelEvent(QWheelEvent * _event, const std::string & /
{
// Skip execution if this is not our pick mode
if( ( (PluginFunctions::pickMode() != "Move")
&& (PluginFunctions::pickMode() != "MoveSelection")
&& (PluginFunctions::pickMode() != "MoveSkeleton") )
&& (PluginFunctions::pickMode() != "MoveSelection") )
|| PluginFunctions::actionMode() != Viewer::PickingMode)
return;
......@@ -358,15 +308,13 @@ void MovePlugin::slotMouseWheelEvent(QWheelEvent * _event, const std::string & /
*/
void MovePlugin::slotMouseEvent(QMouseEvent* _event) {
if (((PluginFunctions::pickMode() == ("Move"))
|| (PluginFunctions::pickMode() == ("MoveSelection"))
|| (PluginFunctions::pickMode() == ("MoveSkeleton")))
|| (PluginFunctions::pickMode() == ("MoveSelection")))
&& PluginFunctions::actionMode() == Viewer::PickingMode) {
if (_event->type() == QEvent::MouseButtonDblClick || (_event->type() == QEvent::MouseButtonPress
&& _event->button() == Qt::LeftButton && (placeAction_->isChecked() || placeMode_))) {
bool snap = (placeMode_ && (PluginFunctions::pickMode() == ("MoveSelection")))
|| (PluginFunctions::pickMode() == ("MoveSkeleton"));
bool snap = (placeMode_ && (PluginFunctions::pickMode() == ("MoveSelection")));
placeManip(_event, snap);
placeAction_->setChecked(false);
......@@ -396,8 +344,6 @@ void MovePlugin::slotMouseEvent(QMouseEvent* _event) {
* is active. Snap to nearest geometry element (vertex, line, face center)
* depending on which selection type is active.
*
* For skeletons always snap to nearest joint
*
*/
placeManip(_event, (PluginFunctions::pickMode() != ("Move")));
......@@ -449,14 +395,7 @@ void MovePlugin::slotPickModeChanged( const std::string& _mode)
moveAction_->setChecked(_mode == "Move");
moveSelectionAction_->setChecked(_mode == "MoveSelection");
#ifdef ENABLE_SKELETON_SUPPORT
moveSkeletonAction_->setChecked(_mode == "MoveSkeleton");
fixChildManipAction_->setVisible(_mode == "MoveSkeleton");
transformRefPoseManipAction_->setVisible(_mode == "MoveSkeleton");
currentPoseManipAction_->setVisible(_mode == "MoveSkeleton");
#endif
hide_ = !(_mode == "Move" || _mode == "MoveSelection" || _mode == "MoveSkeleton");
hide_ = !(_mode == "Move" || _mode == "MoveSelection");
showManipulators();
......@@ -508,10 +447,6 @@ void MovePlugin::moveObject(ACG::Matrix4x4d mat, int _id) {
#ifdef ENABLE_POLYLINE_SUPPORT
} else if ( object->dataType() == DATA_POLY_LINE ) {
transformPolyLine(mat , *PluginFunctions::polyLine(object) );
#endif
#ifdef ENABLE_SKELETON_SUPPORT
} else if ( object->dataType() == DATA_SKELETON ) {
transformSkeleton(mat , PluginFunctions::skeletonObject(object) );
#endif
} else if ( object->dataType() == DATA_PLANE ) {
PluginFunctions::planeNode(object)->transform(mat);
......@@ -552,22 +487,6 @@ void MovePlugin::moveSelection(ACG::Matrix4x4d mat, int _id) {
//------------------------------------------------------------------------------
#ifdef ENABLE_SKELETON_SUPPORT
/** \brief Move joint of a skeleton with given transformation matrix
*
* @param mat the transformation matrix
* @param _id id of the skeleton
*/
void MovePlugin::moveSkeletonJoint(ACG::Matrix4x4d mat, int _id) {
transformSkeletonJoint( _id , mat );
// emit createBackup(_id,"MoveSkeleton");
}
#endif
//------------------------------------------------------------------------------
/** \brief Set the manipulator manipulation mode
*
* @param _mode Mode
......@@ -578,8 +497,7 @@ void MovePlugin::setManipMode (QtTranslationManipulatorNode::ManipulatorMode _mo
if (_mode != manMode_)
{
manMode_ = _mode;
if ((PluginFunctions::pickMode() == "Move" ) || (PluginFunctions::pickMode() == "MoveSelection" )
|| (PluginFunctions::pickMode() == "MoveSkeleton" )) {
if ((PluginFunctions::pickMode() == "Move" ) || (PluginFunctions::pickMode() == "MoveSelection" )) {
for ( PluginFunctions::ObjectIterator o_it(PluginFunctions::ALL_OBJECTS) ;
o_it != PluginFunctions::objectsEnd(); ++o_it)
if ( o_it->manipPlaced() )
......@@ -666,13 +584,12 @@ void MovePlugin::manipulatorMoved( QtTranslationManipulatorNode* _node , QMouseE
// React on event only in move mode
if ( PluginFunctions::pickMode() != "Move"
&& PluginFunctions::pickMode() != "MoveSelection"
&& PluginFunctions::pickMode() != "MoveSkeleton" )
&& PluginFunctions::pickMode() != "MoveSelection" )
return;
OpenFlipper::Options::redrawDisabled( true );
// Apply changes only on Release for moveMode and after every movement in MoveSelection/MoveSkeleton Mode
// Apply changes only on Release for moveMode and after every movement in MoveSelection Mode
if ( ((_event->type() == QEvent::MouseButtonRelease) || (PluginFunctions::pickMode() != "Move")) && !placeMode_) {
int objectId = _node->getIdentifier();
......@@ -690,36 +607,18 @@ void MovePlugin::manipulatorMoved( QtTranslationManipulatorNode* _node , QMouseE
moveObject( mat, objectId );
else if (PluginFunctions::pickMode() == "MoveSelection")
moveSelection( mat, objectId );
#ifdef ENABLE_SKELETON_SUPPORT
else if (PluginFunctions::pickMode() == "MoveSkeleton"){
moveSkeletonJoint( mat, objectId );
if (_event->type() == QEvent::MouseButtonRelease)
emit updatedObject(objectId, UPDATE_GEOMETRY);
}
#endif
// move all other targets without manipulator
if(allTargets_) {
for (PluginFunctions::ObjectIterator o_it(PluginFunctions::TARGET_OBJECTS); o_it
!= PluginFunctions::objectsEnd(); ++o_it) {
if ((o_it->id() != objectId) && !o_it->manipulatorNode()->visible()) { // If it has its own manipulator active, dont move it
// move the object which corresponds to the manipulator
if (PluginFunctions::pickMode() == "Move")
moveObject( mat, o_it->id() );
else if (PluginFunctions::pickMode() == "MoveSelection")
moveSelection( mat, o_it->id() );
#ifdef ENABLE_SKELETON_SUPPORT
else if (PluginFunctions::pickMode() == "MoveSkeleton"){
moveSkeletonJoint( mat, o_it->id() );
if (_event->type() == QEvent::MouseButtonRelease)
emit updatedObject(objectId, UPDATE_GEOMETRY);
}
#endif
}
}
}
......@@ -784,37 +683,6 @@ void MovePlugin::placeManip(QMouseEvent * _event, bool _snap) {
* active.
*/
if (_snap) {
#ifdef ENABLE_SKELETON_SUPPORT
if ( PluginFunctions::pickMode() == "MoveSkeleton" ){
//disable picking for anything but skeletons
for ( PluginFunctions::ObjectIterator o_it(PluginFunctions::ALL_OBJECTS) ; o_it != PluginFunctions::objectsEnd(); ++o_it)
o_it->enablePicking( o_it->dataType(DATA_SKELETON) );
//perform picking
successfullyPicked = PluginFunctions::scenegraphPick(ACG::SceneGraph::PICK_ANYTHING, _event->pos(), node_idx,
target_idx, &hitPoint) && PluginFunctions::getPickedObject(node_idx, object);
//reenable picking for anything
for ( PluginFunctions::ObjectIterator o_it(PluginFunctions::ALL_OBJECTS) ; o_it != PluginFunctions::objectsEnd(); ++o_it)
o_it->enablePicking( true );
if ( successfullyPicked && object->dataType(DATA_SKELETON) ) {
hitPoint = getNearestJoint(PluginFunctions::skeletonObject(object), hitPoint, data);
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::WIREFRAME);
} else {
successfullyPicked = false;
}
} else
#endif
if (!successfullyPicked){
successfullyPicked = PluginFunctions::scenegraphPick(ACG::SceneGraph::PICK_FACE, _event->pos(), node_idx,
target_idx, &hitPoint) && PluginFunctions::getPickedObject(node_idx, object);
......@@ -855,7 +723,6 @@ void MovePlugin::placeManip(QMouseEvent * _event, bool _snap) {
#endif
}
}
}
} else {
successfullyPicked = PluginFunctions::scenegraphPick(ACG::SceneGraph::PICK_ANYTHING, _event->pos(), node_idx,
......@@ -923,8 +790,7 @@ void MovePlugin::showManipulators( )
{
if (!hide_ && (toolboxActive_ || (PluginFunctions::pickMode() == "Move")
|| (PluginFunctions::pickMode() == "MoveSelection")
|| (PluginFunctions::pickMode() == "MoveSkeleton"))) {
|| (PluginFunctions::pickMode() == "MoveSelection"))) {
for (uint i=0; i < activeManipulators_.size(); i++){
......@@ -933,12 +799,6 @@ void MovePlugin::showManipulators( )
PluginFunctions::getObject( activeManipulators_[i], obj );
if (obj != 0 && obj->manipPlaced()) {
#ifdef ENABLE_SKELETON_SUPPORT
if ( obj->dataType(DATA_SKELETON) )
moveManipulatorOnSkeleton(obj);
#endif
obj->manipulatorNode()->show();
obj->manipulatorNode()->apply_transformation( PluginFunctions::pickMode() == "Move" );
emit nodeVisibilityChanged(obj->id());
......@@ -1706,16 +1566,6 @@ void MovePlugin::slotSetMoveMode(QAction* _action) {
moveSelectionAction_->setChecked( true );
}
#ifdef ENABLE_SKELETON_SUPPORT
if (_action == moveSkeletonAction_){
PluginFunctions::actionMode(Viewer::PickingMode);
PluginFunctions::pickMode("MoveSkeleton");
moveSkeletonAction_->setChecked( true );
}
#endif
}
//------------------------------------------------------------------------------
......@@ -1763,23 +1613,6 @@ void MovePlugin::slotPickToolbarAction(QAction* _action)
o_it->manipulatorNode()->set_size(manip_size_ * manip_size_modifier_);
emit nodeVisibilityChanged (-1);
}
#ifdef ENABLE_SKELETON_SUPPORT
if (_action == fixChildManipAction_)
{
recursiveJointTransformation_ = fixChildManipAction_->isChecked();
}
if (_action == transformRefPoseManipAction_)
{
transformRefPose_ = transformRefPoseManipAction_->isChecked();
}
if (_action == currentPoseManipAction_)
{
transformCurrentPose_ = currentPoseManipAction_->isChecked();
}
#endif
}
......@@ -1873,54 +1706,6 @@ void MovePlugin::transformPolyLine( ACG::Matrix4x4d _mat , PolyLineT& _polyLine
//------------------------------------------------------------------------------
#ifdef ENABLE_SKELETON_SUPPORT
/** \brief Transform a skeleton with the given transformation matrix
*
* @param _mat transformation matrix
* @param _skeleton the skeleton
*/
void MovePlugin::transformSkeleton(ACG::Matrix4x4d _mat , SkeletonObject* _skeletonObj ) {
Skeleton* skeleton = PluginFunctions::skeleton(_skeletonObj);
Skeleton::Joint* root = skeleton->getRoot();
AnimationHandle handle = _skeletonObj->skeletonNode()->getActivePose();
if ( !handle.isValid() ){
//no current animation found -> transform the reference Pose
Skeleton::Pose* pose = skeleton->getReferencePose();
//the transformation only has to be applied to the root joint
//it is automatically passed down to the children
ACG::Matrix4x4d transform = pose->getGlobal(root->getID()) * _mat;
pose->setGlobal( root->getID(), transform, false);
} else {
Skeleton::Animation* animation = skeleton->getAnimation(handle);
//transform every Pose of the animation
for(unsigned long iFrame = 0; iFrame < animation->getFrameCount(); iFrame++){
Skeleton::Pose* pose = animation->getPose(iFrame);
//the transformation only has to be applied to the root joint
//it is automatically passed down to the children
ACG::Matrix4x4d transform = _mat * pose->getGlobal(root->getID());
pose->setGlobal( root->getID(), transform, false);
}
}
}
#endif
//------------------------------------------------------------------------------
/** \brief scale mesh to have a boundingboxdiagonal of one
*
* @param _mesh the mesh
......@@ -2191,70 +1976,6 @@ OpenMesh::Vec3d MovePlugin::getNearestFace(MeshType* _mesh, uint _fh, OpenMesh::
//--------------------------------------------------------------------------------
#ifdef ENABLE_SKELETON_SUPPORT
/**
* \brief Get nearest joint to hitPoint (used for snapping)
*/
OpenMesh::Vec3d MovePlugin::getNearestJoint(SkeletonObject* _skeletonObj, OpenMesh::Vec3d &_hitPoint, int& _bestJointID) {
ACG::Vec3d bestJoint;
double bestDistance = DBL_MAX;
_bestJointID = -1;
Skeleton* skeleton = PluginFunctions::skeleton(_skeletonObj);
AnimationHandle handle = _skeletonObj->skeletonNode()->getActivePose();
Skeleton::Pose* pose = 0;
if ( !handle.isValid() ){
//no current animation found -> transform the reference Pose
pose = skeleton->getReferencePose();
} else {
Skeleton::Animation* animation = skeleton->getAnimation(handle);
pose = animation->getPose( handle.getFrame() );
}
//find the nearest joint
for (unsigned long joint = 0; joint < skeleton->getJointCount(); joint++){
double dist = (_hitPoint - pose->getGlobalTranslation(joint)).sqrnorm();
if (dist < bestDistance){
bestJoint = pose->getGlobalTranslation(joint);
_bestJointID = joint;
bestDistance = dist;
}
}
return (OpenMesh::Vec3d) bestJoint;
}
/** \brief make sure the manipulator is positioned on a joint
*
*/
void MovePlugin::moveManipulatorOnSkeleton(BaseObjectData* _skeletonObj){
int bestJoint;
OpenMesh::Vec3d pos = _skeletonObj->manipulatorNode()->center();
OpenMesh::Vec3d newPos = getNearestJoint(PluginFunctions::skeletonObject(_skeletonObj), pos, bestJoint );
_skeletonObj->manipulatorNode()->set_center(newPos);
_skeletonObj->manipulatorNode()->setData( QVariant(bestJoint) );
}
#endif
//--------------------------------------------------------------------------------
void MovePlugin::slotAllCleared(){
activeManipulators_.clear();
}
......
......@@ -63,10 +63,6 @@
#include <ObjectTypes/Plane/Plane.hh>
#include <ObjectTypes/TriangleMesh/TriangleMesh.hh>
#ifdef ENABLE_SKELETON_SUPPORT
#include <ObjectTypes/Skeleton/Skeleton.hh>
#endif
#include "MoveToolbar.hh"
#include "MoveProps.hh"
#include "MoveObjectMarker.hh"
......@@ -234,10 +230,6 @@ class MovePlugin : public QObject, BaseInterface, MouseInterface, KeyInterface,
template <typename MeshType>
OpenMesh::Vec3d getNearestFace(MeshType* _mesh, uint _fh, OpenMesh::Vec3d& _hitPoint);
#ifdef ENABLE_SKELETON_SUPPORT
OpenMesh::Vec3d getNearestJoint(SkeletonObject* _skeletonObj, OpenMesh::Vec3d &_hitPoint, int& _bestJointID);
#endif
/// True if the toolbox widget is active
bool toolboxActive_;
......@@ -254,7 +246,6 @@ class MovePlugin : public QObject, BaseInterface, MouseInterface, KeyInterface,
private :
QAction* moveAction_;
QAction* moveSelectionAction_;
QAction* moveSkeletonAction_;
QActionGroup* toolBarActions_;
......@@ -326,10 +317,6 @@ class MovePlugin : public QObject, BaseInterface, MouseInterface, KeyInterface,
template< class PolyLineT >
void transformPolyLine( ACG::Matrix4x4d _mat , PolyLineT& _polyLine );
#endif
#ifdef ENABLE_SKELETON_SUPPORT
void transformSkeleton(ACG::Matrix4x4d _mat , SkeletonObject* _skeletonObj );
#endif
/** Get the Matrix of the last active Manipulator ( Identity if not found or hidden Manipulator )
*
......@@ -373,20 +360,10 @@ class MovePlugin : public QObject, BaseInterface, MouseInterface, KeyInterface,
/// Move selection on an object with given id
void moveSelection(ACG::Matrix4x4d mat, int _id);
#ifdef ENABLE_SKELETON_SUPPORT
/// Move joint of a skeleton
void moveSkeletonJoint(ACG::Matrix4x4d mat, int _id);
#endif
/// Object marker to dimm Objects during manipulator transformation
MoveObjectMarker objectMarker_;
#ifdef ENABLE_SKELETON_SUPPORT
/// make sure the manipulator is positioned on a joint
void moveManipulatorOnSkeleton(BaseObjectData* _skeletonObj);
#endif
private:
/// Holds the current manipulator mode
......@@ -490,11 +467,6 @@ public slots :
/// transform current selection of an Object by a given matrix
void transformEdgeSelection( int _objectId , Matrix4x4 _matrix );
#ifdef ENABLE_SKELETON_SUPPORT
/// transform selected joint with given matrix
void transformSkeletonJoint( int _objectId , Matrix4x4 _matrix );
#endif
/// Set the position of the manipulator
void setManipulatorPosition( int _objectId , Vector _position );
......@@ -523,11 +495,6 @@ public slots :
bool allTargets_;
bool placeMode_;
// skeleton
bool recursiveJointTransformation_;
bool transformRefPose_;
bool transformCurrentPose_;
};
#endif //MOVEPLUGIN_HH
......@@ -49,10 +49,6 @@
#ifdef ENABLE_TSPLINEMESH_SUPPORT
#include <ObjectTypes/TSplineMesh/TSplineMesh.hh>
#endif
#ifdef ENABLE_SKELETON_SUPPORT
#include <ObjectTypes/Skeleton/SkeletonTransform.hh>
#endif
#include <MeshTools/MeshFunctions.hh>
......@@ -812,115 +808,6 @@ void MovePlugin::transformEdgeSelection( int _objectId , Matrix4x4 _matrix ){
//------------------------------------------------------------------------------
#ifdef ENABLE_SKELETON_SUPPORT
/** \brief transform selected joints with given matrix
*
* when a manipulator is placed on a joint, the selection of the skeleton
* is cleared and only that joint is selected
* the selection is used here to find the joint to be deformed
*
* @param _objectId id of an object
* @param _matrix transformation matrix
*/
void MovePlugin::transformSkeletonJoint( int _objectId , Matrix4x4 _matrix ){
BaseObjectData* obj = 0;
PluginFunctions::getObject(_objectId, obj);
if (obj == 0){
emit log(LOGERR, tr("Unable to get object"));
return;
}
SkeletonObject* skeletonObj = PluginFunctions::skeletonObject(obj);
if (skeletonObj == 0){
emit log(LOGERR, tr("Unable to get skeletonObject"));
return;
}
Skeleton* skeleton = PluginFunctions::skeleton(obj);
if (skeleton == 0){
emit log(LOGERR, tr("Unable to get skeleton"));
return;
}
bool recursiveJointTransformation = recursiveJointTransformation_;
AnimationHandle handle = skeletonObj->skeletonNode()->getActivePose();
Skeleton::Pose* activePose;
if ( !handle.isValid() ){
activePose = skeleton->getReferencePose();
}else{
activePose = skeleton->getAnimation( handle.getAnimation() )->getPose( handle.getFrame() );
//always tranform children otherwise only the local coordsys is rotated
recursiveJointTransformation = false;
// translation changes the skeleton structure
// this is only allowed in refPose therefore delete translation
Matrix4x4 mat = _matrix;
mat(0,3) = 0.0;
mat(1,3) = 0.0;
mat(2,3) = 0.0;
if ( mat.is_identity() )
_matrix = mat;
}