mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Merge pull request #111837 from bruvzg/objid_select
Use ObjectID to store nodes in the editor selection.
This commit is contained in:
@@ -673,12 +673,12 @@ Transform3D Node3DEditorViewport::to_camera_transform(const Cursor &p_cursor) co
|
||||
}
|
||||
|
||||
int Node3DEditorViewport::get_selected_count() const {
|
||||
const HashMap<Node *, Object *> &selection = editor_selection->get_selection();
|
||||
const HashMap<ObjectID, Object *> &selection = editor_selection->get_selection();
|
||||
|
||||
int count = 0;
|
||||
|
||||
for (const KeyValue<Node *, Object *> &E : selection) {
|
||||
Node3D *sp = Object::cast_to<Node3D>(E.key);
|
||||
for (const KeyValue<ObjectID, Object *> &E : selection) {
|
||||
Node3D *sp = ObjectDB::get_instance<Node3D>(E.key);
|
||||
if (!sp) {
|
||||
continue;
|
||||
}
|
||||
@@ -3349,13 +3349,13 @@ void Node3DEditorViewport::_notification(int p_what) {
|
||||
_update_camera(delta);
|
||||
}
|
||||
|
||||
const HashMap<Node *, Object *> &selection = editor_selection->get_selection();
|
||||
const HashMap<ObjectID, Object *> &selection = editor_selection->get_selection();
|
||||
|
||||
bool changed = false;
|
||||
bool exist = false;
|
||||
|
||||
for (const KeyValue<Node *, Object *> &E : selection) {
|
||||
Node3D *sp = Object::cast_to<Node3D>(E.key);
|
||||
for (const KeyValue<ObjectID, Object *> &E : selection) {
|
||||
Node3D *sp = ObjectDB::get_instance<Node3D>(E.key);
|
||||
if (!sp) {
|
||||
continue;
|
||||
}
|
||||
@@ -8497,10 +8497,10 @@ void Node3DEditor::update_grid() {
|
||||
void Node3DEditor::_selection_changed() {
|
||||
_refresh_menu_icons();
|
||||
|
||||
const HashMap<Node *, Object *> &selection = editor_selection->get_selection();
|
||||
const HashMap<ObjectID, Object *> &selection = editor_selection->get_selection();
|
||||
|
||||
for (const KeyValue<Node *, Object *> &E : selection) {
|
||||
Node3D *sp = Object::cast_to<Node3D>(E.key);
|
||||
for (const KeyValue<ObjectID, Object *> &E : selection) {
|
||||
Node3D *sp = ObjectDB::get_instance<Node3D>(E.key);
|
||||
if (!sp) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user