//---------------------------------------------------------------
    void LightExporter::exportLights ( )
    {
        if ( !ExportOptions::exportLights() ) return;

        // Get the list with the transform nodes.
        SceneGraph* sceneGraph = mDocumentExporter->getSceneGraph();
        SceneElementsList* exportNodesTree = sceneGraph->getExportNodesTree();

        // Export all/selected DAG nodes
        size_t length = exportNodesTree->size();
        for ( uint i = 0; i < length; ++i )
        {
            SceneElement* sceneElement = ( *exportNodesTree ) [i];
            exportLights ( sceneElement );
        }

        closeLibrary();
    }
    //------------------------------------------------------
    void MaterialExporter::exportMaterialsBySceneGraph ()
    {
        // Get the list with the transform nodes.
        SceneGraph* sceneGraph = mDocumentExporter->getSceneGraph();
        SceneElementsList* exportNodesTree = sceneGraph->getExportNodesTree();

        // Now go through scene graph and find all shaders, connected to the meshes.
        // So you can find the default shaders of an object.
        size_t length = exportNodesTree->size();
        for ( size_t i = 0; i < length; ++i )
        {
            SceneElement* sceneElement = ( *exportNodesTree ) [i];
            if ( !sceneElement->getIsLocal() ) continue;
            if ( !sceneElement->getIsExportNode () ) continue;

            size_t childCount = sceneElement->getChildCount();
            for ( size_t i=0; i<childCount; ++i )
            {
                SceneElement* childSceneElement = sceneElement->getChild ( i );

                exportConnectedMaterials ( childSceneElement );
            }
        }
    }