|
Blender V5.0
|
#include "AS_asset_representation.hh"#include "BKE_asset.hh"#include "BKE_context.hh"#include "BKE_idprop.hh"#include "BKE_layer.hh"#include "BKE_lib_id.hh"#include "BKE_lib_remap.hh"#include "BKE_library.hh"#include "BKE_object.hh"#include "BLI_listbase.h"#include "BLI_math_matrix.h"#include "BLI_math_rotation.h"#include "BLI_math_vector.h"#include "BLT_translation.hh"#include "DEG_depsgraph.hh"#include "DEG_depsgraph_build.hh"#include "DNA_ID.h"#include "DNA_collection_types.h"#include "DNA_screen_types.h"#include "ED_object.hh"#include "ED_outliner.hh"#include "ED_screen.hh"#include "ED_undo.hh"#include "ED_view3d.hh"#include "UI_resources.hh"#include "RNA_access.hh"#include "WM_api.hh"#include "WM_types.hh"#include "view3d_intern.hh"Go to the source code of this file.
|
static |
Make all selected objects and the collections (if localize_collections is set) local so objects can be transformed. The object data and other dependencies are kept linked/packed.
This is a bit of a minimum effort solution. Ideally there would be a version of BKE_lib_id_make_local() that allows passing multiple IDs to make local.
Definition at line 384 of file view3d_dropboxes.cc.
References blender::bke::id::IDRemapper::add(), blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), blender::Vector< T, InlineBufferCapacity, Allocator >::append(), BKE_collection_has_object(), BKE_lib_id_make_local(), BKE_libblock_remap_multiple(), BKE_view_layer_has_collection(), BKE_view_layer_synced_ensure(), BLI_assert, Main::collections, FOREACH_SELECTED_OBJECT_BEGIN, FOREACH_SELECTED_OBJECT_END, ID_IS_LINKED, ID_REMAP_SKIP_INDIRECT_USAGE, LIB_ID_MAKELOCAL_ASSET_DATA_CLEAR, LIB_ID_MAKELOCAL_LIBOVERRIDE_CLEAR, and LISTBASE_FOREACH.
Referenced by view3d_collection_drop_copy_external_asset(), and view3d_ob_drop_copy_external_asset().
|
static |
Definition at line 560 of file view3d_dropboxes.cc.
References BASE_ENABLED_VIEWPORT, BASE_SELECTABLE, BKE_view_layer_base_deselect_all(), BKE_view_layer_base_find(), BKE_view_layer_base_select_and_set_active(), BKE_view_layer_synced_ensure(), BLI_assert, C, CTX_data_main(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_view3d(), DEG_id_tag_update(), DEG_relations_tag_update(), wmDropBox::draw_data, ED_outliner_select_sync_from_object_tag(), ED_undo_push(), FILE_AUTOSELECT, ListBase::first, Base::flag, Collection::gobject, Collection::id, Scene::id, ID_RECALC_SELECT, wmDragAsset::import_settings, make_selected_objects_local(), NC_SCENE, ND_LAYER_CONTENT, ND_OB_ACTIVE, ID::newid, CollectionObject::ob, wmDropBox::ptr, RNA_boolean_set(), RNA_float_set_array(), RNA_int_set(), rot, ID::session_uid, wmDrag::type, AssetImportSettings::use_instance_collections, view3d_collection_drop_matrix_from_snap(), WM_DRAG_ASSET, WM_drag_asset_id_import(), WM_drag_asset_will_import_packed(), WM_drag_get_asset_data(), WM_event_add_notifier(), and WM_main_add_notifier().
Referenced by view3d_dropboxes().
Definition at line 545 of file view3d_dropboxes.cc.
References ED_view3d_cursor_snap_state_active_get(), ID_GR, wmDropBox::ptr, RNA_float_set_array(), RNA_int_set(), rot, ID::session_uid, view3d_collection_drop_matrix_from_snap(), and WM_drag_get_local_ID().
Referenced by view3d_dropboxes().
|
static |
Definition at line 532 of file view3d_dropboxes.cc.
References BLI_assert, copy_v3_v3(), V3DSnapCursorState::draw_box, V3DSnapCursorState::draw_plane, ED_view3d_cursor_snap_data_get(), V3DSnapCursorData::loc, mat3_normalized_to_eul(), V3DSnapCursorData::plane_omat, and UNUSED_VARS_NDEBUG.
Referenced by view3d_collection_drop_copy_external_asset(), and view3d_collection_drop_copy_local_id().
Definition at line 518 of file view3d_dropboxes.cc.
References wmDragAsset::import_settings, AssetImportSettings::use_instance_collections, view3d_drop_snap_init(), WM_drag_asset_will_import_linked(), and WM_drag_get_asset_data().
Referenced by view3d_dropboxes().
Definition at line 169 of file view3d_dropboxes.cc.
References C, ID_GR, and view3d_drop_id_in_main_region_poll().
Referenced by view3d_collection_drop_poll_external_asset(), and view3d_collection_drop_poll_local_id().
|
static |
Definition at line 182 of file view3d_dropboxes.cc.
References C, wmDrag::type, view3d_collection_drop_poll(), and WM_DRAG_ASSET.
Referenced by view3d_dropboxes().
|
static |
Definition at line 174 of file view3d_dropboxes.cc.
References C, wmDrag::type, view3d_collection_drop_poll(), and WM_DRAG_ID.
Referenced by view3d_dropboxes().
|
static |
Definition at line 81 of file view3d_dropboxes.cc.
References C, view3d_drop_in_main_region_poll(), and WM_drag_is_ID_type().
Referenced by view3d_collection_drop_poll(), view3d_geometry_nodes_drop_poll(), view3d_mat_drop_poll(), view3d_ob_drop_poll(), and view3d_world_drop_poll().
|
static |
Definition at line 55 of file view3d_dropboxes.cc.
References wmDragAsset::asset, C, CTX_wm_area(), ED_region_overlap_isect_any_xy(), blender::asset_system::AssetRepresentation::get_id_type(), GS, ID::name, view3d_drop_in_main_region_poll(), WM_drag_get_asset_data(), WM_drag_get_local_ID(), and wmEvent::xy.
Referenced by view3d_object_data_drop_poll().
Definition at line 49 of file view3d_dropboxes.cc.
References C, CTX_wm_area(), ED_region_overlap_isect_any_xy(), and wmEvent::xy.
Referenced by view3d_drop_id_in_main_region_poll(), and view3d_drop_id_in_main_region_poll_get_id_type().
Definition at line 106 of file view3d_dropboxes.cc.
References wmDropBox::draw_data, ED_view3d_cursor_snap_state_free(), and state.
Referenced by view3d_dropboxes().
|
static |
Definition at line 93 of file view3d_dropboxes.cc.
References wmDropBox::draw_data, ED_view3d_cursor_snap_state_create(), and state.
Referenced by view3d_collection_drop_on_enter(), and view3d_ob_drop_on_enter().
| void view3d_dropboxes | ( | ) |
Definition at line 656 of file view3d_dropboxes.cc.
References wmDropBox::draw_droptip, wmDropBox::on_enter, wmDropBox::on_exit, RGN_TYPE_WINDOW, SPACE_VIEW3D, view3d_collection_drop_copy_external_asset(), view3d_collection_drop_copy_local_id(), view3d_collection_drop_on_enter(), view3d_collection_drop_poll_external_asset(), view3d_collection_drop_poll_local_id(), view3d_drop_snap_exit(), view3d_geometry_nodes_drop_copy(), view3d_geometry_nodes_drop_poll(), view3d_geometry_nodes_drop_tooltip(), view3d_id_drop_copy(), view3d_id_drop_copy_with_type(), view3d_id_path_drop_copy(), view3d_ima_bg_drop_poll(), view3d_ima_empty_drop_poll(), view3d_mat_drop_poll(), view3d_mat_drop_tooltip(), view3d_ob_drop_copy_external_asset(), view3d_ob_drop_copy_local_id(), view3d_ob_drop_on_enter(), view3d_ob_drop_poll_external_asset(), view3d_ob_drop_poll_local_id(), view3d_object_data_drop_poll(), view3d_object_data_drop_tooltip(), view3d_world_drop_poll(), WM_drag_draw_item_name_fn(), WM_drag_free_imported_drag_ID(), WM_dropbox_add(), and WM_dropboxmap_find().
Referenced by ED_spacetype_view3d().
Definition at line 631 of file view3d_dropboxes.cc.
References C, wmDropBox::ptr, RNA_boolean_set(), wmDrag::type, view3d_id_drop_copy(), and WM_DRAG_ASSET.
Referenced by view3d_dropboxes().
Definition at line 291 of file view3d_dropboxes.cc.
References wmDragActiveDropState::active_dropbox, wmDragAsset::asset, BKE_asset_metadata_idprop_find(), BKE_libblock_find_session_uid(), C, CTX_data_main(), wmDrag::drop_state, blender::asset_system::AssetRepresentation::get_metadata(), ID_NT, IDP_int_get, NTREE_GEOMETRY, RNA_int_get(), bNodeTree::type, wmDrag::type, view3d_drop_id_in_main_region_poll(), WM_DRAG_ASSET, WM_drag_get_asset_data(), WM_drag_get_local_ID(), and WM_DRAG_ID.
Referenced by view3d_dropboxes().
|
static |
Definition at line 328 of file view3d_dropboxes.cc.
References C, CTX_wm_region(), blender::ed::object::drop_geometry_nodes_tooltip(), wmDropBox::ptr, ARegion::winrct, rcti::xmin, xy, and rcti::ymin.
Referenced by view3d_dropboxes().
Definition at line 624 of file view3d_dropboxes.cc.
References C, wmDropBox::ptr, WM_drag_get_local_ID_or_import_from_asset(), and WM_operator_properties_id_lookup_set_from_id().
Referenced by view3d_dropboxes(), and view3d_geometry_nodes_drop_copy().
Definition at line 637 of file view3d_dropboxes.cc.
References C, GS, ID::name, wmDropBox::ptr, RNA_enum_set(), WM_drag_get_local_ID_or_import_from_asset(), and WM_operator_properties_id_lookup_set_from_id().
Referenced by view3d_dropboxes().
Definition at line 645 of file view3d_dropboxes.cc.
References C, wmDropBox::ptr, RNA_struct_property_unset(), WM_drag_get_local_ID_or_import_from_asset(), and WM_operator_properties_id_lookup_set_from_id().
Referenced by view3d_dropboxes().
Definition at line 259 of file view3d_dropboxes.cc.
References C, ED_view3d_is_object_under_cursor(), wmEvent::mval, view3d_ima_bg_is_camera_view(), and view3d_ima_drop_poll().
Referenced by view3d_dropboxes().
|
static |
Definition at line 247 of file view3d_dropboxes.cc.
References C, View3D::camera, CTX_wm_region_view3d(), CTX_wm_view3d(), OB_CAMERA, RegionView3D::persp, RV3D_CAMOB, and Object::type.
Referenced by view3d_ima_bg_drop_poll().
Definition at line 239 of file view3d_dropboxes.cc.
References C, CTX_wm_area(), ED_region_overlap_isect_any_xy(), ID_IM, WM_drag_is_ID_type(), and wmEvent::xy.
Referenced by view3d_ima_bg_drop_poll(), and view3d_ima_empty_drop_poll().
Definition at line 272 of file view3d_dropboxes.cc.
References C, ED_view3d_give_object_under_cursor(), Object::empty_drawtype, wmEvent::mval, OB_EMPTY, OB_EMPTY_IMAGE, Object::type, and view3d_ima_drop_poll().
Referenced by view3d_dropboxes().
Definition at line 192 of file view3d_dropboxes.cc.
References C, ED_view3d_give_object_under_cursor(), Object::id, ID_IS_EDITABLE, ID_IS_OVERRIDE_LIBRARY, ID_MA, wmEvent::mval, and view3d_drop_id_in_main_region_poll().
Referenced by view3d_dropboxes().
|
static |
Definition at line 203 of file view3d_dropboxes.cc.
References C, CTX_wm_region(), blender::ed::object::drop_named_material_tooltip(), name, ARegion::winrct, WM_drag_get_item_name(), rcti::xmin, xy, and rcti::ymin.
Referenced by view3d_dropboxes().
Definition at line 459 of file view3d_dropboxes.cc.
References BKE_view_layer_base_deselect_all(), BKE_view_layer_base_find(), BKE_view_layer_base_select_and_set_active(), BKE_view_layer_synced_ensure(), BLI_assert, C, CTX_data_ensure_evaluated_depsgraph(), CTX_data_main(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_view3d(), DEG_id_tag_update(), DEG_relations_tag_update(), wmDropBox::draw_data, ED_outliner_select_sync_from_object_tag(), FILE_AUTOSELECT, Scene::id, ID_RECALC_SELECT, make_selected_objects_local(), NC_SCENE, ND_LAYER_CONTENT, ND_OB_ACTIVE, ID::newid, wmDropBox::ptr, RNA_float_set_array(), RNA_int_set(), ID::session_uid, wmDrag::type, view3d_ob_drop_matrix_from_snap(), WM_DRAG_ASSET, WM_drag_asset_id_import(), WM_drag_asset_will_import_packed(), WM_drag_get_asset_data(), WM_event_add_notifier(), and WM_main_add_notifier().
Referenced by view3d_dropboxes().
Definition at line 361 of file view3d_dropboxes.cc.
References BLI_assert, ED_view3d_cursor_snap_state_active_get(), ID_OB, wmDropBox::ptr, RNA_float_set_array(), RNA_int_set(), ID::session_uid, wmDrag::type, view3d_ob_drop_matrix_from_snap(), WM_DRAG_ASSET, and WM_drag_get_local_ID().
Referenced by view3d_dropboxes().
|
static |
Definition at line 338 of file view3d_dropboxes.cc.
References BKE_object_boundbox_get(), BLI_assert, copy_m4_m3(), copy_v3_v3(), V3DSnapCursorState::draw_box, V3DSnapCursorState::draw_plane, ED_view3d_cursor_snap_data_get(), V3DSnapCursorData::loc, mat4_to_size(), blender::math::midpoint(), mul_mat3_m4_v3(), V3DSnapCursorData::plane_omat, rescale_m4(), sub_v3_v3(), and UNUSED_VARS_NDEBUG.
Referenced by view3d_ob_drop_copy_external_asset(), and view3d_ob_drop_copy_local_id().
Definition at line 115 of file view3d_dropboxes.cc.
References BKE_asset_metadata_idprop_find(), BKE_object_dimensions_eval_cached_get(), copy_v3_v3(), ID_OB, IDP_array_float_get, is_zero_v3(), mul_v3_v3fl(), state, TH_GIZMO_PRIMARY, wmDrag::type, UI_GetThemeColor4ubv(), view3d_drop_snap_init(), WM_drag_asset_will_import_linked(), WM_drag_get_asset_meta_data(), WM_drag_get_local_ID(), and WM_DRAG_ID.
Referenced by view3d_dropboxes().
Definition at line 145 of file view3d_dropboxes.cc.
References C, ID_OB, and view3d_drop_id_in_main_region_poll().
Referenced by view3d_ob_drop_poll_external_asset(), and view3d_ob_drop_poll_local_id().
|
static |
Definition at line 149 of file view3d_dropboxes.cc.
References C, wmDrag::type, view3d_ob_drop_poll(), and WM_DRAG_ASSET.
Referenced by view3d_dropboxes().
Definition at line 161 of file view3d_dropboxes.cc.
References C, wmDrag::type, view3d_ob_drop_poll(), and WM_DRAG_ID.
Referenced by view3d_dropboxes().
Definition at line 222 of file view3d_dropboxes.cc.
References C, OB_DATA_SUPPORT_ID, and view3d_drop_id_in_main_region_poll_get_id_type().
Referenced by view3d_dropboxes().
|
static |
Definition at line 231 of file view3d_dropboxes.cc.
References TIP_.
Referenced by view3d_dropboxes().
Definition at line 217 of file view3d_dropboxes.cc.
References C, ID_WO, and view3d_drop_id_in_main_region_poll().
Referenced by view3d_dropboxes().