Custom ClipInspector with VisualElement ?

Hi,

I am trying to create a custom editor for my special PlayableAsset class (timeline clip) but I haven’t been able to make the element show up in the inspector when the clip is picked. Is this currently possible at all? Seems that UnityEditor.Timeline.ClipInspector by default calls OnInspectorGUI() to draw custom inspectors and CreateInspectorGUI is ignored.

Thanks

Hello,

It seems like this should work. Which Unity version are you using ?

I am using 2019.1.5

Can you report a bug please?

Just did. (Case 1171296)

Sorry to bump this thread, but I just tried to use UIElement for a clip inspector, and it’s not working. I’ve checked the source of ClipInspector.cs in Timeline package, and in fact UIElement are not supported for clip inspector.

Hello, we’ve decide to treat this as a feature request.

More info here: Unity Issue Tracker - VisualElement is not drawn in Playables' Inspector when CreateInspectorGUI() is overridden

Is there any workaround for this while we wait for the feature to be implemented? Would it be possible to wrap an VisualElement inside IMGUI? We have UIElements that we want to reuse for Timeline clips.

1 Like

UIElements cannot run inside IMGUI and we don’t plan to add support for such a case. Best option would be to overlay it using absolute position and the rectangle information from IMGUI.

Yes but the inverse is possible, you can wrap a IMGUI inside a VisualElement, with IMGUIContainer. I did a quick test modifying the code of ClipInspector in Timeline, and I could display all clip inspector inside the CreateInspectorGUI().

2 Likes