Python smtk.plugin doesn't load operations
I tried using the discourse topic Using the python interpreter included with CMB and aevaCMB to load the OpenCascade plugin but it dont work with the current smtk. After some experimentation, it appears that operations don't get loaded for any plugin.
To reproduce:
- Download a recent nightly modelbuilder package (I used 15-Oct-2021).
- Run
pvpython
with the attached script test.py and pass in the path to the OpenCascade plugin (or any plugin library). On linux it's atlib/smtk-21.09.0/smtkOpencascadeSessionPlugin/smtkOpencascadeSessionPlugin.so
- The script prints out the available operations, which is an empty list.
For example on linux, from the install directory:
./bin/pvpython test.py lib/smtk-21.09.0/smtkOpencascadeSessionPlugin/smtkOpencascadeSessionPlugin.so
or for something more familiar:
./bin/pvpython test.py lib/smtk-21.09.0/smtkAttributePlugin/smtkAttributePlugin.so
In either case, the resulting set of available operations is the empty set:
Available Operations: set()
Available Operations: set()
finis
Click here to see the test.py script
import argparse
import paraview.simple
import smtk
import smtk.operation
import smtk.resource
import smtk.plugin
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('plugin_path', help='path to smtk plugin (.so on linux)')
args = parser.parse_args()
# Load the plugin
paraview.simple.LoadPlugin(args.plugin_path)
# Create an operation manager
op_manager = smtk.operation.Manager.create()
op_list1 = op_manager.availableOperations()
print('Available Operations:', op_list1)
# Populate the operation manager
smtk.plugin.registerPluginsTo(op_manager)
op_list2 = op_manager.availableOperations()
print('Available Operations:', op_list2)
print('finis')
Edited by John Tourtellott