Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] [EDITOR] Constraint Manager's button "Go to component" doesn't work for custom TransformConstraint #838

Open
anonymous2585 opened this issue Jul 11, 2024 · 2 comments
Labels
Type: Bug A problem with an existing feature that can be fixed with the next patched release.

Comments

@anonymous2585
Copy link
Contributor

Describe the bug

When using a custom script that extends TransformConstraint, the "Go to component" button in the Constraint Manager doesn't work when clicked.

To reproduce

Steps to reproduce the behavior:

  1. Import this script
using MixedReality.Toolkit;
using MixedReality.Toolkit.SpatialManipulation;

public class CustomConstraint : TransformConstraint
{
    public override TransformFlags ConstraintType => TransformFlags.Rotate;

    public override void ApplyConstraint(ref MixedRealityTransform transform)
    {
        // not necessary for this issue
    }
}
  1. Open scene HandInteractionExample
  2. Add this constraint on one of the ObjectManipulator
  3. On the Constraint Manager, click on 'Go to component' for the custom constraint
  4. See warning Item Custom Constraint not found in window Inspector.

Expected behavior

The component is highlighted just as the built-in components.

Your setup (please complete the following information)

  • Unity Version 2021.3.21f1
  • MRTK Version or Commit main@d818d18

Additional context

  • When changing $"{ObjectNames.NicifyVariableName(constraintName)}" to $"{ObjectNames.NicifyVariableName(constraintName)} (Script)" in ConstraintManagerEditor.cs, the custom component is highlighted but break for MRTK's constraints.
  • User work-around is to add [AddComponentMenu("MRTK/Spatial Manipulation/CustomConstraint")] attribute on the class. It changes the displayed name in inspector and removes the " (Script)" part. But it's better if this feature works out of the box for all scripts.
@anonymous2585 anonymous2585 added Needs: Triage Needs to be triaged. Type: Bug A problem with an existing feature that can be fixed with the next patched release. labels Jul 11, 2024
@shaynie shaynie removed the Needs: Triage Needs to be triaged. label Jul 24, 2024
@shaynie
Copy link
Contributor

shaynie commented Jul 24, 2024

@AMollis thinks this may be a dupe. Investigating.

@AMollis
Copy link
Contributor

AMollis commented Jul 25, 2024

I was thinking of this issue

The #313 issue is slightly different than this new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug A problem with an existing feature that can be fixed with the next patched release.
Projects
None yet
Development

No branches or pull requests

3 participants