def METHOD_NAME():
    dbfile = Argv()[0]
    vdbroot = Argv()[1]
    user = os.environ['USER']
    db = os.path.basename(os.path.splitext(dbfile)[0]) 
    outDir = []
    keyBase = []
    descendOutDir(outDir,keyBase,vdbroot)
    descendOutDir(outDir,keyBase,user)
    descendOutDir(outDir,keyBase,db)
    # get all scalars
    SetTryHarderCyclesTimes(1)
    SetTreatAllDBsAsTimeVarying(1)
    result = OpenDatabase(dbfile)
    if not result:
        sys.exit()
    nts = TimeSliderGetNStates()
    var_list_first = []
    mds = []
    for tidx in range(nts):
        mds.append(GetMetaData(dbfile,tidx))
    CloseDatabase(dbfile)
    OpenDatabase(dbfile)
    for tidx in range(nts):
        TimeSliderSetState(tidx)
        md = mds[tidx]
        state_data = [md.GetTimes()[tidx],md.GetCycles()[tidx]]
        descendOutDir(outDir,keyBase,"%06d"%tidx,state_data)
        # handle curves specially (as kind of meshes)
        for c in range(md.GetNumCurves()):
            if md.GetCurves(c).validVariable == 0:
                continue
            if md.GetCurves(c).hideFromGUI == 1:
                continue
            curve = md.GetCurves(c).name
            var_list = [curve, curve.replace("Scalar_Curves/","")]
            descendOutDir(outDir,keyBase,curve.replace('/','~'),[1,1,1])
            print("[Exporting curve %s for time index %d]" %(curve,tidx))
            export(outDir,keyBase,user,dbfile,tidx,curve,var_list)
            ascendOutDir(outDir,keyBase)
        for m in range(md.GetNumMeshes()):
            if md.GetMeshes(m).validVariable == 0:
                continue
            if md.GetMeshes(m).hideFromGUI == 1:
                continue
            mesh = md.GetMeshes(m).name
            mdata = [md.GetMeshes(m).numBlocks,md.GetMeshes(m).spatialDimension,md.GetMeshes(m).topologicalDimension]
            # num blocks, spatial dim, topo dim, extents?
            descendOutDir(outDir,keyBase,mesh.replace('/','~'),mdata)
            var_list = ["__foo__"] # work-around mesh name overwriting first var
            # add vars for global nodes and zones, handle if missing in vpq
            DefineScalarExpression("%s_global_nodeids"%mesh.replace('/','~'), "global_nodeid(<%s>)"%mesh)
            DefineScalarExpression("%s_global_zoneids"%mesh.replace('/','~'), "global_zoneid(<%s>)"%mesh)
            var_list.append("%s_global_nodeids"%mesh.replace('/','~'))
            var_list.append("%s_global_zoneids"%mesh.replace('/','~'))
            for i in range(md.GetNumScalars()):
                if md.GetScalars(i).validVariable == 0:
                    continue
                if md.GetScalars(i).hideFromGUI == 1:
                    continue
                scals = md.GetScalars(i)
                if scals.meshName == mesh:
                    var_list.append(scals.name)
            for i in range(md.GetNumMaterials()):
                mat = md.GetMaterials(i)
                if mat.validVariable == 0:
                    continue
                if mat.hideFromGUI == 1:
                    continue
                if mat.meshName != mesh:
                    continue
                matvf_array_expr = "array_compose("
                for j in range(mat.numMaterials):
                    mat_varname = "%s_%s"%(mat.name,mat.materialNames[j])
                    DefineScalarExpression(mat_varname,"matvf(%s,%d)"%(mat.name,j+1))
                    if j == mat.numMaterials - 1:
                        matvf_array_expr += "<%s>)"%mat_varname
                    else:
                        matvf_array_expr += "<%s>,"%mat_varname
                if mat.numMaterials > 1:
                    DefineArrayExpression("materials", matvf_array_expr)
                    var_list.append("materials")
            print("[Exporting mesh %s for time index %d]" %(mesh,tidx))
            export(outDir,keyBase,user,dbfile,tidx,mesh,var_list)
            ascendOutDir(outDir,keyBase)
        ascendOutDir(outDir,keyBase)