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

ProSurfaceSnap

Discussion in 'Assets and Asset Store' started by XGT08, Oct 4, 2016.

  1. XGT08

    XGT08

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

    I would like to introduce ProSurfaceSnap. A super handy plugin which allows you snap objects to terrain and mesh surfaces. Incredibly handy when you need to decorate your 3D worlds with props. Feel free to check out the videos below to get a better feel for how the plugin works.

    Presentation video:


    Quick Intro:


    Surface Settings:


    Per Layer Settings:


    Hotkey Customization:


    Cheers,
    Andrew
     
    Last edited: Apr 11, 2018
  2. SarfaraazAlladin

    SarfaraazAlladin

    Joined:
    Dec 20, 2013
    Posts:
    280
    Cool stuff! Looks dead useful.
     
    XGT08 likes this.
  3. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    Thanks! I'm glad you like it!
     
  4. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    @XGT08 ,

    Just bought this asset. V helpful. What would be great would be if you could hit say S whilst holding down SPACE and the camera snaps to a preset view angle on the object you're placing too?
     
  5. XGT08

    XGT08

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

    Thanks! Glad you like it!

    I have tried manipulating the scene view camera in another package of mine and I had no success :). So I can't promise anything, but I will try.

    Just to make sure I understood correctly, you would like the camera to focus on an object from a speciffic angle? Do you think you could me give more details?

    Thanks,
    Andrew
     
  6. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    I was just imagining if you dropped a small object to a large terrain then easily zooming the camera close to that object and pointing at it?
     
  7. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    Well, I believe the F key works pretty well in this case. After you drop the object in the scene, pressing the F key will cause the camera to focus on it. But maybe I misunderstood :)
     
  8. cubrman

    cubrman

    Joined:
    Jun 18, 2016
    Posts:
    409
    I would really love to see u go all the way with this tool and make a mirror of blender's functionality. From the videos i've seen you currently lack these things:

    - Gizmo line from the pivot to the mouse pointer - VERY usefull when scaling/rotating.
    - Toggle move/rotate/scale mode with a key press (instead of activating on key hold).
    - Non-uniform scale with a hotkey control.
    - Mouse positioning matters, when entering scale mode.
    - I assume rotation axis can be changed with a hotkey, if not - it should be.

    Do check blender and see how things work there - it's the best manipulation solution out there.

    One thing I also noticed: when placing grass (the last object) it started positioning it on other grass meshes. In a crouded scene that can be a problem. Did u think about ways of solving it?
     
  9. XGT08

    XGT08

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

    Thanks a lot for your suggestions!

    So let's see:
    1. Gizmo line from pivot - will be done and will be available in the next update;
    2. Toggle move/rotate/scale with key press - I will think about this. I am sure some people would prefer to have it that way, but I believe it is a matter of preference. I may be wrong, but to me for example, holding down a key to scale/rotate and then release the key to stop seems to click very well :). Again, this is just me, and I haven't built this plugin for myself so I promise I will think about this ;)
    3. Non-uniform scale with hotkey - the only way I could think about this is to have a button for each axis (X, Y and Z) and when the button is pressed, adjust the scale by a certain amount. Probably not going to make it into the tool for quite a while. It takes 3 hotkeys which I would rather use for other future operations that might be more important. The reason I am saying this is because I built this plugin with prop placement in mind and to me non-uniform scaling is an extremely rare thing when it comes to that. So noted, but won't be in for now;
    4. Mouse positioning matters, when entering scale mode - I am not sure I understand. I will check and see.
    5. I assume rotation axis can be changed with a hotkey - it can't, but yes it can be done and it will be available in the next update.

    Your last point about crowded areas is perfectly valid and I have thought of it myself, I just do not know exactly how this can be solved. I imagine some form of masking could be done per layer or prefab or simply allowing the user to select objects and adding them to a mask. But yes, I realize this is very important. When I come up with a solution that I feel comfortable with, I will definitely implement it.

    EDIT: I forgot to mention there is already a small update pending review so the next update will not include any of these changes. The one that follows will.

    Thanks again,
    Andrew
     
    Last edited: Apr 23, 2017
  10. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    @XGT08 ,

    Could you do some to point a camera (main camera or other) or GO at another scene object?
     
  11. XGT08

    XGT08

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

    We've talked about this before and I told you I do not understand exactly what you mean. Are you reffering to some form of camera focus? Because in that case you can already do that pressing F on the keyboard.

    So please give me more details :) and I will try to help you out as best I can.

    Al the best,
    Andrew
     
  12. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    So align the main camera say so it is pointing at (and focussed on?) the chosen gameobject when in scene before you go for runtime?
     
  13. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    Oh... So you mean the Main camera. Sorry I totally missed that. I thought you were talking about the scene view camera.

    What I can do is have a button inside the GUI that will make the main camera inherit the scene view camera rotation. Would this work for you? Note: This feature may not make it into an official update.
     
  14. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    Yep. That sounds spot on. ;)
     
  15. XGT08

    XGT08

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

    I sent you a PM with the link to the updated package :)
     
  16. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    Great. Thanks!
     
  17. Metron

    Metron

    Joined:
    Aug 24, 2009
    Posts:
    1,137
    Hi,

    small question: Is there any chance that you can get the Smart Move Gizmo compatible to your Octave3D World Builder?

    I really like the feature that the object is placed/aligned to a mesh. I couldn't find this function in Octave3D (is there?), so I tried to use both together.

    Unfortunately, I get errors like this:

    Assets/Smart Move Gizmo/Scripts/Scene Management/EditorScene.cs(12,17): error CS0246: The type or namespace name `GameObjectSphereTree' could not be found. Are you missing `O3DWB' using directive?


    Thanks.
     
  18. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    Responded on the Octave3D forum :)
     
  19. shamsfk

    shamsfk

    Joined:
    Nov 21, 2014
    Posts:
    307
    Hi! I have a major CPU trouble with Octave and currently, we deleted it from the project. We went with Smart Gizmo for now, but it lacks a very important feature - rotate tree objects in a SPACE + CTRL "not align to surface" mode. We need to rotate trees around their vertical axis and not a normal to surface. Please add SPACE + CTRL + C or something.
     
  20. shamsfk

    shamsfk

    Joined:
    Nov 21, 2014
    Posts:
    307
    And also I always get this error with Smart Gizmo:

    CreateInstanceFromType is not allowed to be called from a ScriptableObject constructor (or instance field initializer), call it in OnEnable instead. Called from ScriptableObject 'GizmoToolbar'.
    See "Script Serialization" page in the Unity Manual for further details.
    UnityEditor.Tools:get_pivotMode()
    SmartMoveGizmo_ObjectTransformGizmo:.ctor() (at Assets/Smart Move Gizmo/Scripts/Transform Gizmos/ObjectTransformGizmo.cs:20)
    SmartMoveGizmo_ObjectSmartMoveGizmo:.ctor() (at Assets/Smart Move Gizmo/Scripts/Transform Gizmos/ObjectSmartMoveGizmo.cs:58)
    SmartMoveGizmo.GizmoToolbar:.ctor() (at Assets/Smart Move Gizmo/Editor/Scripts/GizmoToolbar.cs:14)
     
  21. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    I sent you a PM which fixes the error, but it will take a bit more time to add the new feature. I will attempt to do it ASAP.
     
  22. shamsfk

    shamsfk

    Joined:
    Nov 21, 2014
    Posts:
    307
  23. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
  24. fireburner80

    fireburner80

    Joined:
    Feb 8, 2018
    Posts:
    3
    XGT08, I'm trying to utilize the tool to
    I encountered the same issue. Can you PM me the fix as well?
     
  25. fireburner80

    fireburner80

    Joined:
    Feb 8, 2018
    Posts:
    3
    More specifically, I encountered the errors as seen below. Any idea what's going on?
     

    Attached Files:

  26. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    Sent PM :)
     
  27. XGT08

    XGT08

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

    I just released a new update. The name has changed to ProSurfaceSnap. There are lots of improvements that have been made and settings added. So I suggest you take a look over the videos I prepared in the following playlist (YouTube):
    ProSurfaceSnap Tutorials.

    Here is a quick break-down of the new features and improvements:
    [New Feature]: rotate around anchor point;
    [New Feature]: offset from anchor point;
    [New Feature]: adjust anchor point;
    [New Feature]: explicit support for spherical surfaces;
    [New Feature]: layer override snap settings;

    [Improvement]: hotkey customization;
    [Improvement]: it is now possible to choose the types of surfaces that can be used for snapping (mesh, terrain and/or scene grid);
    [Improvement]: it is now possible to choose the layers that can act as snap surfaces;
    [Improvement]: improved snapping when axis alignment is turned off;
    [Improvement]: the snap functionality now works directly with the selected objects, regardless of the currently active transform gizmo;

    Enjoy!
     
  28. Valkrysa_Herja

    Valkrysa_Herja

    Joined:
    Aug 1, 2014
    Posts:
    41
    This is the sort of thing you'd want in Unity by default and you creating this just saved me a TON of time. Such a great workflow booster!
     
    lightwaterjohn and XGT08 like this.
  29. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    Thank you very much for the feedback! :) If you find the plugin useful, giving it a positive rating on the store would be very much appreciated :)

    Thanks!
    Andrew
     
  30. lightwaterjohn

    lightwaterjohn

    Joined:
    Nov 29, 2017
    Posts:
    13
    Just bought the asset. Could you please provide a list of shortcut keys and their action in the Readme?
     
  31. XGT08

    XGT08

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

    I will get to do that eventually. Until then please use this link for the hotkeys. It's under the section called Selection grab.
    It is for another asset which uses the same functionality.
     
    lightwaterjohn likes this.
  32. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    @XGT08 ,

    Is this Asset included in Octave3D...?
     
  33. XGT08

    XGT08

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

    Yes it is, but it behaves and looks a bit differently.
    Please see this video:
     
    Duffer123 likes this.
  34. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
  35. Hrach_Kar

    Hrach_Kar

    Joined:
    Oct 17, 2017
    Posts:
    2
    I would like to ask how to fix tool hotkey activation as when clicking c hotkeys are not activated and unity standard hotkeys functions remain.
     
  36. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    In the Settings window, there is a field called Surface flags. By default it is set to Terrain only. If you are also placing objects on meshes, you need to include Mesh.
     
  37. Hrach_Kar

    Hrach_Kar

    Joined:
    Oct 17, 2017
    Posts:
    2
    Thanks for responding. There are already terrain and mesh on the surface flags, but after activating tools, it doesn't rotate and scale, and other hotkeys don't work except shift+cntrl.
     
  38. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    Please make sure that the mesh assets that you are working with have the read-write enabled flag enabled. The plugin needs access to vertex data to properly snap the objects on the surface.

    You have to select your mesh assets and make sure the flag is checked as shown in the image below:
    MeshReadWrite.png
     
  39. jim00

    jim00

    Joined:
    Feb 1, 2015
    Posts:
    57
    After I had done some customize on some hotkeys, can I save those setting for next project? Or do I need to redo setting the hotkeys for the next project?
    how to save setting?

    Thanks.
     
  40. XGT08

    XGT08

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

    There is no option that allows you to save the settings. However, I believe (although I haven't tested this) that it should work if you make a prefab out of the ProSurfaceSnap object.
     
  41. Obsurveyor

    Obsurveyor

    Joined:
    Nov 22, 2012
    Posts:
    277
    Does this asset let you snap modular stuff together? Example: Snapping different sections of a modular set of roads(straight, curve, intersection, etc) together. Or another even simpler example, snap one side of a cube to another and have the tops line up.
     
  42. XGT08

    XGT08

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

    No this asset does not do that. It only allows you to snap objects on surfaces such as terrains or meshes.
     
  43. Obsurveyor

    Obsurveyor

    Joined:
    Nov 22, 2012
    Posts:
    277
    Thanks for the quick reply. I didn't notice you made Octave 3D, so I'm just going to grab that soon. :D
     
  44. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    Yes, Octave3d contains that functionality PLUS a whole bunch of other stuff that you can do with it :)
     
  45. matsakovd

    matsakovd

    Joined:
    May 29, 2019
    Posts:
    22
    Hi! I have a problem, this asset loads the editor heavily. How can I solve this problem?
     

    Attached Files:

  46. bbjones

    bbjones

    Joined:
    Feb 1, 2016
    Posts:
    85
    I can't get this to work.

    New project 2019.2.13f1.

    Import ProSurfaceSnap.

    In scene add a few simple objects (plane, cubes etc).
    Initialize ProSurfaceSnap (that is now listed in hierarchy).

    Select anything, press C, nothing happens.

    Tried the same thing in other projects, with other assets, terrains, props, changed all the settings and profiles, hotkeys, and still can't get this tool to activate.

    What am I missing?
     
  47. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    In the settings window, you have to check the Mesh property in the Surface Flags popup.
     
  48. bbjones

    bbjones

    Joined:
    Feb 1, 2016
    Posts:
    85
    I have tried with everything checked, and I've tried every other combination of things checked/unchecked, still nothing happens.

    upload_2019-12-10_9-54-39.png
     
  49. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    It has to work. Can you please record a small video? I would like to take a look at the scene, and see what is happening. Just show me what happens when you press C.
     
  50. bbjones

    bbjones

    Joined:
    Feb 1, 2016
    Posts:
    85
    There's nothing to record, when I press C literally nothing happens. No gizmos or controls appear.
    It has the same effect as if I didn't even press C.

    As I said I've tried changing hotkeys, selecting every type of object in every scenario, and all other options, in difference scenes, projects etc, everywhere it's the same result, nothing happens. Despite having a ProSurfaceSnap object in the scene hierarchy, it's like the asset isn't installed.

    For example, this is the new project, added a cube, plane, sphere and imported PSS. Set flags to mesh, surface is Default. I select any object, but in this screenshot the cube, press and nothing changes in the scene or selection or inspector.
    upload_2019-12-10_10-18-5.png

    I was able to cause some errors in the inspector if I set Surface Layers to Nothing:
    Mask menu has no instance
    UnityEditor.EditorGUILayout:EnumMaskPopup(GUIContent, Enum, GUILayoutOption[])
    PSS.ObjectGrabSettings:RenderContent(Object) (at Assets/ProSurfaceSnap/Scripts/Plugin/ObjectGrabSettings.cs:144)
    PSS.Settings:RenderEditorGUI(Object) (at Assets/ProSurfaceSnap/Scripts/API/UI/Settings.cs:31)
    PSS.SnapSettingsWindow:OnGUI() (at Assets/ProSurfaceSnap/Scripts/Plugin/SnapSettingsWindow.cs:24)
    UnityEditor.MaskCallbackInfo:SetMaskValueDelegate(Object, String[], Int32) (at C:/buildslave/unity/build/Editor/Mono/GUI/MaskFieldGUI.cs:75)

    But that was only after changing every possible PSS setting multiple times.