當前位置: 首頁>>代碼示例>>C++>>正文


C++ BLI_listbase_clear函數代碼示例

本文整理匯總了C++中BLI_listbase_clear函數的典型用法代碼示例。如果您正苦於以下問題:C++ BLI_listbase_clear函數的具體用法?C++ BLI_listbase_clear怎麽用?C++ BLI_listbase_clear使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了BLI_listbase_clear函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的BLI_listbase_clear函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。