Description
When writing plugins we need to do the following :
create the following arborescence
└── pluginFolder
└── meshroom
└── pluginModule
├── __init__.py
└── plugin_node.py
Set the env variable :
export MESHROOM_PLUGINS_PATH=$MESHROOM_PLUGINS_PATH:/path/to/pluginFolder
Or with rez : env.MESHROOM_REZ_PLUGINS.append("myPlugin=/path/to/pluginFolder")
Important
Because of that we often end up having meshroom folders with only a single plugin inside so the meshroom folder could be simply removed.
Proposition
Changes in loadPluginFolder
mrFolder = Path (folder , 'meshroom' )
if not mrFolder .exists ():
logging .info (f"Plugin folder '{ folder } ' does not contain a 'meshroom' folder." )
return
I suggest to replace with :
mrFolder = Path (folder , 'meshroom' )
if not mrFolder .exists ():
mrFolder = folder
That way we keep the retrocompatibility but now the arborescence could be :
└── pluginFolder
└── pluginModule
├── __init__.py
└── plugin_node.py
Which would be simpler.
Changes in loadClasses
if not isPackage :
logging .warning (f"No class defined in plugin: { package .__name__ } .{ pluginName } ('{ pluginMod .__file__ } ')" )
Also here the warning is adding too much logs I think we should put it in info at most.
Changes in initPlugins
pluginsFolders = [os .path .join (meshroomFolder , "plugins" )] + additionalPluginsPath
Here we add a "plugins" folder that doesn't exist in Meshroom. This result in an unwanted log because of that code :
if not os .path .isdir (folder ):
logging .info (f"Plugin folder '{ folder } ' does not exist." )
return
It's not a big issue because the default log level is warning, but I think we should rewrite the function this way :
def initPlugins ():
# Classic plugins (with a DirTreeProcessEnv)
pluginsFolders = EnvVar .getList (EnvVar .MESHROOM_PLUGINS_PATH )
for f in pluginsFolders :
...
...
Description
When writing plugins we need to do the following :
export MESHROOM_PLUGINS_PATH=$MESHROOM_PLUGINS_PATH:/path/to/pluginFolderenv.MESHROOM_REZ_PLUGINS.append("myPlugin=/path/to/pluginFolder")Important
Because of that we often end up having meshroom folders with only a single plugin inside so the meshroom folder could be simply removed.
Proposition
Changes in
loadPluginFolderMeshroom/meshroom/core/__init__.py
Lines 356 to 359 in 83594b4
I suggest to replace with :
That way we keep the retrocompatibility but now the arborescence could be :
Which would be simpler.
Changes in
loadClassesMeshroom/meshroom/core/__init__.py
Lines 106 to 107 in 83594b4
Also here the warning is adding too much logs I think we should put it in info at most.
Changes in
initPluginsMeshroom/meshroom/core/__init__.py
Line 451 in 83594b4
Here we add a "plugins" folder that doesn't exist in Meshroom. This result in an unwanted log because of that code :
Meshroom/meshroom/core/__init__.py
Lines 352 to 354 in 83594b4
It's not a big issue because the default log level is warning, but I think we should rewrite the function this way :