Currently, this method accepts a function pointer, which is used to register a factory method for a specific C++ node type.
For a dynamic integration of Metashade though (#1 ), we need to be able to register different Metashade node implementations which would have different Python code but the same C++ class representing all of them. This way, nodedefs and implementations can be added and modified by editing the Python code but without having to recompile the MaterialX C++ code.
To enable the above, we need to register function objects instead of function pointers. std::function should be enough, and all existing MaterialX node implementation registrations should still work with minimal or no changes.
Currently, this method accepts a function pointer, which is used to register a factory method for a specific C++ node type.
For a dynamic integration of Metashade though (#1 ), we need to be able to register different Metashade node implementations which would have different Python code but the same C++ class representing all of them. This way, nodedefs and implementations can be added and modified by editing the Python code but without having to recompile the MaterialX C++ code.
To enable the above, we need to register function objects instead of function pointers.
std::functionshould be enough, and all existing MaterialX node implementation registrations should still work with minimal or no changes.