Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
1
Question by Jeff-Rosenberg · Nov 14, 2013 at 12:59 AM · jointsbonesgizmosskinnedmeshrenderer

Draw Gizmos without Depth-test

I need to draw my gizmos without using a depth test. I'm trying to replicate the way bones work and are selected within Maya, where each joint has a spherical gizmo and draws a line towards their child joints. My goal is have our animators able to work directly within Unity without having to use the hierarchy to select joints.

Less the left, more the right:alt text

It looks like Gizmos actually did this pre-3.5:

Gizmos are now depth-tested, and exist in world space. The gizmo size can be adjusted using the existing gizmos size slider.

untitled.png (79.6 kB)
Comment
Add comment · Show 2
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 rutter · Nov 14, 2013 at 01:35 AM 0
Share

It's more complicated to use, but you might check out the UnityEditor's Handles class.

avatar image Jeff-Rosenberg · Nov 14, 2013 at 03:30 AM 0
Share

Edit: Tried that, found a workaround using Handles.Button and a circlecap through an editor window. I'm using a recursive method to dig down through the hierarchy, which lets me draw a button on each transform and detect when it's selected, then set Selection.activeObject.

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by AnomalusUndrdog · Aug 11, 2017 at 10:15 PM

The Handles class can draw lines that are above any mesh in the Scene View (it will do the one on the right, in your screenshot).

Most of the things you can do in Gizmos can also be done in Handles. It has Handles.DrawLine() which is equivalent to Gizmos.DrawLine(). There's Handles.color which works the same as Gizmos.color.

However they don't have the same amount of methods, so you'll have to figure out how some of your Gizmos code should be converted to Handles. For example, Gizmos.DrawCube() lets you draw a solid cube but Handles doesn't have that. It has Handles.DrawWireCube(), which, as can be inferred from the name, only draws a wireframe of a cube. There is Handles.CubeHandleCap() which can be used to draw cubes like Gizmos.DrawCube() does, but the Gizmos method allows you to stretch and squash the cube, while Handles.CubeHandleCap() can't.

Handles has a few more methods that Gizmos doesn't have. For example there's Handles.DrawSolidRectangleWithOutline() which lets you draw a quad.

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

18 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

Related Questions

Are Joints in fact Transforms? 2 Answers

Exported "Actions" from Modo don't work in unity. 0 Answers

Does the transform.parent hierarchy have any relationship to the bone hierarchy? 1 Answer

Maya to Unity - joint orientation ignored or lost 1 Answer

Drawcall relation to animated bone count? 0 Answers


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