|
|
@@ -337,6 +337,18 @@ unsigned int Node::findNodes(const char* id, std::vector<Node*>& nodes, bool rec
|
|
|
|
|
|
unsigned int count = 0;
|
|
|
|
|
|
+ // If the node has a model with a mesh skin, search the skin's hierarchy as well.
|
|
|
+ Node* rootNode = NULL;
|
|
|
+ if (_model != NULL && _model->getSkin() != NULL && (rootNode = _model->getSkin()->_rootNode) != NULL)
|
|
|
+ {
|
|
|
+ if ((exactMatch && rootNode->_id == id) || (!exactMatch && rootNode->_id.find(id) == 0))
|
|
|
+ {
|
|
|
+ nodes.push_back(rootNode);
|
|
|
+ ++count;
|
|
|
+ }
|
|
|
+ count += rootNode->findNodes(id, nodes, true, exactMatch);
|
|
|
+ }
|
|
|
+
|
|
|
// Search immediate children first.
|
|
|
for (Node* child = getFirstChild(); child != NULL; child = child->getNextSibling())
|
|
|
{
|