Page 1 of 1

use plugins with GUI scripting / MATLAB

Posted: Sun Sep 20, 2015 12:50 pm
by wietse
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

Re: use plugins with GUI scripting / MATLAB

Posted: Mon Sep 21, 2015 12:48 pm
by aymanh
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

Re: use plugins with GUI scripting / MATLAB

Posted: Wed Sep 23, 2015 9:13 am
by wietse
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