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

Hotfix for removing scene node #410

Closed
wants to merge 12 commits into from

Conversation

onurtore
Copy link
Contributor

@onurtore onurtore commented Aug 3, 2022

🦟 Bug fix

Summary

Directly removing scene node from the skeleton creates problem for meshes without childs. This bugfix creates a dummy skeleton for this type of meshes.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

Onur Berk Tore added 6 commits August 3, 2022 10:15
Hotfix for removing scene node by creating
dummy skeleton for meshes without bones.

Signed-off-by: Onur Berk Tore <[email protected]>
Signed-off-by: Onur Berk Tore <[email protected]>
Signed-off-by: Onur Berk Tore <[email protected]>
Signed-off-by: Onur Berk Tore <[email protected]>
Signed-off-by: Onur Berk Tore <[email protected]>
Signed-off-by: Onur Berk Tore <[email protected]>
@onurtore onurtore requested a review from mjcarroll as a code owner August 3, 2022 08:20
@github-actions github-actions bot added the 🌱 garden Ignition Garden label Aug 3, 2022
@onurtore onurtore marked this pull request as draft August 3, 2022 09:15
@onurtore
Copy link
Contributor Author

onurtore commented Aug 3, 2022

Hi @luca-della-vedova,

This PR results with failing MergeBoxWithDoubleSkeleton test.

I am looking for a mesh where there are two children right after Scene Node to represent this test in real life, however I can not find such mesh. Even PatientWalkingCane.dae, which you mentioned have two skeletons, only have one child. So maybe we should delete MergeBoxWithDoubleSkeleton test?

Secondly, this is currently a hotfix, I can spend time to create a better patch, or we can update our code to work with the new skeleton. What do you think is the best way?

@chapulina chapulina added the bug Something isn't working label Aug 3, 2022
@chapulina chapulina changed the base branch from main to gz-common5 August 5, 2022 19:07
@onurtore onurtore mentioned this pull request Aug 7, 2022
9 tasks
@onurtore onurtore marked this pull request as ready for review August 19, 2022 07:27
@luca-della-vedova
Copy link
Member

Do you have any details of which type of meshes exhibit wrong behavior when the scene node is not removed and works when this patch is added?

@luca-della-vedova
Copy link
Member

I did a bit more investigation and I guess this goes back to the issues with actor.sdf segfaulting?

I wonder if instead of removing the root and hardcoding a "root is equal to the first child" logic we could just fix the scene node by assigning it a dummy animation that is just an identity (zero translation, unit quaternion) for the whole time, so children are preserved and their animations unchanged.

I'm not familiar enough with actor animations and exporting software to know whether the hardcoding 0 would have any side effects or not but it feels a bit dangerous if a root scene node was to have more than one child for any reason.

@onurtore
Copy link
Contributor Author

onurtore commented Aug 22, 2022

I did a bit more investigation and I guess this goes back to the issues with actor.sdf segfaulting?

I wonder if instead of removing the root and hardcoding a "root is equal to the first child" logic we could just fix the scene node by assigning it a dummy animation that is just an identity (zero translation, unit quaternion) for the whole time, so children are preserved and their animations unchanged.

I'm not familiar enough with actor animations and exporting software to know whether the hardcoding 0 would have any side effects or not but it feels a bit dangerous if a root scene node was to have more than one child for any reason.

Yes it's related to actor.sdf segfault.

This idea might work if this is also merged. Otherwise interpolateX flag for the animation will be always negative with dummy animation. This is the only code that I found checks root node properties for setting the animation properties, however if there is more, then this approach create problem. But I think it is bad to set the whole animation properties by just looking root node? And if such thing exist we should remove them?

@onurtore
Copy link
Contributor Author

onurtore commented Sep 29, 2022

Hi @luca-della-vedova,
Friendly ping.

Do you have any details of which type of meshes exhibit wrong behavior when the scene node is not removed and works when this patch is added?

Actor.sdf

We could just fix the scene node by assigning it a dummy animation that is just an identity (zero translation, unit quaternion) for the whole time, so children are preserved and their animations unchanged.

Here, however I dont think thats a good idea.

What is the best way to proceed with this, we still cant load actors with assimp.

@azeey azeey added beta Targeting beta release of upcoming collection and removed beta Targeting beta release of upcoming collection labels Jul 31, 2023
@onurtore onurtore requested a review from marcoag as a code owner January 5, 2024 17:24
@azeey azeey added the beta Targeting beta release of upcoming collection label Jul 29, 2024
@azeey
Copy link
Contributor

azeey commented Jul 29, 2024

@luca-della-vedova can we close this PR? There hasn't been any progress in a long time.

@azeey azeey removed the beta Targeting beta release of upcoming collection label Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 🌱 garden Ignition Garden
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants