Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Runtime Level Design

Discussion in 'Assets and Asset Store' started by XGT08, Jan 17, 2016.

  1. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    Thanks. Do you know if you can lock translate direction so that one can only move an item in the x or z axis and not on the y axis? I have read the documentation but nothing has jumped out at me to tell me this will work. :)
     
  2. XGT08

    XGT08

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

    Thanks for the kind words!

    Yes, indeed for large meshes, this can be a very slow process. This is why I implemented the Use Unity Colliders option so that you can use unity colliders instead and in that case the tree is not used anymore. But I guess mesh colliders suffer from the same problem when you are dealing with large meshes. So you would have to use box/sphere/capsule colliders instead.

    If the Use Unity Colliders solution is not something that helps you, than I can implement a mask as a hash set. You will have to populate this mask somewhere at initialization time. I can implement an event, something like OnPostAppInit. Would this be OK with you?

    Cheers,
    Andrew
     
  3. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    Hi @Teila ,

    Yes you can do that. You can take a look inside the doc at chapter 6.2.3. This can only be done via scripting only though.
    There is one thing to note. For example, let's say that you locked (masked) the X axis of the move gizmo so that it doesn't affect a certain object. When dragging the X axis, the gizmo will still move along with the mouse, but the object will not be affected. This is because there may be more than one object selected and not all of them have the X axis locked.

    You can also hide different axes for each type of gizmo so that they don't show up and when that happens you can't interact with them either. You can do this using the Show X Axis, Show Y Axis, Show Z Axis properties in the gizmo inspector.

    Let me know if this helps.

    Cheers,
    Andrew
     
    Teila likes this.
  4. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    Hi again @Teila,

    For some reason I missed your initial post, but if I understood your question correctly, this is exactly the kind of thing this plugin was developed for. To move, rotate and scale objects inside the game. Hope this helps!

    And welcome to the forum! :)
     
    Teila likes this.
  5. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    Helps a lot! Thank you. That is perfect. Looks like I will buy another one of your assets. :)
     
  6. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    @Teila

    :) That is great news! Thanks! Don't forget to contact me for any inquiries you might have.

    Enjoy!
     
  7. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    @Teila

    Please believe me that I do not mean to push, but I thought I should let you know that today I have submitted an update and the price will go up to 30$. Just a hint :)
     
    Teila likes this.
  8. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    No worries. I am sure it is worth $30.
     
  9. ashmatheson_BBI

    ashmatheson_BBI

    Joined:
    Aug 17, 2016
    Posts:
    8
    Yeah, that makes sense. I've already got a hack in place right now that functionally does that. So no rush.

    It is, indeed.
     
    Teila likes this.
  10. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    Thanks guys :)

    @ashmatheson_BBI
    Ok. Great! I will let you know when it's ready.
     
  11. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    @ashmatheson_BBI
    Hi there. I wanted to let you know that I haven't forgotten about you :), but I haven't managed to implement the functionality yet. I believe I can deliver a working solution tomorrow. Thanks for understanding :)
     
  12. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    @ashmatheson_BBI
    Hi there. Just wanted to let you know the changes are ready. Please send me a PM and I will send you the updated package.
     
  13. GXMark

    GXMark

    Joined:
    Oct 13, 2012
    Posts:
    514
    Grid Height
    =========

    Firstly, thank you for adding my volume scale tool idea. Nice to know it was compatible with your future of where this gizmo tool is heading.

    I also have a requirement in my game which needs the grid to be height adjusted. Although it nice to have the ability to move objects on a terrain this will only partially solve a wider build construction problem requiring grid precision. Currently i don't think this is possible with grid set to world space Y=0. Having the ability to adjust the grids height has the advantage that you can set it to different levels to snap geometry on to. For example, if you were building a castle with different levels like basement, ground floor, second floor etc. For this feature to be really useful, the height of the grid would also have to be snapping to the existing grids spacing to maintain XYZ spacing proportions. (This in fact is another feature that's missing as offset snapping does not find the nearest alignment point on the grid and relies on vertex snapping which for more complex mesh is not so easy to use.

    Having the ability also to vertex snap the bounding selection box to the grid would be another feature very useful.

    The grid material would also need to be visible from above and beneath the players camera as you may be looking upwards to the grid when snapping onto it.

    For run time level geometry construction on unity / mesh based terrains these additions are essential for ease of use.

    Mark
     
    Last edited: Feb 17, 2017
  14. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    Hi there @GXMark

    Thanks for your sugestions! Here's what I can do:
    1. change the grid Y offset via shortcut keys (maybe in combination with the mouse scroll wheel - still have to decide on that);
    2. the step along Y will be configurable. I do not wish to impose a restriction on the value of Y. So you can set this tep value to whatever you wish and then the grid will jump up and down based on the value specified here;
    3. snapping for bounding box (there is a bit of trouble with this, but I am pretty certain it can be done);
    Regarding the grid material, I am not sure what you mean? Isn't this already available? The grid should be visible when looking from above or below.

    Best regards,
    Andrew
     
  15. GXMark

    GXMark

    Joined:
    Oct 13, 2012
    Posts:
    514
    Yes confirmed the grid material is fine i just checked it.

    So for example

    Key + Mouse Scroll (Free Height Movement)

    CTRL + Key + Mouse Scroll (Snapping Offset Height Movement)
     
  16. GXMark

    GXMark

    Joined:
    Oct 13, 2012
    Posts:
    514
    Another aspect to the volume scale tool you may consider is the diagonal volume scaling. This would fully complete the tools features.

    This would require handles on the corners as well to diagonally scale the bounding box and hence the object inside it.
     
  17. ashmatheson_BBI

    ashmatheson_BBI

    Joined:
    Aug 17, 2016
    Posts:
    8
    Excellent. Sorry for the delay in getting back to you - been in the midst of some milestones. I'll see about integrating the changes shortly!
     
  18. XGT08

    XGT08

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

    No problem! The update has bee released on the store in the meantime, so if you wish, you can get it from there.

    All the best,
    Andrew
     
  19. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    @GXMark
    Hi there,

    I have implemented the features you requested. So here's the list of the things that have been added:
    1. it is now possible to adjust the height of the grid using the mouse scroll wheel. By default, the SPACE key is used to activate this behaviour. Holding down CTRL + SPACE will adjust the height via a defined step value. Here is an image with the Inspector settings:
    GridSettings.png

    2. you can now perform box to box snapping with the move gizmo. This works in pretty much the same way as vertex snapping with the exception that the box points are used for snapping. The default shortcut key is B, but it cahn be changed from the gizmo's inspector as shown in the next image:
    BoxSnapping.png

    You can send me a PM and I will send you the updated package.

    Best Regards,
    Andrew
     
  20. GXMark

    GXMark

    Joined:
    Oct 13, 2012
    Posts:
    514
    I would like to thank you for these updates. I myself and many other followers of this awesome transform product will enjoy these updates and the potential power they give to construction at run-time.

    While using the event system [ObjectSelectionChangedEventArgs args] would you be able to include an additional argument for an object(s) already selected. The reason for needing this is that i am integrating a face selection system which requires the need to detect the same game object for tri index raycasting. As i would much prefer to do this from this event callback method without using the update() mouse down strategy :)

    Again many thanks
    Mark
     
  21. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    Hi Mark,

    I have sent you an e-mail with the updated package and more info.

    Thanks,
    Andrew
     
  22. ekergraphics

    ekergraphics

    Joined:
    Feb 22, 2017
    Posts:
    257
    Hello!

    I have requirements for a new project and wonder if we should write our own script or use this:

    * Ability to move objects across a surface (transform constrained to the side of a box collider is probably easiest).
    * Ability to rotate objects normal to that surface (in terms of this plugin, hide individual gizmo options seems closest).
    * Ability to constrain rotation (that is, set a pivot point in editor, then only allow runtime rotation between certain angles, essentially this is a door function, but I wonder if it can be handled by the same script).
    * Ability to skin controls (can the meshes in this plugin be replaced with my own content easily, preferrably the inspector?).

    Oh, and this will all be done in SteamVR, using their interactivity module for all interactions (hence the need for larger controls that can be easily individually highlighted).
     
  23. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    Hi there!

    Thank you for contacting me.

    The first 2 points are already available in the package, if I managed to understand correctly.
    However, as for the rest I am afraid the package does not contain these features. Also, the package was never intended to be used with VR.

    Hope this helps.

    Best Regards,
    Andrew
     
  24. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    Hey everybody,

    Runtime Transform Gizmos is now 20% OFF on MADNESS SALE!
    RTTGizmos.png

    Don't forget to check out the presentation video here.

    And for any questions you might have, drop a buzz ;)

    Best regards,
    Andrew
     
    SunnySunshine likes this.
  25. thrmotta

    thrmotta

    Joined:
    May 27, 2014
    Posts:
    32
    Hello,

    Is it possible to move the gizmo without moving the selected object?

    On my application, all translation and rotation actions have to follow a set of rules, so there are specific events to handle that. Following your documentation, I implemented some callbacks to fill EditorGizmoSystem.Instance.TranslationGizmo.GizmoDragUpdate and alikes, where the position, for instance, sent to be checked by those rules is the gizmo position.

    The problem is that all translations and rotations are done twice, first by the callback mentioned earlier and then by OnInputDeviceMoved() method, which is also responsible for transforming the gizmo. After reading the code, I realized that all translations are done by TranslateControlledObjects() method, and after commenting it out, the movements were done correctly.

    I tried to check if this could be solved by setting some masks in order to prevent TranslateControlledObjects from entering its first condition, but that also prevented the gizmo from working properly.

    Is there a better way of transforming the gizmo while also preventing the selected object from transforming?
     
  26. XGT08

    XGT08

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

    Thanks for contacting me!

    Unfortunately there is not standard way to do that. I never envisioned this scenario to be perfectly honest :)
    Your approach to comment out the TranslateControlledObjects method is very accurate and if I were to implement support for such behaviour I would probably do the same thing but using a boolean flag. So if you wish I could implement a boolean flag which allows you to toggle this on/off.

    Would this work for you? If not, can you give me more details as to what you are trying to achieve?

    Thanks,
    Andrew
     
  27. SunnySunshine

    SunnySunshine

    Joined:
    May 18, 2009
    Posts:
    974
    Great work on all the updates and improvements. :thumbsup:

    I have a request for the IRTEditorEventListener interface. I think it would be great if the gizmo system informed the interface when it's about to alter the object, and when alteration is finished. I.e., something like this:

    Code (CSharp):
    1. // Invoked before any transform values have changed.
    2. void OnBeginAlterationyByTransformGizmo(Gizmo gizmo);
    3.  
    4. // Invoked when manipulation finished, i.e. drag stopped/mouse button released.
    5. void OnEndAlterationByTransformGizmo(Gizmo gizmo);
    This would be very useful for us with our custom undo/redo implementation.
     
    Last edited: Apr 27, 2017
  28. XGT08

    XGT08

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

    There is already something similar described in Doc chapter 6.2. The only difference is that the event handlers need to be registered for each gizmo, so the event doesn't belong to the IRTEditorEventListener interface.

    Example:
    EditorGizmoSystem.Instance.RotationGizmo.GizmoDragStart += EventHandler;
    ... and so on for other event handlers and gizmos.

    Do you think this would work for you?
     
    SunnySunshine likes this.
  29. DSpieldenner

    DSpieldenner

    Joined:
    May 12, 2017
    Posts:
    1
    Hi! I use your plugin in a scene that makes heavy use of the Unity event system, mostly OnPointerClick events and the like for scene and gui interaction.
    Unfortunately this kind of causes trouble when moving objects around using transform gizmos, as these events are also called at the beginning and/or end of dragging the gizmo around.

    Could you recommend a way or a point to start to route events in such a way that I can use transform gizmos without triggering mouse events on my scene?

    Thanks a lot in advance :)
    Daniel
     
  30. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    Hi Daniel,

    Thanks for contacting me.

    I am not sure I understand the problem exactly so I am going to ask for more info from your side :) Maybe just give me a concrete example of what you are trying to do and what problems you encounter. If Unity decides to fire an event, I'm afraid that's totally out of my hands, but I don't see how this can cause problems. So please give me an example of what is actually happenning.

    There might be some info that can help you out. For example, You can register to gizmo drag start and end events like this:

    EditorGizmoSystem.RotationGizmo.GizmoDragStart += MyDragStartHandler;

    This is an example for the rotation gizmo. Same applies to translation and scale gizmos.
    Also, the gizmo base class has a IsTransformingObjects method which informs you if the gizmo is being dragged to trasnform objects. Example: EditorGizmoSystem.TranslationGizmo.IsTransformingObjects().

    Maybe you can use these to solve the problem. But I will wait for more info from you and then maybe I will be able to find a concrete solution to your problem.

    Thanks,
    Andrew
     
  31. wherget

    wherget

    Joined:
    Oct 4, 2016
    Posts:
    4
    Hi Andrew,
    I'm working with Daniel on the same project, and now have had some time to mull over our issues, and came up with a solution (albeit one that needed a tiny modification of the Gizmo class).

    Let me first try rephrasing the issue: Input events are delivered to the Gizmo system as well as Behaviors that use the EventSystem interfaces (e.g. IPointerClickHandler). This lead to the issue that when you start (and finish) dragging a gizmo with the cursor on top of an Object with an EventSystem driven behavior, it would call that behaviors' Interface callbacks. EventSystem looks for event targets using Raycasters (PhysicsRaycaster, GraphicsRaycaster) and delivers events to the "most appropriate" target. Since it doesn't know about the Gizmos, it still thinks the geometry/UI at the same cursor position than the Gizmo is a valid target, and delivers the events.

    To integrate well with EventSystem-driven elements, the EventSystem needs to be aware of the Gizmo's "geometry" (which is a bit hard, since the Gizmos don't actually have geometry, but are drawn separately). Therefore, I devised the following "hack". Maybe you have a better idea on how to accomplish this.

    I added the following function to Gizmo.cs
    Code (CSharp):
    1. public bool IsHovered() {
    2.     return DetectHoveredComponents(false);
    3. }
    And the following class that uses it (attached to the EditorGizmoSystem object):
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using RTEditor;
    5. using UnityEngine.EventSystems;
    6.  
    7. public class GizmoRaycaster : BaseRaycaster {
    8.  
    9.     private EditorGizmoSystem gizmoSystem;
    10.  
    11.     protected void Start() {
    12.         gizmoSystem = GetComponent<EditorGizmoSystem>();
    13.     }
    14.  
    15.     #region implemented abstract members of BaseRaycaster
    16.  
    17.     public override Camera eventCamera {
    18.         get {
    19.             return EditorCamera.Instance.Camera;
    20.         }
    21.     }
    22.  
    23.     public override void Raycast(PointerEventData eventData, List<RaycastResult> resultAppendList) {
    24.         var activeGizmo = gizmoSystem.ActiveGizmo;
    25.         if (activeGizmo.IsHovered())
    26.         {
    27.             resultAppendList.Add(new RaycastResult {
    28.                 gameObject = activeGizmo.gameObject,
    29.                 module = this,
    30.                 distance = 0, // treat gizmos as frontmost objects
    31.                 index = resultAppendList.Count
    32.             });
    33.         }
    34.     }
    35.  
    36.     #endregion
    37. }
    Maybe you can add public IsHovered in a future release, or you have a better interface for figuring out if the cursor is over a gizmo already available which I just didn't see at the time.

    HTH,
    Wolfgang
     
  32. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    Hi there Wolfgang,

    Thanks a lot for reaching out to me!

    Now I have to be 100% honest with you and say that I haven't worked with the EventSystem interfaces before (I will have to play around with them a bit to have a better understanding of the whole thing), but I do understand what the problem is now.

    I see absolutely nothing wrong with the solution you provided. It's probably a lot better than anything I could have come up with at the moment :D

    The only thing that I would like to mention is the IsHovered function. Your implementation is perfectly fine, however, in my code I can see that all gizmos have a IsReadyForObjectManipulation function. I would advise you to use this instead. And yes, you can rename it to IsHovered. I honestly do not know why I gave it such a long and innacurate name :) Looking at my own implementation, there are certain things which I do not remember why they are the way they are, but one important aspect is that it also handles the snapping cases (e.g. vertex snapping for the move gizmo) which the DetectHoveredComponents doesn't take into account.

    So if you want to check if a gizmo is hovered, use: IsReadyForObjectManipulation. There is also another function which allows you to check if the gizmo is being dragged. This is called IsTransformingObjects. Again, poor choice of words. A better name for this is IsDragging.

    IsReadyForObjectManipulation will return true regardless of whether the gizmo is being dragged or not. So if you only want to know if the gizmo is hovered, but not draging you would have to do:

    if(gizmo.IsReadyForObjectManipulation() && !gizmo.IsTransformingObjects) {}

    Of course, I would rename these 2 to IsHovered and IsDragging. And I will also do the same on my side for the next update.

    I hope this helps, but please let me know if you need any more info.

    Best regards,
    Andrew
     
  33. DanielSnd

    DanielSnd

    Joined:
    Sep 4, 2013
    Posts:
    382
    Hi Andrew,

    I'm wondering if there is a way for the cool snapping to surface that happens with Spacebar + Click on the center square to ignore objects that are on a layer that's not selectable. Tried to look for the code that handles that but couldn't find it ;o
     
  34. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    Hi @DanielSnd

    Thanks for contacting me. I will send you the updated package ASAP.
     
  35. WalterEspinar

    WalterEspinar

    Joined:
    Aug 23, 2011
    Posts:
    83
    Hi, undo redo system support object deleting?
     
  36. XGT08

    XGT08

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

    The package does not currently support object deleting. This should be available in the next update.
     
  37. DanielSnd

    DanielSnd

    Joined:
    Sep 4, 2013
    Posts:
    382
    You can make it support it, the undo-redo is extensible :D In my level editor I made the adding/deleting work with undo/redo and also made a little unity-like inspector that you can type values in that also works with undo/redo. This package is awesome!

    This is what I did for the delete undo/redo: https://pastebin.com/kS7hj6TU

    I have a list of objects that work with my level editor and each of them have a unique ID, so I make it use the ID of the object to get the prefab to spawn it back into the scene then I reinsert its values to it.
     
    XGT08 likes this.
  38. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    @DanielSnd
    Hi Daniel,

    Yap. As you said, the Undo/Redo system is extensible and one can easily add more actions to it.

    Support for delete with Undo/Redo has been implemented and will be available in the next version. In my case, I am disabling the deleted objects and re-enable on Undo and disable again on Redo etc. When the action goes out of scope, the objects are destroyed and disappear from the scene. To be honest, I like your prefab approach so much better, but I don't know if I can make it work since I can not make any assumptions about the prefabs which are being used.

    It's very nice to hear you are enjoying the package :) Thanks!
    Andrew
     
  39. mabakay

    mabakay

    Joined:
    Jun 10, 2016
    Posts:
    20
    Prefabs will certainly be not a generic solution. You can work in editor (e.g., you work with objects you have import from obj files).
     
  40. jeremedia

    jeremedia

    Joined:
    Apr 21, 2015
    Posts:
    63
    @wherget_dfki

    Hi Wolfgang,

    I just tracked down how RTG looks for and ignores clicks over objects that respond to EventSystem raycasts: WereAnyUIElementsHovered() in the EditorObjectSelection class.The intention appears to be ignore clicks on UI elements, but this check also disables interactions with scene mesh gameobjects that use EventSystem for messaging. Do you disable this check in your project to integrate RTG, in addition to adding the code you've shared here?
     
  41. XGT08

    XGT08

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

    Indeed the 'WereAnyUIElementsHovered' takes care of the GUI interaction. I had no idea that you could use mesh objects in conjunction with the EventSystem. I believe what would work in this case is to filter the list of RaycastResult instances to include only game objects that have a RectTransform component. I hope I am not mistaken, but I think that will allow you to remove all game objects which are not UI elements.

    Cheers,
    Andrew
     
  42. jeremedia

    jeremedia

    Joined:
    Apr 21, 2015
    Posts:
    63
    Thanks Andrew, I'll implement that filtering. I started using Unity around version 5.1, and the EventSystem is definitely positioned as the recommended technique for managing user input for all on-screen objects, both canvas and mesh. It works great, and would awesome to have implemented in RTG.
     
  43. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    3,850
    Very comprehensive system. However I am trying to do something simple and not have to learn the entire system whilst I have a dozen other things going on. I want to turn on the gizmo system when entering a mode, select one game object at a time on one specific layer, get a reference to it from the gizmo system or pass a gameObject to the system i have already determined by the click and allow it to be translated and rotated, do so and then exit that mode and turn off the system..I want to forego all the Interface gobbledygook as that is just a mess to manage IMHO...if possible:) It becomes a black box of mysterious goings on.
     
  44. XGT08

    XGT08

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

    I am honestly trying to understand what you are trying to accomplish, but I am afraid your explanation is a bigger "gobbledygook" than the interface itself which may not be ideal, but I don't really think it's as complicated as you make out to be.

    So I am going to break it down into pieces and try to understand and then if I didn't get it right, please correct me.
    1. "I want to turn on the gizmo system when entering a mode" - what is the mode you are trying to enter and what do you mean by turning on the gizmo system? The gizmo system is already turned on. If you mean you are trying to turn it off, you can do that using the Q key. The Q key allows you to turn the gizmos on/off as needed. This allows you to only select objects without manipulating them.
    2."select one game object at a time on one specific layer, get a reference to it from the gizmo system" - The selection system can not be constrained to select only a single object at a time. But you can specify the layers which are selectable in the EditorObjectSelection Inspector (there is a SelectableLayers section which allows you to check/uncheck individial layers). To 'get a reference to it from the gizmo system' you can use EditorObjectSelection.Instance.SelectedGameObjects which will return the currently selected objects. These are the objects controlled by the gizmos. Again, the system can not be constrained to only one object.
    3."or pass a gameObject to the system i have already determined by the click and allow it to be translated and rotated" - by this I understand that you would like to manually select objects. Please see doc chapter 6.5.2 for info on how to do this.
    4."do so and then exit that mode and turn off the system" - I am lost here. :)

    Please describe in clear steps what you are trying to accomplish (an example scenario) and I will be glad to do whatever I can to help you out.

    Best Regards,
    Andrew
     
  45. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    3,850
    It is complicated. It is in a state that assumes everything has to be done and then filter it from there. I got this to simply implement a rotate and translate of a single item when it is pinned to the model. Hence I enter Pinning Mode, turn on a gizmo system..[yours or mine i may put together that i can control simply and give that control to others who do not have the code chops to implement], allow the user to translate and rotate the pinned object then exit Pinning Mode so that the gizmo is not used. I can easily activate and deactivate the system and am controlling various parts of it in code already.

    The pdf instructions appear to inform me that every object i interact with has to have a script on it. This is totally unfeasible in the system i use if that is the case. I am also up to my neck in a hot keys system here so the advice to use hot keys is unusable. Hence my gobbledygook of a question. I read the docs..or skimmed them as they are dense and most of it had nothing to do with what i wanted or was not named with an intuitive name. I simply want to control the translation and rotation of a gameObject that is previously selected prior to activating your gizmo system by passing that referenced gameObject to your system without attaching a script to it. Can i do this or not?

    To be clear the steps would be...
    1.I have clicked a GameObject and have a reference I can pass.
    2.I now activate the Gizmo system.
    3.I pass the reference to the previously clicked GameObject to your Gizmo system.
    4.The Gizmo is used to translate and rotate the GameObject which reference was passed to it.
    5.User clicks a button to store the new position and rotation which also deactivates the Gizmo system.

    Out of the above steps the only code I am missing is step 3, which of course makes step 4 possible and I have step 5 in place and working already as well.
     
  46. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    @ippdev

    "The pdf instructions appear to inform me that every object i interact with has to have a script on it. This is totally unfeasible in the system i use if that is the case." - Please point me to the line in the documentation file where I state that you have to have a script attached to a game object in order to interact with it. I assume you are talking about the IRTEditorEventListener interface which can be implemented by a Monobehaviour which you can then attach to a game object IF you wish to listen to different events. Nowhere do I state that this script HAS to be attached to objects to be able to interact with them. You said yourself that you skimmed through the doc file and maybe that is the problem. Also, please be kind enough and specify which titles are not intuitively named so that I can go ahead and modify them accordingly.

    Regarding the steps you mentioned. What I see there is a simple, regular everyday use-case of the package. You click on an object, the gizmo appears and then you can move/rotate/scale (depending on what gizmo is active).

    So, to summarize, steps 1, 2, 3 and 4 from my perspective are already taken care of unless there is something that I am missing. The only somewhat tricky part is the 5th item and here's how you can take care of that:
    User pressed button handler:
    1. Retrieve the selected object by calling EditorObjectSelection.Instance.SelectedGameObjects. This will return a list of all selected objects. Again, it's a list because multiple objects can be selected. EDIT: As I realize now, this returns a HashSet of GameObject instances. This can be inconvenient indeed, and this can be modified easily to return a list instead.
    2. Store position/rotation/scale as needed;
    3. Here you can either call EditorObjectSelection.Instance.ClearSelection (chapter 6.5.2). This will deselect all objects and in turn deactivate the gizmos. Or you can just call EditorGizmoSystem.Instance.TurnOffGizmos(). But in this case you would have to manually activate the gizmos again by doing EditorGizmoSystem.Instance.ActiveGizmoType = GizmoType.####;

    This last step is indeed a bit more tricky and could do with some rework. If you believe that what I have said thus far will help, let me know so we can work out that last bit (point number 3 I wrote above). If not, then I am afraid I will not be able to help you out in which case I am very sorry. You can send me a PM or e-mail with the invoice number and I will arrange for a refund.

    Andrew
     
  47. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    3,850
    Howdy pal. I am not some casual gamer. but neither am I a MicroSoft Certified Engineer, though am quite familiar with how Unity handles C# components and most variable types. I am up against hard deadlines for the largest architecture firm in the world. I do not have time to read all of your docs and have spent three hours already going over it to discern where I can glean the specifics I need if this system is to be useful to me in the short timeframe i have. The pdf wording is not entirely clear to my sense of the English language and technical jargon as it leaves some ambiguities open in a few cases of parsing it. So your snark is unwarranted IMHO. As per your comments. I have sometimes 20k objects in the scene, none of whose data is known prior to it loading. Accessing a List<GameObject> SelectedGameObjects; is simple enough and i would never have had to ask a question. It is part of the Unity paradigm. I then pass or extract the reference to the GameObject to or from the List<> and voila. However I don't have clue one how to access your internal Hash Set to extract or take action upon what i need to do.
     
  48. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    @ippdev
    "Howdy pal. I am not some casual gamer. but neither am I a MicroSoft Certified Engineer" - Nobody said you were and neither am I.

    "I am up against hard deadlines for the largest architecture firm in the world. I do not have time to read all of your docs and have spent three hours already going over it to discern where I can glean the specifics I need if this system is to be useful to me in the short timeframe i have" - I can definitely understand your situation. However, it is not my fault. I can not make the documentation shorter because some poeple don't have the time to read it. If I would do that, other people would complain that the documentation is not comprehensive enough. And I don't understand why you didn't contact me earlier instead of spending 3 hours searching for what you were looking for. All you had to say was "I don't have clue one how to access your internal Hash Set to extract or take action upon what i need to do" and that would have given me a chance to reply as I did in the next paragraph.

    "However I don't have clue one how to access your internal Hash Set to extract or take action upon what i need to do." - you could make a property inside the EditorObjectSelection class something liket SelectedObjects_Internal that returns a direct reference to the _selectedObjects hash set. However, I don't think that would help since it basicly means that you can modify this collection at your own will and I don't know what the implications of that are. I think what you are looking for is a gizmo API which works independently of selection, cameras, Undo/Redo etc. If that is the case, I'm afraid I can not help.

    Also, my so called 'snark' is due to the way you approached me in the first place. Not only was it hard for me to understand what was it that you wanted, but the ending was quite annoying for me to be honest. Trying to approach the publisher with a better attitude might be more helpful for you in the future.
     
  49. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    3,850
    What a load of crap and prevaricating hogwash if you will excuse my bluntness.. Nobody asked you to do that for that particular reason. Every useful asset I have bought..and I own a few hundred and worked with dozens more as a freelancer over 8 years... had a simple quick setup and you could dig in later to get more in depth. The idea of course being to save the developer time..not to learn an entire API for the basics. So, in essence I have spent five hours with your asset only to be told it cannot do the most simple of things and i should shove it. Right-o pal. Got it. My sincerest apologies for rocking your boat and trying to come to grips with getting this to do something it cannot. Replace a hash set with a list to pass a selected game object for actioning by your asset. Seems so bloody simple till one is informed of limitations. .
     
  50. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    Hey, listen up!

    The next time you want help, clearly specify what the hell is it that you really want. I am not going to waste my time trying to help a genius who spent 3 hours trying to find something in a documentation but at the same time is also complaining they're on a tight schedule. If I were in your place, after spending around 10 to 15 minutes and not being able to find what the hell it was that I was looking for, I would have contacted the developer and told him: "Listen dude, I am currently on a tight schedule, I basicly need to do this and I can not find any info on it. Can you help me out?" Instead, you wrote a mess of an explanation and some annoying stuff at the end and now you expect me to help you out because you work for the largest architecture firm and you're on a tight schedule? Nope. Not going to do it. You're on your own.

    To be honest, I still have no idea what your problem is. From your second reply it really seemed to me like you need to select an object, transform it and then press a button to record the position and turn off the gizmos. I already told you how you can do that and I was willing to elaborate on the last point. Then you told me that you basicly need to know how to access the internal hash set which holds the selected objects and I told you.

    The package can be up an running in no time. You go to Tools->Runtime Transform Gizmos->Initialize and that's it. You can select object(s) and transform them with the gizmos. At an API level you can register to gizmo drag events and selection events so that you can get the necessary flexibility to extend your application to suit your needs. Oh, so you found something that you claim is missing? I've got some news for you: it's not the first time. There have been other people in the past approaching me about stuff that could be better or added and I listened to them. But I guess they weren't on a tight schedule and they knew how to ask a question.

    So just to be clear, you will receive no support from me.