Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/curve/editcurve.c
| Show First 20 Lines • Show All 7,088 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| Object *object = CTX_data_active_object(C); | Object *object = CTX_data_active_object(C); | ||||
| return object && ELEM(object->type, OB_CURVE, OB_SURF, OB_FONT); | return object && ELEM(object->type, OB_CURVE, OB_SURF, OB_FONT); | ||||
| } | } | ||||
| static int match_texture_space_exec(bContext *C, wmOperator *UNUSED(op)) | static int match_texture_space_exec(bContext *C, wmOperator *UNUSED(op)) | ||||
| { | { | ||||
| Depsgraph *depsgraph = CTX_data_depsgraph(C); | /* Need to ensure the dependency graph is fully evaluated, so the display list is at a correct | ||||
| Scene *scene = CTX_data_scene(C); | * state. */ | ||||
| Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); | |||||
| (void)depsgraph; | |||||
| Object *object = CTX_data_active_object(C); | Object *object = CTX_data_active_object(C); | ||||
| Curve *curve = (Curve *)object->data; | Curve *curve = (Curve *)object->data; | ||||
| float min[3], max[3], size[3], loc[3]; | float min[3], max[3], size[3], loc[3]; | ||||
| int a; | int a; | ||||
| if (object->runtime.curve_cache == NULL) { | BLI_assert(object->runtime.curve_cache != NULL); | ||||
| BKE_displist_make_curveTypes(depsgraph, scene, object, false, false); | |||||
| } | |||||
| INIT_MINMAX(min, max); | INIT_MINMAX(min, max); | ||||
| BKE_displist_minmax(&object->runtime.curve_cache->disp, min, max); | BKE_displist_minmax(&object->runtime.curve_cache->disp, min, max); | ||||
| mid_v3_v3v3(loc, min, max); | mid_v3_v3v3(loc, min, max); | ||||
| size[0] = (max[0] - min[0]) / 2.0f; | size[0] = (max[0] - min[0]) / 2.0f; | ||||
| size[1] = (max[1] - min[1]) / 2.0f; | size[1] = (max[1] - min[1]) / 2.0f; | ||||
| Show All 39 Lines | |||||