Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

Resolved 'PropertyUtils' is inaccessible due to its protection

Discussion in 'Animation Rigging' started by segant, Aug 22, 2020.

  1. segant

    segant

    Joined:
    May 3, 2017
    Posts:
    196
    I can't reach propertyutils from my assembly definition because of package's AssemblyInfo.cs doesn't contain default library. I think we need line like this
    Code (CSharp):
    1. [assembly: InternalsVisibleTo("Unity.Animation.Rigging")]
    I'm using my solvers in world space. Default chain and two bone are still in local space.
    And i think it should be Unity.Animations not Animation
    Package version 1.0.2
    After upgrading to 0.3.4 preview july 24 version it's solved.
     
    Last edited: Aug 22, 2020
  2. simonbz

    simonbz

    Unity Technologies

    Joined:
    Sep 28, 2015
    Posts:
    295
    We changed the visibility of some classes in the Runtime and Editor assemblies when releasing version 1.0.2 in a last effort to reorganize some of the code before the verified release. The intent was to make a clear and well documented API for Animation Rigging.

    `PropertyUtils` were implementation details of the builtin constraints and that's the reason why it was made `internal`. However, we can promote it back to `public` if users feel like it should be part of the Animation Rigging API.

    Here is the class implementation:

    Code (CSharp):
    1.     internal static class PropertyUtils
    2.     {
    3.         public static string ConstructConstraintDataPropertyName(string property)
    4.         {
    5.             return "m_Data." + property;
    6.         }
    7.  
    8.         public static string ConstructCustomPropertyName(Component component, string property)
    9.         {
    10.             return component.transform.GetInstanceID() + "/" + component.GetType() + "/" + property;
    11.         }
    12.     }
    Cheers!
     
    keni4 and segant like this.
  3. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    Hi. I also get an
    error CS0122: 'PropertyUtils' is inaccessible due to its protection level


    in 13.
    Code (CSharp):
    1. public class CopyLocationBinder : AnimationJobBinder<CopyLocationJob, CopyLocationData>
    2. {
    3.     public override CopyLocationJob Create(Animator animator, ref CopyLocationData data, Component component)
    4.     {
    5.         return new CopyLocationJob()
    6.         {
    7.             constrained = ReadWriteTransformHandle.Bind(animator, data.constrainedObject),
    8.             source = ReadOnlyTransformHandle.Bind(animator, data.sourceObject),
    9.  
    10.             // Bind data.invert to job.invert so values can be resolved from the AnimationStream
    11.             invert = Vector3BoolProperty.Bind(animator,
    12.                                               component,
    13.                                               PropertyUtils.ConstructConstraintDataPropertyName(nameof(data.invert)))[/B]
    14.         };
    15.     }
    16.     public override void Destroy(CopyLocationJob job) { }
    17. }
    in 1.03 and 1.02.
    I am coming from 0.3.4-preview.

    Do you have an idea what to do?
     
  4. Jebtor

    Jebtor

    Unity Technologies

    Joined:
    Apr 18, 2018
    Posts:
    117
    Hey, thanks for reporting this. We will reconsider exposing these as public. For the time being please include the functions locally in your project and call those functions instead. The code snippet with the functionality is posted by Simon in the above post.
     
    keni4 likes this.