-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inspector doesn't appear for resources extending AnimationLibrary
#91516
Comments
This is more of a new feature as |
Only resources extending an |
My bad thought you needed to inspect them in some other resource, you are talking about opening them in the file system, not as a property in the inspector, yes? However I think |
Yes. Double-click from the file system and edit exported variables. Then, if it extends Wouldn't it be enough to just hide the proprieties the user is not supposed to edit so it shows an empty inspector? This is the case if we inspect a library from an export variable. Why disable the inspector itself? |
This comment was marked as outdated.
This comment was marked as outdated.
So are you looking at a library that was imported? That's opened in the import view by design, a non-imported one is fully editable in the inspector, the imported case is handled by settings
Edit: It seems it only some times works to open it like this, so if this is a matter of the case with an animation library stored as a Edit 2: It does indeed fail to open when double clicked, it only worked for me when creating the resource, so this is a bug, thank you for reporting, and a fix is open |
Here is a concrete example: This script will load two glTF (each with a single animation) and an actual @tool
class_name AnimationCollection extends AnimationLibrary
@export var resources:Array:
set(value):
resources = value
update_library()
func _init() -> void:
resources = [
preload("res://animations/x_sword-attack.glb"),
preload("res://animations/x_sword_attack.res"),
preload("res://animations/x_sword_idle.glb")
]
func update_library():
for resource in resources:
if resource is PackedScene:
var scene = resource.instantiate() as Node
var animation_player = scene.find_child("AnimationPlayer") as AnimationPlayer
if animation_player:
for name in animation_player.get_animation_list():
var animation = animation_player.get_animation(name)
add_animation(resource.resource_path.get_file(), animation)
elif resource is Animation:
add_animation(resource.resource_path.get_file(), resource)
If you go |
Please try the linked PR, it should fix that, I missed the specific details when first testing this and this is very much a bug, thought the exact decision on how to inspect the library is a future question, but the specific code is broken |
That's it, thank you! It fixed the issue. It's fine if all priorities are hidden to be edited with a specialized editor but it's great to leave the option to extend it with tool scripts. |
The properties on it (which are none for now but default, but available for extended versions, i.e. your case) are shown, please test if things like saving works correctly for your cases, I don't have an animation library to test on at the moment |
It is working fine. I'm testing with a good number of glTF and .res mixed I can add/remove, playback in the player, clear cache and reload the editor just fine. |
Tested versions
v4.3.dev.custom_build [89850d5]
System information
Windows 11
Issue description
The inspector doesn't show up when selecting
AnimationLibrary
resources. While it may be disabled by design so we edit it on theAnimationPlayer
's manager, it means any resource based on it can't use the inspector as well.I have animations exported as separated glTF files.
AnimationLibrary
only acceptsAnimation
resources so I have to export them all as separate files ending up with duplication (a .glTF and an .res for the same animation) plus manual library management. I'm trying to extendAnimationLibrary
so I can set an array of resources and the library will build automatically if they have animations, but the inspector doesn't appear when I select it.Steps to reproduce
Create a script that extends
AnimationLibrary
and a resource file from it.The inspector doesn't appear if you select the file.
Minimal reproduction project (MRP)
N/A
The text was updated successfully, but these errors were encountered: