diff --git a/CMakeLists.txt b/CMakeLists.txt index ea6efcc58e3b865d6c0398d25b5309b48e388656..c94c059617bfc6b4a4ade85df30de818d0ab02db 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,2 +1,7 @@ include (plugin) + +if (EXISTS ${CMAKE_SOURCE_DIR}/ObjectTypes/BSplineCurve) + add_definitions (-DENABLE_SKELETON_SUPPORT) +endif() + openflipper_plugin (INSTALLDATA Icons) diff --git a/PropertyNameListModel.cc b/PropertyNameListModel.cc index e4323e7b1a22ac3c816cb61fbd8faab892d3a63b..02f41a5615f3b008735d0d2aa480a0022864679a 100644 --- a/PropertyNameListModel.cc +++ b/PropertyNameListModel.cc @@ -52,7 +52,6 @@ #include #include -#include #include #include @@ -69,8 +68,12 @@ const PropertyNameListModel::TypeInfoWrapper PropertyNameListModel::proptype_Vec PropertyNameListModel::TypeInfoWrapper(typeid(OpenMesh::PropertyT), "Vec3d"); const PropertyNameListModel::TypeInfoWrapper PropertyNameListModel::proptype_Vec3f = PropertyNameListModel::TypeInfoWrapper(typeid(OpenMesh::PropertyT), "Vec3f"); -const PropertyNameListModel::TypeInfoWrapper PropertyNameListModel::proptype_SkinWeights = + +#ifdef ENABLE_SKELETON_SUPPORT + #include + const PropertyNameListModel::TypeInfoWrapper PropertyNameListModel::proptype_SkinWeights = PropertyNameListModel::TypeInfoWrapper(typeid(OpenMesh::PropertyT), "SkinWeights"); +#endif /* * I'd love to do this with boost::assign but I'm not allowed to. :-( @@ -83,7 +86,9 @@ const PropertyNameListModel::TypeInfoWrapper PropertyNameListModel::prop_types[] proptype_double, proptype_Vec3d, proptype_Vec3f, +#ifdef ENABLE_SKELETON_SUPPORT proptype_SkinWeights, +#endif }; const PropertyNameListModel::TYPE_INFO_SET PropertyNameListModel::sane_prop_types(prop_types, prop_types + 7); diff --git a/PropertyVisPlugin.cc b/PropertyVisPlugin.cc index b1389cdebeac98d8f21e95c8f6c1159afa4db65a..d1e2e81f32355c8828731dac8e843aec61206e94 100644 --- a/PropertyVisPlugin.cc +++ b/PropertyVisPlugin.cc @@ -219,8 +219,10 @@ void PropertyVisPlugin::propertySelectionChanged() { visibleMask |= T_UINT; } else if (currentProp.typeinfo() == PropertyNameListModel::proptype_bool) { visibleMask |= T_BOOL; +#ifdef ENABLE_SKELETON_SUPPORT } else if (currentProp.typeinfo() == PropertyNameListModel::proptype_SkinWeights) { visibleMask |= T_SKIN_WEIGHTS; +#endif } } @@ -236,7 +238,9 @@ void PropertyVisPlugin::propertySelectionChanged() { tool_->paramUint->setVisible(visibleMask & T_UINT); tool_->paramInt->setVisible(visibleMask & T_INT); tool_->paramBool->setVisible(visibleMask & T_BOOL); +#ifdef ENABLE_SKELETON_SUPPORT tool_->paramSkinWeights->setVisible(visibleMask & T_SKIN_WEIGHTS); +#endif tool_->vectors_edges_rb->setVisible(visibleMask & T_VECTOR_EDGES); if (tool_->vectors_edges_rb->isChecked() && (visibleMask & T_VECTOR_EDGES) == 0) tool_->vectors_strokes_rb->setChecked(true); @@ -292,9 +296,11 @@ void PropertyVisPlugin::visualizeProperty(MeshT *mesh, const PropertyNameListMod //BOOL else if (currentProp.typeinfo() == PropertyNameListModel::proptype_bool) visualizeBool(mesh, currentProp); +#ifdef ENABLE_SKELETON_SUPPORT //SKIN WEIGHTS else if (currentProp.typeinfo() == PropertyNameListModel::proptype_SkinWeights) visualizeSkinWeights(mesh, tool_->boneId->value(), currentProp); +#endif } @@ -2006,8 +2012,10 @@ void PropertyVisPlugin::duplicateProperty(MeshT *mesh, const PropertyNameListMod duplicateProperty_stage1(*mesh, currentProp); else if (currentProp.typeinfo() == PropertyNameListModel::proptype_bool) duplicateProperty_stage1(*mesh, currentProp); +#ifdef ENABLE_SKELETON_SUPPORT else if (currentProp.typeinfo() == PropertyNameListModel::proptype_SkinWeights) duplicateProperty_stage1(*mesh, currentProp); +#endif } template @@ -2023,8 +2031,10 @@ void PropertyVisPlugin::removeProperty(MeshT *mesh, const PropertyNameListModel: removeProperty_stage1(*mesh, currentProp); else if (currentProp.typeinfo() == PropertyNameListModel::proptype_bool) removeProperty_stage1(*mesh, currentProp); +#ifdef ENABLE_SKELETON_SUPPORT else if (currentProp.typeinfo() == PropertyNameListModel::proptype_SkinWeights) removeProperty_stage1(*mesh, currentProp); +#endif } Q_EXPORT_PLUGIN2( propertyvisplugin , PropertyVisPlugin ); diff --git a/PropertyVisPlugin.hh b/PropertyVisPlugin.hh index 5a960f3f002920d745c9b92c48afe0d0ef168c76..41fba1541c7e6eca352052e67ad823feacc0ce52 100644 --- a/PropertyVisPlugin.hh +++ b/PropertyVisPlugin.hh @@ -74,7 +74,10 @@ #include #include -#include + +#ifdef ENABLE_SKELETON_SUPPORT + #include +#endif #include "PropertyVisToolbar.hh" #include "PropertyNameListModel.hh" diff --git a/PropertyVisPluginT.cc b/PropertyVisPluginT.cc index edd9361345dd85831c1022da7e42b5a6081fbff0..7468a796d08473e4a138ae4c99dacc16fd0ea440 100644 --- a/PropertyVisPluginT.cc +++ b/PropertyVisPluginT.cc @@ -811,6 +811,7 @@ void PropertyVisPlugin::visualizeInteger( MeshT* _mesh, const PropertyNameList //------------------------------------------------------------------------------ +#ifdef ENABLE_SKELETON_SUPPORT template< class MeshT > void PropertyVisPlugin::visualizeSkinWeights( MeshT* _mesh, int _boneId, const PropertyNameListModel::PROP_INFO ¤tProp) { @@ -847,6 +848,7 @@ void PropertyVisPlugin::visualizeSkinWeights( MeshT* _mesh, int _boneId, const PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::SOLID_POINTS_COLORED); } +#endif //------------------------------------------------------------------------------ @@ -1747,7 +1749,8 @@ void PropertyVisPlugin::getPropertyValue( MeshT* _mesh , int _id, unsigned int _ } } - + +#ifdef ENABLE_SKELETON_SUPPORT //================================================================== //Skin Weights //================================================================== @@ -1781,6 +1784,7 @@ void PropertyVisPlugin::getPropertyValue( MeshT* _mesh , int _id, unsigned int _ } } +#endif } }