Merge pull request #57606 from SaracenOne/update_on_reimport

Update instances of scenes which have been reimported.
This commit is contained in:
Rémi Verschelde 2023-01-23 15:35:44 +01:00
commit 11e2278844
No known key found for this signature in database
GPG key ID: C3336907360768E1
8 changed files with 538 additions and 2 deletions

View file

@ -87,6 +87,7 @@ class ImportDock;
class LinkButton;
class MenuBar;
class MenuButton;
class Node2D;
class NodeDock;
class OptionButton;
class OrphanResourcesDialog;
@ -818,6 +819,37 @@ public:
Error load_scene(const String &p_scene, bool p_ignore_broken_deps = false, bool p_set_inherited = false, bool p_clear_errors = true, bool p_force_open_imported = false, bool p_silent_change_tab = false);
Error load_resource(const String &p_resource, bool p_ignore_broken_deps = false);
HashMap<StringName, Variant> get_modified_properties_for_node(Node *p_node);
struct AdditiveNodeEntry {
Node *node = nullptr;
NodePath parent = NodePath();
Node *owner = nullptr;
int index = 0;
// Used if the original parent node is lost
Transform2D transform_2d;
Transform3D transform_3d;
};
struct ConnectionWithNodePath {
Connection connection;
NodePath node_path;
};
struct ModificationNodeEntry {
HashMap<StringName, Variant> property_table;
List<ConnectionWithNodePath> connections_to;
List<Connection> connections_from;
List<Node::GroupInfo> groups;
};
void update_diff_data_for_node(
Node *p_edited_scene,
Node *p_root,
Node *p_node,
HashMap<NodePath, ModificationNodeEntry> &p_modification_table,
List<AdditiveNodeEntry> &p_addition_list);
bool is_scene_open(const String &p_path);
void set_current_scene(int p_idx);
@ -870,6 +902,9 @@ public:
void reload_scene(const String &p_path);
void find_all_instances_inheriting_path_in_node(Node *p_root, Node *p_node, const String &p_instance_path, List<Node *> &p_instance_list);
void reload_instances_with_path_in_edited_scenes(const String &p_path);
bool is_exiting() const { return exiting; }
Button *get_pause_button() { return pause_button; }