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

Entity Relations #236

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

Conversation

DasLixou
Copy link

@DasLixou DasLixou commented Aug 22, 2024

Alternative to #188
Closes #187

This makes all Entity fields in blender selectable to objects, which translate to gltf nodes, so mesh selecting currently isn't possible yet.
image

On the bevy side, it uses a fake Entity overwrite with custom deserialization, which parses the name and over thread_local statics searches for the real entity id and replaces itself with that.
image
A previous attempt was to change the dyn Reflect tree, which currently isn't possible (bevyengine/bevy#14850) but could clean up a lot of stuff in the future.

One downside this approach currently has, is that I can only check whether an entity is a gltf node or mesh, which can share the same names, with GltfExtra and GltfMeshExtra, so when you want to select an object, it must at least have one component, otherwise it won't be able to find it.

On the blender side, it also fixes some code with values not having defaults, which with entities is now possible, and sets the default for boolean from True to False.

I haven't tested it yet, but this should also make joints from avian possible to declare in blender.

Testing

I did some basic things including the example, but external more extensive tests appreciated!
Having a reference in a collection which is instantiated multiple times also works correctly.

@DasLixou DasLixou mentioned this pull request Aug 22, 2024
@DasLixou
Copy link
Author

DasLixou commented Sep 9, 2024

Ok, much of the unsafe code is gone now, should be much easier to read :D
(also, for spawning many many blueprints over a span of multiple frames might have a little perf improvement because query states are now cached)

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