Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by xanaxknight · May 01, 2013 at 09:48 AM · animationeditorinspectorfbxpreview

Is it possible to create a custom model preview in an Editor window akin to the one displayed when an FBX is selected?

Hello all.

I'm looking for a way to show a preview of a model in an Editor window. This preview will ideally be able to play an animation that I would drag on to the window.

The only solution I can seem to think of is displaying a render texture of a camera set up to look at a model in game but this does not seem ideal as it means physically placing this in a scene when I would like to have this all done via the Editor window. If animations were to be played, it would also require the scene to be running.

To give you an idea, this is exactly what I want to show in an Editor window. This is an example of what is displayed when an FBX is selected.

alt text

Thanks for your time.

modelviewer.png (88.5 kB)
Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image whydoidoit · May 01, 2013 at 10:38 AM 0
Share

You can get a preview like this:

alt text

Is that enough?

screen shot 2013-05-01 at 11.37.57.png (9.7 kB)
avatar image fafase · May 01, 2013 at 01:21 PM 0
Share

Answer from xanaxknight converted to comment:

Unfortunately, I would need more or less exactly the style of window shown in my screenshot, with the ability to translate the camera around the model and such. Thanks anyway.

avatar image IgorAherne · Jan 23, 2017 at 09:12 PM 0
Share

check my comment under @jasonlu00 answer

4 Replies

· Add your reply
  • Sort: 
avatar image
3

Answer by jasonlu00 · Jul 15, 2015 at 07:19 PM

Yes, you can do it by using Editor class. Check out "HasPreviewGUI, OnPreviewGUI and OnPreviewSettings" http://docs.unity3d.com/ScriptReference/Editor.OnPreviewGUI.html http://docs.unity3d.com/ScriptReference/Editor.OnInteractivePreviewGUI.html

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image IgorAherne · Jan 23, 2017 at 04:29 PM 2
Share

Thank you for this, here is another link to look at (read 9.8, google translate works with Japanese translation, really cool tutorial) http://anchan828.github.io/editor-manual/web/customeditor.html

avatar image IgorAherne · Jan 23, 2017 at 04:32 PM 2
Share

also this one, is more towards animation http://anchan828.github.io/editor-manual/web/spri$$anonymous$$nimationpreview2.html

avatar image dCalle IgorAherne · Feb 03, 2018 at 01:38 PM 0
Share

JESUS! this stuff is amazing. Thanks buddy!

avatar image
1

Answer by CrazyDoctor · Feb 25, 2014 at 01:24 PM

see here http://docs.unity3d.com/Documentation/Components/editor-CustomEditors.html use Editor.CreateEditor, OnInteractivePreviewGUI,OnInspectorGUI in your own custom editor

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by conceptfac · Aug 04, 2020 at 12:32 AM

I create a object preview in my EditorWindow but it's impossible preview a prefabs out of scene!

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by TJHeuvel-net · Jan 11 at 07:32 PM

Turns out its not that hard, just make a MeshPreview: https://github.com/Unity-Technologies/UnityCsReference/blob/e740821767d2290238ea7954457333f06e952bad/Editor/Mono/Inspector/ModelInspector.cs#L249

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

22 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Animation Preview in Custom Asset Inspector Window 2 Answers

Two same fbx files works different 1 Answer

FBX -> 3dsMax problem 0 Answers

Animation showing up in inspector preview, but not when I drag into scene. 0 Answers

What Unity version introduced OnInteractivePreviewGUI() ? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges