diff --git a/source/MaterialXCore/Element.cpp b/source/MaterialXCore/Element.cpp index 2627be60a1..af47a6a2ba 100644 --- a/source/MaterialXCore/Element.cpp +++ b/source/MaterialXCore/Element.cpp @@ -287,7 +287,7 @@ ElementPtr Element::changeChildCategory(ElementPtr child, const string& category template shared_ptr Element::getChildOfType(const string& name) const { ElementPtr child; - DocumentPtr doc = asA(); + ConstDocumentPtr doc = asA(); if (doc && doc->hasDataLibrary()) { child = doc->getDataLibrary()->getChild(name); @@ -302,7 +302,7 @@ template shared_ptr Element::getChildOfType(const string& name) con template vector> Element::getChildrenOfType(const string& category) const { vector> children; - DocumentPtr doc = asA(); + ConstDocumentPtr doc = asA(); if (doc && doc->hasDataLibrary()) { children = doc->getDataLibrary()->getChildrenOfType(category);