Home Technical Talk

[3dsMax] Grid Snap Tool?

GhosTDoG
polycounter lvl 6
Offline / Send Message
GhosTDoG polycounter lvl 6
Hi,

I'm looking for a max script similar to UE4s customizable grid snap templates, like 50 cm, 100 cm ...etc. as buttons or a drop down list.

thx

Replies

  • Gustavo_Elliott
    Offline / Send Message
    Gustavo_Elliott polycounter lvl 4
    3DS has a built-in tool for such.

    Step 1: create object
    Step 2: Affect pivot only
    Step 3: Press the 'S' key to enable snap options or click the hotkey in the toolbar with a large 3 on it
    Step 4: Right click that same hotkey to open the snap option menu, here you can change what kind of snaps to use, first your going to want to move your pivot to a modular point (The lower corner of a cube, etc.) using the vertex snaps
    Step 5: Disable vertex snaps and then enable grid snaps in the snap options menu, you can also change the amount of lines on the grid to snap by --- each line on the grid is 1 unit and as long as the system units are set to Cm then it will be exactly the same as UE4.

    I hope this has helped you or anyone else searching for an answer related to such.

    refer to this video for a better basic understanding... https://www.youtube.com/watch?v=693IWvAlAnc
  • GhosTDoG
    Offline / Send Message
    GhosTDoG polycounter lvl 6
    @Gustavo_Elliott

    Thx for your answer, but I think we're talking at cross purposes here. :)

    At "1:32 min" f.e you always have to type in the grid spacing manually - im looking for a script with a menu: buttons or drop down and predefinied templates like 25 cm, 50 cm etc.
    This would fasten your workflow - UE4 provides this kind of dropdown list and you have the ability to customize your grid settings in the editor preferences.



    This should be very simple with maxscript, but I'm not very experienced with max scripting.

  • Gustavo_Elliott
    Offline / Send Message
    Gustavo_Elliott polycounter lvl 4
    I mean you can set a hotkey to open the snap menu if having it open bothers you... I don't think your wasting time by typing in your snap value but if you wanna take the time to write a script, if sure you could, but I don't think you could have it as a viewport button like ue4
  • GhosTDoG
    Offline / Send Message
    GhosTDoG polycounter lvl 6

    I don't think your wasting time by typing in your snap value...

    You do, especially in production, when you have to create and test a bunch of modular assets set up with the power of 2.
    We had inhouse scripts with mel script, I was just looking for something similar with maxsxript.

    A menu or toolbar script would be fine. The UE4 Viewport was just an example.
  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    you can set the grid size with this  

    SetGridSpacing <float>  

    it'll be easy to make yourself a toolbar



  • GhosTDoG
    Offline / Send Message
    GhosTDoG polycounter lvl 6
    poopipe said:
    you can set the grid size with this  

    SetGridSpacing <float>  

    it'll be easy to make yourself a toolbar



    Thx. I'll take a look how to make a button menu in maxscript.
  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    Make a new toolbar and drag the script onto it from the editor window.   It'll autogenerate a macroscript for you.


  • miauu
    Offline / Send Message
    miauu polycounter lvl 14
    If something like this is useful then follow the link below the image. :)




    <br><br>



  • GhosTDoG
    Offline / Send Message
    GhosTDoG polycounter lvl 6

    thx



    Nice! Thx a lot. :)

    But somehow the download link on scriptspot is messed up, resp. there is no download link.
  • miauu
    Offline / Send Message
    miauu polycounter lvl 14
    GhosTDoG said:




    But somehow the download link on scriptspot is messed up, resp. there is no download link.
    Because I forgot to attach the file in scriptspot. :)
    It is fixed now and you can download it. :)
  • GhosTDoG
    Offline / Send Message
    GhosTDoG polycounter lvl 6

    Thx
    Works so far, I only get issues with values like 12,5 - I get syntax errors. I tried 12.5 or 25/2  (does nothing). How can I add float values?

                            menuItem setGridSpacing25/2 "12,5" checked:false<br>			<br>			<br>		        on setGridSpacing25/2 picked do SetGridSpacing 25/2



  • miauu
    Offline / Send Message
    miauu polycounter lvl 14
    GhosTDoG said:

    Thx
    Works so far, I only get issues with values like 12,5 - I get syntax errors. I tried 12.5 or 25/2  (does nothing). How can I add float values?

                            menuItem setGridSpacing25/2 "12,5" checked:false<br>			<br>			<br>		        on setGridSpacing25/2 picked do SetGridSpacing 25/2



    This way:

    rcMenu rcMapSize<br>		(<br>			menuItem setGridSpacing1 "1" checked:false<br>			menuItem setGridSpacing5 "5" checked:false<br>			menuItem setGridSpacing12_5 "12.5" checked:false<br>			menuItem setGridSpacing50 "50" checked:false<br>			menuItem setGridSpacing100 "100" checked:false<br>			menuItem setGridSpacing500 "500" checked:false<br>			menuItem setGridSpacing1000 "1000" checked:false<br>			menuItem setGridSpacing5000 "5000" checked:false<br>			menuItem setGridSpacing10000 "10000" checked:false<br>			<br>			on setGridSpacing1 picked do SetGridSpacing 1<br>			on setGridSpacing5 picked do SetGridSpacing 5<br>			on setGridSpacing12_5 picked do SetGridSpacing 12.5<br>			on setGridSpacing50 picked do SetGridSpacing 50<br>			on setGridSpacing100 picked do SetGridSpacing 100<br>			on setGridSpacing500 picked do SetGridSpacing 500<br>			on setGridSpacing1000 picked do SetGridSpacing 1000<br>			on setGridSpacing5000 picked do SetGridSpacing 5000<br>			on setGridSpacing10000 picked do SetGridSpacing 10000			<br>		) 

    Your error is because of this:

    </code><code>setGridSpacing25/2
    You can't set the name of a variable or any control this way. Instead use somehing else. For example setGridSpacing12_5.




  • GhosTDoG
    Offline / Send Message
    GhosTDoG polycounter lvl 6

    Works now. Pretty fast and useful in combination with hotkeys. Thx again. ;)   :)
Sign In or Register to comment.