• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ BLI_snprintf函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: nla_draw_strip_frames_text

/* add frame extents to cache of text-strings to draw in pixelspace
 * for now, only used when transforming strips
 */
static void nla_draw_strip_frames_text(NlaTrack *UNUSED(nlt), NlaStrip *strip, View2D *v2d, float UNUSED(yminc), float ymaxc)
{
	const float ytol = 1.0f; /* small offset to vertical positioning of text, for legibility */
	const char col[4] = {220, 220, 220, 255}; /* light gray */
	char numstr[32] = "";
	
	
	/* Always draw times above the strip, whereas sequencer drew below + above.
	 * However, we should be fine having everything on top, since these tend to be 
	 * quite spaced out. 
	 *	- 1 dp is compromise between lack of precision (ints only, as per sequencer)
	 *	  while also preserving some accuracy, since we do use floats
	 */
	/* start frame */
	BLI_snprintf(numstr, sizeof(numstr), "%.1f", strip->start);
	UI_view2d_text_cache_add(v2d, strip->start - 1.0f, ymaxc + ytol, numstr, col);
	
	/* end frame */
	BLI_snprintf(numstr, sizeof(numstr), "%.1f", strip->end);
	UI_view2d_text_cache_add(v2d, strip->end, ymaxc + ytol, numstr, col);
}
开发者ID:YasirArafath,项目名称:blender-git,代码行数:24,代码来源:nla_draw.c


示例2: initglobals

void initglobals(void)
{
	memset(&G, 0, sizeof(Global));
	
	U.savetime = 1;

	G.main = BKE_main_new();

	strcpy(G.ima, "//");

	if (BLENDER_SUBVERSION)
		BLI_snprintf(versionstr, sizeof(versionstr), "v%d.%02d.%d", BLENDER_VERSION / 100, BLENDER_VERSION % 100, BLENDER_SUBVERSION);
	else
		BLI_snprintf(versionstr, sizeof(versionstr), "v%d.%02d", BLENDER_VERSION / 100, BLENDER_VERSION % 100);

#ifndef WITH_PYTHON_SECURITY /* default */
	G.f |= G_SCRIPT_AUTOEXEC;
#else
	G.f &= ~G_SCRIPT_AUTOEXEC;
#endif
}
开发者ID:akonneker,项目名称:blensor,代码行数:21,代码来源:blender.c


示例3: unpack_generate_paths

static void unpack_generate_paths(
        const char *name, ID *id, char *r_abspath, char *r_relpath, size_t abspathlen, size_t relpathlen)
{
	char tempname[FILE_MAX];
	char tempdir[FILE_MAXDIR];

	BLI_split_dirfile(name, tempdir, tempname, sizeof(tempdir), sizeof(tempname));

	if (tempname[0] == '\0') {
		/* Note: we do not have any real way to re-create extension out of data... */
		BLI_strncpy(tempname, id->name + 2, sizeof(tempname));
		printf("%s\n", tempname);
		BLI_filename_make_safe(tempname);
		printf("%s\n", tempname);
	}

	if (tempdir[0] == '\0') {
		/* Fallback to relative dir. */
		BLI_strncpy(tempdir, "//", sizeof(tempdir));
	}

	switch (GS(id->name)) {
		case ID_VF:
			BLI_snprintf(r_relpath, relpathlen, "//fonts/%s", tempname);
			break;
		case ID_SO:
			BLI_snprintf(r_relpath, relpathlen, "//sounds/%s", tempname);
			break;
		case ID_IM:
			BLI_snprintf(r_relpath, relpathlen, "//textures/%s", tempname);
			break;
		default:
			break;
	}

	{
		size_t len = BLI_strncpy_rlen(r_abspath, tempdir, abspathlen);
		BLI_strncpy(r_abspath + len, tempname, abspathlen - len);
	}
}
开发者ID:wchargin,项目名称:blender,代码行数:40,代码来源:packedFile.c


示例4: handle_subversion_warning

static int handle_subversion_warning(Main *main)
{
    if(main->minversionfile > BLENDER_VERSION ||
            (main->minversionfile == BLENDER_VERSION &&
             main->minsubversionfile > BLENDER_SUBVERSION)) {

        char str[128];

        BLI_snprintf(str, sizeof(str), "File written by newer Blender binary: %d.%d , expect loss of data!", main->minversionfile, main->minsubversionfile);
// XXX		error(str);
    }
    return 1;
}
开发者ID:OldBrunet,项目名称:BGERTPS,代码行数:13,代码来源:blender.c


示例5: get_proxy_filename

static void get_proxy_filename(struct anim *anim, IMB_Proxy_Size preview_size,
                               char *fname, bool temp)
{
	char index_dir[FILE_MAXDIR];
	int i = IMB_proxy_size_to_array_index(preview_size);

	char proxy_name[256];
	char stream_suffix[20];
	const char *name = (temp) ? "proxy_%d%s_part.avi" : "proxy_%d%s.avi";
	
	stream_suffix[0] = 0;

	if (anim->streamindex > 0) {
		BLI_snprintf(stream_suffix, sizeof(stream_suffix), "_st%d", anim->streamindex);
	}

	BLI_snprintf(proxy_name, sizeof(proxy_name), name,
	             (int) (proxy_fac[i] * 100), stream_suffix, anim->suffix);

	get_index_dir(anim, index_dir, sizeof(index_dir));

	BLI_join_dirfile(fname, FILE_MAXFILE + FILE_MAXDIR, index_dir, proxy_name);
}
开发者ID:mgschwan,项目名称:blensor,代码行数:23,代码来源:indexer.c


示例6: edbm_bevel_update_header

static void edbm_bevel_update_header(wmOperator *op, bContext *C)
{
	const char *str = IFACE_("Confirm: (Enter/LMB), Cancel: (Esc/RMB), Offset: %s, Segments: %d");

	char msg[HEADER_LENGTH];
	ScrArea *sa = CTX_wm_area(C);

	if (sa) {
		BevelData *opdata = op->customdata;
		char offset_str[NUM_STR_REP_LEN];

		if (hasNumInput(&opdata->num_input)) {
			outputNumInput(&opdata->num_input, offset_str);
		}
		else {
			BLI_snprintf(offset_str, NUM_STR_REP_LEN, "%f", RNA_float_get(op->ptr, "offset"));
		}

		BLI_snprintf(msg, HEADER_LENGTH, str, offset_str, RNA_int_get(op->ptr, "segments"));

		ED_area_headerprint(sa, msg);
	}
}
开发者ID:silkentrance,项目名称:blender,代码行数:23,代码来源:editmesh_bevel.c


示例7: set_pass_name

static void set_pass_name(char *passname, int passtype, int channel, const char *view)
{
	const char delims[] = {'.', '\0'};
	const char *sep;
	const char *token;
	size_t len;

	const char *passtype_name = name_from_passtype(passtype, channel);

	if (view == NULL || view[0] == '\0') {
		BLI_strncpy(passname, passtype_name, EXR_PASS_MAXNAME);
		return;
	}

	len = BLI_str_rpartition(passtype_name, delims, &sep, &token);

	if (sep) {
		BLI_snprintf(passname, EXR_PASS_MAXNAME, "%.*s.%s.%s", (int)len, passtype_name, view, token);
	}
	else {
		BLI_snprintf(passname, EXR_PASS_MAXNAME, "%s.%s", passtype_name, view);
	}
}
开发者ID:sntulix,项目名称:blender-api-javascript,代码行数:23,代码来源:render_result.c


示例8: do_node_add

static void do_node_add(bContext *C, bNodeTemplate *ntemp)
{
	Main *bmain = CTX_data_main(C);
	Scene *scene = CTX_data_scene(C);
	SpaceNode *snode = CTX_wm_space_node(C);
	ScrArea *sa = CTX_wm_area(C);
	ARegion *ar;
	bNode *node, *node_new;
	
	/* get location to add node at mouse */
	for (ar = sa->regionbase.first; ar; ar = ar->next) {
		if (ar->regiontype == RGN_TYPE_WINDOW) {
			wmWindow *win = CTX_wm_window(C);
			int x = win->eventstate->x - ar->winrct.xmin;
			int y = win->eventstate->y - ar->winrct.ymin;
			
			if (y < 60) y += 60;
			UI_view2d_region_to_view(&ar->v2d, x, y, &snode->cursor[0], &snode->cursor[1]);
		}
	}
	
	/* store selection in temp test flag */
	for (node = snode->edittree->nodes.first; node; node = node->next) {
		if (node->flag & NODE_SELECT) node->flag |= NODE_TEST;
		else node->flag &= ~NODE_TEST;
	}
	
	node_new = node_add_node(snode, bmain, scene, ntemp, snode->cursor[0], snode->cursor[1]);
	
	/* select previous selection before autoconnect */
	for (node = snode->edittree->nodes.first; node; node = node->next) {
		if (node->flag & NODE_TEST) node->flag |= NODE_SELECT;
	}
	
	/* deselect after autoconnection */
	for (node = snode->edittree->nodes.first; node; node = node->next) {
		if (node->flag & NODE_TEST) node->flag &= ~NODE_SELECT;
	}

	/* once this is called from an operator, this should be removed */
	if (node_new) {
		char undostr[BKE_UNDO_STR_MAX];
		BLI_snprintf(undostr, sizeof(undostr), "Add Node %s", nodeLabel(node_new));
		BKE_write_undo(C, undostr);
	}

	snode_notify(C, snode);
	snode_dag_update(C, snode);
}
开发者ID:danielmarg,项目名称:blender-main,代码行数:49,代码来源:node_header.c


示例9: get_proxy_fname

/* supposed to work with sequences only */
static void get_proxy_fname(MovieClip *clip, int proxy_render_size, int undistorted, int framenr, char *name)
{
    int size = rendersize_to_number(proxy_render_size);
    char dir[FILE_MAX], clipdir[FILE_MAX], clipfile[FILE_MAX];

    BLI_split_dirfile(clip->name, clipdir, clipfile, FILE_MAX, FILE_MAX);

    if (clip->flag & MCLIP_USE_PROXY_CUSTOM_DIR) {
        BLI_strncpy(dir, clip->proxy.dir, sizeof(dir));
    }
    else {
        BLI_snprintf(dir, FILE_MAX, "%s/BL_proxy", clipdir);
    }

    if (undistorted)
        BLI_snprintf(name, FILE_MAX, "%s/%s/proxy_%d_undistorted/%08d", dir, clipfile, size, framenr);
    else
        BLI_snprintf(name, FILE_MAX, "%s/%s/proxy_%d/%08d", dir, clipfile, size, framenr);

    BLI_path_abs(name, G.main->name);
    BLI_path_frame(name, 1, 0);

    strcat(name, ".jpg");
}
开发者ID:nttputus,项目名称:blensor,代码行数:25,代码来源:movieclip.c


示例10: pose_slide_draw_status

/* draw percentage indicator in header */
static void pose_slide_draw_status(tPoseSlideOp *pso)
{
	char status_str[UI_MAX_DRAW_STR];
	char mode_str[32];
	
	switch (pso->mode) {
		case POSESLIDE_PUSH:
			strcpy(mode_str, "Push Pose");
			break;
		case POSESLIDE_RELAX:
			strcpy(mode_str, "Relax Pose");
			break;
		case POSESLIDE_BREAKDOWN:
			strcpy(mode_str, "Breakdown");
			break;
		
		default:
			/* unknown */
			strcpy(mode_str, "Sliding-Tool");
			break;
	}
	
	if (hasNumInput(&pso->num)) {
		Scene *scene = pso->scene;
		char str_offs[NUM_STR_REP_LEN];
		
		outputNumInput(&pso->num, str_offs, &scene->unit);
		
		BLI_snprintf(status_str, sizeof(status_str), "%s: %s", mode_str, str_offs);
	}
	else {
		BLI_snprintf(status_str, sizeof(status_str), "%s: %d %%", mode_str, (int)(pso->percentage * 100.0f));
	}
	
	ED_area_headerprint(pso->sa, status_str);
}
开发者ID:UPBGE,项目名称:blender,代码行数:37,代码来源:pose_slide.c


示例11: fluidsim_find_lastframe

static int fluidsim_find_lastframe(FluidsimSettings *fss)
{
	char targetDir[FILE_MAXFILE+FILE_MAXDIR], targetFile[FILE_MAXFILE+FILE_MAXDIR];
	int curFrame = 1;

	BLI_snprintf(targetDir, sizeof(targetDir), "%sfluidsurface_final_####.bobj.gz", fss->surfdataPath);
	BLI_path_abs(targetDir, G.main->name);

	do {
		BLI_strncpy(targetFile, targetDir, sizeof(targetFile));
		BLI_path_frame(targetFile, curFrame++, 0);
	} while(BLI_exist(targetFile));

	return curFrame - 1;
}
开发者ID:BHCLL,项目名称:blendocv,代码行数:15,代码来源:rna_fluidsim.c


示例12: unit_scale_str

static int unit_scale_str(char *str, int len_max, char *str_tmp, double scale_pref, bUnitDef *unit,
                          const char *replace_str)
{
	char *str_found;

	if ((len_max > 0) && (str_found = (char *)unit_find_str(str, replace_str))) {
		/* XXX - investigate, does not respect len_max properly  */

		int len, len_num, len_name, len_move, found_ofs;

		found_ofs = (int)(str_found - str);

		len = strlen(str);

		len_name = strlen(replace_str);
		len_move = (len - (found_ofs + len_name)) + 1; /* 1+ to copy the string terminator */
		len_num = BLI_snprintf(str_tmp, TEMP_STR_SIZE, "*%g"SEP_STR, unit->scalar / scale_pref); /* # removed later */

		if (len_num > len_max)
			len_num = len_max;

		if (found_ofs + len_num + len_move > len_max) {
			/* can't move the whole string, move just as much as will fit */
			len_move -= (found_ofs + len_num + len_move) - len_max;
		}

		if (len_move > 0) {
			/* resize the last part of the string */
			memmove(str_found + len_num, str_found + len_name, len_move); /* may grow or shrink the string */
		}

		if (found_ofs + len_num > len_max) {
			/* not even the number will fit into the string, only copy part of it */
			len_num -= (found_ofs + len_num) - len_max;
		}

		if (len_num > 0) {
			/* its possible none of the number could be copied in */
			memcpy(str_found, str_tmp, len_num); /* without the string terminator */
		}

		/* since the null terminator wont be moved if the stringlen_max
		 * was not long enough to fit everything in it */
		str[len_max - 1] = '\0';
		return found_ofs + len_num;
	}
	return 0;
}
开发者ID:Walid-Shouman,项目名称:Blender,代码行数:48,代码来源:unit.c


示例13: ui_imageuser_slot_menu

static void ui_imageuser_slot_menu(bContext *UNUSED(C), uiLayout *layout, void *image_p)
{
  uiBlock *block = uiLayoutGetBlock(layout);
  Image *image = image_p;
  int slot_id;

  uiDefBut(block,
           UI_BTYPE_LABEL,
           0,
           IFACE_("Slot"),
           0,
           0,
           UI_UNIT_X * 5,
           UI_UNIT_Y,
           NULL,
           0.0,
           0.0,
           0,
           0,
           "");
  uiItemS(layout);

  slot_id = BLI_listbase_count(&image->renderslots) - 1;
  for (RenderSlot *slot = image->renderslots.last; slot; slot = slot->prev) {
    char str[64];
    if (slot->name[0] != '\0') {
      BLI_strncpy(str, slot->name, sizeof(str));
    }
    else {
      BLI_snprintf(str, sizeof(str), IFACE_("Slot %d"), slot_id + 1);
    }
    uiDefButS(block,
              UI_BTYPE_BUT_MENU,
              B_NOP,
              str,
              0,
              0,
              UI_UNIT_X * 5,
              UI_UNIT_X,
              &image->render_slot,
              (float)slot_id,
              0.0,
              0,
              -1,
              "");
    slot_id--;
  }
}
开发者ID:dfelinto,项目名称:blender,代码行数:48,代码来源:image_buttons.c


示例14: BPY_modules_load_user

void BPY_modules_load_user(bContext *C)
{
	PyGILState_STATE gilstate;
	Main *bmain = CTX_data_main(C);
	Text *text;

	/* can happen on file load */
	if (bmain == NULL)
		return;

	/* update pointers since this can run from a nested script
	 * on file load */
	if (py_call_level) {
		BPY_context_update(C);
	}

	bpy_context_set(C, &gilstate);

	for (text = bmain->text.first; text; text = text->id.next) {
		if (text->flags & TXT_ISSCRIPT && BLI_testextensie(text->id.name + 2, ".py")) {
			if (!(G.f & G_SCRIPT_AUTOEXEC)) {
				if (!(G.f & G_SCRIPT_AUTOEXEC_FAIL_QUIET)) {
					G.f |= G_SCRIPT_AUTOEXEC_FAIL;
					BLI_snprintf(G.autoexec_fail, sizeof(G.autoexec_fail), "Text '%s'", text->id.name + 2);

					printf("scripts disabled for \"%s\", skipping '%s'\n", bmain->name, text->id.name + 2);
				}
			}
			else {
				PyObject *module = bpy_text_import(text);

				if (module == NULL) {
					PyErr_Print();
					PyErr_Clear();
				}
				else {
					Py_DECREF(module);
				}

				/* check if the script loaded a new file */
				if (bmain != CTX_data_main(C)) {
					break;
				}
			}
		}
	}
	bpy_context_clear(C, &gilstate);
}
开发者ID:UPBGE,项目名称:blender,代码行数:48,代码来源:bpy_interface.c


示例15: MEM_callocN

BoidState *boid_new_state(BoidSettings *boids)
{
	BoidState *state = MEM_callocN(sizeof(BoidState), "BoidState");

	state->id = boids->last_state_id++;
	if (state->id)
		BLI_snprintf(state->name, sizeof(state->name), "State %i", state->id);
	else
		strcpy(state->name, "State");

	state->rule_fuzziness = 0.5;
	state->volume = 1.0f;
	state->channels |= ~0;

	return state;
}
开发者ID:Andrewson3D,项目名称:blender-for-vray,代码行数:16,代码来源:boids.c


示例16: 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 protected] */
      tc = strchr(uilng, '@');
      if (tc) {
        BLI_strncpy(tstr + szt, tc, sizeof(tstr) - szt);
      }

      BLI_join_dirfile(path, maxlen, root, tstr);
      strcat(tstr, ".po");
      BLI_path_append(path, maxlen, tstr);
      if (BLI_is_file(path)) {
        return;
      }
    }
  }

  /* Else no po file! */
  path[0] = '\0';
}
开发者ID:dfelinto,项目名称:blender,代码行数:52,代码来源:interface_ops.c


示例17: BLI_path_frame_range

int BLI_path_frame_range(char *path, int sta, int end, int digits)
{
	int ch_sta, ch_end;

	if (digits)
		ensure_digits(path, digits);

	if (stringframe_chars(path, &ch_sta, &ch_end)) { /* warning, ch_end is the last # +1 */
		char tmp[FILE_MAX];
		BLI_snprintf(tmp, sizeof(tmp),
		             "%.*s%.*d-%.*d%s",
		             ch_sta, path, ch_end - ch_sta, sta, ch_end - ch_sta, end, path + ch_end);
		BLI_strncpy(path, tmp, FILE_MAX);
		return 1;
	}
	return 0;
}
开发者ID:danielmarg,项目名称:blender-main,代码行数:17,代码来源:path_util.c


示例18: clip_delete_track

void clip_delete_track(bContext *C, MovieClip *clip, MovieTrackingTrack *track)
{
	MovieTracking *tracking = &clip->tracking;
	MovieTrackingStabilization *stab = &tracking->stabilization;
	MovieTrackingTrack *act_track = BKE_tracking_track_get_active(tracking);
	ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking);
	bool has_bundle = false, update_stab = false;
	char track_name_escaped[MAX_NAME], prefix[MAX_NAME * 2];

	if (track == act_track)
		tracking->act_track = NULL;

	if (track == stab->rot_track) {
		stab->rot_track = NULL;

		update_stab = true;
	}

	/* handle reconstruction display in 3d viewport */
	if (track->flag & TRACK_HAS_BUNDLE)
		has_bundle = true;

	/* Make sure no plane will use freed track */
	BKE_tracking_plane_tracks_remove_point_track(tracking, track);

	/* Delete f-curves associated with the track (such as weight, i.e.) */
	BLI_strescape(track_name_escaped, track->name, sizeof(track_name_escaped));
	BLI_snprintf(prefix, sizeof(prefix), "tracks[\"%s\"]", track_name_escaped);
	BKE_animdata_fix_paths_remove(&clip->id, prefix);

	BKE_tracking_track_free(track);
	BLI_freelinkN(tracksbase, track);

	WM_event_add_notifier(C, NC_MOVIECLIP | NA_EDITED, clip);

	if (update_stab) {
		tracking->stabilization.ok = false;
		WM_event_add_notifier(C, NC_MOVIECLIP | ND_DISPLAY, clip);
	}

	DAG_id_tag_update(&clip->id, 0);

	if (has_bundle)
		WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, NULL);
}
开发者ID:Andrewson3D,项目名称:blender-for-vray,代码行数:45,代码来源:clip_utils.c


示例19: walk_update_header

static void walk_update_header(bContext *C, wmOperator *op, WalkInfo *walk)
{
  const bool gravity = (walk->navigation_mode == WALK_MODE_GRAVITY) ||
                       ((walk->teleport.state == WALK_TELEPORT_STATE_ON) &&
                        (walk->teleport.navigation_mode == WALK_MODE_GRAVITY));
  char header[UI_MAX_DRAW_STR];
  char buf[UI_MAX_DRAW_STR];

  char *p = buf;
  int available_len = sizeof(buf);

#define WM_MODALKEY(_id) \
  WM_modalkeymap_operator_items_to_string_buf( \
      op->type, (_id), true, UI_MAX_SHORTCUT_STR, &available_len, &p)

  BLI_snprintf(header,
               sizeof(header),
               IFACE_("%s: confirm, %s: cancel, "
                      "%s: gravity (%s), "
                      "%s|%s|%s|%s: move around, "
                      "%s: fast, %s: slow, "
                      "%s|%s: up and down, "
                      "%s: teleport, %s: jump, "
                      "%s: increase speed, %s: decrease speed"),
               WM_MODALKEY(WALK_MODAL_CONFIRM),
               WM_MODALKEY(WALK_MODAL_CANCEL),
               WM_MODALKEY(WALK_MODAL_TOGGLE),
               WM_bool_as_string(gravity),
               WM_MODALKEY(WALK_MODAL_DIR_FORWARD),
               WM_MODALKEY(WALK_MODAL_DIR_LEFT),
               WM_MODALKEY(WALK_MODAL_DIR_BACKWARD),
               WM_MODALKEY(WALK_MODAL_DIR_RIGHT),
               WM_MODALKEY(WALK_MODAL_FAST_ENABLE),
               WM_MODALKEY(WALK_MODAL_SLOW_ENABLE),
               WM_MODALKEY(WALK_MODAL_DIR_UP),
               WM_MODALKEY(WALK_MODAL_DIR_DOWN),
               WM_MODALKEY(WALK_MODAL_TELEPORT),
               WM_MODALKEY(WALK_MODAL_JUMP),
               WM_MODALKEY(WALK_MODAL_ACCELERATE),
               WM_MODALKEY(WALK_MODAL_DECELERATE));

#undef WM_MODALKEY

  ED_workspace_status_text(C, header);
}
开发者ID:dfelinto,项目名称:blender,代码行数:45,代码来源:view3d_walk.c


示例20: 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,代码来源:file_ops.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ BLI_sprintfN函数代码示例发布时间:2022-05-30
下一篇:
C++ BLI_remlink函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap