Use ArticyRef/Picker in an EditorWindow

Sun 1. Apr 2018, 03:54

Hello, I was wondering if it's possible to use ArticyRef to trigger the articy object picker within a custom EditorWindow. My goal is to have a custom menu item that opens a window, allows me to select an Articy Location, and will parse some paths I've created and create a few unity objects using that data. I want to be able to easily choose the Location using the object picker.

I've had no luck using:
  • EditorGUILayout.ObjectField(...)
  • SerializedObject so = new SerializedObject(this);
    EditorGUILayout.PropertyField(so.FindProperty("Location"));

Any other suggestions? I know this is possible using a standard script, as was done in the Maniac Manfred demo, but I was hoping to do this in a menu item, as I have several other utilities that I run from there.

Thanks,
Shaun
shaun
 
Posts: 5
Joined: Sun 4. Jan 2015, 10:22

Re: Use ArticyRef/Picker in an EditorWindow

Wed 4. Apr 2018, 08:59

Hi shaun,

you can create custom UI with the ArticyObjectPicker using ArticyGUILayout. But this ofc works only in a new window or in the inspector. If i understand you correctly you want a modal object picker window that returns the selected reference once closed, without the need of the field.
I haven't thought about that and i think that option would be useful indeed, i see if i can squeeze that in for the next release.

In the meantime you could create a small window with an ArticyObjectField, poll the field in an update and once its set you can execute your logic and close the window. Not the most convenient, but at least a start.

Hope that helps and thanks for the suggestion

best regards

Nico
Nico Probst
Senior Software Engineer | Articy | LinkedIn
User avatar
[Articy] Nico Probst
Articy Staff
Articy Staff
 
Posts: 217
Joined: Wed 23. Nov 2011, 09:45
Location: Bochum

Re: Use ArticyRef/Picker in an EditorWindow

Wed 4. Apr 2018, 13:03

Hi Nico,

ArticyGUILayout was exactly what I was looking for! Maybe just a brief mention in the articy importer guide would be helpful.

Thanks very much!
Shaun
shaun
 
Posts: 5
Joined: Sun 4. Jan 2015, 10:22

Return to articy:draft Unity Importer

Who is online

Users browsing this forum: No registered users and 18 guests

Who We Are
Contact Us
Social Links