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

[Bug]: Modified component serialization issues #10024

Open
1 of 5 tasks
SamMazerIR opened this issue Apr 3, 2024 · 4 comments
Open
1 of 5 tasks

[Bug]: Modified component serialization issues #10024

SamMazerIR opened this issue Apr 3, 2024 · 4 comments
Labels
bug Something isn't working triage Remove once bug is reviewed

Comments

@SamMazerIR
Copy link
Contributor

Version

8d9e94c

Operating Systems

  • macOS
  • Windows
  • Linux
  • Android
  • IOS

Browser (if applicable)

Chrome

What is supposed happened?

When adding serialized information to your component through your custom NodeEditor inputs (e.g. ColorInput field, TextInput field, etc.) if you have already added your component to an entity new fields should serialize properly as you add them

What happened?

When adding serialized information to your component through your custom NodeEditor inputs (e.g. ColorInput field, TextInput field, etc.) if you have already added your component to an entity it will not update/serialize properly.

You'll know you're in this state because the json for the component's props will be null.
This will lead to issues in setting the values, potentially initializing the value on load (if you're attempting to load from json) and may throw errors when assigning information (e.g. from a color picker selection)

Steps to reproduce

create a new component type and associated node editor. add your component to an entity in your scene and save.

once this is done, add data to your component and expose them with inputs from your node editor. make sure you add associated `onSet` and `toJson` to your component

Relevant Info

No response

@SamMazerIR SamMazerIR added bug Something isn't working triage Remove once bug is reviewed labels Apr 3, 2024
@HexaField
Copy link
Member

which component did this happen for?

@SamMazerIR
Copy link
Contributor Author

which component did this happen for?

this was a custom component I was developing. I think it's a fairly reasonable workflow that leads you to this issue (create a component, add to scene, keep adding to component/node editor).

It's easy enough to work around (delete your entity and remake it with your component) but if you're unaware of what is happening the errors you get don't help much to identify the root cause

@HexaField
Copy link
Member

interesting, theres a few variables that could be at play here. i'd have to look through the code you wrote to see exactly what could be happening

@SamMazerIR
Copy link
Contributor Author

interesting, theres a few variables that could be at play here. i'd have to look through the code you wrote to see exactly what could be happening

you can repro this with any new component that has an editor accessible value if you follow my repro steps in the ticket. It isn't so much about the specific code but the order in which you do the actions. Daniel is also already looking into this I think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Remove once bug is reviewed
Projects
None yet
Development

No branches or pull requests

2 participants