From 74938480083a908a5d1fad448f1214b214727bf3 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 26 Nov 2018 13:49:17 +1100 Subject: 3D View: remove 3D cursor Use 3D cursor from the scene (was previously used for local-view). --- source/blender/makesrna/intern/rna_space.c | 56 ------------------------------ 1 file changed, 56 deletions(-) (limited to 'source/blender/makesrna/intern/rna_space.c') diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 774fbe1f7ba..b28e0951877 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -531,47 +531,6 @@ static void rna_SpaceView3D_lock_camera_and_layers_set(PointerRNA *ptr, bool val } } - -static View3DCursor *rna_View3D_Cursor_get_from_scene_or_localview(PointerRNA *ptr) -{ - View3D *v3d = (View3D *)(ptr->data); - bScreen *screen = ptr->id.data; - Scene *scene = ED_screen_scene_find(screen, G_MAIN->wm.first); - return ED_view3d_cursor3d_get(scene, v3d); -} - -static void rna_View3D_Cursor_location_get(PointerRNA *ptr, float *values) -{ - const View3DCursor *cursor = rna_View3D_Cursor_get_from_scene_or_localview(ptr); - copy_v3_v3(values, cursor->location); -} - -static void rna_View3D_Cursor_location_set(PointerRNA *ptr, const float *values) -{ - View3DCursor *cursor = rna_View3D_Cursor_get_from_scene_or_localview(ptr); - copy_v3_v3(cursor->location, values); -} - -static void rna_View3D_Cursor_rotation_get(PointerRNA *ptr, float *values) -{ - const View3DCursor *cursor = rna_View3D_Cursor_get_from_scene_or_localview(ptr); - copy_qt_qt(values, cursor->rotation); -} - -static void rna_View3D_Cursor_rotation_set(PointerRNA *ptr, const float *values) -{ - View3DCursor *cursor = rna_View3D_Cursor_get_from_scene_or_localview(ptr); - copy_qt_qt(cursor->rotation, values); -} - -static void rna_View3D_Cursor_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr) -{ - View3D *v3d = ptr->data; - if (v3d->localvd == NULL) { - DEG_id_tag_update(&scene->id, DEG_TAG_COPY_ON_WRITE); - } -} - static float rna_View3DOverlay_GridScaleUnit_get(PointerRNA *ptr) { View3D *v3d = (View3D *)(ptr->data); @@ -3108,21 +3067,6 @@ static void rna_def_space_view3d(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Local View", "Display an isolated sub-set of objects, apart from the scene visibility"); - prop = RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ_LENGTH); - RNA_def_property_array(prop, 3); - RNA_def_property_float_funcs(prop, "rna_View3D_Cursor_location_get", "rna_View3D_Cursor_location_set", NULL); - RNA_def_property_ui_text(prop, "3D Cursor Location", - "3D cursor location for this view (dependent on local view setting)"); - RNA_def_property_ui_range(prop, -10000.0, 10000.0, 1, RNA_TRANSLATION_PREC_DEFAULT); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_View3D_Cursor_update"); - - prop = RNA_def_property(srna, "cursor_rotation", PROP_FLOAT, PROP_QUATERNION); - RNA_def_property_array(prop, 4); - RNA_def_property_float_funcs(prop, "rna_View3D_Cursor_rotation_get", "rna_View3D_Cursor_rotation_set", NULL); - RNA_def_property_ui_text(prop, "3D Cursor Rotation", - "Rotation in quaternions (keep normalized)"); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_View3D_Cursor_update"); - prop = RNA_def_property(srna, "lens", PROP_FLOAT, PROP_UNIT_CAMERA); RNA_def_property_float_sdna(prop, NULL, "lens"); RNA_def_property_ui_text(prop, "Lens", "Viewport lens angle"); -- cgit v1.2.3