Search Unity

Bug Issue: VFXTransformBinder redundantly accesses transform

Discussion in 'Visual Effect Graph' started by vertxxyz, Jun 8, 2021.

  1. vertxxyz

    vertxxyz

    Joined:
    Oct 29, 2014
    Posts:
    109
    VFXTransformBinder currently accesses the
    .transform
    property repeatedly and redundantly.

    Code (CSharp):
    1. component.SetVector3((int)Position, Target.transform.position);
    2. component.SetVector3((int)Angles, Target.transform.eulerAngles);
    3. component.SetVector3((int)Scale, Target.transform.localScale);
    Target
    is already a Transform.

    Easy fix. I'd like to know what the best way to report these sort of issues is (can I make a PR on the Graphics repo?) in future. Thanks!
     
  2. vertxxyz

    vertxxyz

    Joined:
    Oct 29, 2014
    Posts:
    109
    I know this is a minor bug, but it'd be nice to acknowledge the thread has been seen.
     
  3. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    550
    Hi @vertxxyz ,

    Nice catch! Looks like a relic of an earlier iteration when Target was a GameObject.
    The impact of this should be minimal (self-reference), but it would be a nice clean-up.
    Yup! :) You can make a PR from master in the graphics repo: https://github.com/Unity-Technologies/Graphics

    Thanks for bringing this up!
     
    PutridEx and vertxxyz like this.
  4. vertxxyz

    vertxxyz

    Joined:
    Oct 29, 2014
    Posts:
    109
    PutridEx likes this.