Hello,
I am trying to access the Displayer of an Opensim body using the MATLAB API in Opensim 4.0. Basically, I want to change the color and display properties of my bodies in my simulation. Of course this can be done manually by editing the XML file but I was hoping to do it through a MATLAB command.
I've done some searching on the forum and it seems like in previous versions of Opensim you could use the command:
displayer = body.GetDisplayer()
(referencing this thread: viewtopicPhpbb.php?f=91&t=3844&p=8559&start=0&view=)
However, this command does not seem to be working in Opensim 4.0. Are there any alternatives to accessing a body's display preferences?
Thanks,
Michael
accessing Displayer for a body through Matlab API (opensim 4.0)
- Michael Fanton
- Posts: 11
- Joined: Sun Jan 22, 2017 12:21 pm
- Christopher Dembia
- Posts: 506
- Joined: Fri Oct 12, 2012 4:09 pm
Re: accessing Displayer for a body through Matlab API (opensim 4.0)
You may be able to use body.get_attached_geometry(). If you know the name of the geometry, you could maybe use Geometry.safeDownCast(body.getComponent('<geom-name>'))
- Michael Fanton
- Posts: 11
- Joined: Sun Jan 22, 2017 12:21 pm
Re: accessing Displayer for a body through Matlab API (opensim 4.0)
This worked, thanks!Geometry.safeDownCast(body.getComponent('<geom-name>'))