当前位置: 首页>>代码示例>>C++>>正文


C++ BLI_sprintfN函数代码示例

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


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

示例1: BLI_sprintfN

static char *rna_DynamicPaintBrushSettings_path(PointerRNA *ptr)
{
	DynamicPaintBrushSettings *settings = (DynamicPaintBrushSettings*)ptr->data;
	ModifierData *md= (ModifierData *)settings->pmd;

	return BLI_sprintfN("modifiers[\"%s\"].brush_settings", md->name);
}
开发者ID:mik0001,项目名称:Blender,代码行数:7,代码来源:rna_dynamicpaint.c

示例2: BLI_sprintfN

static char *rna_FluidSettings_path(PointerRNA *ptr)
{
	FluidsimSettings *fss = (FluidsimSettings*)ptr->data;
	ModifierData *md= (ModifierData *)fss->fmd;

	return BLI_sprintfN("modifiers[\"%s\"].settings", md->name);
}
开发者ID:BHCLL,项目名称:blendocv,代码行数:7,代码来源:rna_fluidsim.c

示例3: modifiers_findByType

static char *rna_ClothCollisionSettings_path(PointerRNA *ptr)
{
	Object *ob= (Object*)ptr->id.data;
	ModifierData *md= modifiers_findByType(ob, eModifierType_Cloth);

	return md ? BLI_sprintfN("modifiers[%s].collision_settings", md->name) : NULL;
}
开发者ID:jinjoh,项目名称:NOOR,代码行数:7,代码来源:rna_cloth.c

示例4: BLI_sprintfN

static char *rna_Bone_path(PointerRNA *ptr)
{
	Bone *bone = (Bone*)ptr->data;
	
	/* special exception for trying to get the path where ID-block is Object
	 *	- this will be assumed to be from a Pose Bone...
	 */
	if (ptr->id.data) {
		ID *id = (ID *)ptr->id.data;
		
		if (GS(id->name) == ID_OB)
			return BLI_sprintfN("pose.bones[\"%s\"].bone", bone->name);
	}
	
	/* from armature... */
	return BLI_sprintfN("bones[\"%s\"]", bone->name);
}
开发者ID:mik0001,项目名称:Blender,代码行数:17,代码来源:rna_armature.c

示例5: BLI_strescape

static char *rna_ViewLayer_path(PointerRNA *ptr)
{
  ViewLayer *srl = (ViewLayer *)ptr->data;
  char name_esc[sizeof(srl->name) * 2];

  BLI_strescape(name_esc, srl->name, sizeof(name_esc));
  return BLI_sprintfN("view_layers[\"%s\"]", name_esc);
}
开发者ID:dfelinto,项目名称:blender,代码行数:8,代码来源:rna_layer.c

示例6: BLI_strescape

static char *rna_DynamicPaintBrushSettings_path(PointerRNA *ptr)
{
	DynamicPaintBrushSettings *settings = (DynamicPaintBrushSettings *)ptr->data;
	ModifierData *md = (ModifierData *)settings->pmd;
	char name_esc[sizeof(md->name) * 2];

	BLI_strescape(name_esc, md->name, sizeof(name_esc));
	return BLI_sprintfN("modifiers[\"%s\"].brush_settings", name_esc);
}
开发者ID:244xiao,项目名称:blender,代码行数:9,代码来源:rna_dynamicpaint.c

示例7: CTX_wm_area

/* Temporary wrapper for driver operators for buttons to make it easier to create
 * such drivers by rerouting all paths through the active object instead so that
 * they will get picked up by the dependency system.
 *
 * < C: context pointer - for getting active data 
 * <> ptr: RNA pointer for property's datablock. May be modified as result of path remapping.
 * < prop: RNA definition of property to add for
 *
 * > returns: MEM_alloc'd string representing the path to the property from the given PointerRNA
 */
static char *get_driver_path_hack(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
{
	ID *id = (ID *)ptr->id.data;
	ScrArea *sa = CTX_wm_area(C);
	
	/* get standard path which may be extended */
	char *basepath = RNA_path_from_ID_to_property(ptr, prop);
	char *path = basepath; /* in case no remapping is needed */
	
	
	/* Remapping will only be performed in the Properties Editor, as only this 
	 * restricts the subspace of options to the 'active' data (a manageable state)
	 */
	// TODO: watch out for pinned context?
	if ((sa) && (sa->spacetype == SPACE_BUTS)) {
		Object *ob = CTX_data_active_object(C);
		
		if (ob && id) {
			/* only id-types which can be remapped to go through objects should be considered */
			switch (GS(id->name)) {
				case ID_TE: /* textures */
				{
					Material *ma = give_current_material(ob, ob->actcol);
					Tex *tex = give_current_material_texture(ma);
					
					/* assumes: texture will only be shown if it is active material's active texture it's ok */
					if ((ID *)tex == id) {
						char name_esc_ma[(sizeof(ma->id.name) - 2) * 2];
						char name_esc_tex[(sizeof(tex->id.name) - 2) * 2];

						BLI_strescape(name_esc_ma, ma->id.name + 2, sizeof(name_esc_ma));
						BLI_strescape(name_esc_tex, tex->id.name + 2, sizeof(name_esc_tex));

						/* create new path */
						// TODO: use RNA path functions to construct step by step instead?
						// FIXME: maybe this isn't even needed anymore...
						path = BLI_sprintfN("material_slots[\"%s\"].material.texture_slots[\"%s\"].texture.%s", 
						                    name_esc_ma, name_esc_tex, basepath);
							
						/* free old one */
						MEM_freeN(basepath);
					}
					break;
				}
			}
			
			/* fix RNA pointer, as we've now changed the ID root by changing the paths */
			if (basepath != path) {
				/* rebase provided pointer so that it starts from object... */
				RNA_pointer_create(&ob->id, ptr->type, ptr->data, ptr);
			}
		}
	}
	
	/* the path should now have been corrected for use */
	return path;
}
开发者ID:Walid-Shouman,项目名称:Blender,代码行数:67,代码来源:drivers.c

示例8: BLI_strescape

static char *rna_FluidSettings_path(PointerRNA *ptr)
{
  FluidsimSettings *fss = (FluidsimSettings *)ptr->data;
  ModifierData *md = (ModifierData *)fss->fmd;
  char name_esc[sizeof(md->name) * 2];

  BLI_strescape(name_esc, md->name, sizeof(name_esc));
  return BLI_sprintfN("modifiers[\"%s\"].settings", name_esc);
}
开发者ID:dfelinto,项目名称:blender,代码行数:9,代码来源:rna_fluidsim.c

示例9: BLI_strescape

static char *rna_BoidRule_path(PointerRNA *ptr)
{
    BoidRule *rule = (BoidRule *)ptr->data;
    char name_esc[sizeof(rule->name) * 2];

    BLI_strescape(name_esc, rule->name, sizeof(name_esc));

    return BLI_sprintfN("rules[\"%s\"]", name_esc);  /* XXX not unique */
}
开发者ID:caomw,项目名称:blender-ui,代码行数:9,代码来源:rna_boid.c

示例10: BLI_strescape

static char *rna_GPencilLayer_path(PointerRNA *ptr)
{
	bGPDlayer *gpl = (bGPDlayer *)ptr->data;
	char name_esc[sizeof(gpl->info) * 2];
	
	BLI_strescape(name_esc, gpl->info, sizeof(name_esc));
	
	return BLI_sprintfN("layers[\"%s\"]", name_esc);
}
开发者ID:Andrewson3D,项目名称:blender-for-vray,代码行数:9,代码来源:rna_gpencil.c

示例11: BLI_strescape

static char *rna_Bone_path(PointerRNA *ptr)
{
	ID *id = ptr->id.data;
	Bone *bone = (Bone *)ptr->data;
	char name_esc[sizeof(bone->name) * 2];
	
	BLI_strescape(name_esc, bone->name, sizeof(name_esc));

	/* special exception for trying to get the path where ID-block is Object
	 * - this will be assumed to be from a Pose Bone...
	 */
	if (id) {
		if (GS(id->name) == ID_OB) {
			return BLI_sprintfN("pose.bones[\"%s\"].bone", name_esc);
		}
	}
	
	/* from armature... */
	return BLI_sprintfN("bones[\"%s\"]", name_esc);
}
开发者ID:SuriyaaKudoIsc,项目名称:blender-git,代码行数:20,代码来源:rna_armature.c

示例12: BLI_sprintfN

static char *rna_BoidSettings_path(PointerRNA *ptr)
{
    BoidSettings *boids = (BoidSettings *)ptr->data;

    if (particle_id_check(ptr)) {
        ParticleSettings *part = (ParticleSettings *)ptr->id.data;

        if (part->boids == boids)
            return BLI_sprintfN("boids");
    }
    return NULL;
}
开发者ID:caomw,项目名称:blender-ui,代码行数:12,代码来源:rna_boid.c

示例13: BKE_collection_new_name_get

/**
 * The automatic/fallback name of a new collection.
 */
void BKE_collection_new_name_get(Collection *collection_parent, char *rname)
{
  char *name;

  if (!collection_parent) {
    name = BLI_strdup("Collection");
  }
  else if (collection_parent->flag & COLLECTION_IS_MASTER) {
    name = BLI_sprintfN("Collection %d", BLI_listbase_count(&collection_parent->children) + 1);
  }
  else {
    const int number = BLI_listbase_count(&collection_parent->children) + 1;
    const int digits = integer_digits_i(number);
    const int max_len = sizeof(collection_parent->id.name) - 1 /* NULL terminator */ -
                        (1 + digits) /* " %d" */ - 2 /* ID */;
    name = BLI_sprintfN("%.*s %d", max_len, collection_parent->id.name + 2, number);
  }

  BLI_strncpy(rname, name, MAX_NAME);
  MEM_freeN(name);
}
开发者ID:wangyxuan,项目名称:blender,代码行数:24,代码来源:collection.c

示例14: rna_ShapeKey_find_key

static char *rna_ShapeKeyPoint_path(PointerRNA *ptr)
{
	ID *id = (ID *)ptr->id.data;
	Key *key = rna_ShapeKey_find_key(ptr->id.data);
	KeyBlock *kb;
	float *point = (float *)ptr->data;
	
	/* if we can get a key block, we can construct a path */
	kb = rna_ShapeKeyData_find_keyblock(key, point); 
	
	if (kb) {
		int index = rna_ShapeKeyPoint_get_index(key, kb, point);
		
		if (GS(id->name) == ID_KE)
			return BLI_sprintfN("key_blocks[\"%s\"].data[%d]", kb->name, index);
		else
			return BLI_sprintfN("shape_keys.key_blocks[\"%s\"].data[%d]", kb->name, index);
	}
	else
		return NULL; // XXX: there's really no way to resolve this...
}
开发者ID:mik0001,项目名称:Blender,代码行数:21,代码来源:rna_key.c

示例15: switch

char *BKE_linestyle_path_to_color_ramp(FreestyleLineStyle *linestyle, ColorBand *color_ramp)
{
	LineStyleModifier *m;
	bool found = false;

	for (m = (LineStyleModifier *)linestyle->color_modifiers.first; m; m = m->next) {
		switch (m->type) {
			case LS_MODIFIER_ALONG_STROKE:
				if (color_ramp == ((LineStyleColorModifier_AlongStroke *)m)->color_ramp)
					found = true;
				break;
			case LS_MODIFIER_DISTANCE_FROM_CAMERA:
				if (color_ramp == ((LineStyleColorModifier_DistanceFromCamera *)m)->color_ramp)
					found = true;
				break;
			case LS_MODIFIER_DISTANCE_FROM_OBJECT:
				if (color_ramp == ((LineStyleColorModifier_DistanceFromObject *)m)->color_ramp)
					found = true;
				break;
			case LS_MODIFIER_MATERIAL:
				if (color_ramp == ((LineStyleColorModifier_Material *)m)->color_ramp)
					found = true;
				break;
			case LS_MODIFIER_TANGENT:
				if (color_ramp == ((LineStyleColorModifier_Tangent *)m)->color_ramp)
					found = true;
				break;
			case LS_MODIFIER_NOISE:
				if (color_ramp == ((LineStyleColorModifier_Noise *)m)->color_ramp)
					found = true;
				break;
			case LS_MODIFIER_CREASE_ANGLE:
				if (color_ramp == ((LineStyleColorModifier_CreaseAngle *)m)->color_ramp)
					found = true;
				break;
			case LS_MODIFIER_CURVATURE_3D:
				if (color_ramp == ((LineStyleColorModifier_Curvature_3D *)m)->color_ramp)
					found = true;
				break;
		}

		if (found) {
			char name_esc[sizeof(m->name) * 2];
			BLI_strescape(name_esc, m->name, sizeof(name_esc));
			return BLI_sprintfN("color_modifiers[\"%s\"].color_ramp", name_esc);
		}
	}
	printf("BKE_linestyle_path_to_color_ramp: No color ramps correspond to the given pointer.\n");
	return NULL;
}
开发者ID:rav66,项目名称:blender,代码行数:50,代码来源:linestyle.c


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