Skip to content

Component is the new controller#606

Open
bakpaul wants to merge 10 commits intosofa-framework:masterfrom
bakpaul:26_04_introduce_component_binding
Open

Component is the new controller#606
bakpaul wants to merge 10 commits intosofa-framework:masterfrom
bakpaul:26_04_introduce_component_binding

Conversation

@bakpaul
Copy link
Copy Markdown
Contributor

@bakpaul bakpaul commented Apr 9, 2026

While working on prefabs we have a new type of python object that is to be stored in the graph, so it needs to inherit from BaseComponent somehow. The dirty way to do this was to inherit from Controller which doesn't make sens as it is not meant to be actively doing something.

At first I only wanted to make a python class named Component until I realized that it was meaningless without an ability to override handleEvent. Looking at that I realized that BaseContoller is nothing more than a BaseObject. So merging both makes sense.

This PR keeps the old Controller implementation, just replaced the name to Component and added both to the python bindings. Therefore, such as in the actual core of SOFA, we have controllers and components which are basically the same but named differently

@bakpaul
Copy link
Copy Markdown
Contributor Author

bakpaul commented Apr 23, 2026

@damienmarchal could you make a review on that PR ?

Copy link
Copy Markdown
Contributor

@epernod epernod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very important suggestion....

Comment thread bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Component.cpp Outdated
Comment thread bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Component.h Outdated
Comment thread bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Component.inl Outdated
Comment thread bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Component_doc.h Outdated
Co-authored-by: erik pernod <erik.pernod@gmail.com>
@hugtalbot
Copy link
Copy Markdown
Contributor

sounds like the name of the next blockbuster movie

"Component is the new controller"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants