[Merged by Bors] - Reflect Default for ComputedVisibility and Handle<T>#6187
Closed
zicklag wants to merge 2 commits into
Closed
[Merged by Bors] - Reflect Default for ComputedVisibility and Handle<T>#6187zicklag wants to merge 2 commits into
ComputedVisibility and Handle<T>#6187zicklag wants to merge 2 commits into
Conversation
alice-i-cecile
left a comment
Member
There was a problem hiding this comment.
Shouldn't we have a Default trait impl for this reflection to work? Or at least for consistency.
Member
Author
|
Yes, both types already had |
alice-i-cecile
approved these changes
Oct 6, 2022
alice-i-cecile
left a comment
Member
There was a problem hiding this comment.
Thanks for the explanation; it wasn't visible in the code review pane :)
Member
|
Merging as trivial. bors r+ |
bors Bot
pushed a commit
that referenced
this pull request
Oct 6, 2022
# Objective - Reflecting `Default` is required for scripts to create `Reflect` types at runtime with no static type information. - Reflecting `Default` on `Handle<T>` and `ComputedVisibility` should allow scripts from `bevy_mod_js_scripting` to actually spawn sprites from scratch, without needing any hand-holding from the host-game. ## Solution - Derive `ReflectDefault` for `Handle<T>` and `ComputedVisiblity`. --- ## Changelog > This section is optional. If this was a trivial fix, or has no externally-visible impact, you can delete this section. - The `Default` trait is now reflected for `Handle<T>` and `ComputedVisibility`
|
Pull request successfully merged into main. Build succeeded: |
ComputedVisibility and Handle<T>ComputedVisibility and Handle<T>
bors Bot
pushed a commit
that referenced
this pull request
Oct 10, 2022
# Objective Make `GlobalTransform` constructible from scripts, in the same vein as #6187. ## Solution - Use the derive macro to reflect default --- ## Changelog > This section is optional. If this was a trivial fix, or has no externally-visible impact, you can delete this section. - `GlobalTransform` now reflects the `Default` trait.
james7132
pushed a commit
to james7132/bevy
that referenced
this pull request
Oct 19, 2022
…6187) # Objective - Reflecting `Default` is required for scripts to create `Reflect` types at runtime with no static type information. - Reflecting `Default` on `Handle<T>` and `ComputedVisibility` should allow scripts from `bevy_mod_js_scripting` to actually spawn sprites from scratch, without needing any hand-holding from the host-game. ## Solution - Derive `ReflectDefault` for `Handle<T>` and `ComputedVisiblity`. --- ## Changelog > This section is optional. If this was a trivial fix, or has no externally-visible impact, you can delete this section. - The `Default` trait is now reflected for `Handle<T>` and `ComputedVisibility`
james7132
pushed a commit
to james7132/bevy
that referenced
this pull request
Oct 19, 2022
# Objective Make `GlobalTransform` constructible from scripts, in the same vein as bevyengine#6187. ## Solution - Use the derive macro to reflect default --- ## Changelog > This section is optional. If this was a trivial fix, or has no externally-visible impact, you can delete this section. - `GlobalTransform` now reflects the `Default` trait.
james7132
pushed a commit
to james7132/bevy
that referenced
this pull request
Oct 28, 2022
…6187) # Objective - Reflecting `Default` is required for scripts to create `Reflect` types at runtime with no static type information. - Reflecting `Default` on `Handle<T>` and `ComputedVisibility` should allow scripts from `bevy_mod_js_scripting` to actually spawn sprites from scratch, without needing any hand-holding from the host-game. ## Solution - Derive `ReflectDefault` for `Handle<T>` and `ComputedVisiblity`. --- ## Changelog > This section is optional. If this was a trivial fix, or has no externally-visible impact, you can delete this section. - The `Default` trait is now reflected for `Handle<T>` and `ComputedVisibility`
james7132
pushed a commit
to james7132/bevy
that referenced
this pull request
Oct 28, 2022
# Objective Make `GlobalTransform` constructible from scripts, in the same vein as bevyengine#6187. ## Solution - Use the derive macro to reflect default --- ## Changelog > This section is optional. If this was a trivial fix, or has no externally-visible impact, you can delete this section. - `GlobalTransform` now reflects the `Default` trait.
Pietrek14
pushed a commit
to Pietrek14/bevy
that referenced
this pull request
Dec 17, 2022
# Objective Make `GlobalTransform` constructible from scripts, in the same vein as bevyengine#6187. ## Solution - Use the derive macro to reflect default --- ## Changelog > This section is optional. If this was a trivial fix, or has no externally-visible impact, you can delete this section. - `GlobalTransform` now reflects the `Default` trait.
ItsDoot
pushed a commit
to ItsDoot/bevy
that referenced
this pull request
Feb 1, 2023
…6187) # Objective - Reflecting `Default` is required for scripts to create `Reflect` types at runtime with no static type information. - Reflecting `Default` on `Handle<T>` and `ComputedVisibility` should allow scripts from `bevy_mod_js_scripting` to actually spawn sprites from scratch, without needing any hand-holding from the host-game. ## Solution - Derive `ReflectDefault` for `Handle<T>` and `ComputedVisiblity`. --- ## Changelog > This section is optional. If this was a trivial fix, or has no externally-visible impact, you can delete this section. - The `Default` trait is now reflected for `Handle<T>` and `ComputedVisibility`
ItsDoot
pushed a commit
to ItsDoot/bevy
that referenced
this pull request
Feb 1, 2023
# Objective Make `GlobalTransform` constructible from scripts, in the same vein as bevyengine#6187. ## Solution - Use the derive macro to reflect default --- ## Changelog > This section is optional. If this was a trivial fix, or has no externally-visible impact, you can delete this section. - `GlobalTransform` now reflects the `Default` trait.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
Defaultis required for scripts to createReflecttypes at runtime with no static type information.DefaultonHandle<T>andComputedVisibilityshould allow scripts frombevy_mod_js_scriptingto actually spawn sprites from scratch, without needing any hand-holding from the host-game.Solution
ReflectDefaultforHandle<T>andComputedVisiblity.Changelog
Defaulttrait is now reflected forHandle<T>andComputedVisibility