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

C++ BKE_libblock_alloc函数代码示例

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

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



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

示例1: BKE_libblock_alloc

World *add_world(Main *bmain, const char *name)
{
	World *wrld;

	wrld = BKE_libblock_alloc(&bmain->world, ID_WO, name);
	
	wrld->horr = 0.05f;
	wrld->horg = 0.05f;
	wrld->horb = 0.05f;
	wrld->zenr = 0.01f;
	wrld->zeng = 0.01f;
	wrld->zenb = 0.01f;
	wrld->skytype = 0;
	wrld->stardist = 15.0f;
	wrld->starsize = 2.0f;

	wrld->exp = 0.0f;
	wrld->exposure = wrld->range = 1.0f;

	wrld->aodist = 10.0f;
	wrld->aosamp = 5;
	wrld->aoenergy = 1.0f;
	wrld->ao_env_energy = 1.0f;
	wrld->ao_indirect_energy = 1.0f;
	wrld->ao_indirect_bounces = 1;
	wrld->aobias = 0.05f;
	wrld->ao_samp_method = WO_AOSAMP_HAMMERSLEY;
	wrld->ao_approx_error = 0.25f;
	
	wrld->preview = NULL;
	wrld->miststa = 5.0f;
	wrld->mistdist = 25.0f;

	return wrld;
}
开发者ID:244xiao,项目名称:blender,代码行数:35,代码来源:world.c


示例2: which_libbase

/* used everywhere in blenkernel */
void *BKE_libblock_copy(ID *id)
{
    ID *idn;
    ListBase *lb;
    size_t idn_len;

    lb = which_libbase(G.main, GS(id->name));
    idn = BKE_libblock_alloc(lb, GS(id->name), id->name + 2);

    assert(idn != NULL);

    idn_len = MEM_allocN_len(idn);
    if ((int)idn_len - (int)sizeof(ID) > 0) { /* signed to allow neg result */
        const char *cp = (const char *)id;
        char *cpn = (char *)idn;

        memcpy(cpn + sizeof(ID), cp + sizeof(ID), idn_len - sizeof(ID));
    }

    id->newid = idn;
    idn->flag |= LIB_NEW;

    BKE_libblock_copy_data(idn, id, FALSE);

    return idn;
}
开发者ID:nttputus,项目名称:blensor,代码行数:27,代码来源:library.c


示例3: BLI_strncpy

bSound *sound_new_file(struct Main *bmain, const char *filename)
{
	bSound *sound = NULL;

	char str[FILE_MAX];
	char *path;

	size_t len;

	BLI_strncpy(str, filename, sizeof(str));

	path = /*bmain ? bmain->name :*/ G.main->name;

	BLI_path_abs(str, path);

	len = strlen(filename);
	while (len > 0 && filename[len - 1] != '/' && filename[len - 1] != '\\')
		len--;

	sound = BKE_libblock_alloc(bmain, ID_SO, filename + len);
	BLI_strncpy(sound->name, filename, FILE_MAX);
	/* sound->type = SOUND_TYPE_FILE; */ /* XXX unused currently */

	sound_load(bmain, sound);

	if (!sound->playback_handle) {
		BKE_libblock_free(bmain, sound);
		sound = NULL;
	}

	return sound;
}
开发者ID:Walid-Shouman,项目名称:Blender,代码行数:32,代码来源:sound.c


示例4: strcpy

bSound *sound_new_limiter(struct Main *bmain, bSound *source, float start, float end)
{
	bSound *sound = NULL;

	char name[MAX_ID_NAME + 5];
	strcpy(name, "lim_");
	strcpy(name + 4, source->id.name);

	sound = BKE_libblock_alloc(bmain, ID_SO, name);

	sound->child_sound = source;
	sound->start = start;
	sound->end = end;
	sound->type = SOUND_TYPE_LIMITER;

	sound_load(bmain, sound);

	if (!sound->playback_handle)
	{
		BKE_libblock_free(bmain, sound);
		sound = NULL;
	}

	return sound;
}
开发者ID:Walid-Shouman,项目名称:Blender,代码行数:25,代码来源:sound.c


示例5: STRNCPY

/* Add new collection, without view layer syncing. */
static Collection *collection_add(Main *bmain,
                                  Collection *collection_parent,
                                  const char *name_custom)
{
  /* Determine new collection name. */
  char name[MAX_NAME];

  if (name_custom) {
    STRNCPY(name, name_custom);
  }
  else {
    BKE_collection_new_name_get(collection_parent, name);
  }

  /* Create new collection. */
  Collection *collection = BKE_libblock_alloc(bmain, ID_GR, name, 0);

  /* We increase collection user count when linking to Collections. */
  id_us_min(&collection->id);

  /* Optionally add to parent collection. */
  if (collection_parent) {
    collection_child_add(collection_parent, collection, 0, true);
  }

  return collection;
}
开发者ID:wangyxuan,项目名称:blender,代码行数:28,代码来源:collection.c


示例6: BKE_libblock_alloc

bAction *add_empty_action(Main *bmain, const char name[])
{
	bAction *act;
	
	act = BKE_libblock_alloc(bmain, ID_AC, name);
	
	return act;
}	
开发者ID:UPBGE,项目名称:blender,代码行数:8,代码来源:action.c


示例7: BKE_libblock_alloc

void *BKE_cachefile_add(Main *bmain, const char *name)
{
	CacheFile *cache_file = BKE_libblock_alloc(bmain, ID_CF, name, 0);

	BKE_cachefile_init(cache_file);

	return cache_file;
}
开发者ID:mgschwan,项目名称:blensor,代码行数:8,代码来源:cachefile.c


示例8:

FreestyleLineStyle *BKE_linestyle_new(struct Main *bmain, const char *name)
{
	FreestyleLineStyle *linestyle;

	linestyle = (FreestyleLineStyle *)BKE_libblock_alloc(bmain, ID_LS, name);

	BKE_linestyle_init(linestyle);

	return linestyle;
}
开发者ID:rav66,项目名称:blender,代码行数:10,代码来源:linestyle.c


示例9: BKE_libblock_alloc

Lattice *BKE_lattice_add(Main *bmain, const char *name)
{
  Lattice *lt;

  lt = BKE_libblock_alloc(bmain, ID_LT, name, 0);

  BKE_lattice_init(lt);

  return lt;
}
开发者ID:dfelinto,项目名称:blender,代码行数:10,代码来源:lattice.c


示例10: BKE_libblock_alloc

Lamp *BKE_lamp_add(Main *bmain, const char *name)
{
	Lamp *la;

	la =  BKE_libblock_alloc(bmain, ID_LA, name);

	BKE_lamp_init(la);

	return la;
}
开发者ID:DrangPo,项目名称:blender,代码行数:10,代码来源:lamp.c


示例11: BKE_libblock_alloc

Tex *BKE_texture_add(Main *bmain, const char *name)
{
	Tex *tex;

	tex = BKE_libblock_alloc(bmain, ID_TE, name, 0);
	
	BKE_texture_default(tex);
	
	return tex;
}
开发者ID:mgschwan,项目名称:blensor,代码行数:10,代码来源:texture.c


示例12: BKE_libblock_alloc

MetaBall *BKE_mball_add(Main *bmain, const char *name)
{
	MetaBall *mb;

	mb = BKE_libblock_alloc(bmain, ID_MB, name);

	BKE_mball_init(mb);

	return mb;
}
开发者ID:flair2005,项目名称:mechanical-blender,代码行数:10,代码来源:mball.c


示例13: BKE_libblock_alloc

Light *BKE_light_add(Main *bmain, const char *name)
{
  Light *la;

  la = BKE_libblock_alloc(bmain, ID_LA, name, 0);

  BKE_light_init(la);

  return la;
}
开发者ID:wangyxuan,项目名称:blender,代码行数:10,代码来源:light.c


示例14: BKE_libblock_alloc

void *BKE_speaker_add(Main *bmain, const char *name)
{
  Speaker *spk;

  spk = BKE_libblock_alloc(bmain, ID_SPK, name, 0);

  BKE_speaker_init(spk);

  return spk;
}
开发者ID:dfelinto,项目名称:blender,代码行数:10,代码来源:speaker.c


示例15: BKE_libblock_alloc

void *BKE_camera_add(Main *bmain, const char *name)
{
	Camera *cam;

	cam =  BKE_libblock_alloc(bmain, ID_CA, name, 0);

	BKE_camera_init(cam);

	return cam;
}
开发者ID:Ichthyostega,项目名称:blender,代码行数:10,代码来源:camera.c


示例16: BLI_strncpy

VFont *BKE_vfont_load(Main *bmain, const char *name)
{
	char filename[FILE_MAXFILE];
	VFont *vfont = NULL;
	PackedFile *pf;
	PackedFile *temp_pf = NULL;
	int is_builtin;
	
	if (STREQ(name, FO_BUILTIN_NAME)) {
		BLI_strncpy(filename, name, sizeof(filename));
		
		pf = get_builtin_packedfile();
		is_builtin = TRUE;
	}
	else {
		BLI_split_file_part(name, filename, sizeof(filename));
		pf = newPackedFile(NULL, name, bmain->name);
		temp_pf = newPackedFile(NULL, name, bmain->name);
		
		is_builtin = FALSE;
	}

	if (pf) {
		VFontData *vfd;

		vfd = BLI_vfontdata_from_freetypefont(pf);
		if (vfd) {
			vfont = BKE_libblock_alloc(&bmain->vfont, ID_VF, filename);
			vfont->data = vfd;

			/* if there's a font name, use it for the ID name */
			if (vfd->name[0] != '\0') {
				BLI_strncpy(vfont->id.name + 2, vfd->name, sizeof(vfont->id.name) - 2);
			}
			BLI_strncpy(vfont->name, name, sizeof(vfont->name));

			/* if autopack is on store the packedfile in de font structure */
			if (!is_builtin && (G.fileflags & G_AUTOPACK)) {
				vfont->packedfile = pf;
			}

			/* Do not add FO_BUILTIN_NAME to temporary listbase */
			if (strcmp(filename, FO_BUILTIN_NAME)) {
				vfont->temp_pf = temp_pf;
			}
		}

		/* Free the packed file */
		if (!vfont || vfont->packedfile != pf) {
			freePackedFile(pf);
		}
	}
	
	return vfont;
}
开发者ID:JasonWilkins,项目名称:blender-wayland,代码行数:55,代码来源:font.c


示例17: BKE_libblock_alloc

Brush *BKE_brush_add(Main *bmain, const char *name, short ob_mode)
{
	Brush *brush;

	brush = BKE_libblock_alloc(bmain, ID_BR, name);

	BKE_brush_init(brush);

	brush->ob_mode = ob_mode;

	return brush;
}
开发者ID:UPBGE,项目名称:blender,代码行数:12,代码来源:brush.c


示例18:

FreestyleLineStyle *BKE_new_linestyle(const char *name, struct Main *main)
{
	FreestyleLineStyle *linestyle;

	if (!main)
		main = G.main;

	linestyle = (FreestyleLineStyle *)BKE_libblock_alloc(main, ID_LS, name);

	default_linestyle_settings(linestyle);

	return linestyle;
}
开发者ID:Walid-Shouman,项目名称:Blender,代码行数:13,代码来源:linestyle.c


示例19: BKE_libblock_alloc

Lattice *BKE_lattice_add(const char *name)
{
	Lattice *lt;
	
	lt = BKE_libblock_alloc(&G.main->latt, ID_LT, name);
	
	lt->flag = LT_GRID;
	
	lt->typeu = lt->typev = lt->typew = KEY_BSPLINE;
	
	lt->def = MEM_callocN(sizeof(BPoint), "lattvert"); /* temporary */
	BKE_lattice_resize(lt, 2, 2, 2, NULL);  /* creates a uniform lattice */
		
	return lt;
}
开发者ID:vanangamudi,项目名称:blender-main,代码行数:15,代码来源:lattice.c


示例20: BKE_libblock_alloc

MetaBall *BKE_mball_add(Main *bmain, const char *name)
{
    MetaBall *mb;

    mb = BKE_libblock_alloc(bmain, ID_MB, name);

    mb->size[0] = mb->size[1] = mb->size[2] = 1.0;
    mb->texflag = MB_AUTOSPACE;

    mb->wiresize = 0.4f;
    mb->rendersize = 0.2f;
    mb->thresh = 0.6f;

    return mb;
}
开发者ID:mcgrathd,项目名称:blender,代码行数:15,代码来源:mball.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ BKE_paint_get_active_from_context函数代码示例发布时间:2022-05-30
下一篇:
C++ BKE_image_signal函数代码示例发布时间: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