Search Unity

Custom Processors and Animation Curves

Discussion in 'Input System' started by owen_proto, Sep 2, 2020.

  1. owen_proto

    owen_proto

    Joined:
    Mar 18, 2018
    Posts:
    118
    Are there plans to support AnimationCurve fields for custom input processors? In 2020.1.3f1, adding an AnimationCurve field throws the following error for me:

    Code (CSharp):
    1. ArgumentException: Don't know how to convert PrimitiveValue to 'Object'
    2. Parameter name: type
    3. UnityEngine.InputSystem.Utilities.PrimitiveValue.ConvertTo (System.TypeCode type) (at Library/PackageCache/com.unity.inputsystem@1.0.0/InputSystem/Utilities/PrimitiveValue.cs:227)
    4. UnityEngine.InputSystem.Utilities.NamedValue.ConvertTo (System.TypeCode type) (at Library/PackageCache/com.unity.inputsystem@1.0.0/InputSystem/Utilities/NamedValue.cs:28)
    5. UnityEngine.InputSystem.Editor.Lists.ParameterListView.Initialize (System.Type registeredType, UnityEngine.InputSystem.Utilities.ReadOnlyArray`1[TValue] existingParameters) (at Library/PackageCache/com.unity.inputsystem@1.0.0/InputSystem/Editor/AssetEditor/ParameterListView.cs:146)
    6. UnityEngine.InputSystem.Editor.Lists.NameAndParameterListView..ctor (UnityEditor.SerializedProperty property, System.Action applyAction, System.String expectedControlLayout, UnityEngine.InputSystem.Utilities.TypeTable listOptions, System.Func`2[T,TResult] getValueType, System.String itemName) (at Library/PackageCache/com.unity.inputsystem@1.0.0/InputSystem/Editor/AssetEditor/NameAndParameterListView.cs:44)
    7. UnityEngine.InputSystem.Editor.Lists.ProcessorsListView..ctor (UnityEditor.SerializedProperty property, System.Action applyAction, System.String expectedControlLayout) (at Library/PackageCache/com.unity.inputsystem@1.0.0/InputSystem/Editor/AssetEditor/NameAndParameterListView.cs:213)
    8. UnityEngine.InputSystem.Editor.PropertiesViewBase.UpdateProcessors (System.String expectedControlLayout) (at Library/PackageCache/com.unity.inputsystem@1.0.0/InputSystem/Editor/AssetEditor/PropertiesViewBase.cs:33)
    9. UnityEngine.InputSystem.Editor.PropertiesViewBase..ctor (System.String label, UnityEditor.SerializedProperty bindingOrAction, System.Action`1[T] onChange, System.String expectedControlLayout) (at Library/PackageCache/com.unity.inputsystem@1.0.0/InputSystem/Editor/AssetEditor/PropertiesViewBase.cs:25)
    10. UnityEngine.InputSystem.Editor.InputActionPropertiesView..ctor (UnityEditor.SerializedProperty actionProperty, System.Action`1[T] onChange) (at Library/PackageCache/com.unity.inputsystem@1.0.0/InputSystem/Editor/AssetEditor/InputActionPropertiesView.cs:22)
    11. UnityEngine.InputSystem.Editor.InputActionEditorWindow.LoadPropertiesForSelection () (at Library/PackageCache/com.unity.inputsystem@1.0.0/InputSystem/Editor/AssetEditor/InputActionEditorWindow.cs:547)
    12. UnityEngine.InputSystem.Editor.InputActionEditorWindow.InitializeTrees () (at Library/PackageCache/com.unity.inputsystem@1.0.0/InputSystem/Editor/AssetEditor/InputActionEditorWindow.cs:376)
    13. UnityEngine.InputSystem.Editor.InputActionEditorWindow.OnEnable () (at Library/PackageCache/com.unity.inputsystem@1.0.0/InputSystem/Editor/AssetEditor/InputActionEditorWindow.cs:225)
    Edit:
    After trying some other stuff, looks like the InputAction asset editor window doesn't support property drawers of any kind. This would be useful to have to enforce value ranges etc.
     
    Last edited: Sep 2, 2020