这篇教程C++ BLI_freelinkN函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中BLI_freelinkN函数的典型用法代码示例。如果您正苦于以下问题:C++ BLI_freelinkN函数的具体用法?C++ BLI_freelinkN怎么用?C++ BLI_freelinkN使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了BLI_freelinkN函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: poselib_remove_execstatic int poselib_remove_exec(bContext *C, wmOperator *op){ Object *ob = get_poselib_object(C); bAction *act = (ob) ? ob->poselib : NULL; TimeMarker *marker; int marker_index; FCurve *fcu; PropertyRNA *prop; /* check if valid poselib */ if (act == NULL) { BKE_report(op->reports, RPT_ERROR, "Object does not have pose lib data"); return OPERATOR_CANCELLED; } prop = RNA_struct_find_property(op->ptr, "pose"); if (RNA_property_is_set(op->ptr, prop)) { marker_index = RNA_property_enum_get(op->ptr, prop); } else { marker_index = act->active_marker - 1; } /* get index (and pointer) of pose to remove */ marker = BLI_findlink(&act->markers, marker_index); if (marker == NULL) { BKE_reportf(op->reports, RPT_ERROR, "Invalid pose specified %d", marker_index); return OPERATOR_CANCELLED; } /* remove relevant keyframes */ for (fcu = act->curves.first; fcu; fcu = fcu->next) { BezTriple *bezt; unsigned int i; if (fcu->bezt) { for (i = 0, bezt = fcu->bezt; i < fcu->totvert; i++, bezt++) { /* check if remove */ if (IS_EQF(bezt->vec[1][0], (float)marker->frame)) { delete_fcurve_key(fcu, i, 1); break; } } } } /* remove poselib from list */ BLI_freelinkN(&act->markers, marker); /* fix active pose number */ act->active_marker = 0; /* send notifiers for this - using keyframe editing notifiers, since action * may be being shown in anim editors as active action */ WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); /* done */ return OPERATOR_FINISHED;}
开发者ID:castlelore,项目名称:blender-git,代码行数:60,
示例2: 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 */ animcopybuf.first= animcopybuf.last= NULL; animcopy_firstframe= 999999999.0f; animcopy_lastframe= -999999999.0f;}
开发者ID:rexbron,项目名称:blender-ocio,代码行数:26,
示例3: clip_delete_trackvoid clip_delete_track(bContext *C, MovieClip *clip, MovieTrackingTrack *track){ MovieTracking *tracking= &clip->tracking; MovieTrackingStabilization *stab= &tracking->stabilization; int has_bundle= 0, update_stab= 0; if(track==tracking->act_track) tracking->act_track= NULL; if(track==stab->rot_track) { stab->rot_track= NULL; update_stab= 1; } /* handle reconstruction display in 3d viewport */ if(track->flag&TRACK_HAS_BUNDLE) has_bundle= 1; BKE_tracking_free_track(track); BLI_freelinkN(&tracking->tracks, track); WM_event_add_notifier(C, NC_MOVIECLIP|NA_EDITED, clip); if(update_stab) { tracking->stabilization.ok= 0; DAG_id_tag_update(&clip->id, 0); WM_event_add_notifier(C, NC_MOVIECLIP|ND_DISPLAY, clip); } if(has_bundle) WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, NULL);}
开发者ID:mik0001,项目名称:Blender,代码行数:35,
示例4: splineik_execute_tree/* Evaluate the chain starting from the nominated bone */static void splineik_execute_tree(Scene *scene, Object *ob, bPoseChannel *pchan_root, float ctime){ tSplineIK_Tree *tree; /* for each pose-tree, execute it if it is spline, otherwise just free it */ while ((tree = pchan_root->siktree.first) != NULL) { int i; /* walk over each bone in the chain, calculating the effects of spline IK * - the chain is traversed in the opposite order to storage order (i.e. parent to children) * so that dependencies are correct */ for (i = tree->chainlen - 1; i >= 0; i--) { bPoseChannel *pchan = tree->chain[i]; splineik_evaluate_bone(tree, scene, ob, pchan, i, ctime); } /* free the tree info specific to SplineIK trees now */ if (tree->chain) MEM_freeN(tree->chain); if (tree->free_points) MEM_freeN(tree->points); /* free this tree */ BLI_freelinkN(&pchan_root->siktree, tree); }}
开发者ID:Andrewson3D,项目名称:blender-for-vray,代码行数:28,
示例5: remove_active_keyingset_execstatic int remove_active_keyingset_exec (bContext *C, wmOperator *op){ Scene *scene= CTX_data_scene(C); KeyingSet *ks; /* verify the Keying Set to use: * - use the active one * - return error if it doesn't exist */ if (scene->active_keyingset == 0) { BKE_report(op->reports, RPT_ERROR, "No active Keying Set to remove"); return OPERATOR_CANCELLED; } else ks= BLI_findlink(&scene->keyingsets, scene->active_keyingset-1); /* free KeyingSet's data, then remove it from the scene */ BKE_keyingset_free(ks); BLI_freelinkN(&scene->keyingsets, ks); /* the active one should now be the previously second-to-last one */ scene->active_keyingset--; /* send notifiers */ WM_event_add_notifier(C, NC_SCENE|ND_KEYINGSET, NULL); return OPERATOR_FINISHED;}
开发者ID:jinjoh,项目名称:NOOR,代码行数:28,
示例6: undo_stack_push_endstatic void undo_stack_push_end(UndoStack *stack){ UndoElem *uel; uintptr_t totmem, maxmem; if(U.undomemory != 0) { /* limit to maximum memory (afterwards, we can't know in advance) */ totmem= 0; maxmem= ((uintptr_t)U.undomemory)*1024*1024; uel= stack->elems.last; while(uel) { totmem+= uel->undosize; if(totmem>maxmem) break; uel= uel->prev; } if(uel) { while(stack->elems.first!=uel) { UndoElem *first= stack->elems.first; undo_elem_free(stack, first); BLI_freelinkN(&stack->elems, first); } } }}
开发者ID:BHCLL,项目名称:blendocv,代码行数:26,
示例7: BKE_pose_remove_group/* Remove the active bone-group */void BKE_pose_remove_group(Object *ob){ bPose *pose = (ob) ? ob->pose : NULL; bActionGroup *grp = NULL; bPoseChannel *pchan; /* sanity checks */ if (ELEM(NULL, ob, pose)) return; if (pose->active_group <= 0) return; /* get group to remove */ grp = BLI_findlink(&pose->agroups, pose->active_group - 1); if (grp) { /* adjust group references (the trouble of using indices!): * - firstly, make sure nothing references it * - also, make sure that those after this item get corrected */ for (pchan = pose->chanbase.first; pchan; pchan = pchan->next) { if (pchan->agrp_index == pose->active_group) pchan->agrp_index = 0; else if (pchan->agrp_index > pose->active_group) pchan->agrp_index--; } /* now, remove it from the pose */ BLI_freelinkN(&pose->agroups, grp); pose->active_group--; if (pose->active_group < 0 || pose->agroups.first == NULL) { pose->active_group = 0; } }}
开发者ID:diosney,项目名称:blender,代码行数:35,
示例8: remove_active_ks_path_execstatic int remove_active_ks_path_exec (bContext *C, wmOperator *op){ Scene *scene= CTX_data_scene(C); KeyingSet *ks= BLI_findlink(&scene->keyingsets, scene->active_keyingset-1); /* if there is a KeyingSet, find the nominated path to remove */ if (ks) { KS_Path *ksp= BLI_findlink(&ks->paths, ks->active_path-1); if (ksp) { /* NOTE: sync this code with BKE_keyingset_free() */ { /* free RNA-path info */ MEM_freeN(ksp->rna_path); /* free path itself */ BLI_freelinkN(&ks->paths, ksp); } /* the active path should now be the previously second-to-last active one */ ks->active_path--; } else { BKE_report(op->reports, RPT_ERROR, "No active Keying Set Path to remove"); return OPERATOR_CANCELLED; } } else { BKE_report(op->reports, RPT_ERROR, "No active Keying Set to remove a path from"); return OPERATOR_CANCELLED; } return OPERATOR_FINISHED;}
开发者ID:jinjoh,项目名称:NOOR,代码行数:34,
示例9: ANIM_fcurves_copybuf_free/* This function frees any MEM_calloc'ed copy/paste buffer data */void ANIM_fcurves_copybuf_free(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:DarkDefender,项目名称:blender-npr-tess2,代码行数:26,
示例10: BLI_replaceNodevoid BLI_replaceNode(BGraph *graph, BNode *node_src, BNode *node_replaced){ BArc *arc, *next_arc; for (arc = graph->arcs.first; arc; arc = next_arc) { next_arc = arc->next; if (arc->head == node_replaced) { arc->head = node_src; node_replaced->degree--; node_src->degree++; } if (arc->tail == node_replaced) { arc->tail = node_src; node_replaced->degree--; node_src->degree++; } if (arc->head == arc->tail) { node_src->degree -= 2; graph->free_arc(arc); BLI_freelinkN(&graph->arcs, arc); } } if (node_replaced->degree == 0) { BLI_removeNode(graph, node_replaced); }}
开发者ID:DarkDefender,项目名称:blender-npr-tess2,代码行数:31,
示例11: ANIM_keyingset_info_unregister/* Remove the given KeyingSetInfo from the list of type infos, and also remove the builtin set if appropriate */void ANIM_keyingset_info_unregister (Main *bmain, KeyingSetInfo *ksi){ KeyingSet *ks, *ksn; /* find relevant builtin KeyingSets which use this, and remove them */ // TODO: this isn't done now, since unregister is really only used atm when we // reload the scripts, which kindof defeats the purpose of "builtin"? for (ks= builtin_keyingsets.first; ks; ks= ksn) { ksn = ks->next; /* remove if matching typeinfo name */ if (strcmp(ks->typeinfo, ksi->idname) == 0) { Scene *scene; BKE_keyingset_free(ks); BLI_remlink(&builtin_keyingsets, ks); for(scene= bmain->scene.first; scene; scene= scene->id.next) BLI_remlink_safe(&scene->keyingsets, ks); MEM_freeN(ks); } } /* free the type info */ BLI_freelinkN(&keyingset_type_infos, ksi);}
开发者ID:BHCLL,项目名称:blendocv,代码行数:27,
示例12: BKE_pose_remove_group/* Remove the given bone-group (expects 'virtual' index (+1 one, used by active_group etc.)) * index might be invalid ( < 1), in which case it will be find from grp. */void BKE_pose_remove_group(bPose *pose, bActionGroup *grp, const int index){ bPoseChannel *pchan; int idx = index; if (idx < 1) { idx = BLI_findindex(&pose->agroups, grp) + 1; } BLI_assert(idx > 0); /* adjust group references (the trouble of using indices!): * - firstly, make sure nothing references it * - also, make sure that those after this item get corrected */ for (pchan = pose->chanbase.first; pchan; pchan = pchan->next) { if (pchan->agrp_index == idx) pchan->agrp_index = 0; else if (pchan->agrp_index > idx) pchan->agrp_index--; } /* now, remove it from the pose */ BLI_freelinkN(&pose->agroups, grp); if (pose->active_group >= idx) { pose->active_group--; if (pose->active_group < 0 || BLI_listbase_is_empty(&pose->agroups)) { pose->active_group = 0; } }}
开发者ID:SuriyaaKudoIsc,项目名称:blender-git,代码行数:33,
示例13: task_scheduler_clearstatic void task_scheduler_clear(TaskScheduler *scheduler, TaskPool *pool){ Task *task, *nexttask; size_t done = 0; BLI_mutex_lock(&scheduler->queue_mutex); /* free all tasks from this pool from the queue */ for (task = scheduler->queue.first; task; task = nexttask) { nexttask = task->next; if (task->pool == pool) { if (task->free_taskdata) MEM_freeN(task->taskdata); BLI_freelinkN(&scheduler->queue, task); done++; } } BLI_mutex_unlock(&scheduler->queue_mutex); /* notify done */ task_pool_num_decrease(pool, done);}
开发者ID:flair2005,项目名称:mechanical-blender,代码行数:25,
示例14: BLI_removeArcvoid BLI_removeArc(BGraph *graph, BArc *arc){ if (graph->free_arc) { graph->free_arc(arc); } BLI_freelinkN(&graph->arcs, arc);}
开发者ID:nttputus,项目名称:blensor,代码行数:8,
示例15: remove_keyingset_button_execstatic int remove_keyingset_button_exec (bContext *C, wmOperator *op){ Scene *scene= CTX_data_scene(C); KeyingSet *ks = NULL; PropertyRNA *prop= NULL; PointerRNA ptr; char *path = NULL; short success= 0; int index=0; /* verify the Keying Set to use: * - use the active one for now (more control over this can be added later) * - return error if it doesn't exist */ if (scene->active_keyingset == 0) { BKE_report(op->reports, RPT_ERROR, "No active Keying Set to remove property from"); return OPERATOR_CANCELLED; } else ks= BLI_findlink(&scene->keyingsets, scene->active_keyingset-1); /* try to add to keyingset using property retrieved from UI */ memset(&ptr, 0, sizeof(PointerRNA)); uiAnimContextProperty(C, &ptr, &prop, &index); if (ptr.data && prop) { path= RNA_path_from_ID_to_property(&ptr, prop); if (path) { KS_Path *ksp; /* try to find a path matching this description */ ksp= BKE_keyingset_find_destination(ks, ptr.id.data, ks->name, path, index, KSP_GROUP_KSNAME); if (ksp) { /* just free it... */ MEM_freeN(ksp->rna_path); BLI_freelinkN(&ks->paths, ksp); success= 1; } /* free temp path used */ MEM_freeN(path); } } if (success) { /* send updates */ ED_anim_dag_flush_update(C); /* for now, only send ND_KEYS for KeyingSets */ WM_event_add_notifier(C, NC_SCENE|ND_KEYINGSET, NULL); } return (success)? OPERATOR_FINISHED: OPERATOR_CANCELLED;}
开发者ID:jinjoh,项目名称:NOOR,代码行数:58,
示例16: free_iconfile_liststatic void free_iconfile_list(struct ListBase *list){ IconFile *ifile = NULL, *next_ifile = NULL; for (ifile = list->first; ifile; ifile = next_ifile) { next_ifile = ifile->next; BLI_freelinkN(list, ifile); }}
开发者ID:AwesomeDoesIt,项目名称:blender-git,代码行数:9,
示例17: WM_keymap_list_findstatic wmKeyMap *wm_keymap_patch_update(ListBase *lb, wmKeyMap *defaultmap, wmKeyMap *addonmap, wmKeyMap *usermap){ wmKeyMap *km; int expanded = 0; /* remove previous keymap in list, we will replace it */ km = WM_keymap_list_find(lb, defaultmap->idname, defaultmap->spaceid, defaultmap->regionid); if(km) { expanded = (km->flag & (KEYMAP_EXPANDED|KEYMAP_CHILDREN_EXPANDED)); WM_keymap_free(km); BLI_freelinkN(lb, km); } /* copy new keymap from an existing one */ if(usermap && !(usermap->flag & KEYMAP_DIFF)) { /* for compatibiltiy with old user preferences with non-diff keymaps we override the original entirely */ wmKeyMapItem *kmi, *orig_kmi; km = wm_keymap_copy(usermap); /* try to find corresponding id's for items */ for(kmi=km->items.first; kmi; kmi=kmi->next) { orig_kmi = wm_keymap_find_item_equals(defaultmap, kmi); if(!orig_kmi) orig_kmi = wm_keymap_find_item_equals_result(defaultmap, kmi); if(orig_kmi) kmi->id = orig_kmi->id; else kmi->id = -(km->kmi_id++); } km->flag |= KEYMAP_UPDATE; /* update again to create diff */ } else km = wm_keymap_copy(defaultmap); /* add addon keymap items */ if(addonmap) wm_keymap_addon_add(km, addonmap); /* tag as being user edited */ if(usermap) km->flag |= KEYMAP_USER_MODIFIED; km->flag |= KEYMAP_USER|expanded; /* apply user changes of diff keymap */ if(usermap && (usermap->flag & KEYMAP_DIFF)) wm_keymap_patch(km, usermap); /* add to list */ BLI_addtail(lb, km); return km;}
开发者ID:OldBrunet,项目名称:BGERTPS,代码行数:56,
示例18: gpencil_layer_delete/* delete the active gp-layer */void gpencil_layer_delete(bGPdata *gpd, bGPDlayer *gpl){ /* error checking */ if (ELEM(NULL, gpd, gpl)) return; /* free layer */ free_gpencil_frames(gpl); BLI_freelinkN(&gpd->layers, gpl);}
开发者ID:linkedinyou,项目名称:blender-git,代码行数:11,
示例19: remove_tagged_functionsstatic void remove_tagged_functions(void){ for (TimedFunction *timed_func = GlobalTimer.funcs.first; timed_func;) { TimedFunction *next = timed_func->next; if (timed_func->tag_removal) { clear_user_data(timed_func); BLI_freelinkN(&GlobalTimer.funcs, timed_func); } timed_func = next; }}
开发者ID:dfelinto,项目名称:blender,代码行数:11,
示例20: gpencil_layer_delframe/* delete the given frame from a layer */void gpencil_layer_delframe(bGPDlayer *gpl, bGPDframe *gpf){ /* error checking */ if (ELEM(NULL, gpl, gpf)) return; /* free the frame and its data */ free_gpencil_strokes(gpf); BLI_freelinkN(&gpl->frames, gpf); gpl->actframe = NULL;}
开发者ID:244xiao,项目名称:blender,代码行数:12,
示例21: WM_keyconfig_freevoid WM_keyconfig_free(wmKeyConfig *keyconf){ wmKeyMap *km; while((km= keyconf->keymaps.first)) { WM_keymap_free(km); BLI_freelinkN(&keyconf->keymaps, km); } MEM_freeN(keyconf);}
开发者ID:OldBrunet,项目名称:BGERTPS,代码行数:11,
示例22: bone_freevoid bone_free(bArmature *arm, EditBone *bone){ if (arm->act_edbone == bone) arm->act_edbone = NULL; if (bone->prop) { IDP_FreeProperty(bone->prop); MEM_freeN(bone->prop); } BLI_freelinkN(arm->edbo, bone);}
开发者ID:mgschwan,项目名称:blensor,代码行数:12,
示例23: WM_keymap_remove_itemvoid WM_keymap_remove_item(wmKeyMap *keymap, wmKeyMapItem *kmi){ if(BLI_findindex(&keymap->items, kmi) != -1) { if(kmi->ptr) { WM_operator_properties_free(kmi->ptr); MEM_freeN(kmi->ptr); } BLI_freelinkN(&keymap->items, kmi); WM_keyconfig_update_tag(keymap, kmi); }}
开发者ID:OldBrunet,项目名称:BGERTPS,代码行数:12,
示例24: rna_GPencil_stroke_removestatic void rna_GPencil_stroke_remove(bGPDframe *frame, ReportList *reports, PointerRNA *stroke_ptr){ bGPDstroke *stroke = stroke_ptr->data; if (BLI_findindex(&frame->strokes, stroke) == -1) { BKE_report(reports, RPT_ERROR, "Stroke not found in grease pencil frame"); return; } BLI_freelinkN(&frame->strokes, stroke); RNA_POINTER_INVALIDATE(stroke_ptr); WM_main_add_notifier(NC_GPENCIL | NA_EDITED, NULL);}
开发者ID:244xiao,项目名称:blender,代码行数:13,
示例25: preview_startjob/* only this runs inside thread */static void preview_startjob(void *data, short *stop, short *do_update, float *progress){ PreviewJob *pj = data; PreviewJobAudio *previewjb; BLI_mutex_lock(pj->mutex); previewjb = pj->previews.first; BLI_mutex_unlock(pj->mutex); while (previewjb) { PreviewJobAudio *preview_next; bSound *sound = previewjb->sound; BKE_sound_read_waveform(sound, stop); if (*stop || G.is_break) { BLI_mutex_lock(pj->mutex); previewjb = previewjb->next; BLI_mutex_unlock(pj->mutex); while (previewjb) { sound = previewjb->sound; /* make sure we cleanup the loading flag! */ BLI_spin_lock(sound->spinlock); sound->tags &= ~SOUND_TAGS_WAVEFORM_LOADING; BLI_spin_unlock(sound->spinlock); BLI_mutex_lock(pj->mutex); previewjb = previewjb->next; BLI_mutex_unlock(pj->mutex); } BLI_mutex_lock(pj->mutex); BLI_freelistN(&pj->previews); pj->total = 0; pj->processed = 0; BLI_mutex_unlock(pj->mutex); break; } BLI_mutex_lock(pj->mutex); preview_next = previewjb->next; BLI_freelinkN(&pj->previews, previewjb); previewjb = preview_next; pj->processed++; *progress = (pj->total > 0) ? (float)pj->processed / (float)pj->total : 1.0f; *do_update = true; BLI_mutex_unlock(pj->mutex); }}
开发者ID:Ichthyostega,项目名称:blender,代码行数:51,
注:本文中的BLI_freelinkN函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ BLI_freelistN函数代码示例 C++ BLI_findstring函数代码示例 |