-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Create AudioStreamPlayer when dropping AudioStream #92004
Conversation
Hey, thanks for implementing this I have two questions:
I can also think of some potential cases where you won't have the viewport available at all, only docks
|
Oh, using the parent node as a basis is a good idea. But for many 2D games, it's more likely to use plain AudioStreamPlayer instead of AudioStreamPlayer2D. There should be a way to toggle the behavior. godotengine/godot-proposals#9699 is about dropping onto a node. That action is taken by property setter.
It already is.
AFAIK, the debugger does not support assigning resource properties at runtime. i.e., you can create the audio stream player node, but its stream property won't be synced. That's a current limitation. |
A modifier key perhaps?
I believe it does support that, but I'll open a proposal in the future if that's not the case. I've been doing some R&D related to hot-reloading at runtime (with a GDScript plugin) and it doesn't seem hard to achieve those things anyway
My bad, I see now that I made a mistake while testing |
Peek.2024-05-16.16-35.mp4 |
But I can though, wdym? Screen.Recording.mp4 |
Looks like I accidentally broken the "drop to set property" feature 😂 |
Can you leave it "broken" when another modifier key is held? It's kinda super convenient :D Or perhaps do what we discussed in the proposal and check if the node has a "stream" property to assign to? |
Valid properties are only checked at the time of drop, to avoid performance problems when hovering. |
Doesn't it work for this PR? There's no preview in the scene dock or anything like that |
I cleaned up the drop code a bit. Now scene tree dock always tries to do a property drop first. If no property can be set, then the file is dropped as a new node. This has a side-effect: Say a node has a I think this change is okay because:
If this concerns, maybe we can add an editor setting like |
I found a bug. When dropping a scene right under a node that has a Screen.Recording.mp4 |
Fixed. Turns out to be my mistake, sorry :P |
} | ||
if (!valid_properties.is_empty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove else if
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two branches both returns now. So the else
is redundant.
Currently, the header is shown if the file list contains texture. I added the same for audio streams in the recent update. e.g.:
Note that scene-dropping does not have this header either. I'm out of ideas about how to describe the combinations 😛 Probably worth another PR. |
Hello, I open a proposal on making the dropping tooltips consistent between object types and 2D/3D Viewport a few days ago: godotengine/godot-proposals#9752 I am going to start working on it this weekend and open a PR. So maybe we could add the Audio dropping tooltip to that PR rather than to this one? to avoid merge conflict? |
- Create AudioStreamPlayer if dropped in between nodes in the Scene dock - Create AudioStreamPlayer2D if dropped into 2D editor - Create AudioStreamPlayer3D if dropped into 3D editor
Thanks! |
@timothyqiu hello, after this commit I'm getting |
Closes godotengine/godot-proposals#9699
Peek.2024-05-16.13-21.mp4