本文整理汇总了C++中BLI_sprintfN函数的典型用法代码示例。如果您正苦于以下问题:C++ BLI_sprintfN函数的具体用法?C++ BLI_sprintfN怎么用?C++ BLI_sprintfN使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了BLI_sprintfN函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: modifiers_findByType
static char *rna_ClothCollisionSettings_path(PointerRNA *ptr)
{
Object *ob = (Object *)ptr->id.data;
ModifierData *md = modifiers_findByType(ob, eModifierType_Cloth);
if (md) {
char name_esc[sizeof(md->name) * 2];
BLI_strescape(name_esc, md->name, sizeof(name_esc));
return BLI_sprintfN("modifiers[\"%s\"].collision_settings", name_esc);
}
else {
return NULL;
}
}
开发者ID:DrangPo,项目名称:blender,代码行数:14,代码来源:rna_cloth.c
示例17: set_brush_rc_props
void set_brush_rc_props(PointerRNA *ptr, const char *paint,
const char *prop, const char *secondary_prop,
RCFlags flags)
{
const char *ups_path = "tool_settings.unified_paint_settings";
char *brush_path;
brush_path = BLI_sprintfN("tool_settings.%s.brush", paint);
set_brush_rc_path(ptr, brush_path, "data_path_primary", prop);
if (secondary_prop) {
set_brush_rc_path(ptr, ups_path, "use_secondary", secondary_prop);
set_brush_rc_path(ptr, ups_path, "data_path_secondary", prop);
}
else {
RNA_string_set(ptr, "use_secondary", "");
RNA_string_set(ptr, "data_path_secondary", "");
}
set_brush_rc_path(ptr, brush_path, "color_path", "cursor_color_add");
if (flags & RC_SECONDARY_ROTATION)
set_brush_rc_path(ptr, brush_path, "rotation_path", "mask_texture_slot.angle");
else
set_brush_rc_path(ptr, brush_path, "rotation_path", "texture_slot.angle");
RNA_string_set(ptr, "image_id", brush_path);
if (flags & RC_COLOR) {
set_brush_rc_path(ptr, brush_path, "fill_color_path", "color");
}
else {
RNA_string_set(ptr, "fill_color_path", "");
}
if (flags & RC_COLOR_OVERRIDE) {
RNA_string_set(ptr, "fill_color_override_path", "tool_settings.unified_paint_settings.color");
RNA_string_set(ptr, "fill_color_override_test_path", "tool_settings.unified_paint_settings.use_unified_color");
}
else {
RNA_string_set(ptr, "fill_color_override_path", "");
RNA_string_set(ptr, "fill_color_override_test_path", "");
}
if (flags & RC_ZOOM)
RNA_string_set(ptr, "zoom_path", "space_data.zoom");
else
RNA_string_set(ptr, "zoom_path", "");
RNA_boolean_set(ptr, "secondary_tex", (flags & RC_SECONDARY_ROTATION) != 0);
MEM_freeN(brush_path);
}
开发者ID:mgschwan,项目名称:blensor,代码行数:50,代码来源:paint_ops.c
示例18: BLI_findindex
static char *rna_MetaElement_path(PointerRNA *ptr)
{
MetaBall *mb = ptr->id.data;
MetaElem *ml = ptr->data;
int index = -1;
if (mb->editelems)
index = BLI_findindex(mb->editelems, ml);
if (index == -1)
index = BLI_findindex(&mb->elems, ml);
if (index == -1)
return NULL;
return BLI_sprintfN("elements[%d]", index);
}
开发者ID:YasirArafath,项目名称:blender-git,代码行数:15,代码来源:rna_meta.c
示例19: BLF_lang_set
void BLF_lang_set(const char *str)
{
#ifdef WITH_INTERNATIONAL
int ulang = ULANGUAGE;
const char *short_locale = str ? str : LOCALE(ulang);
const char *short_locale_utf8 = NULL;
if ((U.transopts & USER_DOTRANSLATE) == 0)
return;
/* We want to avoid locales like '.UTF-8'! */
if (short_locale[0]) {
/* Hurrey! encoding needs to be placed *before* variant! */
char *variant = strchr(short_locale, '@');
if (variant) {
char *locale = BLI_strdupn(short_locale, variant - short_locale);
short_locale_utf8 = BLI_sprintfN("%s.UTF-8%s", locale, variant);
MEM_freeN(locale);
}
else {
short_locale_utf8 = BLI_sprintfN("%s.UTF-8", short_locale);
}
}
else {
short_locale_utf8 = short_locale;
}
bl_locale_set(short_locale_utf8);
if (short_locale[0]) {
MEM_freeN((void *)short_locale_utf8);
}
#else
(void)str;
#endif
}
开发者ID:linkedinyou,项目名称:blender-git,代码行数:36,代码来源:blf_lang.c
示例20: pose_slide_apply_vec3
/* helper for apply() - perform sliding for some 3-element vector */
static void pose_slide_apply_vec3(tPoseSlideOp *pso, tPChanFCurveLink *pfl, float vec[3], const char propName[])
{
LinkData *ld = NULL;
char *path = NULL;
/* get the path to use... */
path = BLI_sprintfN("%s.%s", pfl->pchan_path, propName);
/* using this path, find each matching F-Curve for the variables we're interested in */
while ( (ld = poseAnim_mapping_getNextFCurve(&pfl->fcurves, ld, path)) ) {
FCurve *fcu = (FCurve *)ld->data;
/* just work on these channels one by one... there's no interaction between values */
BLI_assert(fcu->array_index < 3);
pose_slide_apply_val(pso, fcu, &vec[fcu->array_index]);
}
/* free the temp path we got */
MEM_freeN(path);
}
开发者ID:Walid-Shouman,项目名称:Blender,代码行数:21,代码来源:pose_slide.c
注:本文中的BLI_sprintfN函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论