Skip to content
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

Add support for references between entities. #188

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

andriyDev
Copy link

Fixes #187.

The issue has more context on the idea behind this PR.

@andriyDev
Copy link
Author

I am leaving a TODO for the docs, examples and tests. I will get around to that soon.

For a short walkthrough of what this looks like in practice, users just have to:

  1. Add the GltfRefMapPlugin.
  2. Implement FromGltfRef for each type.
  3. Add the GltfRefPlugin<T> for each type.

bevy_registry_export can export the registry to Blender which will include:

  • GltfRefTarget - Holds a string that can be used to identify this entity.
  • GltfRef<T> for each T - Holds a string that can be used to pick which entity should be associated with T on this entity.

@andriyDev
Copy link
Author

I realized I should be using the SceneInstance component to determine where Gltf roots are, hence the force push.

The fewer traits the better. This does add a little bit of a weirdness where it's unclear that some components should implement this, however in those cases, users can always fallback to manually dealing with GltfRefMap.
This was referenced Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for references between entities
1 participant