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

[POC] The Really Magic Require Plugin #275

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

damienmarchal
Copy link
Contributor

@damienmarchal damienmarchal commented Jun 16, 2022

The plugin scans the plugin reporitories to locate what are the Sofa plugins that match a given pattern.
Once found it createe a hierarchy in the scene graph by splitting the "." in the names.

So now you can do stuff like

def createScene(root):
     # Load everything about SolidMechanics
     root.addChild(RequiredPlugin("Sofa.Component.SolidMechanics"))
  
     # Load everything about Sofa.Component
     root.addChild(RequiredPlugin("Sofa.Component"))      

screen

This is a WIP as some feature are badly implemented in python without changing anything in the sofa core.

@damienmarchal damienmarchal changed the title [POC] The Really Magic Requiere Plugin [POC] The Really Magic Require Plugin Jun 16, 2022
@alxbilger
Copy link
Contributor

Interesting idea 👏

@guparan
Copy link
Contributor

guparan commented Jun 22, 2022

Is it not already possible to do this?

# Load everything about Sofa.Component
root.addChild(RequiredPlugin("Sofa.Component")) 

If no, I don't understand why. The plugin Sofa.Component does exist.

@damienmarchal
Copy link
Contributor Author

damienmarchal commented Jun 22, 2022

@guparan

No, what we currently have is:

root.addChild("RequiredPlugin". "Sofa.Component") 

Which is loading a single "special" plugin targets that loads other. To make that happens, we have hardcoded, for every intermediate level of the hierarchy, to build such a target. This is far from satisfying as it is very invasive and it is only working if the /plugin/module's supplier has modified it CMakeList.txt to build every target. The existing mecanism also does not provide any feedback on what is actually "imported" from Sofa.Component and will not work for anything other than the hardcoded targets.

This POC shows that a similar feature can be implemented in a non-invasive way, without the need for harcoded extra target (saving writing and compiling them in CMakeLists.txt for all the intermediate targets).
It also provide an interesting graphical feedback so the users knows what is actually loaded which has a lot of side effects (among which better learning curve for user to discover the sub-packages).

Another POC could be to implement the same thing in c++ so it would also work the same for XML.

@damienmarchal damienmarchal added pr: highlighted in next release Highlight this contribution in the notes of the upcoming release pr: dev meeting topic Worth discussion at dev meeting and removed pr: status wip pr: highlighted in next release Highlight this contribution in the notes of the upcoming release labels Jul 19, 2022
@damienmarchal
Copy link
Contributor Author

I wonder if this POC is worth upgrading.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: dev meeting topic Worth discussion at dev meeting pr: new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants