def replace_spaces():
    global options
    file_list = filter(lambda x: (" " in x) or ("(" in x) or (")" in x), basic.recursive_file_list(os.path.join(options.projectdir, options.inputdir)))
    for file_name in file_list:
        new_file    = file_name.replace(" ", "_")
        new_file    = new_file.replace("(", "_")
        new_file    = new_file.replace(")", "_")
        os.system('mv "%s" %s' % (file_name, new_file))
def get_file_list():
    global options

    file_list = filter(lambda x: x.endswith('.obj'), basic.recursive_file_list(os.path.join(options.projectdir, options.inputdir)))
    file_list = filter(lambda x: os.path.isfile(x[:-3] + 'mtl'), file_list)
    file_list.sort()

    return file_list
Exemple #3
0
def do_it(ind):

    cmdtmpl1 = '%s --input "%s" --output "%s" --log log.txt --resolution 500000 --maxNumVerticesPerCH 64' 
    cmdtmpl2 = '%s --input "%s" --output "%s" --log log.txt --resolution 16000000 --concavity 0.001 --maxNumVerticesPerCH 64 --minVolumePerCH 0.0001' 
    
    #L = filter(lambda x: x.endswith('.obj'), basic.recursive_file_list('/Users/chengxuz/3Dworld/ThreeDWorld/Assets/Models/dorsh_models/JobPoses'))
    L = filter(lambda x: x.endswith('.obj'), basic.recursive_file_list('/home/chengxuz/ThreeDWorld/Assets/Models/dorsch_models/JobPoses'))
    L.sort()
    
    start_indx  = min(ind * divide_in, len(L))
    end_indx    = min((ind+1)*divide_in, len(L))
    #objfiles = L[ind * 100: (ind+1)*100]
    objfiles = L[start_indx: end_indx]
    
    for of in objfiles:
        print('FILE: %s' % of)
        wf = of[:-3] + 'wrl'
        cmd = cmdtmpl1 % (VHACD, of, wf)
        os.system(cmd)
        osize = os.path.getsize(of)
        wsize = os.path.getsize(wf)
        if osize > 100 * wsize:
            cmd = cmdtmpl2 % (VHACD, of, wf)
            os.system(cmd)