Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/armature/armature_add.c
| Show First 20 Lines • Show All 1,068 Lines • ▼ Show 20 Lines | |||||
| * This group of operators all use the same 'exec' callback, but they are called | * This group of operators all use the same 'exec' callback, but they are called | ||||
| * through several different operators - a combined menu (which just calls the exec in the | * through several different operators - a combined menu (which just calls the exec in the | ||||
| * appropriate ways), and two separate ones. | * appropriate ways), and two separate ones. | ||||
| */ | */ | ||||
| static int armature_subdivide_exec(bContext *C, wmOperator *op) | static int armature_subdivide_exec(bContext *C, wmOperator *op) | ||||
| { | { | ||||
| Object *obedit = CTX_data_edit_object(C); | Object *obedit = CTX_data_edit_object(C); | ||||
| bArmature *arm = obedit->data; | |||||
| EditBone *newbone, *tbone; | EditBone *newbone, *tbone; | ||||
| int cuts, i; | int cuts, i; | ||||
| /* there may not be a number_cuts property defined (for 'simple' subdivide) */ | /* there may not be a number_cuts property defined (for 'simple' subdivide) */ | ||||
| cuts = RNA_int_get(op->ptr, "number_cuts"); | cuts = RNA_int_get(op->ptr, "number_cuts"); | ||||
| /* loop over all editable bones */ | /* loop over all editable bones */ | ||||
| // XXX the old code did this in reverse order though! | // XXX the old code did this in reverse order though! | ||||
| CTX_DATA_BEGIN(C, EditBone *, ebone, selected_editable_bones) | CTX_DATA_BEGIN_WITH_ID(C, EditBone *, ebone, selected_editable_bones, bArmature *, arm) | ||||
| { | { | ||||
| for (i = cuts + 1; i > 1; i--) { | for (i = cuts + 1; i > 1; i--) { | ||||
| /* compute cut ratio first */ | /* compute cut ratio first */ | ||||
| float cutratio = 1.0f / (float)i; | float cutratio = 1.0f / (float)i; | ||||
| float cutratioI = 1.0f - cutratio; | float cutratioI = 1.0f - cutratio; | ||||
| float val1[3]; | float val1[3]; | ||||
| float val2[3]; | float val2[3]; | ||||
| ▲ Show 20 Lines • Show All 65 Lines • Show Last 20 Lines | |||||