Hi,
I made a plugin for a new joint type (CustomJointFilter). I can load the plugin in OpenSim (Tools -> User Plugins -> CustomJointFilterPlugin) and I can load models that contain this new joint type in OpenSim. So far so good.
I would also like to make new joints with GUI scripting or Matlab, but I’m not able to do this so far. I tried this:
[GUI]
>>> j = modeling.CustomJointFilter
Traceback (most recent call last):
File "<input>", line 1, in <module>
AttributeError: 'javapackage' object has no attribute 'CustomJointFilter'
[MATLAB]
>> j = CustomJointFilter
Undefined function or variable 'CustomJointFilter'.
I would also like to do this for a Tool plugin. So do something like:
myTool = myNewTool(‘myNewToolSettings.xml’)
myTool.run
Maybe I did overlook something. Any help is welcome.
Wietse
use plugins with GUI scripting / MATLAB
- Wietse van Dijk
- Posts: 2
- Joined: Sun Sep 20, 2015 12:45 pm
- Ayman Habib
- Posts: 2239
- Joined: Fri Apr 01, 2005 12:24 pm
Re: use plugins with GUI scripting / MATLAB
Hi,
Our current plugin mechanism is intended for users writing C++ plugins. Classes defined in a plugin are not accessible through the scripting layer (Matlab or GUI). If you load the plugin (e.g. using System.LoadLibrary) then the classes will be available for use/reading/writing but not through scripting basically because the types defined in the plugin are not known to the corresponding interpreter. You can only use the Properties interface assuming your Class derives from OpenSim::Object, which is what the GUI and serialization code does.
We'll try to make this process easier in upcoming releases but for now what you're trying to accomplish is not supported.
Hope this helps,
-Ayman
Our current plugin mechanism is intended for users writing C++ plugins. Classes defined in a plugin are not accessible through the scripting layer (Matlab or GUI). If you load the plugin (e.g. using System.LoadLibrary) then the classes will be available for use/reading/writing but not through scripting basically because the types defined in the plugin are not known to the corresponding interpreter. You can only use the Properties interface assuming your Class derives from OpenSim::Object, which is what the GUI and serialization code does.
We'll try to make this process easier in upcoming releases but for now what you're trying to accomplish is not supported.
Hope this helps,
-Ayman
- Wietse van Dijk
- Posts: 2
- Joined: Sun Sep 20, 2015 12:45 pm
Re: use plugins with GUI scripting / MATLAB
Hi Ayman,
Thank you for your answer. I’ll try to solve it in a different way. I might come back with a follow up.
Best,
Wietse
Thank you for your answer. I’ll try to solve it in a different way. I might come back with a follow up.
Best,
Wietse