Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_manipulator.c
| Show First 20 Lines • Show All 593 Lines • ▼ Show 20 Lines | static int calc_manipulator_stats(const bContext *C, struct TransformBounds *tbounds) | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| SceneLayer *sl = CTX_data_scene_layer(C); | SceneLayer *sl = CTX_data_scene_layer(C); | ||||
| Object *obedit = CTX_data_edit_object(C); | Object *obedit = CTX_data_edit_object(C); | ||||
| View3D *v3d = sa->spacedata.first; | View3D *v3d = sa->spacedata.first; | ||||
| RegionView3D *rv3d = ar->regiondata; | RegionView3D *rv3d = ar->regiondata; | ||||
| Base *base; | Base *base; | ||||
| Object *ob = OBACT_NEW(sl); | Object *ob = OBACT_NEW(sl); | ||||
| bGPdata *gpd = CTX_data_gpencil_data(C); | bGPdata *gpd = CTX_data_gpencil_data(C); | ||||
| const bool is_gp_edit = ((gpd) && (gpd->flag & GP_DATA_STROKE_EDITMODE)); | const bool is_gp_edit = GPENCIL_ANY_MODE(gpd); | ||||
| int a, totsel = 0; | int a, totsel = 0; | ||||
| /* transform widget matrix */ | /* transform widget matrix */ | ||||
| unit_m4(rv3d->twmat); | unit_m4(rv3d->twmat); | ||||
| #ifdef USE_AXIS_BOUNDS | #ifdef USE_AXIS_BOUNDS | ||||
| unit_m3(rv3d->tw_axis_matrix); | unit_m3(rv3d->tw_axis_matrix); | ||||
| zero_v3(rv3d->tw_axis_min); | zero_v3(rv3d->tw_axis_min); | ||||
| ▲ Show 20 Lines • Show All 95 Lines • ▼ Show 20 Lines | #endif | ||||
| if (is_gp_edit) { | if (is_gp_edit) { | ||||
| float diff_mat[4][4]; | float diff_mat[4][4]; | ||||
| float fpt[3]; | float fpt[3]; | ||||
| for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) { | for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) { | ||||
| /* only editable and visible layers are considered */ | /* only editable and visible layers are considered */ | ||||
| if (gpencil_layer_is_editable(gpl) && (gpl->actframe != NULL)) { | if (gpencil_layer_is_editable(gpl) && (gpl->actframe != NULL)) { | ||||
| /* calculate difference matrix if parent object */ | /* calculate difference matrix */ | ||||
| if (gpl->parent != NULL) { | ED_gpencil_parent_location(ob, gpd, gpl, diff_mat); | ||||
| ED_gpencil_parent_location(gpl, diff_mat); | |||||
| } | |||||
| for (bGPDstroke *gps = gpl->actframe->strokes.first; gps; gps = gps->next) { | for (bGPDstroke *gps = gpl->actframe->strokes.first; gps; gps = gps->next) { | ||||
| /* skip strokes that are invalid for current view */ | /* skip strokes that are invalid for current view */ | ||||
| if (ED_gpencil_stroke_can_use(C, gps) == false) { | if (ED_gpencil_stroke_can_use(C, gps) == false) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| /* we're only interested in selected points here... */ | /* we're only interested in selected points here... */ | ||||
| ▲ Show 20 Lines • Show All 815 Lines • Show Last 20 Lines | |||||