Search Unity

Runtime Transform Gizmos (Move, Rotate, Scale, Universal, Scene Gizmo, Navigation Camera)

Discussion in 'Assets and Asset Store' started by XGT08, Sep 13, 2018.

  1. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,905
    It is not very clear to me what is happening here. The idea is this: once the SetEnabled function is used to deactivate a gizmo, you should no longer be able to interact with the gizmo. If at some point, you activate all the gizmos and all of them are sitting on top of each other, then in that one of the gizmos will be manipulated. What do you mean when you say it is impossible to manipulate the active gizmo? What is it that actually happens?
     
  2. gamebytom

    gamebytom

    Joined:
    Mar 13, 2017
    Posts:
    10
    I can send a video recording if you want. The active gizmo arrows change on mouse over as expected, but when you click to grab hold of them they don't always allow you to manipulate the object.
     
  3. TonismoGames

    TonismoGames

    Joined:
    Jun 12, 2018
    Posts:
    111
    Hi everyone!I ran into this issue on the newest update using unity 2017 .
    upload_2019-8-20_15-39-50.png upload_2019-8-20_15-40-13.png
     
  4. TonismoGames

    TonismoGames

    Joined:
    Jun 12, 2018
    Posts:
    111
    Hi,Is there a faster way to instantiate RTG?Instantiation is really slow on mobile
     
  5. XGT08

    XGT08

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

    I can't say there is. There is one thing you can try: in the RTGApp.cs file, inside the Start function, there is a call to RTMeshCompiler.CompileEntireScene(); You could try to comment this out and see if the load times get faster. But in that case, you might experience small lags (happens once per mesh) when you try to interact with the objects. For example, the first time you click on a mesh, the tool will have to build an internal data structure and lag a bit until it finishes. This happens once per mesh.

    Regarding the other issue, I have increased the minimum required version. Is it possible to switch to Unity 2018?
     
  6. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,905
    A video recording would be great. Thanks!
     
  7. gamebytom

    gamebytom

    Joined:
    Mar 13, 2017
    Posts:
    10
    Here is a video -you can see when the cubes overlap I can't always move them.

     
  8. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,905
    Ok. Thanks. I will look into this. Definitely looks like a bug.
     
  9. Handsome-Wisely

    Handsome-Wisely

    Joined:
    Mar 20, 2013
    Posts:
    102
    when i use at webgl, it is error like this. in editor ok!
    gizmose er.png
     
  10. jexmatex

    jexmatex

    Joined:
    Jun 23, 2016
    Posts:
    47
    Hello guy's is theres any way to handle multiple camera ?
    in my app i have two differents systems of camera and in the singleton i can only put one, hence i cant select nothing with the second cam wich is a problem :)

    any idea ?

    i have tried to duplicate the singleton but doesnt work either
     
  11. jexmatex

    jexmatex

    Joined:
    Jun 23, 2016
    Posts:
    47
    ok i have found my way differently i just have modified your TransformSpace.cs
    where by default there is

    // Local = 0,
    Local = 1,

    the one make's exacly what i need
     
  12. XGT08

    XGT08

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

    The gizmo transform space doesn't have anything to do with the camera you are using :) I mean if it works for you, then great, but if you plan on supporting multiple cameras, this is only possible if you use multiple viewports and you can find info about that here.

    Cheers,
    Andrew
     
  13. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,905
    Ok. So here is what's happening. This is not a bug in the plugin. What is happening there has to do with how you are selecting the objects. When you click on the gizmo, you also click on an object and your selection code will kick in and it will change the position of the gizmo. There may be other things happening. I don't know how your selection code works.

    But what you have to do is to make sure that objects only get selected if the gizmo is not hovered. You can check if a gizmo is hovered using the IsHovered property. So when you click on an object, check if the gizmo is hovered. If it is, don't select the object. More information about gizmo hover info can be found here.
     
  14. jexmatex

    jexmatex

    Joined:
    Jun 23, 2016
    Posts:
    47
    haha hello Octamodius, my second answer was the problem solved of my first page question regarding the default world or local settings
    i still have the probleme with my two camera

    Hello, i'm not sure to fully understand, by multiple camera rendering in different viewport you mean like more than one screen ?
    i only have two camera i swap with tab key,
     
  15. gamebytom

    gamebytom

    Joined:
    Mar 13, 2017
    Posts:
    10
    Thanks for looking into this - very much appreciated.
     
  16. zjm2333

    zjm2333

    Joined:
    Apr 20, 2016
    Posts:
    2
    Hi,
    Is this asset support for VR? I would like to use it for oculus. Thank you.
     
  17. XGT08

    XGT08

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

    No, VR is not supported.

    Cheers,
    Andrew
     
  18. zjm2333

    zjm2333

    Joined:
    Apr 20, 2016
    Posts:
    2
    Ok. Thank you.
     
  19. smartinetz

    smartinetz

    Joined:
    Dec 8, 2017
    Posts:
    49
    Hey ... as far as I can tell, RTG is looping thru ALL game objects in a scene in order to register them in it's sceneTree. Am I Correct?
    Is there a way to turn this feature off and register only certain objects to be handled by RTG? This would save us alot of extra GC overhead and cycle time.

    Regards
     
  20. XGT08

    XGT08

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

    What I can do is provide a function that will allow you to inform the scene to ignore certain root objects. What I mean is that you will have to have a root (or more) object in the scene that contains as the children the objects that should be ignored by RTG. Is this OK for you?

    Cheers,
    Andrew
     
  21. smartinetz

    smartinetz

    Joined:
    Dec 8, 2017
    Posts:
    49
    Hey,

    I think that could be exactly what I need. The Problem is, that I have dynamic objects (3D Models) loaded at runtime and that RTG is trying to go thru ALL sub-objects (which can be 1 or 9999+) after they are loaded. What I would like to accomplish now is to have RTG ignore ALL sub-objects of a specific gameobject after they are loaded into the scene. Do you get the idea?

    Regards
     
  22. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,905
    Yes, so for example, you could call a function such as:

    RTScene.Get.SetIgnoredRoot(myRoot);

    where myRoot is the object that holds all subobjects.

    Note: In this case, RTG will ignore those objects. For example, you may not be able to vertex snap to one of those objects with the move gizmo.
     
    smartinetz likes this.
  23. smartinetz

    smartinetz

    Joined:
    Dec 8, 2017
    Posts:
    49
    Vertex snapping is not needed because I don't even want to use any of the gizmos on those objects anyways.I just want to prevent RTG from constantly trying to register them.
     
  24. smartinetz

    smartinetz

    Joined:
    Dec 8, 2017
    Posts:
    49
    Do you have any idea how long you might need to implement this feature? No pressure though :p ;)
     
  25. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,905
    Well, you can call me stupid. The feature is already there :D

    Just call RTScene.Get.SetRootObjectIgnored(rootObject);

    I have another asset which uses a similar architecture and the impression was that it was only implemented in that asset. It turns out it's here too :)
     
    smartinetz likes this.
  26. smartinetz

    smartinetz

    Joined:
    Dec 8, 2017
    Posts:
    49
    Seems to work, spike(s) in profiler are gone. Thank you for that! :)
     
  27. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,905
    Ok. Great to hear that! Thanks for letting me know.
     
    smartinetz likes this.
  28. jexmatex

    jexmatex

    Joined:
    Jun 23, 2016
    Posts:
    47
    Hello,

    i have rework my project from scrach to work on 2019.2 and have a clean and optimisez project, what i dont understand is gizmo seem to work, object can move but gizmo are invisible, any idea for what appens

    thanks by advance ?
     
    XGT08 likes this.
  29. sxnorthrop

    sxnorthrop

    Joined:
    Sep 29, 2014
    Posts:
    43
    Hi,

    Just want to say right off the bat, this asset is amazing!

    Anyways, it seems like I'm unable to get the SetEnabled() functionality working (if I'm understanding what it should do). Calling SetEnabled() on an ObjectTransformGizmo seems to have no effect on its visibility. It simply detaches the gizmo from any objects it was controlling.

    Is there a way to modify the visibility of a gizmo and/or delete it?

    Here's what I've tried with no luck:
    Code (CSharp):
    1. public class GizmoTest : MonoBehaviour
    2. {
    3.     void Start()
    4.     {
    5.         var gizmo = RTGizmosEngine.Get.CreateObjectUniversalGizmo();
    6.         gizmo.SetEnabled(false);
    7.     }
    8. }
    Thanks!
     
  30. sxnorthrop

    sxnorthrop

    Joined:
    Sep 29, 2014
    Posts:
    43
    As a matter of fact, after doing a little bit more digging in the source, I've found out that calling the SetEnabled() method on the Gizmo type (under GizmoBehaviour.Gizmo) will actually visibly disable the gizmo from rendering to the gizmo camera.

    Also, it's probably wise to call SetEnabled(false/true) on the GizmoBehaviour as well since it will unhook it from other event handlers.

    Hope this helps someone else!

    Code (CSharp):
    1. public class Test : MonoBehaviour
    2. {
    3.     void Start()
    4.     {
    5.         var gizmo = RTGizmosEngine.Get.CreateObjectUniversalGizmo();
    6.         gizmo.SetEnabled(false); // <---- Unhooks changed events.
    7.         gizmo.Gizmo.SetEnabled(false); // <---- Stops it from rendering.
    8.     }
    9. }
     
    XGT08 likes this.
  31. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,905
    Yes, calling SetEnabled of the parent Gizmo is the way to go. You don't need to call SetEnabled on the ObjectTransformGizmo. You can think of the Gizmo class as Unity's GameObject. The ObjectTransformGizmo derives from GizmoBehaviour which is the equivalent of Unity's Monobheaviour in gizmo land. So disabling the parent gizmo will disable all attached behaviours.
     
    sxnorthrop likes this.
  32. XGT08

    XGT08

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

    Are you using SRP? This plugin does not support SRP.
     
  33. XGT08

    XGT08

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

    I've just released a new plugin with a new set of gizmos. The plugin is called Runtime Collider & Light Gizmos.
    It works great with Runtime Transform Gizmos and it gives you access to the following gizmos:
    • Box Collider3D;
    • Sphere Collider;
    • Capsule Collider3D;
    • Character Controller3D;
    • Directional Light (with direction snap);
    • Point Light;
    • Spot Light (with direction snap).
    Here is a short video in which I provide a quick overview of the plugin.
    Cheers,
    Andrew
     
  34. raisaleemcp

    raisaleemcp

    Joined:
    Feb 18, 2020
    Posts:
    17
    Hello,

    I want to know if its possible to set some kind of Gizmo offset rotation by keeping Vector3.Zero value for Transform and Rotation. Gizmo got visibility automatically adjusted by object current transform. I just want some kind of offset adjustment to all.

    Like for example,
    I have 3 different mesh objects. All transformed at Vector3.Zero value for Transform and Rotation. But I wanna have some custom gizmo rotation offset at Vector3.Zero with respect to shape difference. Just like we can set pivots for gizmo.
     
  35. XGT08

    XGT08

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

    I am not sure I understand what is needed. All I can say is that no offset of any kind can be applied to the gizmos. Any change in position or rotation is controlled by the gizmo space (global or local) and by the pivot point.
     
  36. raisaleemcp

    raisaleemcp

    Joined:
    Feb 18, 2020
    Posts:
    17
    I wanna rotate the gizmo local space. Like this cube is on Vector3.Zero transform. But I wanna adjust the gizmo initial rotation as which direction I wanna have to be my X,Y,Z as by the mesh shape. CW or CCW.
     

    Attached Files:

  37. XGT08

    XGT08

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

    This is not possible.
     
  38. raisaleemcp

    raisaleemcp

    Joined:
    Feb 18, 2020
    Posts:
    17
    Can I expect to have this in future updates?
     
  39. XGT08

    XGT08

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

    I don't think this feature will make it in future updates.

    However, there may be something you can do to achieve this. All gizmos have a Trasnform property.

    You could do something like this:
    Code (CSharp):
    1. moveGizmo.Gizmo.Transform.Rotation3D = desiredRotation;
    2.  
    Where desiredRotation is a Quaternion. Now I'm not sure exactly how you would calculate this quaternion. It depends. Probably you could try something like this:

    Code (CSharp):
    1. // Retrieve the current gizmo rotation
    2. Quaternion desiredRotation = moveGizmo.Transform.Rotation3D;
    3.  
    4. // From the current rotation, rotate 180 degrees around the target object's local up vector.
    5. desiredRotation  = Quaternion.AngleAxis(180.0f, targetObject.transform.up) * desiredRotation ;
    This could would have to be called each time you change the target object. Maybe you should give this a try and let me know how it went.
     
  40. raisaleemcp

    raisaleemcp

    Joined:
    Feb 18, 2020
    Posts:
    17
    Thanks. It adjusted the rotation of Gizmo as what I wanted. But when I interact with gizmo axes, it resets to original moveGizmo.Gizmo.Transform.Rotation3D.
     
  41. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,905
    I see. I'm sorry to hear it's not working. I will check to see if there is a simple solution for this.
    May I ask, why is this feature needed? Why is the rotation of the gizmo important?
     
  42. raisaleemcp

    raisaleemcp

    Joined:
    Feb 18, 2020
    Posts:
    17
    Its important due to the shape difference of meshes. Need to manually set gizmo rotation with respect to proper facing alignment.
     
  43. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,905
    I honestly fail to see the importance of such a feature. You already can adjust the space of the gizmos: global and local. This should be enough. Maybe this is what you are looking for.
     
  44. raisaleemcp

    raisaleemcp

    Joined:
    Feb 18, 2020
    Posts:
    17
    There are multiple meshes with shaped like rocks as example(means all are unique). Every Shape has different side as Face. But shapes are all positioned at export level side by side accordingly. My goal is to adjust the gizmo rotation xyz-axis with respect to facing direction after setting gizmo space to local.

    I can share more details by email. But this is important for me because my end users are not technical who know what is gizmo.
     
  45. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,905
    A gizmo is a very simple concept. And it is very easy to use. I still fail to understand why the gizmo needs to be rotated. No matter how it is rotated, it will always sit on top of the object and the handles can be used to move it. It' really simple. It's also how Unity does it.
     
  46. raisaleemcp

    raisaleemcp

    Joined:
    Feb 18, 2020
    Posts:
    17
    I completely understand the concept. I just need for my project. Its very simple thing to get a kind of offset rotation function to change the default behavior of gizmos at Vector3.Zero. I can explain more over email. But I need that.

    I just wanna adjust/add some eular rotation to local space coordinates.
     
    Last edited: Feb 29, 2020
  47. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,905
    Can you show me a screenshot of the models that you are working with?
     
  48. raisaleemcp

    raisaleemcp

    Joined:
    Feb 18, 2020
    Posts:
    17
    Yes by email for sure.
     
  49. raisaleemcp

    raisaleemcp

    Joined:
    Feb 18, 2020
    Posts:
    17
  50. carla_sidi

    carla_sidi

    Joined:
    Dec 9, 2019
    Posts:
    8
    Hi there,
    I`m wondering if this asset works with UWP (Windows Universal Platform) games?:D
    Please let me know.:)

    Best regards,
    Carla
     
    Last edited: Mar 30, 2020