-
Notifications
You must be signed in to change notification settings - Fork 41
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
Scene creation stops when encounter a warning #92
Comments
Hey @EulalieCoevoet , I'm not sure I understand your issue. Which warning, the one emitted by Do you have a minimal reproducible example? That would be very useful. |
You're right I'm mixing different things, and I've opened this issue a bit too fast. Sorry for that, let's do it again. I've noticed that the creation of the scene would stop really often (compared to SofaPython). For instance, if I change a property of a prefab:
This example generates the following warning (which is actually hard to link to the problematic line of code):
and the creation of the scene will just stop at this stage. I've had other similar issues, the creation of the scene would just stop without any python error. It's a shame I can't remember/reproduce the other problems I had. I don't think they are all related to this warning in doReInit(), but yeah I'm not sure. |
Hey @EulalieCoevoet , I just tried your example. While I do get the warning, I'm not having any crash. Are you up-to-date with the master branch of SofaPython3? We fixed many bugs related to inheriting C++ classes in Python recently. The warning seems to happen because void Prefab::init()
{
reinit(); // <--------------- (1)
Inherit1::init(sofa::core::ExecParams::defaultInstance());
m_is_initialized = true; // <--------------- (2)
}
Could you try changing the order of the calls (1) and (2) like this: void Prefab::init()
{
Inherit1::init(sofa::core::ExecParams::defaultInstance());
m_is_initialized = true; // <--------------- (2)
reinit(); // <--------------- (1)
} I never used the Prefab so I'm not sure of the impact here, although looking very quickly through this part of the code, it doesn't seems too dangerous. |
Yep, that solves it. |
I think there is two issue mixed together. The other is the error message relative to prefab. @jnbrunet gave a proper answer here. |
All right, yeah I remember vaguely about this. I created #106 in order to follow the former issue. |
When a warning is raised by Sofa, the creation of the scene stops.
After a discussion with Damien, it seems that SofaPython3 should catch python3's exceptions, the same way it was done in SofaPython plugin.
If I understood correctly it wasn't possible with python 3.8 but it should be with the new release 3.9.
The text was updated successfully, but these errors were encountered: