本文整理汇总了C++中BLI_freelistN函数的典型用法代码示例。如果您正苦于以下问题:C++ BLI_freelistN函数的具体用法?C++ BLI_freelistN怎么用?C++ BLI_freelistN使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了BLI_freelistN函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: clean_action_keys
static void clean_action_keys (bAnimContext *ac, float thresh)
{
ListBase anim_data = {NULL, NULL};
bAnimListElem *ale;
int filter;
/* filter data */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_SEL | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* loop through filtered data and clean curves */
for (ale= anim_data.first; ale; ale= ale->next)
clean_fcurve((FCurve *)ale->key_data, thresh);
/* free temp data */
BLI_freelistN(&anim_data);
}
开发者ID:OldBrunet,项目名称:BGERTPS,代码行数:17,代码来源:action_edit.c
示例2: paste_action_keys
static short paste_action_keys (bAnimContext *ac)
{
ListBase anim_data = {NULL, NULL};
int filter, ok=0;
/* filter data */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* paste keyframes */
ok= paste_animedit_keys(ac, &anim_data);
/* clean up */
BLI_freelistN(&anim_data);
return ok;
}
开发者ID:jinjoh,项目名称:NOOR,代码行数:17,代码来源:action_edit.c
示例3: sample_action_keys
/* Evaluates the curves between each selected keyframe on each frame, and keys the value */
static void sample_action_keys (bAnimContext *ac)
{
ListBase anim_data = {NULL, NULL};
bAnimListElem *ale;
int filter;
/* filter data */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* loop through filtered data and add keys between selected keyframes on every frame */
for (ale= anim_data.first; ale; ale= ale->next)
sample_fcurve((FCurve *)ale->key_data);
/* admin and redraws */
BLI_freelistN(&anim_data);
}
开发者ID:OldBrunet,项目名称:BGERTPS,代码行数:18,代码来源:action_edit.c
示例4: node_group_output_update
static void node_group_output_update(bNodeTree *ntree, bNode *node)
{
bNodeSocket *extsock = node->inputs.last;
bNodeLink *link;
/* Adding a tree socket and verifying will remove the extension socket!
* This list caches the existing links to the extension socket
* so they can be recreated after verification.
*/
ListBase tmplinks;
/* find links to the extension socket and store them */
tmplinks.first = tmplinks.last = NULL;
for (link = ntree->links.first; link; link = link->next) {
if (nodeLinkIsHidden(link))
continue;
if (link->tosock == extsock) {
bNodeLink *tlink = MEM_callocN(sizeof(bNodeLink), "temporary link");
*tlink = *link;
BLI_addtail(&tmplinks, tlink);
}
}
if (tmplinks.first) {
bNodeSocket *gsock, *newsock;
/* XXX Multiple sockets can be connected to the extension socket at once,
* in that case the arbitrary first link determines name and type.
* This could be improved by choosing the "best" type among all links,
* whatever that means.
*/
bNodeLink *exposelink = tmplinks.first;
/* XXX what if connecting virtual to virtual socket?? */
gsock = ntreeAddSocketInterfaceFromSocket(ntree, exposelink->fromnode, exposelink->fromsock);
node_group_output_verify(ntree, node, (ID *)ntree);
newsock = node_group_output_find_socket(node, gsock->identifier);
/* redirect links to the extension socket */
for (link = tmplinks.first; link; link = link->next) {
nodeAddLink(ntree, link->fromnode, link->fromsock, node, newsock);
}
BLI_freelistN(&tmplinks);
}
}
开发者ID:244xiao,项目名称:blender,代码行数:45,代码来源:node_common.c
示例5: paste_action_keys
static short paste_action_keys (bAnimContext *ac,
const eKeyPasteOffset offset_mode, const eKeyMergeMode merge_mode)
{
ListBase anim_data = {NULL, NULL};
int filter, ok=0;
/* filter data */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* paste keyframes */
ok= paste_animedit_keys(ac, &anim_data, offset_mode, merge_mode);
/* clean up */
BLI_freelistN(&anim_data);
return ok;
}
开发者ID:OldBrunet,项目名称:BGERTPS,代码行数:18,代码来源:action_edit.c
示例6: BLI_mempool_destroy
void BLI_mempool_destroy(BLI_mempool *pool)
{
BLI_mempool_chunk *mpchunk=NULL;
if(pool->use_sysmalloc) {
for(mpchunk = pool->chunks.first; mpchunk; mpchunk = mpchunk->next) {
free(mpchunk->data);
}
BLI_freelist(&(pool->chunks));
free(pool);
}
else {
for(mpchunk = pool->chunks.first; mpchunk; mpchunk = mpchunk->next) {
MEM_freeN(mpchunk->data);
}
BLI_freelistN(&(pool->chunks));
MEM_freeN(pool);
}
}
开发者ID:BHCLL,项目名称:blendocv,代码行数:18,代码来源:BLI_mempool.c
示例7: ED_preview_icon_render
void ED_preview_icon_render(Scene *scene, ID *id, unsigned int *rect, int sizex, int sizey)
{
IconPreview ip = {NULL};
short stop = false, update = false;
float progress = 0.0f;
ip.scene = scene;
ip.owner = id;
ip.id = id;
icon_preview_add_size(&ip, rect, sizex, sizey);
icon_preview_startjob_all_sizes(&ip, &stop, &update, &progress);
icon_preview_endjob(&ip);
BLI_freelistN(&ip.sizes);
}
开发者ID:Andrewson3D,项目名称:blender-for-vray,代码行数:18,代码来源:render_preview.c
示例8: ntreeShaderEndExecTree_internal
void ntreeShaderEndExecTree_internal(bNodeTreeExec *exec)
{
bNodeThreadStack *nts;
int a;
if (exec->threadstack) {
for (a = 0; a < BLENDER_MAX_THREADS; a++) {
for (nts = exec->threadstack[a].first; nts; nts = nts->next)
if (nts->stack) MEM_freeN(nts->stack);
BLI_freelistN(&exec->threadstack[a]);
}
MEM_freeN(exec->threadstack);
exec->threadstack = NULL;
}
ntree_exec_end(exec);
}
开发者ID:mcolletta,项目名称:blender,代码行数:18,代码来源:node_shader_tree.c
示例9: actkeys_mselect_column
/* Option 3) Selects all visible keyframes in the same frame as the mouse click */
static void actkeys_mselect_column(bAnimContext *ac, short select_mode, float selx)
{
ListBase anim_data = {NULL, NULL};
bAnimListElem *ale;
int filter;
KeyframeEditFunc select_cb, ok_cb;
KeyframeEditData ked = {{NULL}};
/* set up BezTriple edit callbacks */
select_cb = ANIM_editkeyframes_select(select_mode);
ok_cb = ANIM_editkeyframes_ok(BEZT_OK_FRAME);
/* loop through all of the keys and select additional keyframes
* based on the keys found to be selected above
*/
if (ELEM(ac->datatype, ANIMCONT_GPENCIL, ANIMCONT_MASK))
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE /*| ANIMFILTER_CURVESONLY */ | ANIMFILTER_NODUPLIS);
else
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
for (ale = anim_data.first; ale; ale = ale->next) {
AnimData *adt = ANIM_nla_mapping_get(ac, ale);
/* set frame for validation callback to refer to */
if (adt)
ked.f1 = BKE_nla_tweakedit_remap(adt, selx, NLATIME_CONVERT_UNMAP);
else
ked.f1 = selx;
/* select elements with frame number matching cfra */
if (ale->type == ANIMTYPE_GPLAYER)
ED_gpencil_select_frame(ale->key_data, selx, select_mode);
else if (ale->type == ANIMTYPE_MASKLAYER)
ED_mask_select_frame(ale->key_data, selx, select_mode);
else
ANIM_fcurve_keyframes_loop(&ked, ale->key_data, ok_cb, select_cb, NULL);
}
/* free elements */
BLI_freelistN(&ked.list);
ANIM_animdata_freelist(&anim_data);
}
开发者ID:mgschwan,项目名称:blensor,代码行数:45,代码来源:action_select.c
示例10: actkeys_framejump_exec
/* snap current-frame indicator to 'average time' of selected keyframe */
static int actkeys_framejump_exec(bContext *C, wmOperator *op)
{
bAnimContext ac;
ListBase anim_data= {NULL, NULL};
bAnimListElem *ale;
int filter;
BeztEditData bed;
/* get editor data */
if (ANIM_animdata_get_context(C, &ac) == 0)
return OPERATOR_CANCELLED;
/* init edit data */
memset(&bed, 0, sizeof(BeztEditData));
/* loop over action data, averaging values */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY);
ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
for (ale= anim_data.first; ale; ale= ale->next) {
AnimData *adt= ANIM_nla_mapping_get(&ac, ale);
if (adt) {
ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1);
ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, bezt_calc_average, NULL);
ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 1);
}
else
ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, bezt_calc_average, NULL);
}
BLI_freelistN(&anim_data);
/* set the new current frame value, based on the average time */
if (bed.i1) {
Scene *scene= ac.scene;
CFRA= (int)floor((bed.f1 / bed.i1) + 0.5f);
}
/* set notifier that things have changed */
WM_event_add_notifier(C, NC_SCENE|ND_FRAME, ac.scene);
return OPERATOR_FINISHED;
}
开发者ID:jinjoh,项目名称:NOOR,代码行数:45,代码来源:action_edit.c
示例11: setexpo_action_keys
/* this function is responsible for setting extrapolation mode for keyframes */
static void setexpo_action_keys(bAnimContext *ac, short mode)
{
ListBase anim_data = {NULL, NULL};
bAnimListElem *ale;
int filter;
/* filter data */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_SEL | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* loop through setting mode per F-Curve */
for (ale= anim_data.first; ale; ale= ale->next) {
FCurve *fcu= (FCurve *)ale->data;
fcu->extend= mode;
}
/* cleanup */
BLI_freelistN(&anim_data);
}
开发者ID:OldBrunet,项目名称:BGERTPS,代码行数:20,代码来源:action_edit.c
示例12: actkeys_mselect_single
/* option 1) select keyframe directly under mouse */
static void actkeys_mselect_single(bAnimContext *ac, bAnimListElem *ale, short select_mode, float selx)
{
KeyframeEditData ked = {{NULL}};
KeyframeEditFunc select_cb, ok_cb;
/* get functions for selecting keyframes */
select_cb = ANIM_editkeyframes_select(select_mode);
ok_cb = ANIM_editkeyframes_ok(BEZT_OK_FRAME);
ked.f1 = selx;
/* select the nominated keyframe on the given frame */
if (ale->type == ANIMTYPE_GPLAYER) {
ED_gpencil_select_frame(ale->data, selx, select_mode);
}
else if (ale->type == ANIMTYPE_MASKLAYER) {
ED_mask_select_frame(ale->data, selx, select_mode);
}
else {
if (ELEM(ac->datatype, ANIMCONT_GPENCIL, ANIMCONT_MASK) &&
(ale->type == ANIMTYPE_SUMMARY) && (ale->datatype == ALE_ALL))
{
ListBase anim_data = {NULL, NULL};
int filter;
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE /*| ANIMFILTER_CURVESONLY */ | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
for (ale = anim_data.first; ale; ale = ale->next) {
if (ale->type == ANIMTYPE_GPLAYER) {
ED_gpencil_select_frame(ale->data, selx, select_mode);
}
else if (ale->type == ANIMTYPE_MASKLAYER) {
ED_mask_select_frame(ale->data, selx, select_mode);
}
}
BLI_freelistN(&anim_data);
}
else {
ANIM_animchannel_keyframes_loop(&ked, ac->ads, ale, ok_cb, select_cb, NULL);
}
}
}
开发者ID:YasirArafath,项目名称:blender-git,代码行数:44,代码来源:action_select.c
示例13: ob_keyframes_loop
/* This function is used to loop over the keyframe data in an Object */
static short ob_keyframes_loop(KeyframeEditData *ked, bDopeSheet *ads, Object *ob, KeyframeEditFunc key_ok, KeyframeEditFunc key_cb, FcuEditFunc fcu_cb)
{
bAnimContext ac = {NULL};
ListBase anim_data = {NULL, NULL};
bAnimListElem *ale;
int filter;
int ret = 0;
bAnimListElem dummychan = {NULL};
Base dummybase = {NULL};
if (ob == NULL)
return 0;
/* create a dummy wrapper data to work with */
dummybase.object = ob;
dummychan.type = ANIMTYPE_OBJECT;
dummychan.data = &dummybase;
dummychan.id = &ob->id;
dummychan.adt = ob->adt;
ac.ads = ads;
ac.data = &dummychan;
ac.datatype = ANIMCONT_CHANNEL;
/* get F-Curves to take keyframes from */
filter = ANIMFILTER_DATA_VISIBLE; // curves only
ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
/* loop through each F-Curve, applying the operation as required, but stopping on the first one */
for (ale = anim_data.first; ale; ale = ale->next) {
if (ANIM_fcurve_keyframes_loop(ked, (FCurve *)ale->data, key_ok, key_cb, fcu_cb)) {
ret = 1;
break;
}
}
BLI_freelistN(&anim_data);
/* return return code - defaults to zero if nothing happened */
return ret;
}
开发者ID:nttputus,项目名称:blensor,代码行数:44,代码来源:keyframes_edit.c
示例14: insert_action_keys
/* this function is responsible for snapping keyframes to frame-times */
static void insert_action_keys(bAnimContext *ac, short mode)
{
ListBase anim_data = {NULL, NULL};
bAnimListElem *ale;
int filter;
Scene *scene= ac->scene;
float cfra= (float)CFRA;
short flag = 0;
/* filter data */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY);
if (mode == 2) filter |= ANIMFILTER_SEL;
else if (mode == 3) filter |= ANIMFILTER_ACTGROUPED;
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* init keyframing flag */
if (IS_AUTOKEY_FLAG(AUTOMATKEY)) flag |= INSERTKEY_MATRIX;
if (IS_AUTOKEY_FLAG(INSERTNEEDED)) flag |= INSERTKEY_NEEDED;
if (IS_AUTOKEY_MODE(scene, EDITKEYS)) flag |= INSERTKEY_REPLACE;
/* insert keyframes */
for (ale= anim_data.first; ale; ale= ale->next) {
AnimData *adt= ANIM_nla_mapping_get(ac, ale);
FCurve *fcu= (FCurve *)ale->key_data;
/* adjust current frame for NLA-scaling */
if (adt)
cfra= BKE_nla_tweakedit_remap(adt, (float)CFRA, NLATIME_CONVERT_UNMAP);
else
cfra= (float)CFRA;
/* if there's an id */
if (ale->id)
insert_keyframe(ale->id, NULL, ((fcu->grp)?(fcu->grp->name):(NULL)), fcu->rna_path, fcu->array_index, cfra, flag);
else
insert_vert_fcurve(fcu, cfra, fcu->curval, 0);
}
BLI_freelistN(&anim_data);
}
开发者ID:jinjoh,项目名称:NOOR,代码行数:43,代码来源:action_edit.c
示例15: snap_action_keys
/* this function is responsible for snapping keyframes to frame-times */
static void snap_action_keys(bAnimContext *ac, short mode)
{
ListBase anim_data = {NULL, NULL};
bAnimListElem *ale;
int filter;
KeyframeEditData ked= {{NULL}};
KeyframeEditFunc edit_cb;
/* filter data */
if (ac->datatype == ANIMCONT_GPENCIL)
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT);
else
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* get beztriple editing callbacks */
edit_cb= ANIM_editkeyframes_snap(mode);
ked.scene= ac->scene;
if (mode == ACTKEYS_SNAP_NEAREST_MARKER) {
ked.list.first= (ac->markers) ? ac->markers->first : NULL;
ked.list.last= (ac->markers) ? ac->markers->last : NULL;
}
/* snap keyframes */
for (ale= anim_data.first; ale; ale= ale->next) {
AnimData *adt= ANIM_nla_mapping_get(ac, ale);
if (adt) {
ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1);
ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, edit_cb, calchandles_fcurve);
ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 1);
}
//else if (ale->type == ACTTYPE_GPLAYER)
// snap_gplayer_frames(ale->data, mode);
else
ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, edit_cb, calchandles_fcurve);
}
BLI_freelistN(&anim_data);
}
开发者ID:OldBrunet,项目名称:BGERTPS,代码行数:43,代码来源:action_edit.c
示例16: BLI_end_threads
void BLI_end_threads(ListBase *threadbase)
{
ThreadSlot *tslot;
/* only needed if there's actually some stuff to end
* this way we don't end up decrementing thread_levels on an empty threadbase
* */
if (threadbase && (BLI_listbase_is_empty(threadbase) == false)) {
for (tslot = threadbase->first; tslot; tslot = tslot->next) {
if (tslot->avail == 0) {
pthread_join(tslot->pthread, NULL);
}
}
BLI_freelistN(threadbase);
}
thread_levels--;
if (thread_levels == 0)
MEM_set_lock_callback(NULL, NULL);
}
开发者ID:mcgrathd,项目名称:blender,代码行数:20,代码来源:threads.c
示例17: BLI_dlrbTree_free
/* Free the given tree's data but not the tree itself */
void BLI_dlrbTree_free (DLRBT_Tree *tree)
{
if (tree == NULL)
return;
/* if the list-base stuff is set, just use that (and assume its set),
* otherwise, we'll need to traverse the tree...
*/
if (tree->first) {
/* free list */
BLI_freelistN((ListBase *)tree);
}
else {
/* traverse tree, freeing sub-nodes */
recursive_tree_free_nodes(tree->root);
}
/* clear pointers */
tree->first= tree->last= tree->root= NULL;
}
开发者ID:mik0001,项目名称:Blender,代码行数:21,代码来源:DLRB_tree.c
示例18: ntreeTexEndExecTree_internal
void ntreeTexEndExecTree_internal(bNodeTreeExec *exec)
{
bNodeThreadStack *nts;
int a;
if (exec->threadstack) {
tex_free_delegates(exec);
for (a = 0; a < exec->tot_thread; a++) {
for (nts = exec->threadstack[a].first; nts; nts = nts->next)
if (nts->stack) MEM_freeN(nts->stack);
BLI_freelistN(&exec->threadstack[a]);
}
MEM_freeN(exec->threadstack);
exec->threadstack = NULL;
}
ntree_exec_end(exec);
}
开发者ID:Andrewson3D,项目名称:blender-for-vray,代码行数:20,代码来源:node_texture_tree.c
示例19: fluidbake_free_data
static void fluidbake_free_data(FluidAnimChannels *channels, ListBase *fobjects, elbeemSimulationSettings *fsset, FluidBakeJob *fb)
{
free_domain_channels(channels);
MEM_freeN(channels);
channels = NULL;
free_all_fluidobject_channels(fobjects);
BLI_freelistN(fobjects);
MEM_freeN(fobjects);
fobjects = NULL;
if (fsset) {
MEM_freeN(fsset);
fsset = NULL;
}
if (fb) {
MEM_freeN(fb);
fb = NULL;
}
}
开发者ID:Bforartists,项目名称:Bforartists,代码行数:21,代码来源:physics_fluid.c
示例20: ED_armature_edit_free
void ED_armature_edit_free(struct bArmature *arm)
{
EditBone *eBone;
/* Clear the editbones list */
if (arm->edbo) {
if (arm->edbo->first) {
for (eBone = arm->edbo->first; eBone; eBone = eBone->next) {
if (eBone->prop) {
IDP_FreeProperty(eBone->prop);
MEM_freeN(eBone->prop);
}
}
BLI_freelistN(arm->edbo);
}
MEM_freeN(arm->edbo);
arm->edbo = NULL;
arm->act_edbone = NULL;
}
}
开发者ID:mgschwan,项目名称:blensor,代码行数:21,代码来源:armature_utils.c
注:本文中的BLI_freelistN函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论