这篇教程C++ BLI_join_dirfile函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中BLI_join_dirfile函数的典型用法代码示例。如果您正苦于以下问题:C++ BLI_join_dirfile函数的具体用法?C++ BLI_join_dirfile怎么用?C++ BLI_join_dirfile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了BLI_join_dirfile函数的23个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: fluidsim_delete_until_lastframe/* copied from rna_fluidsim.c: fluidsim_find_lastframe() */static void fluidsim_delete_until_lastframe(FluidsimSettings *fss, const char *relbase){ char targetDir[FILE_MAX], targetFile[FILE_MAX]; char targetDirVel[FILE_MAX], targetFileVel[FILE_MAX]; char previewDir[FILE_MAX], previewFile[FILE_MAX]; int curFrame = 1, exists = 0; BLI_join_dirfile(targetDir, sizeof(targetDir), fss->surfdataPath, OB_FLUIDSIM_SURF_FINAL_OBJ_FNAME); BLI_join_dirfile(targetDirVel, sizeof(targetDirVel), fss->surfdataPath, OB_FLUIDSIM_SURF_FINAL_VEL_FNAME); BLI_join_dirfile(previewDir, sizeof(previewDir), fss->surfdataPath, OB_FLUIDSIM_SURF_PREVIEW_OBJ_FNAME); BLI_path_abs(targetDir, relbase); BLI_path_abs(targetDirVel, relbase); BLI_path_abs(previewDir, relbase); do { BLI_strncpy(targetFile, targetDir, sizeof(targetFile)); BLI_strncpy(targetFileVel, targetDirVel, sizeof(targetFileVel)); BLI_strncpy(previewFile, previewDir, sizeof(previewFile)); BLI_path_frame(targetFile, curFrame, 0); BLI_path_frame(targetFileVel, curFrame, 0); BLI_path_frame(previewFile, curFrame, 0); curFrame++; if ((exists = BLI_exists(targetFile))) { BLI_delete(targetFile, false, false); BLI_delete(targetFileVel, false, false); BLI_delete(previewFile, false, false); } } while (exists); return;}
开发者ID:Bforartists,项目名称:Bforartists,代码行数:36,
示例2: file_expand_directorystatic void file_expand_directory(bContext *C){ SpaceFile *sfile= CTX_wm_space_file(C); if(sfile->params) { if ( sfile->params->dir[0] == '~' ) { char tmpstr[sizeof(sfile->params->dir)-1]; BLI_strncpy(tmpstr, sfile->params->dir+1, sizeof(tmpstr)); BLI_join_dirfile(sfile->params->dir, sizeof(sfile->params->dir), BLI_getDefaultDocumentFolder(), tmpstr); }#ifdef WIN32 if (sfile->params->dir[0] == '/0') { get_default_root(sfile->params->dir); } /* change "C:" --> "C:/", [#28102] */ else if ( (isalpha(sfile->params->dir[0]) && (sfile->params->dir[1] == ':')) && (sfile->params->dir[2] == '/0') ) { sfile->params->dir[2]= '//'; sfile->params->dir[3]= '/0'; }#endif }}
开发者ID:OldBrunet,项目名称:BGERTPS,代码行数:27,
示例3: get_path_local/** * Constructs in /a targetpath the name of a directory relative to a version-specific * subdirectory in the parent directory of the Blender executable. * * /param targetpath String to return path * /param folder_name Optional folder name within version-specific directory * /param subfolder_name Optional subfolder name within folder_name * /param ver To construct name of version-specific directory within bprogdir * /return true if such a directory exists. */static bool get_path_local(char *targetpath, const char *folder_name, const char *subfolder_name, const int ver){ char relfolder[FILE_MAX]; #ifdef PATH_DEBUG printf("%s.../n", __func__);#endif if (folder_name) { if (subfolder_name) { BLI_join_dirfile(relfolder, sizeof(relfolder), folder_name, subfolder_name); } else { BLI_strncpy(relfolder, folder_name, sizeof(relfolder)); } } else { relfolder[0] = '/0'; } /* try EXECUTABLE_DIR/2.5x/folder_name - new default directory for local blender installed files */#ifdef __APPLE__ static char osx_resourses[FILE_MAX]; /* due new codesign situation in OSX > 10.9.5 we must move the blender_version dir with contents to Resources */ sprintf(osx_resourses, "%s../Resources", bprogdir); return test_path(targetpath, osx_resourses, blender_version_decimal(ver), relfolder);#else return test_path(targetpath, bprogdir, blender_version_decimal(ver), relfolder);#endif}
开发者ID:greg100795,项目名称:blender-git,代码行数:39,
示例4: test_path/** * Concatenates path_base, (optional) path_sep and (optional) folder_name into targetpath, * returning true if result points to a directory. */static bool test_path(char *targetpath, const char *path_base, const char *path_sep, const char *folder_name){ char tmppath[FILE_MAX]; if (path_sep) BLI_join_dirfile(tmppath, sizeof(tmppath), path_base, path_sep); else BLI_strncpy(tmppath, path_base, sizeof(tmppath)); /* rare cases folder_name is omitted (when looking for ~/.blender/2.xx dir only) */ if (folder_name) BLI_make_file_string("/", targetpath, tmppath, folder_name); else BLI_strncpy(targetpath, tmppath, sizeof(tmppath)); /* FIXME: why is "//" on front of tmppath expanded to "/" (by BLI_join_dirfile) * if folder_name is specified but not otherwise? */ if (BLI_is_dir(targetpath)) {#ifdef PATH_DEBUG printf("/t%s found: %s/n", __func__, targetpath);#endif return true; } else {#ifdef PATH_DEBUG printf("/t%s missing: %s/n", __func__, targetpath);#endif //targetpath[0] = '/0'; return false; }}
开发者ID:greg100795,项目名称:blender-git,代码行数:33,
示例5: strip_last_slashstatic char *check_destination(const char *file, const char *to){ struct stat st; if (!stat(to, &st)) { if (S_ISDIR(st.st_mode)) { char *str, *path; const char *filename; size_t len = 0; str = strip_last_slash(file); filename = BLI_last_slash(str); if (!filename) { MEM_freeN(str); return (char *)to; } /* skip slash */ filename += 1; len = strlen(to) + strlen(filename) + 1; path = MEM_callocN(len + 1, "check_destination path"); BLI_join_dirfile(path, len + 1, to, filename); MEM_freeN(str); return path; } } return (char *)to;}
开发者ID:linkedinyou,项目名称:blender-git,代码行数:33,
示例6: test_pathstatic int test_path(char *targetpath, const char *path_base, const char *path_sep, const char *folder_name){ char tmppath[FILE_MAX]; if (path_sep) BLI_join_dirfile(tmppath, sizeof(tmppath), path_base, path_sep); else BLI_strncpy(tmppath, path_base, sizeof(tmppath)); /* rare cases folder_name is omitted (when looking for ~/.blender/2.xx dir only) */ if (folder_name) BLI_make_file_string("/", targetpath, tmppath, folder_name); else BLI_strncpy(targetpath, tmppath, sizeof(tmppath)); if (BLI_is_dir(targetpath)) {#ifdef PATH_DEBUG2 printf("/tpath found: %s/n", targetpath);#endif return 1; } else {#ifdef PATH_DEBUG2 printf("/tpath missing: %s/n", targetpath);#endif //targetpath[0] = '/0'; return 0; }}
开发者ID:danielmarg,项目名称:blender-main,代码行数:27,
示例7: gpu_dump_shaders/** * Dump GLSL shaders to disk * * This is used for profiling shader performance externally and debug if shader code is correct. * If called with no code, it simply bumps the shader index, so different shaders for the same * program share the same index. */static void gpu_dump_shaders(const char **code, const int num_shaders, const char *extension){ if ((G.debug & G_DEBUG_GPU_SHADERS) == 0) { return; } /* We use the same shader index for shaders in the same program. * So we call this function once before calling for the individual shaders. */ static int shader_index = 0; if (code == NULL) { shader_index++; BLI_assert(STREQ(DEBUG_SHADER_NONE, extension)); return; } /* Determine the full path of the new shader. */ char shader_path[FILE_MAX]; char file_name[512] = {'/0'}; sprintf(file_name, "%04d.%s", shader_index, extension); BLI_join_dirfile(shader_path, sizeof(shader_path), BKE_tempdir_session(), file_name); /* Write shader to disk. */ FILE *f = fopen(shader_path, "w"); if (f == NULL) { printf("Error writing to file: %s/n", shader_path); } for (int j = 0; j < num_shaders; j++) { fprintf(f, "%s", code[j]); } fclose(f); printf("Shader file written to disk: %s/n", shader_path);}
开发者ID:Ichthyostega,项目名称:blender,代码行数:41,
示例8: BLI_split_dir_part/** When this method is called, the writer must write the image. * /return The writer should return true, if writing succeeded, false otherwise.*/bool DocumentImporter::writeImage(const COLLADAFW::Image *image){ if (mImportStage != General) return true; const std::string& imagepath = image->getImageURI().toNativePath(); char dir[FILE_MAX]; char absolute_path[FILE_MAX]; const char *workpath; BLI_split_dir_part(this->import_settings->filepath, dir, sizeof(dir)); BLI_join_dirfile(absolute_path, sizeof(absolute_path), dir, imagepath.c_str()); if (BLI_exists(absolute_path)) { workpath = absolute_path; } else { // Maybe imagepath was already absolute ? if (!BLI_exists(imagepath.c_str())) { fprintf(stderr, "Image not found: %s./n", imagepath.c_str() ); return true; } workpath = imagepath.c_str(); } Image *ima = BKE_image_load_exists(workpath); if (!ima) { fprintf(stderr, "Cannot create image: %s/n", workpath); return true; } this->uid_image_map[image->getUniqueId()] = ima; return true;}
开发者ID:DrangPo,项目名称:blender,代码行数:36,
示例9: autocomplete_directoryvoid autocomplete_directory(struct bContext *C, char *str, void *arg_v){ char tmp[FILE_MAX]; SpaceFile *sfile= CTX_wm_space_file(C); /* search if str matches the beginning of name */ if(str[0] && sfile->files) { AutoComplete *autocpl= autocomplete_begin(str, FILE_MAX); int nentries = filelist_numfiles(sfile->files); int i; for(i= 0; i<nentries; ++i) { struct direntry* file = filelist_file(sfile->files, i); const char* dir = filelist_dir(sfile->files); if (file && S_ISDIR(file->type)) { // BLI_make_file_string(G.sce, tmp, dir, file->relname); BLI_join_dirfile(tmp, dir, file->relname); autocomplete_do_name(autocpl,tmp); } } autocomplete_end(autocpl, str); if (BLI_exists(str)) { BLI_add_slash(str); } else { BLI_make_exist(str); } }}
开发者ID:jinjoh,项目名称:NOOR,代码行数:28,
示例10: get_path_localstatic int get_path_local(char *targetpath, const char *folder_name, const char *subfolder_name, const int ver){ char relfolder[FILE_MAX]; #ifdef PATH_DEBUG2 printf("get_path_local.../n");#endif if (folder_name) { if (subfolder_name) { BLI_join_dirfile(relfolder, sizeof(relfolder), folder_name, subfolder_name); } else { BLI_strncpy(relfolder, folder_name, sizeof(relfolder)); } } else { relfolder[0] = '/0'; } /* try EXECUTABLE_DIR/2.5x/folder_name - new default directory for local blender installed files */ if (test_path(targetpath, bprogdir, blender_version_decimal(ver), relfolder)) return 1; return 0;}
开发者ID:danielmarg,项目名称:blender-main,代码行数:26,
示例11: edittranslation_find_po_file/** * EditTranslation utility funcs and operator, * /note: this includes utility functions and button matching checks. * this only works in conjunction with a py operator! */static void edittranslation_find_po_file(const char *root, const char *uilng, char *path, const size_t maxlen){ char tstr[32]; /* Should be more than enough! */ /* First, full lang code. */ BLI_snprintf(tstr, sizeof(tstr), "%s.po", uilng); BLI_join_dirfile(path, maxlen, root, uilng); BLI_path_append(path, maxlen, tstr); if (BLI_is_file(path)) { return; } /* Now try without the second iso code part (_ES in es_ES). */ { const char *tc = NULL; size_t szt = 0; tstr[0] = '/0'; tc = strchr(uilng, '_'); if (tc) { szt = tc - uilng; if (szt < sizeof(tstr)) { /* Paranoid, should always be true! */ BLI_strncpy(tstr, uilng, szt + 1); /* +1 for '/0' char! */ } } if (tstr[0]) { /* Because of some codes like [email C++ BLI_listbase_clear函数代码示例 C++ BLI_insertlinkbefore函数代码示例
|