Change muscle attachments individually

Hi AnyBody-Team!

I would like to change the muscle attachments (insertions/origins) of the standing model separately in one leg. Therefore, I already modified the points in the body-part, which certainly effects both sides. Furthermore, I dont want to touch this part of the model (if possible). Is there a smart way how to achieve this?

Thanks a lot and best regards,
Mulle

Hi Mulle,

Yes, you could use a SetValue operation to do that without modifying the repository (which is a good practice). Here is a short example of how this can be achieved:


AnyOperationSetValue SetValue = {
      
      AnyVar NewMass = 10;
      AnyVar NewMass1 = 20;
      
      Target = {
        &Main.ArmModel.Segs.UpperArm.m1,
        &Main.ArmModel.Segs.UpperArm.m2,
        &Main.ArmModel.Segs.UpperArm.m3
      };
      Source = {
        &NewMass,
        &NewMass,
        &NewMass1
      };
      
      
    };


Use SetValue as a pre-operation for InitialConditions and access the needed side by using the link to the actual values, e.g.:
Main.HumanModel.BodyModel.Right.Leg.Seg.Thigh.GluteusMinimusNode.sRel

Best regards,
Pavel

2 Likes

Hi Pavel,

that’s exactly what I was looking for. Thanks a lot! Do you still have any ideas, how to change the attachments of only one side? The only method, which comes to my mind is to duplicate and rename the CadaverParameters.any and to include the file two times.

Best regards,
Mulle

Mulle,

What I meant was that you should use a single SetValue just for one side, where you do something like:


AnyOperationSetValue SetValue = {
      
      AnyVec3 NewPosGM = {0, 0.1, -0,1};
      AnyVec3 NewPos1  = {0, 0.1, -0,1};
      AnyVec3 NewPos2 = {0, 0.1, -0,1};
      AnyVec3 NewPos3 = {0, 0.1, -0,1};
      
      Target = {
        &Main.HumanModel.BodyModel.[b][u]Right[/u][/b].Leg.Seg.Thigh.GluteusMinimusNode.sRel,
        &Main.HumanModel.BodyModel.[b][u]Right[/u][/b].Leg.Seg.Thigh.Muscle1.sRel,
        &Main.HumanModel.BodyModel.[b][u]Right[/u][/b].Leg.Seg.Thigh.Muscle2.sRel,
        &Main.HumanModel.BodyModel.[b][u]Right[/u][/b].Leg.Seg.Thigh.Muscle3.sRel
      };
      Source = {
        &NewPosGM,
        &NewPos1,
        &NewPos2,
        &NewPos3
      };
    };

This way you modify just one side and you do not touch the repository code (cadaver parameters or alike).

Regards,
Pavel

Hi Pavel,

it works fine, thank you! :slight_smile: I think I was a bit confused about ā€œusing the link to the actual valuesā€. So I automatically assumed that you were talking about the original definition in the body-part.

Best regards,
Mulle

Hi Pavel,
I’ve been working on Malte’s model and ran into the following warning message using the new AnyBody version 6.0:
Set Value’ operation on this value-object has broken symbolic dependency. (ā€˜Reset Value’ to re-establish this dependency)
Additionally to the aformentioned muscle attachements, I’m also using the SetValue operation on a different AnyVar, that is evaluated as a constant, which gives me the following error:
ā€˜Set Value’ operation on this value-object is not allowed
I did not have this problem with the 5.3. Version, were there any changes that could affect this?
Best regards,
Kat

Dear Katharina,

I don’t think anything changed in the latest AMS, but some warnings have changed. You are overwriting with this set Value function a fixed variable, therefore you get a warning, to make you aware of this. This is just to avoid that set value is used unintentionally.

to be sure, click in the model tree on the muscle attachment node to see if it has the new value.

Hi Amir,

the variable isn’t overwritten by the AnyOperationSetValue, only the RefNodes are…
It works fine in the 5.3 version, not in the 6.0…
regards,
Kat

Hi,

to demonstrate my problem on an easy model, I slightly changed the Demo.Arm2D model and the AnyOperationSetValue demo, that is available through the AnyScriptReference Manual.
The model runs in the 5.3 AMS version, not in the 6.0!
Any idea why?
Best regards,
Kat

Katharina,

In AMS v6.0 only editable values can be set with the ā€œset valueā€ operation. That means only design variables and by default design variables can be used.

you can modify any value into a DesignVar:

  AnyVar HebelarmInit = 3;
  AnyVar Hebelarm = DesignVar(HebelarmInit);

then it will work.