summaryrefslogtreecommitdiffstats
path: root/scene/resources/packed_scene.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* | Use range iterators in LocalVector loopskobewi2023-01-211-2/+1
|/
* One Copyright Update to rule them allRémi Verschelde2023-01-051-29/+29
| | | | | | | | | | | | | | | | | | | | As many open source projects have started doing it, we're removing the current year from the copyright notice, so that we don't need to bump it every year. It seems like only the first year of publication is technically relevant for copyright notices, and even that seems to be something that many companies stopped listing altogether (in a version controlled codebase, the commits are a much better source of date of publication than a hardcoded copyright statement). We also now list Godot Engine contributors first as we're collectively the current maintainers of the project, and we clarify that the "exclusive" copyright of the co-founders covers the timespan before opensourcing (their further contributions are included as part of Godot Engine contributors). Also fixed "cf." Frenchism - it's meant as "refer to / see".
* Fix unable to disconnect signal in Editor once createdMicky2022-12-081-1/+1
| | | | Adds a CONNECT_INHERITED flag to connections, only available in editor builds. This flag denotes that the signal has been inherited from a previous Scene in the instancing hierarchy.
* Add PackedScene::reload_from_file() overrideAdam Scott2022-11-281-0/+53
|
* Remove more instances of 'instance' being used as a verbVolTer2022-11-161-9/+9
|
* Merge pull request #66665 from Mickeon/editor-do-not-edit-inherited-signalsRémi Verschelde2022-10-141-1/+5
|\ | | | | | | Do not allow editing Scene-inherited signal connections
| * Do not allow editing Scene-inherited signal connectionsMicky2022-10-131-1/+5
| | | | | | | | Inherited connections are also highlighted with the warning color in the Node dock.
* | Fix MSVC warnings, rename shadowed variables, fix uninitialized values, ↵bruvzg2022-10-071-5/+5
|/ | | | change warnings=all to use /W4.
* Merge pull request #64410 from MewPurPur/rename-notification-instancedRémi Verschelde2022-08-301-1/+1
|\
| * Rename NOTIFICATION_INSTANCED to NOTIFICATION_SCENE_INSTANTIATEDVolTer2022-08-161-1/+1
| |
* | Merge pull request #64999 from Chaosus/fix_packed_scene_crashRémi Verschelde2022-08-281-3/+5
|\ \
| * | Prevent crash at loading some scenesYuri Rubinsky2022-08-281-3/+5
| | |
* | | Make local-to-scene resources behavior consistent in child scenesPedro J. Estébanez2022-08-281-1/+1
|/ /
* | Improve PackedScene instantiateRindbee2022-08-281-17/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | Make `resource_local_to_scene` behave as described in the documentation. (If I understand correctly, the following **instance** refers to **the instance of the sub-scene**.) https://github.com/godotengine/godot/blob/2e24b76535dceb9cf18ab8ece3304ed92948c1b5/doc/classes/Resource.xml#L70-L72 If the resources of the sub-scene are modified in the main scene, the modified resources will be recorded in the `tscn` file of the main scene. And the root node of the sub-scene will be set twice. 1. In the main scene, when encountering a sub-scene, the sub-scene will be initialized first; 2. Then use the resources in the main scene to reset the root node of the sub-scene. This may make `resource_local_to_scene` not work as expected. The resources cannot be shared between the sub-scene root node and other ordinary nodes in the sub-scene. Yes, if the resources have `resource_local_to_scene` enabled, this patch treats the modified resources of the sub-scene root node as resources in the sub-scene, not in the main scene. Although the modifications are recorded in the `tscn` file of the main scene.
* | Add tests for empty/unnamed arguments to ClassDB, Variant, GDScriptYuri Sizov2022-08-081-1/+1
|/
* Remove Signal connect bindsJuan Linietsky2022-07-291-5/+3
| | | | | Remove the optional argument p_binds from `Object::connect` since it was deprecated by Callable.bind(). Changed all uses of it to Callable.bind()
* Add ability to export Node pointers as NodePathsreduz2022-06-251-6/+66
| | | | | | | | | | | | | This PR implements: * A new hint: PROPERTY_HINT_NODE_TYPE for variant type OBJECT, which can take specific node types as hint string. * The editor will show it as a node path, but will set it as a pointer to a node from the current scene if you select a path. * When scene is saved, the node path is saved, then restored as a pointer. NOTE: This is a proof of concept and this approach will most likely not work. The reason if that, if the node referenced is deleted, then when trying to edit this the node will become invalid. Potential workarounds: Since this uses the Variant API, it should obtain the pointer from the Variant object ID. Yet, this would either only really work in GDScript or it would need to be implemented with workarounds in every language. Alternative ways to make this work: Nodes could export an additional property with a node path (like for which_node, it could be which_node_path). Another alternative: Path editing could happen as a hidden metadata (ignoring the pointer).
* Fix typos with codespellRémi Verschelde2022-05-231-2/+2
| | | | Using codespell 2.2-dev from current git.
* Add a new HashSet templatereduz2022-05-201-1/+1
| | | | | * Intended to replace RBSet in most cases. * Optimized for iteration speed
* Replace most uses of Map by HashMapreduz2022-05-161-10/+10
| | | | | | | | | | | | * Map is unnecessary and inefficient in almost every case. * Replaced by the new HashMap. * Renamed Map to RBMap and Set to RBSet for cases that still make sense (order matters) but use is discouraged. There were very few cases where replacing by HashMap was undesired because keeping the key order was intended. I tried to keep those (as RBMap) as much as possible, but might have missed some. Review appreciated!
* Add a new HashMap implementationreduz2022-05-121-4/+4
| | | | | | | | | | | | | | | | | Adds a new, cleaned up, HashMap implementation. * Uses Robin Hood Hashing (https://en.wikipedia.org/wiki/Hash_table#Robin_Hood_hashing). * Keeps elements in a double linked list for simpler, ordered, iteration. * Allows keeping iterators for later use in removal (Unlike Map<>, it does not do much for performance vs keeping the key, but helps replace old code). * Uses a more modern C++ iterator API, deprecates the old one. * Supports custom allocator (in case there is a wish to use a paged one). This class aims to unify all the associative template usage and replace it by this one: * Map<> (whereas key order does not matter, which is 99% of cases) * HashMap<> * OrderedHashMap<> * OAHashMap<>
* Rescue orphan nodes in inherited sceneskobewi2022-05-091-0/+7
|
* Cleanup metadata usagekobewi2022-05-061-19/+6
|
* Implement missing Node & Resource placeholdersreduz2022-05-031-15/+68
| | | | | | | | | Implemented by request of @neikeq to advance in the GDExtension version of Mono. * If a Resource type is missing upon load, it will be remembered together with its data (Unless manually overriden). * If a Node type is missing upon load, it will be also be remembered together with its data (unless deleted). This feature makes working with GDExtension much easier, as it ensures that missing types no longer cause data loss.
* Implement Scene Unique Nodesreduz2022-04-251-0/+3
| | | | | | | | Implements https://github.com/godotengine/godot-proposals/issues/4096 * Nodes can be marked unique to the scene in the editor (or via code). * Unique nodes can be accessed via the **%** prefix at any point in the path. From that point in the path (depending on whether the scene of the path is), the unique node will be fetched. * Implementation is very optimal, as these nodes are cached.
* Fix Callable::bind usage in connections_dialog.h and packed_scene.cppC.Even2022-03-291-2/+5
| | | | | * Callable::bind takes an array of pointers to Variant * Fixes #57057
* Remove last editor code dependencies in template buildRémi Verschelde2022-03-281-1/+0
| | | | | | SConstruct change also makes it possible to outright delete the `editor` folder in a `tools=no` build, which we use in CI to ensure no invalid cross-dependencies are added.
* Various code and documentation improvementskobewi2022-03-051-1/+1
|
* Style: Cleanup single-line blocks, semicolons, dead codeRémi Verschelde2022-02-161-4/+0
| | | | | Remove currently unused implementation of TextureBasisU, could be re-added later on if needed and ported.
* Removed redundant ClassDB::is_class_enabled() and moved second dynamic_cast ↵Bartłomiej T. Listwon2022-01-081-8/+6
| | | | inside worst case if
* Merge pull request #53313 from KoBeWi/debinded_konnektRémi Verschelde2022-01-041-12/+51
|\
| * Add support for unbinding in connection dialogkobewi2021-10-041-12/+51
| |
* | Update copyright statements to 2022Rémi Verschelde2022-01-031-2/+2
| | | | | | | | Happy new year to the wonderful Godot community!
* | Stop asuming a default value of NIL means there's no defaultPedro J. Estébanez2021-12-111-2/+3
| |
* | Replace String comparisons with "", String() to is_empty()Nathan Franke2021-12-091-4/+4
| | | | | | | | | | | | Also: - Adds two stress tests to test_string.h - Changes to .empty() on std::strings
* | Rename `remove()` to `remove_at()` when removing by indexLightning_A2021-11-231-1/+1
| |
* | Fix crash when loading scene instance after node vanished from parentPedro J. Estébanez2021-11-171-6/+6
| |
* | Add property value pinningPedro J. Estébanez2021-11-081-8/+57
| |
* | Unify determination of default property valuesPedro J. Estébanez2021-11-071-142/+37
| |
* | Add is_built_in() method to Resourcekobewi2021-11-041-1/+1
| |
* | Fix editable children errors when packing scene tree at runtimePouleyKetchoupp2021-10-051-1/+1
|/ | | | | | | When packing a scene node which is not the root, errors where caused by internal checks in is_editable_instance method. This check can be safely made outside instead.
* Use range iterators for `Map`Lightning_A2021-09-301-11/+11
|
* Rename Node's `filename` property to `scene_file_path` for clarityHugo Locurcio2021-09-301-8/+8
|
* Fail at instantiating if the root node is instantiatedgyroninja2021-09-181-1/+2
|
* Fix loading packed scene with editable children at runtimePouleyKetchoupp2021-08-271-1/+8
| | | | | | | | | | | | | | | At runtime, packed scenes with nodes marked as editable instance where saved with node type tags, which prevented the scene to be then loaded as an instance, causing duplicated nodes in the tree. This change ensures nodes marked as editable instances and their owned children are properly set as instances. That doesn't make a difference in the editor, since such nodes where already set as instances based on their instance state, but it helps at runtime where instance states are disabled. Co-authored-by: latorril <latorril@gmail.com>
* Disable Node3D when compiling without 3D and fix disable_3d optionAaron Franke2021-08-131-3/+5
|
* Use const references where possible for List range iteratorsRémi Verschelde2021-07-251-6/+6
|
* Use C++ iterators for Lists in many situationsAaron Franke2021-07-231-18/+16
|
* Merge pull request #49713 from nekomatata/fix-export-var-override-runtimeRémi Verschelde2021-06-291-1/+3
|\ | | | | Fix export var override in PackedScene at runtime
| * Fix export var override in PackedScene at runtimePouleyKetchoupp2021-06-181-1/+3
| | | | | | | | | | | | Regression fix: update_exports is tool only and should be used only in the editor, otherwise it can cause export variable overrides from instances to be discarded in favor of the parent's value.