Unity-Technologies / com.unity.perception

Perception toolkit for sim2real training and validation in Unity
Other
920 stars 177 forks source link

Error - Trying to read value of type Dimension while reading a value of type CommaSeparator #473

Closed Robotatron closed 2 years ago

Robotatron commented 2 years ago

Clicking on the scenario game object with the Randomizer component in the scene view creates 150+ identical error messages:

Trying to read value of type Dimension while reading a value of type CommaSeparator
UnityEditor.RetainedMode:UpdateSchedulers ()

image

Video - https://streamable.com/errwe9

Perception version 0.11.1-preview.1 Unity 2021.3.0f1 Windows 10, 64bit, Version 21H2, OS build 19044.1645

RuiyuZ commented 2 years ago

Hi @Robotatron, I was not able to reproduce this issue. Can you try to remove one of the scenario game object and see if that helps? Or try the scenario game object in a blank new project to see if the issue persists.

If you are willing to share a project with us to diagnose further, send us an email at computer-vision@unity3d.com and we will give you a link to upload your project. Thanks!

-Ruiyu

methier-CPR commented 2 years ago

Hi @RuiyuZ, I am getting these errors as well when clicking on a scenario object in the Hierarchy. I've noticed that the errors only appear when I have at least one randomizer with a FloatParameter in my scenario. The error seems to be related to the UI display for adjusting the FloatParameter range.

Using: Package version 0.11.2-preview.2 Unity 2021.2.7f1 Ubuntu 20.04

nicoarnaise commented 2 years ago

Hi @RuiyuZ, I am getting these errors as well when clicking on a scenario object in the Hierarchy. I've noticed that the errors only appear when I have at least one randomizer with a FloatParameter in my scenario. The error seems to be related to the UI display for adjusting the FloatParameter range.

Using: Package version 0.11.2-preview.2 Unity 2021.2.7f1 Ubuntu 20.04

I have the same issue on my HDRP project. It appears each time the inspector is refreshed and a FixedLengthScenario is drawn with one or more Randomizer (even when the Randomizers are collapsed).

Using: Package version 0.11.2-preview.2 HDRP 12.1.6 Python for Unity 4.0.0-exp.5 Unity 2021.2.19f1 Windows 10

Robotatron commented 2 years ago

Hi @Robotatron, I was not able to reproduce this issue. Can you try to remove one of the scenario game object and see if that helps? Or try the scenario game object in a blank new project to see if the issue persists.

If you are willing to share a project with us to diagnose further, send us an email at computer-vision@unity3d.com and we will give you a link to upload your project. Thanks!

-Ruiyu

Yes, removing the scenario game object and creating it again fixes the problem. However I've encountered this problem several times during different projects (your tutorial and my own project). If I can recreate the issue again in the tutorial demo project I will mail it at you!

enickel00 commented 2 years ago

I'm also having this issue in Unity 2021.3.2f1 with HDRP 12.1.6 on Windows 10. When I delete the scenario then the issue goes away, but when I make a new scenario and add a randomizer (doesn't seem to matter which one) then the issue comes back immediately. I've tried removing and re-installing the perception package (version 0.11.2-preview.2) and the issue still occurs when I make a new scenario. Is there anything I can do to help troubleshoot this issue?

RuiyuZ commented 2 years ago

Hey @enickel00, the fix on this issue will be included in the next release of the package. This error won't harm or affect the functionality of the perception package though. For now, if you want to fix it yourself, you can go into com.unity.perception/com.unity.perception/Editor/Randomization/Uxml/Sampler/FloatRangeElement.uxml and delete all the commas on line 4. This appears to be invalid CSS/USS syntax that probably wasn't caught in older versions of unity, but causes an error in 2021. So the fixed version of FloatRangeElement.uxml should look like this:

<UXML xmlns="UnityEngine.UIElements" xmlns:editor="UnityEditor.UIElements">
    <VisualElement>
        <Style src="../../Uss/Styles.uss"/>
        <VisualElement style="flex-direction: row; margin: 1px 1px 1px 3px;">
            <Label text="Range" class="unity-base-field__label" style="min-width: 147;"/>
            <VisualElement class="sampler__float-range" style="flex-grow: 1; flex-direction: row;">
                <editor:FloatField label="Min" tooltip="Minimum" name="minimum" style="flex-grow: 1; flex-shrink: 0; flex-basis: 0; margin-bottom: 0;"/>
                <editor:FloatField label="Max" tooltip="Maximum" name="maximum" style="flex-grow: 1; flex-shrink: 0; flex-basis: 0; margin-right: 2px; margin-bottom: 0;"/>
            </VisualElement>
        </VisualElement>
    </VisualElement>
</UXML>

Please feel free to let me know if this solves the problem, thanks!

methier-CPR commented 2 years ago

That fixed the issue for me. Thanks!

enickel00 commented 2 years ago

This initially fixed the issue, but it seems that Unity keeps overwriting this file and putting the commas back in. I've tried deleting and recreating my fixed length scenario and have also deleted and reinstalled the perception package. Any idea why Unity is continuing to overwrite this UXML file and putting the commas back in?

Is there a new release with this bug fixed that I could try installing? 0.11.2 seems to be the newest I could find in the repo, but maybe I'm missing something.