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

C++ BLI_listbase_clear函数代码示例

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

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



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

示例1: BKE_linestyle_init

void BKE_linestyle_init(FreestyleLineStyle *linestyle)
{
	BLI_assert(MEMCMP_STRUCT_OFS_IS_ZERO(linestyle, id));

	linestyle->panel = LS_PANEL_STROKES;
	linestyle->r = linestyle->g = linestyle->b = 0.0f;
	linestyle->alpha = 1.0f;
	linestyle->thickness = 3.0f;
	linestyle->thickness_position = LS_THICKNESS_CENTER;
	linestyle->thickness_ratio = 0.5f;
	linestyle->flag = LS_SAME_OBJECT | LS_NO_SORTING | LS_TEXTURE;
	linestyle->chaining = LS_CHAINING_PLAIN;
	linestyle->rounds = 3;
	linestyle->min_angle = DEG2RADF(0.0f);
	linestyle->max_angle = DEG2RADF(0.0f);
	linestyle->min_length = 0.0f;
	linestyle->max_length = 10000.0f;
	linestyle->split_length = 100;
	linestyle->chain_count = 10;
	linestyle->sort_key = LS_SORT_KEY_DISTANCE_FROM_CAMERA;
	linestyle->integration_type = LS_INTEGRATION_MEAN;
	linestyle->texstep = 1.0f;
	linestyle->pr_texture = TEX_PR_TEXTURE;

	BLI_listbase_clear(&linestyle->color_modifiers);
	BLI_listbase_clear(&linestyle->alpha_modifiers);
	BLI_listbase_clear(&linestyle->thickness_modifiers);
	BLI_listbase_clear(&linestyle->geometry_modifiers);

	BKE_linestyle_geometry_modifier_add(linestyle, NULL, LS_MODIFIER_SAMPLING);

	linestyle->caps = LS_CAPS_BUTT;
}
开发者ID:rav66,项目名称:blender,代码行数:33,代码来源:linestyle.c


示例2: BKE_collection_copy_data

/**
 * Only copy internal data of Collection ID from source
 * to already allocated/initialized destination.
 * You probably never want to use that directly,
 * use #BKE_id_copy or #BKE_id_copy_ex for typical needs.
 *
 * WARNING! This function will not handle ID user count!
 *
 * \param flag: Copying options (see BKE_library.h's LIB_ID_COPY_... flags for more).
 */
void BKE_collection_copy_data(Main *bmain,
                              Collection *collection_dst,
                              const Collection *collection_src,
                              const int flag)
{
  /* Do not copy collection's preview (same behavior as for objects). */
  if ((flag & LIB_ID_COPY_NO_PREVIEW) == 0 && false) { /* XXX TODO temp hack */
    BKE_previewimg_id_copy(&collection_dst->id, &collection_src->id);
  }
  else {
    collection_dst->preview = NULL;
  }

  collection_dst->flag &= ~COLLECTION_HAS_OBJECT_CACHE;
  BLI_listbase_clear(&collection_dst->object_cache);

  BLI_listbase_clear(&collection_dst->gobject);
  BLI_listbase_clear(&collection_dst->children);
  BLI_listbase_clear(&collection_dst->parents);

  for (CollectionChild *child = collection_src->children.first; child; child = child->next) {
    collection_child_add(collection_dst, child->collection, flag, false);
  }
  for (CollectionObject *cob = collection_src->gobject.first; cob; cob = cob->next) {
    collection_object_add(bmain, collection_dst, cob->ob, flag, false);
  }
}
开发者ID:wangyxuan,项目名称:blender,代码行数:37,代码来源:collection.c


示例3: default_linestyle_settings

static void default_linestyle_settings(FreestyleLineStyle *linestyle)
{
	linestyle->panel = LS_PANEL_STROKES;
	linestyle->r = linestyle->g = linestyle->b = 0.0f;
	linestyle->alpha = 1.0f;
	linestyle->thickness = 3.0f;
	linestyle->thickness_position = LS_THICKNESS_CENTER;
	linestyle->thickness_ratio = 0.5f;
	linestyle->flag = LS_SAME_OBJECT | LS_NO_SORTING;
	linestyle->chaining = LS_CHAINING_PLAIN;
	linestyle->rounds = 3;
	linestyle->min_angle = DEG2RADF(0.0f);
	linestyle->max_angle = DEG2RADF(0.0f);
	linestyle->min_length = 0.0f;
	linestyle->max_length = 10000.0f;
	linestyle->split_length = 100;
	linestyle->sort_key = LS_SORT_KEY_DISTANCE_FROM_CAMERA;
	linestyle->integration_type = LS_INTEGRATION_MEAN;

	BLI_listbase_clear(&linestyle->color_modifiers);
	BLI_listbase_clear(&linestyle->alpha_modifiers);
	BLI_listbase_clear(&linestyle->thickness_modifiers);
	BLI_listbase_clear(&linestyle->geometry_modifiers);

	BKE_add_linestyle_geometry_modifier(linestyle, LS_MODIFIER_SAMPLING);

	linestyle->caps = LS_CAPS_BUTT;
}
开发者ID:Walid-Shouman,项目名称:Blender,代码行数:28,代码来源:linestyle.c


示例4: BLI_scanfill_end

void BLI_scanfill_end(ScanFillContext *sf_ctx)
{
	BLI_memarena_free(sf_ctx->arena);
	sf_ctx->arena = NULL;

	BLI_listbase_clear(&sf_ctx->fillvertbase);
	BLI_listbase_clear(&sf_ctx->filledgebase);
	BLI_listbase_clear(&sf_ctx->fillfacebase);
}
开发者ID:sftd,项目名称:blender,代码行数:9,代码来源:scanfill.c


示例5: BLI_scanfill_end_arena

void BLI_scanfill_end_arena(ScanFillContext *sf_ctx, MemArena *arena)
{
	BLI_memarena_clear(arena);
	BLI_assert(sf_ctx->arena == arena);

	BLI_listbase_clear(&sf_ctx->fillvertbase);
	BLI_listbase_clear(&sf_ctx->filledgebase);
	BLI_listbase_clear(&sf_ctx->fillfacebase);
}
开发者ID:sftd,项目名称:blender,代码行数:9,代码来源:scanfill.c


示例6: copy_particle_edit

static void copy_particle_edit(Scene *scene, Object *ob, ParticleSystem *psys, ParticleSystem *psys_from)
{
	PTCacheEdit *edit_from = psys_from->edit, *edit;
	ParticleData *pa;
	KEY_K;
	POINT_P;
	
	if (!edit_from)
		return;
	
	edit = MEM_dupallocN(edit_from);
	edit->psys = psys;
	psys->edit = edit;
	
	edit->pathcache = NULL;
	BLI_listbase_clear(&edit->pathcachebufs);
	
	edit->emitter_field = NULL;
	edit->emitter_cosnos = NULL;
	
	BLI_listbase_clear(&edit->undo);
	edit->curundo = NULL;
	
	edit->points = MEM_dupallocN(edit_from->points);
	pa = psys->particles;
	LOOP_POINTS {
		HairKey *hkey = pa->hair;
		
		point->keys= MEM_dupallocN(point->keys);
		LOOP_KEYS {
			key->co = hkey->co;
			key->time = &hkey->time;
			key->flag = hkey->editflag;
			if (!(psys->flag & PSYS_GLOBAL_HAIR)) {
				key->flag |= PEK_USE_WCO;
				hkey->editflag |= PEK_USE_WCO;
			}
			
			hkey++;
		}
		
		pa++;
	}
	update_world_cos(ob, edit);
	
	UI_GetThemeColor3ubv(TH_EDGE_SELECT, edit->sel_col);
	UI_GetThemeColor3ubv(TH_WIRE, edit->nosel_col);
	
	recalc_lengths(edit);
	recalc_emitter_field(ob, psys);
	PE_update_object(scene, ob, true);
	
	PTCacheUndo_clear(edit);
	PE_undo_push(scene, "Original");
}
开发者ID:flair2005,项目名称:mechanical-blender,代码行数:55,代码来源:particle_object.c


示例7: RE_bake_engine_set_engine_parameters

/* Bake */
void RE_bake_engine_set_engine_parameters(Render *re, Main *bmain, Scene *scene)
{
	re->scene = scene;
	re->main = bmain;
	re->r = scene->r;

	/* prevent crash when freeing the scene
	 * but it potentially leaves unfreed memory blocks
	 * not sure how to fix this yet -- dfelinto */
	BLI_listbase_clear(&re->r.layers);
	BLI_listbase_clear(&re->r.views);
}
开发者ID:bitfusionio,项目名称:blender,代码行数:13,代码来源:external_engine.c


示例8: MEM_dupallocN

/* make a copy of a given gpencil datablock */
bGPdata *gpencil_data_duplicate(bGPdata *src, bool internal_copy)
{
    bGPDlayer *gpl, *gpld;
    bGPdata *dst;

    /* error checking */
    if (src == NULL)
        return NULL;

    /* make a copy of the base-data */
    if (internal_copy) {
        /* make a straight copy for undo buffers used during stroke drawing */
        dst = MEM_dupallocN(src);
    }
    else {
        /* make a copy when others use this */
        dst = BKE_libblock_copy(&src->id);
    }

    /* copy layers */
    BLI_listbase_clear(&dst->layers);
    for (gpl = src->layers.first; gpl; gpl = gpl->next) {
        /* make a copy of source layer and its data */
        gpld = gpencil_layer_duplicate(gpl);
        BLI_addtail(&dst->layers, gpld);
    }

    /* return new */
    return dst;
}
开发者ID:mcgrathd,项目名称:blender,代码行数:31,代码来源:gpencil.c


示例9: free_anim_copybuf

// XXX find some header to put this in!
void free_anim_copybuf(void)
{
	tAnimCopybufItem *aci, *acn;
	
	/* free each buffer element */
	for (aci = animcopybuf.first; aci; aci = acn) {
		acn = aci->next;
		
		/* free keyframes */
		if (aci->bezt) 
			MEM_freeN(aci->bezt);
			
		/* free RNA-path */
		if (aci->rna_path)
			MEM_freeN(aci->rna_path);
			
		/* free ourself */
		BLI_freelinkN(&animcopybuf, aci);
	}
	
	/* restore initial state */
	BLI_listbase_clear(&animcopybuf);
	animcopy_firstframe = 999999999.0f;
	animcopy_lastframe = -999999999.0f;
}
开发者ID:Moguri,项目名称:blender,代码行数:26,代码来源:keyframes_general.c


示例10: BKE_libblock_copy_nolib

World *localize_world(World *wrld)
{
	World *wrldn;
	int a;
	
	wrldn = BKE_libblock_copy_nolib(&wrld->id, false);
	
	for (a = 0; a < MAX_MTEX; a++) {
		if (wrld->mtex[a]) {
			wrldn->mtex[a] = MEM_mallocN(sizeof(MTex), "localize_world");
			memcpy(wrldn->mtex[a], wrld->mtex[a], sizeof(MTex));
			/* free world decrements */
			id_us_plus((ID *)wrldn->mtex[a]->tex);
		}
	}

	if (wrld->nodetree)
		wrldn->nodetree = ntreeLocalize(wrld->nodetree);
	
	wrldn->preview = NULL;
	
	BLI_listbase_clear(&wrldn->gpumaterial);
	
	return wrldn;
}
开发者ID:mcgrathd,项目名称:blender,代码行数:25,代码来源:world.c


示例11: BKE_libblock_copy

World *BKE_world_copy(World *wrld)
{
	World *wrldn;
	int a;
	
	wrldn = BKE_libblock_copy(&wrld->id);
	
	for (a = 0; a < MAX_MTEX; a++) {
		if (wrld->mtex[a]) {
			wrldn->mtex[a] = MEM_mallocN(sizeof(MTex), "BKE_world_copy");
			memcpy(wrldn->mtex[a], wrld->mtex[a], sizeof(MTex));
			id_us_plus((ID *)wrldn->mtex[a]->tex);
		}
	}

	if (wrld->nodetree) {
		wrldn->nodetree = ntreeCopyTree(wrld->nodetree);
	}
	
	if (wrld->preview)
		wrldn->preview = BKE_previewimg_copy(wrld->preview);

	BLI_listbase_clear(&wrldn->gpumaterial);

	if (wrld->id.lib) {
		BKE_id_lib_local_paths(G.main, wrld->id.lib, &wrldn->id);
	}

	return wrldn;
}
开发者ID:mcgrathd,项目名称:blender,代码行数:30,代码来源:world.c


示例12: copy_fmodifiers

/* Duplicate all of the F-Modifiers in the Modifier stacks */
void copy_fmodifiers(ListBase *dst, const ListBase *src)
{
  FModifier *fcm, *srcfcm;

  if (ELEM(NULL, dst, src)) {
    return;
  }

  BLI_listbase_clear(dst);
  BLI_duplicatelist(dst, src);

  for (fcm = dst->first, srcfcm = src->first; fcm && srcfcm;
       srcfcm = srcfcm->next, fcm = fcm->next) {
    const FModifierTypeInfo *fmi = fmodifier_get_typeinfo(fcm);

    /* make a new copy of the F-Modifier's data */
    fcm->data = MEM_dupallocN(fcm->data);
    fcm->curve = NULL;

    /* only do specific constraints if required */
    if (fmi && fmi->copy_data) {
      fmi->copy_data(fcm, srcfcm);
    }
  }
}
开发者ID:wangyxuan,项目名称:blender,代码行数:26,代码来源:fmodifier.c


示例13: BLI_init_threads

void BLI_init_threads(ListBase *threadbase, void *(*do_thread)(void *), int tot)
{
	int a;

	if (threadbase != NULL && tot > 0) {
		BLI_listbase_clear(threadbase);
	
		if (tot > RE_MAX_THREAD) tot = RE_MAX_THREAD;
		else if (tot < 1) tot = 1;
	
		for (a = 0; a < tot; a++) {
			ThreadSlot *tslot = MEM_callocN(sizeof(ThreadSlot), "threadslot");
			BLI_addtail(threadbase, tslot);
			tslot->do_thread = do_thread;
			tslot->avail = 1;
		}
	}
	
	if (thread_levels == 0) {
		MEM_set_lock_callback(BLI_lock_malloc_thread, BLI_unlock_malloc_thread);

#ifdef USE_APPLE_OMP_FIX
		/* workaround for Apple gcc 4.2.1 omp vs background thread bug,
		 * we copy gomp thread local storage pointer to setting it again
		 * inside the thread that we start */
		thread_tls_data = pthread_getspecific(gomp_tls_key);
#endif
	}

	thread_levels++;
}
开发者ID:mcgrathd,项目名称:blender,代码行数:31,代码来源:threads.c


示例14: userdef_free_keymaps

static void userdef_free_keymaps(UserDef *userdef)
{
  for (wmKeyMap *km = userdef->user_keymaps.first, *km_next; km; km = km_next) {
    km_next = km->next;
    for (wmKeyMapDiffItem *kmdi = km->diff_items.first; kmdi; kmdi = kmdi->next) {
      if (kmdi->add_item) {
        keymap_item_free(kmdi->add_item);
        MEM_freeN(kmdi->add_item);
      }
      if (kmdi->remove_item) {
        keymap_item_free(kmdi->remove_item);
        MEM_freeN(kmdi->remove_item);
      }
    }

    for (wmKeyMapItem *kmi = km->items.first; kmi; kmi = kmi->next) {
      keymap_item_free(kmi);
    }

    BLI_freelistN(&km->diff_items);
    BLI_freelistN(&km->items);

    MEM_freeN(km);
  }
  BLI_listbase_clear(&userdef->user_keymaps);
}
开发者ID:wangyxuan,项目名称:blender,代码行数:26,代码来源:blender.c


示例15: wm_window_new

/* part of wm_window.c api */
wmWindow *wm_window_copy(bContext *C, wmWindow *win_src)
{
    wmWindow *win_dst = wm_window_new(C);

    win_dst->posx = win_src->posx + 10;
    win_dst->posy = win_src->posy;
    win_dst->sizex = win_src->sizex;
    win_dst->sizey = win_src->sizey;

    /* duplicate assigns to window */
    win_dst->screen = ED_screen_duplicate(win_dst, win_src->screen);
    BLI_strncpy(win_dst->screenname, win_dst->screen->id.name + 2, sizeof(win_dst->screenname));
    win_dst->screen->winid = win_dst->winid;

    win_dst->screen->do_refresh = true;
    win_dst->screen->do_draw = true;

    win_dst->drawmethod = U.wmdrawmethod;

    BLI_listbase_clear(&win_dst->drawdata);

    *win_dst->stereo3d_format = *win_src->stereo3d_format;

    return win_dst;
}
开发者ID:JasonWilkins,项目名称:blender-viewport_fx,代码行数:26,代码来源:wm_window.c


示例16: BKE_list_modifier_color_ramps

void BKE_list_modifier_color_ramps(FreestyleLineStyle *linestyle, ListBase *listbase)
{
	LineStyleModifier *m;
	ColorBand *color_ramp;
	LinkData *link;

	BLI_listbase_clear(listbase);

	for (m = (LineStyleModifier *)linestyle->color_modifiers.first; m; m = m->next) {
		switch (m->type) {
			case LS_MODIFIER_ALONG_STROKE:
				color_ramp = ((LineStyleColorModifier_AlongStroke *)m)->color_ramp;
				break;
			case LS_MODIFIER_DISTANCE_FROM_CAMERA:
				color_ramp = ((LineStyleColorModifier_DistanceFromCamera *)m)->color_ramp;
				break;
			case LS_MODIFIER_DISTANCE_FROM_OBJECT:
				color_ramp = ((LineStyleColorModifier_DistanceFromObject *)m)->color_ramp;
				break;
			case LS_MODIFIER_MATERIAL:
				color_ramp = ((LineStyleColorModifier_Material *)m)->color_ramp;
				break;
			default:
				continue;
		}
		link = (LinkData *) MEM_callocN(sizeof(LinkData), "link to color ramp");
		link->data = color_ramp;
		BLI_addtail(listbase, link);
	}
}
开发者ID:Walid-Shouman,项目名称:Blender,代码行数:30,代码来源:linestyle.c


示例17: wm_history_file_read

void wm_history_file_read(void)
{
	char name[FILE_MAX];
	LinkNode *l, *lines;
	struct RecentFile *recent;
	const char *line;
	int num;
	const char * const cfgdir = BKE_appdir_folder_id(BLENDER_USER_CONFIG, NULL);

	if (!cfgdir) return;

	BLI_make_file_string("/", name, cfgdir, BLENDER_HISTORY_FILE);

	lines = BLI_file_read_as_lines(name);

	BLI_listbase_clear(&G.recent_files);

	/* read list of recent opened files from recent-files.txt to memory */
	for (l = lines, num = 0; l && (num < U.recent_files); l = l->next) {
		line = l->link;
		/* don't check if files exist, causes slow startup for remote/external drives */
		if (line[0]) {
			recent = (RecentFile *)MEM_mallocN(sizeof(RecentFile), "RecentFile");
			BLI_addtail(&(G.recent_files), recent);
			recent->filepath = BLI_strdup(line);
			num++;
		}
	}
	
	BLI_file_free_lines(lines);
}
开发者ID:ChunHungLiu,项目名称:blender,代码行数:31,代码来源:wm_files.c


示例18: MEM_dupallocN

/* make a copy of a given gpencil layer */
bGPDlayer *gpencil_layer_duplicate(bGPDlayer *src)
{
	bGPDframe *gpf, *gpfd;
	bGPDlayer *dst;
	
	/* error checking */
	if (src == NULL)
		return NULL;
		
	/* make a copy of source layer */
	dst = MEM_dupallocN(src);
	dst->prev = dst->next = NULL;
	
	/* copy frames */
	BLI_listbase_clear(&dst->frames);
	for (gpf = src->frames.first; gpf; gpf = gpf->next) {
		/* make a copy of source frame */
		gpfd = gpencil_frame_duplicate(gpf);
		BLI_addtail(&dst->frames, gpfd);
		
		/* if source frame was the current layer's 'active' frame, reassign that too */
		if (gpf == dst->actframe)
			dst->actframe = gpfd;
	}
	
	/* return new layer */
	return dst;
}
开发者ID:linkedinyou,项目名称:blender-git,代码行数:29,代码来源:gpencil.c


示例19: action_groups_remove_channel

/* Remove the given channel from all groups */
void action_groups_remove_channel(bAction *act, FCurve *fcu)
{
	/* sanity checks */
	if (ELEM(NULL, act, fcu))
		return;
	
	/* check if any group used this directly */
	if (fcu->grp) {
		bActionGroup *agrp = fcu->grp;
		
		if (agrp->channels.first == agrp->channels.last) {
			if (agrp->channels.first == fcu) {
				BLI_listbase_clear(&agrp->channels);
			}
		}
		else if (agrp->channels.first == fcu) {
			if ((fcu->next) && (fcu->next->grp == agrp))
				agrp->channels.first = fcu->next;
			else
				agrp->channels.first = NULL;
		}
		else if (agrp->channels.last == fcu) {
			if ((fcu->prev) && (fcu->prev->grp == agrp))
				agrp->channels.last = fcu->prev;
			else
				agrp->channels.last = NULL;
		}
		
		fcu->grp = NULL;
	}
	
	/* now just remove from list */
	BLI_remlink(&act->curves, fcu);
}
开发者ID:UPBGE,项目名称:blender,代码行数:35,代码来源:action.c


示例20: screen_data_copy

void screen_data_copy(bScreen *to, bScreen *from)
{
  ScrVert *s1, *s2;
  ScrEdge *se;
  ScrArea *sa, *saf;

  /* free contents of 'to', is from blenkernel screen.c */
  BKE_screen_free(to);

  to->flag = from->flag;

  BLI_duplicatelist(&to->vertbase, &from->vertbase);
  BLI_duplicatelist(&to->edgebase, &from->edgebase);
  BLI_duplicatelist(&to->areabase, &from->areabase);
  BLI_listbase_clear(&to->regionbase);

  s2 = to->vertbase.first;
  for (s1 = from->vertbase.first; s1; s1 = s1->next, s2 = s2->next) {
    s1->newv = s2;
  }

  for (se = to->edgebase.first; se; se = se->next) {
    se->v1 = se->v1->newv;
    se->v2 = se->v2->newv;
    BKE_screen_sort_scrvert(&(se->v1), &(se->v2));
  }

  saf = from->areabase.first;
  for (sa = to->areabase.first; sa; sa = sa->next, saf = saf->next) {
    sa->v1 = sa->v1->newv;
    sa->v2 = sa->v2->newv;
    sa->v3 = sa->v3->newv;
    sa->v4 = sa->v4->newv;

    BLI_listbase_clear(&sa->spacedata);
    BLI_listbase_clear(&sa->regionbase);
    BLI_listbase_clear(&sa->actionzones);
    BLI_listbase_clear(&sa->handlers);

    ED_area_data_copy(sa, saf, true);
  }

  /* put at zero (needed?) */
  for (s1 = from->vertbase.first; s1; s1 = s1->next) {
    s1->newv = NULL;
  }
}
开发者ID:dfelinto,项目名称:blender,代码行数:47,代码来源:screen_edit.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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