Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/key.c
| Context not available. | |||||
| if (ob->shapeflag & OB_SHAPE_LOCK) { | if (ob->shapeflag & OB_SHAPE_LOCK) { | ||||
| /* shape locked, copy the locked shape instead of blending */ | /* shape locked, copy the locked shape instead of blending */ | ||||
| KeyBlock *kb = BLI_findlink(&key->block, ob->shapenr - 1); | KeyBlock *kb = BLI_findlink(&key->block, ob->shapenr); | ||||
| if (kb && (kb->flag & KEYBLOCK_MUTE)) | if (kb && (kb->flag & KEYBLOCK_MUTE)) | ||||
| kb = key->refkey; | kb = key->refkey; | ||||
| if (kb == NULL) { | if (kb == NULL) { | ||||
| kb = key->block.first; | kb = key->block.first; | ||||
| ob->shapenr = 1; | ob->shapenr = 0; | ||||
| } | } | ||||
| if (OB_TYPE_SUPPORT_VGROUP(ob->type)) { | if (OB_TYPE_SUPPORT_VGROUP(ob->type)) { | ||||
| Context not available. | |||||
| Key *key = BKE_key_from_object(ob); | Key *key = BKE_key_from_object(ob); | ||||
| if (key) { | if (key) { | ||||
| KeyBlock *kb = BLI_findlink(&key->block, ob->shapenr - 1); | KeyBlock *kb = BLI_findlink(&key->block, ob->shapenr); | ||||
| return kb; | return kb; | ||||
| } | } | ||||
| Context not available. | |||||
| { | { | ||||
| Key *key = BKE_key_from_object(ob); | Key *key = BKE_key_from_object(ob); | ||||
| KeyBlock *kb; | KeyBlock *kb; | ||||
| const int act_index = ob->shapenr - 1; | const int act_index = ob->shapenr; | ||||
| const int totkey = key->totkey; | const int totkey = key->totkey; | ||||
| int i; | int i; | ||||
| bool rev, in_range = false; | bool rev, in_range = false; | ||||
| Context not available. | |||||
| /* Need to update active shape number if it's affected, same principle as for relative indices above. */ | /* Need to update active shape number if it's affected, same principle as for relative indices above. */ | ||||
| if (org_index == act_index) { | if (org_index == act_index) { | ||||
| ob->shapenr = new_index + 1; | ob->shapenr = new_index; | ||||
| } | } | ||||
| else if (act_index < org_index && act_index >= new_index) { | else if (act_index < org_index && act_index >= new_index) { | ||||
| ob->shapenr++; | ob->shapenr++; | ||||
| Context not available. | |||||