void ModelKey::skinChanged(const std::string& value)
{
	// Check if we have a skinnable model
	SkinnedModelPtr skinned = boost::dynamic_pointer_cast<SkinnedModel>(_modelNode);

	if (skinned)
	{
		skinned->skinChanged(value);
	}
}
Beispiel #2
0
    bool pre(const scene::INodePtr& node) {
        // Check if we have a skinnable model
        SkinnedModelPtr skinned = boost::dynamic_pointer_cast<SkinnedModel>(node);

        if (skinned != NULL) {
            // Let the skinned model reload its current skin.
            skinned->skinChanged(skinned->getSkin());
        }

        return true; // traverse children
    }
void ModelKey::refreshModel()
{
	if (!_modelNode) return;

	// Check if we have a skinnable model and remember the skin
	SkinnedModelPtr skinned = boost::dynamic_pointer_cast<SkinnedModel>(_modelNode);

	std::string skin = skinned ? skinned->getSkin() : "";
	
	attachModelNode();
	
	// Reset the skin to the previous value if we have a model
	skinned = boost::dynamic_pointer_cast<SkinnedModel>(_modelNode);

	if (skinned)
	{
		skinned->skinChanged(skin);
	}
}