Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/action.c
| Context not available. | |||||
| } | } | ||||
| } | } | ||||
| static void pose_channels_remove_internal_links(Object *ob, bPoseChannel *unlinked_pchan) | |||||
sergey: Don't think `target` is best name here. | |||||
Not Done Inline ActionsWhat would be a better name? Does unlinked_pchansounds better? fclem: What would be a better name? Does `unlinked_pchan`sounds better? | |||||
Not Done Inline ActionsSounds good to me. sergey: Sounds good to me. | |||||
| { | |||||
| LISTBASE_FOREACH (bPoseChannel *, pchan, &ob->pose->chanbase) { | |||||
| if (pchan->bbone_prev == unlinked_pchan) { | |||||
Not Done Inline ActionsIs this needed? sergey: Is this needed? | |||||
| pchan->bbone_prev = NULL; | |||||
| } | |||||
| if (pchan->bbone_next == unlinked_pchan) { | |||||
| pchan->bbone_next = NULL; | |||||
| } | |||||
| if (pchan->custom_tx == unlinked_pchan) { | |||||
| pchan->custom_tx = NULL; | |||||
| } | |||||
| } | |||||
| } | |||||
Not Done Inline ActionsNot entirely sure how the bbones are stored internally, but usually in the linked list you would do something like: pchan->bbone_prev = target_pchar->bbone_prev Or maybe even: target_pchar->bbone_prev->bbone_next = target_pchar->bbone_next; target_pchar->bbone_next->bbone_prev = target_pchar->bbone_prevt; But i am not sure whether bbone chain thingamajig is supposed to "break" on removing pchan or not. sergey: Not entirely sure how the bbones are stored internally, but usually in the linked list you… | |||||
Not Done Inline ActionsIt's not a linked list I think, just a cache to quickly lookup the next/prev bone for b-bones. So I don't think this part is an issue. brecht: It's not a linked list I think, just a cache to quickly lookup the next/prev bone for b-bones. | |||||
Not Done Inline ActionsOk, then ignore my comment :) sergey: Ok, then ignore my comment :) | |||||
| /** | /** | ||||
| * Selectively remove pose channels. | * Selectively remove pose channels. | ||||
| */ | */ | ||||
| Context not available. | |||||
| if (filter_fn(pchan->name, user_data)) { | if (filter_fn(pchan->name, user_data)) { | ||||
| /* Bone itself is being removed */ | /* Bone itself is being removed */ | ||||
| BKE_pose_channel_free(pchan); | BKE_pose_channel_free(pchan); | ||||
| pose_channels_remove_internal_links(ob, pchan); | |||||
| if (ob->pose->chanhash) { | if (ob->pose->chanhash) { | ||||
| BLI_ghash_remove(ob->pose->chanhash, pchan->name, NULL, NULL); | BLI_ghash_remove(ob->pose->chanhash, pchan->name, NULL, NULL); | ||||
| } | } | ||||
| Context not available. | |||||
Don't think target is best name here.