您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ BLI_exists函数代码示例

51自学网 2021-06-01 19:51:03
  C++
这篇教程C++ BLI_exists函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中BLI_exists函数的典型用法代码示例。如果您正苦于以下问题:C++ BLI_exists函数的具体用法?C++ BLI_exists怎么用?C++ BLI_exists使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了BLI_exists函数的24个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: movieclip_calc_length

static void movieclip_calc_length(MovieClip *clip){    if (clip->source == MCLIP_SRC_MOVIE) {        movieclip_open_anim_file(clip);        if (clip->anim) {            clip->len = IMB_anim_get_duration(clip->anim, clip->proxy.tc);        }    }    else if (clip->source == MCLIP_SRC_SEQUENCE) {        int framenr = 1;        unsigned short numlen;        char name[FILE_MAX], head[FILE_MAX], tail[FILE_MAX];        BLI_stringdec(clip->name, head, tail, &numlen);        if (numlen == 0) {            /* there's no number group in file name, assume it's single framed sequence */            clip->len = framenr + 1;        }        else {            for (;; ) {                get_sequence_fname(clip, framenr, name);                if (!BLI_exists(name)) {                    clip->len = framenr + 1;                    break;                }                framenr++;            }        }    }}
开发者ID:nttputus,项目名称:blensor,代码行数:34,


示例2: BLI_recurdir_fileops

void BLI_recurdir_fileops(char *dirname) {	char *lslash;	char tmp[MAXPATHLEN];		// First remove possible slash at the end of the dirname.	// This routine otherwise tries to create	// blah1/blah2/ (with slash) after creating	// blah1/blah2 (without slash)	strcpy(tmp, dirname);	lslash= BLI_last_slash(tmp);	if (lslash == tmp + strlen(tmp) - 1) {		*lslash = 0;	}		if (BLI_exists(tmp)) return;			lslash= BLI_last_slash(tmp);	if (lslash) {			/* Split about the last slash and recurse */			*lslash = 0;		BLI_recurdir_fileops(tmp);	}		if(dirname[0]) /* patch, this recursive loop tries to create a nameless directory */		if (!CreateDirectory(dirname, NULL))			callLocalErrorCallBack("Unable to create directory/n");}
开发者ID:jinjoh,项目名称:NOOR,代码行数:29,


示例3: BLI_dir_create_recursive

void BLI_dir_create_recursive(const char *dirname){	char *lslash;	size_t size;#ifdef MAXPATHLEN	char static_buf[MAXPATHLEN];#endif	char *tmp;	if (BLI_exists(dirname)) return;#ifdef MAXPATHLEN	size = MAXPATHLEN;	tmp = static_buf;#else	size = strlen(dirname) + 1;	tmp = MEM_callocN(size, __func__);#endif	BLI_strncpy(tmp, dirname, size);			lslash = (char *)BLI_last_slash(tmp);	if (lslash) {		/* Split about the last slash and recurse */		*lslash = 0;		BLI_dir_create_recursive(tmp);	}#ifndef MAXPATHLEN	MEM_freeN(tmp);#endif	mkdir(dirname, 0777);}
开发者ID:linkedinyou,项目名称:blender-git,代码行数:34,


示例4: wm_autosave_location

void wm_autosave_location(char *filepath){	const int pid = abs(getpid());	char path[1024];#ifdef WIN32	const char *savedir;#endif	if (G.main && G.relbase_valid) {		const char *basename = BLI_path_basename(G.main->name);		int len = strlen(basename) - 6;		BLI_snprintf(path, sizeof(path), "%.*s.blend", len, basename);	}	else {		BLI_snprintf(path, sizeof(path), "%d.blend", pid);	}#ifdef WIN32	/* XXX Need to investigate how to handle default location of '/tmp/'	 * This is a relative directory on Windows, and it may be	 * found. Example:	 * Blender installed on D:/ drive, D:/ drive has D:/tmp/	 * Now, BLI_exists() will find '/tmp/' exists, but	 * BLI_make_file_string will create string that has it most likely on C:/	 * through get_default_root().	 * If there is no C:/tmp autosave fails. */	if (!BLI_exists(BKE_tempdir_base())) {		savedir = BKE_appdir_folder_id_create(BLENDER_USER_AUTOSAVE, NULL);		BLI_make_file_string("/", filepath, savedir, path);		return;	}#endif	BLI_make_file_string("/", filepath, BKE_tempdir_base(), path);}
开发者ID:Moguri,项目名称:blender,代码行数:35,


示例5: get_filename

static void get_filename(int argc, char **argv, char *filename){#ifdef __APPLE__    /* On Mac we park the game file (called game.blend) in the application bundle.     * The executable is located in the bundle as well.     * Therefore, we can locate the game relative to the executable.     */    int srclen = ::strlen(argv[0]);    int len = 0;    char *gamefile = NULL;    filename[0] = '/0';    if (argc > 1) {        if (BLI_exists(argv[argc-1])) {            BLI_strncpy(filename, argv[argc-1], FILE_MAX);        }        if (::strncmp(argv[argc-1], "-psn_", 5)==0) {            static char firstfilebuf[512];            if (GHOST_HACK_getFirstFile(firstfilebuf)) {                BLI_strncpy(filename, firstfilebuf, FILE_MAX);            }        }    }    srclen -= ::strlen("MacOS/blenderplayer");    if (srclen > 0) {        len = srclen + ::strlen("Resources/game.blend");        gamefile = new char [len + 1];        ::strcpy(gamefile, argv[0]);        ::strcpy(gamefile + srclen, "Resources/game.blend");        //::printf("looking for file: %s/n", filename);        if (BLI_exists(gamefile))            BLI_strncpy(filename, gamefile, FILE_MAX);        delete [] gamefile;    }#else    filename[0] = '/0';    if (argc > 1)        BLI_strncpy(filename, argv[argc-1], FILE_MAX);#endif // !_APPLE}
开发者ID:akonneker,项目名称:blensor,代码行数:46,


示例6: WM_read_homefile

/* op can be NULL */int WM_read_homefile(bContext *C, wmOperator *op){	ListBase wmbase;	char tstr[FILE_MAXDIR+FILE_MAXFILE], scestr[FILE_MAXDIR];	char *home= BLI_gethome();	int from_memory= op?RNA_boolean_get(op->ptr, "factory"):0;	int success;			BLI_clean(home);		free_ttfont(); /* still weird... what does it here? */			G.relbase_valid = 0;	if (!from_memory) {		BLI_make_file_string(G.sce, tstr, home, ".B25.blend");	}	strcpy(scestr, G.sce);	/* temporary store */		/* prevent loading no UI */	G.fileflags &= ~G_FILE_NO_UI;		/* put aside screens to match with persistant windows later */	wm_window_match_init(C, &wmbase); 		if (!from_memory && BLI_exists(tstr)) {		success = BKE_read_file(C, tstr, NULL, NULL);	} else {		success = BKE_read_file_from_memory(C, datatoc_B_blend, datatoc_B_blend_size, NULL, NULL);		if (wmbase.first == NULL) wm_clear_default_size(C);	}		/* match the read WM with current WM */	wm_window_match_do(C, &wmbase); 	wm_check(C); /* opens window(s), checks keymaps */	strcpy(G.sce, scestr); /* restore */		wm_init_userdef();		/* When loading factory settings, the reset solid OpenGL lights need to be applied. */	GPU_default_lights();		/* XXX */	G.save_over = 0;	// start with save preference untitled.blend	G.fileflags &= ~G_FILE_AUTOPLAY;	/*  disable autoplay in .B.blend... *///	mainwindow_set_filename_to_title("");	// empty string re-initializes title to "Blender"	//	refresh_interface_font();	//	undo_editmode_clear();	BKE_reset_undo();	BKE_write_undo(C, "original");	/* save current state */		WM_event_add_notifier(C, NC_WM|ND_FILEREAD, NULL);	CTX_wm_window_set(C, NULL); /* exits queues */	return OPERATOR_FINISHED;}
开发者ID:jinjoh,项目名称:NOOR,代码行数:59,


示例7: file_directory_new_exec

int file_directory_new_exec(bContext *C, wmOperator *op){	char name[FILE_MAXFILE];	char path[FILE_MAX];	int generate_name = 1;	wmWindowManager *wm = CTX_wm_manager(C);	SpaceFile *sfile = CTX_wm_space_file(C);		if (!sfile->params) {		BKE_report(op->reports, RPT_WARNING, "No parent directory given");		return OPERATOR_CANCELLED;	}		path[0] = '/0';	if (RNA_struct_find_property(op->ptr, "directory")) {		RNA_string_get(op->ptr, "directory", path);		if (path[0] != '/0') generate_name = 0;	}	if (generate_name) {		/* create a new, non-existing folder name */		if (!new_folder_path(sfile->params->dir, path, name)) {			BKE_report(op->reports, RPT_ERROR, "Could not create new folder name");			return OPERATOR_CANCELLED;		}	}	/* create the file */	BLI_dir_create_recursive(path);	if (!BLI_exists(path)) {		BKE_report(op->reports, RPT_ERROR, "Could not create new folder");		return OPERATOR_CANCELLED;	}	/* now remember file to jump into editing */	BLI_strncpy(sfile->params->renamefile, name, FILE_MAXFILE);	/* set timer to smoothly view newly generated file */	sfile->smoothscroll_timer = WM_event_add_timer(wm, CTX_wm_window(C), TIMER1, 1.0 / 1000.0);  /* max 30 frs/sec */	sfile->scroll_offset = 0;	/* reload dir to make sure we're seeing what's in the directory */	ED_fileselect_clear(wm, sfile);	if (RNA_boolean_get(op->ptr, "open")) {		BLI_strncpy(sfile->params->dir, path, sizeof(sfile->params->dir));		file_change_dir(C, 1);	}	WM_event_add_notifier(C, NC_SPACE | ND_SPACE_FILE_LIST, NULL);	return OPERATOR_FINISHED;}
开发者ID:manwapastorelli,项目名称:blender-git,代码行数:56,


示例8: add_win32_extension

static int add_win32_extension(char *name){	int retval = 0;	int type;	type = BLI_exists(name);	if ((type == 0) || S_ISDIR(type)) {#ifdef _WIN32		char filename[FILE_MAX];		char ext[FILE_MAX];		const char *extensions = getenv("PATHEXT");		if (extensions) {			char *temp;			do {				strcpy(filename, name);				temp = strstr(extensions, ";");				if (temp) {					strncpy(ext, extensions, temp - extensions);					ext[temp - extensions] = 0;					extensions = temp + 1;					strcat(filename, ext);				}				else {					strcat(filename, extensions);				}				type = BLI_exists(filename);				if (type && (!S_ISDIR(type))) {					retval = 1;					strcpy(name, filename);					break;				}			} while (temp);		}#endif	}	else {		retval = 1;	}	return (retval);}
开发者ID:danielmarg,项目名称:blender-main,代码行数:42,


示例9: BKE_appdir_folder_id

static WorkspaceConfigFileData *workspace_config_file_read(const char *app_template){  const char *cfgdir = BKE_appdir_folder_id(BLENDER_USER_CONFIG, app_template);  char startup_file_path[FILE_MAX] = {0};  if (cfgdir) {    BLI_join_dirfile(startup_file_path, sizeof(startup_file_path), cfgdir, BLENDER_STARTUP_FILE);  }  bool has_path = BLI_exists(startup_file_path);  return (has_path) ? BKE_blendfile_workspace_config_read(startup_file_path, NULL, 0, NULL) : NULL;}
开发者ID:dfelinto,项目名称:blender,代码行数:12,


示例10: BLI_make_existing_file

void BLI_make_existing_file(const char *name){	char di[FILE_MAX], fi[FILE_MAXFILE];	BLI_strncpy(di, name, sizeof(di));	BLI_splitdirstring(di, fi);		/* test exist */	if (BLI_exists(di) == 0) {		BLI_dir_create_recursive(di);	}}
开发者ID:danielmarg,项目名称:blender-main,代码行数:12,


示例11: BLI_join_dirfile

char *blf_dir_search(const char *file){	DirBLF *dir;	char full_path[FILE_MAX];	char *s = NULL;	for (dir = global_font_dir.first; dir; dir = dir->next) {		BLI_join_dirfile(full_path, sizeof(full_path), dir->path, file);		if (BLI_exists(full_path)) {			s = BLI_strdup(full_path);			break;		}	}	if (!s) {		/* check the current directory, why not ? */		if (BLI_exists(file))			s = BLI_strdup(file);	}	return s;}
开发者ID:Andrewson3D,项目名称:blender-for-vray,代码行数:22,


示例12: wm_autosave_delete

void wm_autosave_delete(void){	char filename[FILE_MAX];		wm_autosave_location(filename);	if (BLI_exists(filename)) {		char str[FILE_MAX];		BLI_make_file_string("/", str, BKE_tempdir_base(), BLENDER_QUIT_FILE);		/* if global undo; remove tempsave, otherwise rename */		if (U.uiflag & USER_GLOBALUNDO) BLI_delete(filename, false, false);		else BLI_rename(filename, str);	}}
开发者ID:ChunHungLiu,项目名称:blender,代码行数:15,


示例13: wm_autosave_delete

void wm_autosave_delete(void){	char filename[FILE_MAX];		wm_autosave_location(filename);	if(BLI_exists(filename)) {		char str[FILE_MAXDIR+FILE_MAXFILE];		BLI_make_file_string("/", str, U.tempdir, "quit.blend");		/* if global undo; remove tempsave, otherwise rename */		if(U.uiflag & USER_GLOBALUNDO) BLI_delete(filename, 0, 0);		else BLI_rename(filename, str);	}}
开发者ID:jinjoh,项目名称:NOOR,代码行数:15,


示例14: IMB_anim_proxy_get_existing

IMB_Proxy_Size IMB_anim_proxy_get_existing(struct anim *anim){	const int num_proxy_sizes = IMB_PROXY_MAX_SLOT;	IMB_Proxy_Size existing = 0;	int i;	for (i = 0; i < num_proxy_sizes; ++i) {		IMB_Proxy_Size proxy_size = proxy_sizes[i];		char filename[FILE_MAX];		get_proxy_filename(anim, proxy_size, filename, false);		if (BLI_exists(filename)) {			existing |= proxy_size;		}	}	return existing;}
开发者ID:mgschwan,项目名称:blensor,代码行数:15,


示例15: file_directory_invoke

static int file_directory_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)){	SpaceFile *sfile= CTX_wm_space_file(C);	if(sfile->params) {		file_expand_directory(C);				if (!BLI_exists(sfile->params->dir)) {			return WM_operator_confirm_message(C, op, "Create new directory?");		} 		return file_directory_exec(C, op);	}	return OPERATOR_CANCELLED;}
开发者ID:OldBrunet,项目名称:BGERTPS,代码行数:16,


示例16: file_draw_check_exists

int file_draw_check_exists(SpaceFile *sfile){	if(sfile->op) { /* fails on reload */		if(RNA_struct_find_property(sfile->op->ptr, "check_existing")) {			if(RNA_boolean_get(sfile->op->ptr, "check_existing")) {				char filepath[FILE_MAX];				BLI_join_dirfile(filepath, sizeof(filepath), sfile->params->dir, sfile->params->file);				if(BLI_exists(filepath) && !BLI_is_dir(filepath)) {					return TRUE;				}			}		}	}	return FALSE;}
开发者ID:OldBrunet,项目名称:BGERTPS,代码行数:16,


示例17: autocomplete_directory

void autocomplete_directory(struct bContext *C, char *str, void *UNUSED(arg_v)){	SpaceFile *sfile = CTX_wm_space_file(C);	/* search if str matches the beginning of name */	if (str[0] && sfile->files) {		char dirname[FILE_MAX];		DIR *dir;		struct dirent *de;				BLI_split_dir_part(str, dirname, sizeof(dirname));		dir = opendir(dirname);		if (dir) {			AutoComplete *autocpl = autocomplete_begin(str, FILE_MAX);			while ((de = readdir(dir)) != NULL) {				if (strcmp(".", de->d_name) == 0 || strcmp("..", de->d_name) == 0) {					/* pass */				}				else {					char path[FILE_MAX];					struct stat status;										BLI_join_dirfile(path, sizeof(path), dirname, de->d_name);					if (stat(path, &status) == 0) {						if (S_ISDIR(status.st_mode)) { /* is subdir */							autocomplete_do_name(autocpl, path);						}					}				}			}			closedir(dir);			autocomplete_end(autocpl, str);			if (BLI_exists(str)) {				BLI_add_slash(str);			}			else {				BLI_strncpy(sfile->params->dir, str, sizeof(sfile->params->dir));			}		}	}}
开发者ID:danielmarg,项目名称:blender-main,代码行数:47,


示例18: new_folder_path

/* create a new, non-existing folder name, returns 1 if successful, 0 if name couldn't be created. * The actual name is returned in 'name', 'folder' contains the complete path, including the new folder name. */static int new_folder_path(const char *parent, char *folder, char *name){	int i = 1;	int len = 0;	BLI_strncpy(name, "New Folder", FILE_MAXFILE);	BLI_join_dirfile(folder, FILE_MAX, parent, name); /* XXX, not real length */	/* check whether folder with the name already exists, in this case	 * add number to the name. Check length of generated name to avoid	 * crazy case of huge number of folders each named 'New Folder (x)' */	while (BLI_exists(folder) && (len < FILE_MAXFILE)) {		len = BLI_snprintf(name, FILE_MAXFILE, "New Folder(%d)", i);		BLI_join_dirfile(folder, FILE_MAX, parent, name); /* XXX, not real length */		i++;	}	return (len < FILE_MAXFILE);}
开发者ID:manwapastorelli,项目名称:blender-git,代码行数:21,


示例19: BKE_blendfile_workspace_config_read

static WorkspaceConfigFileData *workspace_system_file_read(const char *app_template){  if (app_template == NULL) {    return BKE_blendfile_workspace_config_read(        NULL, datatoc_startup_blend, datatoc_startup_blend_size, NULL);  }  char template_dir[FILE_MAX];  if (!BKE_appdir_app_template_id_search(app_template, template_dir, sizeof(template_dir))) {    return NULL;  }  char startup_file_path[FILE_MAX];  BLI_join_dirfile(      startup_file_path, sizeof(startup_file_path), template_dir, BLENDER_STARTUP_FILE);  bool has_path = BLI_exists(startup_file_path);  return (has_path) ? BKE_blendfile_workspace_config_read(startup_file_path, NULL, 0, NULL) : NULL;}
开发者ID:dfelinto,项目名称:blender,代码行数:19,


示例20: file_exec

/* sends events now, so things get handled on windowqueue level */int file_exec(bContext *C, wmOperator *exec_op){	wmWindowManager *wm = CTX_wm_manager(C);	SpaceFile *sfile = CTX_wm_space_file(C);	char filepath[FILE_MAX];		if (sfile->op) {		wmOperator *op = sfile->op;			/* when used as a macro, for doubleclick, 		 * to prevent closing when doubleclicking on .. item */		if (RNA_boolean_get(exec_op->ptr, "need_active")) {			int i, active = 0;						for (i = 0; i < filelist_numfiles(sfile->files); i++) {				if (filelist_is_selected(sfile->files, i, CHECK_ALL)) {					active = 1;					break;				}			}			if (active == 0)				return OPERATOR_CANCELLED;		}				sfile->op = NULL;		file_sfile_to_operator(op, sfile, filepath);		if (BLI_exists(sfile->params->dir)) {			fsmenu_insert_entry(fsmenu_get(), FS_CATEGORY_RECENT, sfile->params->dir, FS_INSERT_SAVE | FS_INSERT_FIRST);		}		BLI_make_file_string(G.main->name, filepath, BLI_get_folder_create(BLENDER_USER_CONFIG, NULL), BLENDER_BOOKMARK_FILE);		fsmenu_write_file(fsmenu_get(), filepath);		WM_event_fileselect_event(wm, op, EVT_FILESELECT_EXEC);	}					return OPERATOR_FINISHED;}
开发者ID:manwapastorelli,项目名称:blender-git,代码行数:41,


示例21: BKE_cachefile_filepath_get

bool BKE_cachefile_filepath_get(        const Main *bmain, const CacheFile *cache_file, float frame,        char r_filepath[FILE_MAX]){	BLI_strncpy(r_filepath, cache_file->filepath, FILE_MAX);	BLI_path_abs(r_filepath, ID_BLEND_PATH(bmain, &cache_file->id));	int fframe;	int frame_len;	if (cache_file->is_sequence && BLI_path_frame_get(r_filepath, &fframe, &frame_len)) {		char ext[32];		BLI_path_frame_strip(r_filepath, true, ext);		BLI_path_frame(r_filepath, frame, frame_len);		BLI_ensure_extension(r_filepath, FILE_MAX, ext);		/* TODO(kevin): store sequence range? */		return BLI_exists(r_filepath);	}	return true;}
开发者ID:mgschwan,项目名称:blensor,代码行数:22,


示例22: renamebutton_cb

static void renamebutton_cb(bContext *C, void *UNUSED(arg1), char *oldname){	char newname[FILE_MAX + 12];	char orgname[FILE_MAX + 12];	char filename[FILE_MAX + 12];	SpaceFile *sfile = (SpaceFile *)CTX_wm_space_data(C);	ARegion *ar = CTX_wm_region(C);	BLI_make_file_string(G.main->name, orgname, sfile->params->dir, oldname);	BLI_strncpy(filename, sfile->params->renameedit, sizeof(filename));	BLI_make_file_string(G.main->name, newname, sfile->params->dir, filename);	if (strcmp(orgname, newname) != 0) {		if (!BLI_exists(newname)) {			BLI_rename(orgname, newname);			/* to make sure we show what is on disk */			ED_fileselect_clear(C, sfile);		}		ED_region_tag_redraw(ar);	}}
开发者ID:danielmarg,项目名称:blender-main,代码行数:22,


示例23: collada_export

	int collada_export(Scene *sce, const char *filepath, int selected, int apply_modifiers, int second_life)	{		ExportSettings export_settings;				export_settings.selected        = selected != 0;		export_settings.apply_modifiers = apply_modifiers != 0;		export_settings.second_life     = second_life != 0;		export_settings.filepath        = (char *)filepath;		/* annoying, collada crashes if file cant be created! [#27162] */		if (!BLI_exists(filepath)) {			BLI_make_existing_file(filepath); /* makes the dir if its not there */			if (BLI_file_touch(filepath) == 0) {				return 0;			}		}		/* end! */		DocumentExporter exporter(&export_settings);		exporter.exportCurrentScene(sce);		return 1;	}
开发者ID:nttputus,项目名称:blensor,代码行数:23,


示例24: wm_homefile_read

/** * called on startup,  (context entirely filled with NULLs) * or called for 'New File' * both startup.blend and userpref.blend are checked * the optional parameter custom_file points to an alternative startup page * custom_file can be NULL */int wm_homefile_read(bContext *C, ReportList *reports, bool from_memory, const char *custom_file){	ListBase wmbase;	char startstr[FILE_MAX];	char prefstr[FILE_MAX];	int success = 0;	/* Indicates whether user preferences were really load from memory.	 *	 * This is used for versioning code, and for this we can not rely on from_memory	 * passed via argument. This is because there might be configuration folder	 * exists but it might not have userpref.blend and in this case we fallback to	 * reading home file from memory.	 *	 * And in this case versioning code is to be run.	 */	bool read_userdef_from_memory = true;	/* options exclude eachother */	BLI_assert((from_memory && custom_file) == 0);	if ((G.f & G_SCRIPT_OVERRIDE_PREF) == 0) {		BKE_BIT_TEST_SET(G.f, (U.flag & USER_SCRIPT_AUTOEXEC_DISABLE) == 0, G_SCRIPT_AUTOEXEC);	}	BLI_callback_exec(CTX_data_main(C), NULL, BLI_CB_EVT_LOAD_PRE);	UI_view2d_zoom_cache_reset();	G.relbase_valid = 0;	if (!from_memory) {		const char * const cfgdir = BKE_appdir_folder_id(BLENDER_USER_CONFIG, NULL);		if (custom_file) {			BLI_strncpy(startstr, custom_file, FILE_MAX);			if (cfgdir) {				BLI_make_file_string(G.main->name, prefstr, cfgdir, BLENDER_USERPREF_FILE);			}			else {				prefstr[0] = '/0';			}		}		else if (cfgdir) {			BLI_make_file_string(G.main->name, startstr, cfgdir, BLENDER_STARTUP_FILE);			BLI_make_file_string(G.main->name, prefstr, cfgdir, BLENDER_USERPREF_FILE);		}		else {			startstr[0] = '/0';			prefstr[0] = '/0';			from_memory = 1;		}	}		/* put aside screens to match with persistent windows later */	wm_window_match_init(C, &wmbase);		if (!from_memory) {		if (BLI_access(startstr, R_OK) == 0) {			success = (BKE_read_file(C, startstr, NULL) != BKE_READ_FILE_FAIL);		}		if (BLI_listbase_is_empty(&U.themes)) {			if (G.debug & G_DEBUG)				printf("/nNote: No (valid) '%s' found, fall back to built-in default./n/n", startstr);			success = 0;		}	}	if (success == 0 && custom_file && reports) {		BKE_reportf(reports, RPT_ERROR, "Could not read '%s'", custom_file);		/*We can not return from here because wm is already reset*/	}	if (success == 0) {		success = BKE_read_file_from_memory(C, datatoc_startup_blend, datatoc_startup_blend_size, NULL, true);		if (BLI_listbase_is_empty(&wmbase)) {			wm_clear_default_size(C);		}		BKE_tempdir_init(U.tempdir);#ifdef WITH_PYTHON_SECURITY		/* use alternative setting for security nuts		 * otherwise we'd need to patch the binary blob - startup.blend.c */		U.flag |= USER_SCRIPT_AUTOEXEC_DISABLE;#endif	}		/* check new prefs only after startup.blend was finished */	if (!from_memory && BLI_exists(prefstr)) {		int done = BKE_read_file_userdef(prefstr, NULL);		if (done != BKE_READ_FILE_FAIL) {			read_userdef_from_memory = false;			printf("Read new prefs: %s/n", prefstr);		}//.........这里部分代码省略.........
开发者ID:ChunHungLiu,项目名称:blender,代码行数:101,



注:本文中的BLI_exists函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ BLI_findindex函数代码示例
C++ BLI_dynstr_append函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。