Search Unity

[Released] - Runtime Transform Gizmos

Discussion in 'Works In Progress - Archive' started by XGT08, Jan 16, 2016.

  1. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,905
    Hi there,

    Runtime Transform Gizmos is a system that gives you the possibility of using transform gizmos at runtime. The system implements all 3 gizmo types including snapping for all gizmos.

    The package is available on the Unity Asset Store here.

    Here is a complete list of features:
    • translation, rotation and scale gizmos;
    • snapping for all gizmo types - this includes vertex snapping for the translation gizmo;
    • object selection interface - click on objects to select/deselect them or perform multi-object selections using a selection rectangle;
    • transform space - transform the objects in local or global space;
    • transform pivot point - object center and mesh pivot;
    • Undo/Redo (object transforms, object selection and a few properties like transform space and transform pivot point) - can be extended for different types of actions;
    • works with multi-level object hierarchies;
    • ability to customize gizmo appearance and behavior;
    You can download a demo build from here.
    The documentation can be downloaded from here.

    Work on update 1.0.1 is already finished, so it will be available pretty soon. The update contains the following features:
    • object selection mask - gives you the possibility to specify which objects should be ignored by the selection module. Objects which belong to the mask can not be selected;
    • Editor camera Smooth Zoom;
    • Editor camera Smooth Pan;
    Note: This update also fixes a bug which happens in Unity 5.3.1. This is related to a call to the DontDestroyOnLoad function inside the Unity Editor. For some reason, when calling this function from the editor, objects disappear from the hierarchy. This bug prevents you from setting up the scene correctly. For those of you who encounter this problem, as a quick fix until the update is available, you can perform the following steps:
    1. Open the MonoSingletonBase.cs file located at Assets\Runtime Transform Gizmos\Scripts\Singleton;
    2. Scroll down to the bottom of the file and comment the line which contains the call to DontDestroyOnLoad;
    3. Open the RuntimeEditorApplication.cs file located at Assets\Runtime Transform Gizmos\Scripts\Runtime Editor;
    4. Implement the Awake method of the Monobehavior and call DontDestroyOnLoad(this.gameObject) from there.

    Small presentation video:


    Video tutorial:


    Kind Regards,
    Andrew
     
  2. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,905
    Hi guys,

    Version 1.0.1 has been released.
     
  3. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,905
    Hello,

    Version 1.0.7 has been released. This version contains the following new functionality:
    • camera focus on object selection. 3 types of focus modes are available: Smooth, ConstantSpeed and Instant;
    • camera orbit;
    • it is now possible to customize the object selection mechanism at the script level;
    • 3 object selection modes are now available: IndividualObjects - only the objects which are clicked or enter the selection shape's area are selected; EntireHierarchy - when an object is clicked or enters the object selection shape's area, the entire hierarchy is selected; Custom - allows you to customize how objects get selected by implementing a series of handlers (please see documentation);
    • it is now possible to disable the object selection mechanism if needed;
    • added Bootstrap scene to handle multi-scene loading at runtime while avoiding duplicate objects;
    Bug fixes:
    • there was a bug which was happening when you wanted to vertex snap an object onto one of its children. When this was the case, the parent was snapped, but the child position was also modified. This has now been fixed;
    • fixed bug which happened when new scenes were loaded. All the necessary cleanup is now performed (i.e. gizmo deactivation, object selection cleanup, Undo/Redo stack reset etc).
    The package can be downloaded from here.
     
  4. SunnySunshine

    SunnySunshine

    Joined:
    May 18, 2009
    Posts:
    976
    I just bought this asset, but I'm not happy with how it works. It feels like it tries to do everything by its own. Or rather - it feels like a framework where it calls you, instead of a library where you call it. As it is now, customizing the behavior feels unnecessarily complex.

    I think a lot of users would just like to show these gizmos at specific times, without having to dive into all this architecture. I don't want this selection system, undo or camera system. I just want to show the gizmos at some point and use its behavior. Perhaps something like this:

    Code (CSharp):
    1. private void ShowGizmoForThisGameObject()
    2. {
    3.     RTEditor.TranslationGizmo.Show(transform, OnEvent);
    4. }
    5.  
    6. private void OnEvent(RTEditor.Event event)
    7. {
    8.     // ...
    9. }
    That's it.

    As it is now, all these separate systems (that seem mandatory, because if you remove them they will be instantiated regardless) and features makes it hard to overview. I just want my gizmos...

    I wouldn't use this asset in its current state.

    Furthermore, I think it would be a good idea to use a shadless shader for the gizmos. I noticed when you disabled the lighting, the gizmos became very dark.
     
    Last edited: Feb 5, 2016
  5. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,905
    Hi SunnySunshine,

    I am sorry that the package is not to your liking. The idea was to construct a system which already implements much of the functionality that is most frequently needed in conjunction with the gizmos.

    If you like, you can send me an e-mail describing how you would like the system to work (what parts you would like to keep and what parts you would like removed) and I am sure I would be able to modify the package to suit your own needs.

    If that is not something that you wish to do, and if you would like a refund, please let me know via e-mail and I will contact the asset store right away.

    Cheers,
    Andrew
     
  6. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,905
    I missed this the first time I read your post. This is configurable for each gizmo. Set the following properties to false if you prefer flat shading:
    -translation gizmo -> AreArrowConesLit;
    -rotation gizmo -> IsRotationSphereLit;
    -scale gizmo -> AreScaleBoxesLit;

    The properties can be modified both from the inspector and at the script level.
     
  7. SunnySunshine

    SunnySunshine

    Joined:
    May 18, 2009
    Posts:
    976
    Ah, my bad about the shaders. That's great. :)

    And I will take you up on that offer. I'll be in touch.
     
  8. SamwooImmersion

    SamwooImmersion

    Joined:
    Oct 23, 2014
    Posts:
    4
    i use multi-camera
    one camera 3d view
    other camera ngui view

    but SeletionBox tow is Rendering

    what is use Multi-Camera?
     

    Attached Files:

    • 1111.PNG
      1111.PNG
      File size:
      1.7 MB
      Views:
      1,268
  9. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,905
    Hi there kimhc,

    You can solve this issue by adjusting the UI Camera culling mask as shown in the following image:
    UICameraCullingMask.png

    This of course works if the UI elements belong to the UI layer. If they belong to another layer, just select that one instead of the UI.

    You can find more info on the camera culling mask here.
    Please let me know if this helps.

    Best Regards,
    Andrew
     
  10. SamwooImmersion

    SamwooImmersion

    Joined:
    Oct 23, 2014
    Posts:
    4
    Thank you answer

    but
    The problem is not solved

    camera culling mask
    It was in use from the previous

    Draw a box like cider function problems

    OnRenderObject () is invoked twice
    In ui camera again
    Once the camera in play

    Is there a workaround?

    The camera this happens, go near the object!
    When one is drawn away gizmo go out of the screen ui camera!
     
  11. SamwooImmersion

    SamwooImmersion

    Joined:
    Oct 23, 2014
    Posts:
    4
    private void OnRenderObject()
    {
    if (Camera.current.CompareTag("MainCamera"))
    {
    // Render the object selection
    ObjectSelectionRenderer objectSelectionRenderer = ObjectSelectionRendererFactory.Create(_objectSelectionSettings.ObjectSelectionRenderMode);
    objectSelectionRenderer.RenderObjectSelection(_selectedObjects, _objectSelectionSettings);

    // Render the selection shape
    GetObjectSelectionShape().Render();
    }
    }

    This solved!

    Thank you~!
     
  12. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,905
    AA... Yes the OnRenderObject function. Totally forgot about that one. Thanks for pointing that out to me. I am very glad the problem was solved!

    Best Regards,
    Andrew