-
Notifications
You must be signed in to change notification settings - Fork 36
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
Problems with module name reuse #1220
Comments
Some context from perspective of the MegaMolGraph: The graph creates modules with the requested ID, including group namespaces, pretty much verbatim (https://github.com/UniStuttgart-VISUS/megamol/blob/master/core/src/MegaMolGraph.cpp#L597). Currently, not even a check for duplicate names is performed. There is no inherent problem for the graph if multiple modules with the same name exist, except that lookup and graph manipulation of these modules will result in undefined behaviour (i.e., 'the user providing the broken graph is to blame'). Multiple modules with the same name will result in distinct entries in the internal std::vector holding modules. However, since lookup of modules is implemented as sequential search in a std::vector (https://github.com/UniStuttgart-VISUS/megamol/blob/master/core/src/MegaMolGraph.cpp#L526-L530), only the first module with a given name will be found.
The question is: how are you deleting the module in question? Via the GUI? Using Lua? The module deletion code in the graph can only delete one module per deletion request.
There are different ideas what the project loader should do (load the whole project despite errors -vs.- refuse to instantiate faulty project files). |
That sounds good from a user perspective that only the combination namespace and module name must be unique and not module name only.
Configurator in the GUI
I am simply meaning something like, when executing mmCreateModule, just not create the module like if any other module creation error would happen, print an error that the module cannot be created, because the name is already in use, and then just continue. This would be way better, than creating the graph anyway, but then strange things happens on graph manipulation later on. |
There is some related bug when deleting a module in the Configurator that will be fixed with PR #1221. But this is not the root of this problem. FYI: When deleting a module, MegaMol breaks when trying to delete the call: megamol/core/src/MegaMolGraph.cpp Line 830 in 7d26f59
|
Describe the bug
Multiple problems with the attached project:
VolumetricDataSource_1
, one in the group and one outside the groupObviously, there is a problem if a name is reused inside and outside of a group at the same time. If names must be unique over several groups, this is at least something already the loader should check and throw an exception on loading the project.
Loaded with MegaMol:
Loaded with Configurator
Additional Context
The text was updated successfully, but these errors were encountered: