I've managed to mirror the muscles but I can't figure out how to do this for the wrap objects.
Using the Arm26 model as an example, let's say I wanted to clone the TRIlonghh WrapEllipsoid attached to the r_humerus body and attach it to the r_ulna_radius_hand body at an arbitrary location.
I can access the Wrap Set for r_humerus with the following script, but then I can't seem to get individual wrap objects. Since wrapSet is an Abstract Property I probably need to safeDownCast, but to what derived class?
Code: Select all
clear
import org.opensim.modeling.*
model = Model('arm26.osim');
bodySet = model.getBodySet();
body = bodySet.getPropertyByIndex(0).getValueAsObject(1);
bodyName = cell2mat(body.getName.string);
wrapSet = body.updPropertyByName('WrapObjectSet');
Thanks for your help!