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

[SofaKernel] Fix XML export #4

Closed
wants to merge 1 commit into from

Conversation

guparan
Copy link
Contributor

@guparan guparan commented Jun 7, 2016

As suggested by Alex Bilger in SOFA forum: https://www.sofa-framework.org/community/forum/topic/duplicated-components-in-xml-export/

Hello guys,

I noticed a bad behavior when exporting a scene in xml. The components are duplicated within the same node. The node components are written, then the sub-nodes, and then the same node components again.
You can get the same behavior by opening any sofa scene and exporting it (File -> Save As in runSofa), then open it in a text editor.
I see that the xml export uses visitors. I found that the objects are processed twice: once in processNodeTopDown and once in processNodeBottomUp. So I removed the processing part in processNodeBottomUp, and kept only the node closure. I get the expected behavior. Could you guys confirm this is the right thing to do?
I tested on Windows with a very recent commit.

@guparan
Copy link
Contributor Author

guparan commented Jun 7, 2016

Comment from Alex Bilger on SOFA Forum:

I also would like to highlight a problem with xml export: when exporting, we loop over the objects and write all the data in this object. This is not correct as some component compute things differently if some data are provided or not. This means the initialization is not the same with the exported scene than in the initial one. I don’t have a fix for that. Maybe by writing only the provided data? But that would mean to write file names instead of the position/faces in the case of a MeshLoader for instance.

@matthieu-nesme
Copy link
Member

I think I created trouble in the commit ef8b7f0.
Thanks for letting us notice that!

Should be fixed by commit b80b877

thomas-lemaire pushed a commit that referenced this pull request Sep 1, 2016
@guparan guparan deleted the fix_xml_export branch March 24, 2017 17:03
fredroy referenced this pull request in fredroy/sofa Feb 16, 2021
[SofaHelper] Vector:(try to) port for MSVC
hugtalbot pushed a commit that referenced this pull request Feb 16, 2022
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.

2 participants