Home Technical Talk

Game Unit Snapping For Modo To UDK

polycounter lvl 6
Offline / Send Message
repete polycounter lvl 6
Hello all

Modo users might find this useful :poly121:

It sorts out the grid size issues in relation to UDK and I have created a pie menu with F1 as the hot key.

This is the menu:

Modo (turns grid snapping off)
1024
512
256
64
8
4
1


I added the LXM files along with the cfg file so you can create your own menus.

You can edit the LXM files to make this work with Unity.

Meters Per Game Unit must be set to 0.01 (UDK equivalent) for this to work properly.

This works on 601 without issues and don't know if it will work on 701 or 501 and lower.

ModoGameUnitSnapping_zps8af7316e.jpg

ModoGameUnitSnappingUDK_zps7f09fae2.jpg


https://www.dropbox.com/l/fVaEFtePqxHd1LW21q2CQ9

Happy snapping

pete

Replies

  • genwu
    Options
    Offline / Send Message
    genwu polycounter lvl 7
    Awesome! Thanks a lot Pete. I'll be sure to try it out sometime after work! Cheers!
  • peanut™
    Options
    Offline / Send Message
    peanut™ polycounter lvl 19
    Thanks Repete, this is going to be useful... great find
  • Bek
    Options
    Offline / Send Message
    Bek interpolator
    What were the issues you were having with modo to udk grid? As far as I can remember it worked fine going to UDK for me; I may have be remembering wrong though. I just have modo to base 2 grid and 0.01m per game unit.
  • repete
    Options
    Offline / Send Message
    repete polycounter lvl 6
    Everything lines up outside or inside a segment on the grid and you have to judge your sizes based on the grid size that you zoom to which is wrong because it wont align to a segment and you cannot export to UDK like this and expect everything to be the same, it wont be.

    I am not sure what you mean by a base 2 grid. Are you setting the coordinate rounding to fixed with a fixed increment of 2?

    For a 1024x1024x1024 cube with the coordinate rounding set to Forced Fixed at a fixed increment of 102400 (translates in modo as 1024.0) you pull out a perfect cube with snapping at that grid size no matter how far you zoom in or out. Each segment of the grid is exactly 1024x1024 and forced to that size, the same goes for 512,256 and so on.

    the macro looks like this:
    #LXMacro#
    tool.set snap.grid on
    pref.select input/units set
    pref.value opengl.gridSnap force
    pref.value opengl.gridFixed 1024.0


    Normal modo grid:

    normalmodogrid_zps292bca7b.jpg

    Forced fixed grid:

    forcefixedgrid_zpsf9467fcd.jpg

    Bek wrote: »
    What were the issues you were having with modo to udk grid? As far as I can remember it worked fine going to UDK for me; I may have be remembering wrong though. I just have modo to base 2 grid and 0.01m per game unit.
  • MoustacheMike
    Options
    Offline / Send Message
    MoustacheMike polycounter lvl 3
    Noob question :
    how do you use this ?
    I copy all the files in my script folder, then assign the F1 shortcut to the command. and I'm sure I'm doing it wrong cuz nothing happened.
    modo 701
  • Bek
    Options
    Offline / Send Message
    Bek interpolator
    Unless I'm misunderstanding; you can achieve the same thing (having the grid at increments of 2/4/8/16/32/etc) by setting preferences > input> workplane > plane and grid increments to 10, 25, 50 with your unit system set to game units.
  • repete
    Options
    Offline / Send Message
    repete polycounter lvl 6
    I thought I was clear, anyway here you go:

    modogridNOgood_zps6e9ba28f.jpg


    modoGridGood_zps5b14e742.jpg
  • repete
    Options
    Offline / Send Message
    repete polycounter lvl 6
    Add the cfg file to your user configs folder and see if it works. I have only tested this on 601.

    Also add the macros to your user scripts folder to test them. Just select "run script" and pick one of the LXM files.

    If that fails then you have to record the macros yourself and create your own pie menu. Give me a shout if you have any problems with this and we will sort it out :poly121:


    Noob question :
    how do you use this ?
    I copy all the files in my script folder, then assign the F1 shortcut to the command. and I'm sure I'm doing it wrong cuz nothing happened.
    modo 701
  • MoustacheMike
    Options
    Offline / Send Message
    MoustacheMike polycounter lvl 3
    repete wrote: »
    Add the cfg file to your user configs folder and see if it works. I have only tested this on 601.

    Also add the macros to your user scripts folder to test them. Just select "run script" and pick one of the LXM files.

    If that fails then you have to record the macros yourself and create your own pie menu. Give me a shout if you have any problems with this and we will sort it out :poly121:


    Oh I got it now, the first time I assigned modo.lxm to F1 so nothing happened :poly117:
    I successfully created the pie menu, assigned it to F1, checked my unit in modo and UDK it's all good in 701.
    Thanks a lot sir.
  • repete
    Options
    Offline / Send Message
    repete polycounter lvl 6
    Good Job :thumbup:
    Oh I got it now, the first time I assigned modo.lxm to F1 so nothing happened :poly117:
    I successfully created the pie menu, assigned it to F1, checked my unit in modo and UDK it's all good in 701.
    Thanks a lot sir.
  • Bek
    Options
    Offline / Send Message
    Bek interpolator
    I'm really not getting the same results as you; if I export a 256^3 cube to UDK it matches the default 256^3 UDK cube 1:1 perfectly.
  • WarrenM
    Options
    Offline / Send Message
    Yes, I always got perfect matches too. Using "Game Units" with "Meters Per Game Unit" set to 0.01 gives me 1:1 mapping with Unreal. Not sure why you don't get the same...
  • repete
    Options
    Offline / Send Message
    repete polycounter lvl 6
    Please show me how you are achieving this in modos view port.

    Are you inputting the x y z size by hand ?
    Bek wrote: »
    I'm really not getting the same results as you; if I export a 256^3 cube to UDK it matches the default 256^3 UDK cube 1:1 perfectly.
  • repete
    Options
    Offline / Send Message
    repete polycounter lvl 6
    I see what you're doing now :poly122:

    That modo grid you are using is off and you are relying on the zoom to draw out the 25600 box, a tedious workflow imo.

    Below is UDK's start scene

    modogrid_zps51e30c67.jpg

    mymodogrid_zps8a427149.jpg

    As you can see the modo grid is off even if is set to game units. It would have been prudent if you had at least tried the snapping tool first and then you would see how useful it really is. Is it not more logical to be locked to a square number that you can choose from rather than depend on modos zoom function?

    I set my snapping tool to 1024 and that's what I get even in perspective view, no messing around with zooms or having to manually type in the size.

    Mystery solved :thumbup:
  • Bek
    Options
    Offline / Send Message
    Bek interpolator
    I did try setting snapping to fixed by 1024 and wasn't sure I could see the point? There is definitely some misunderstanding or miscommunication happening here that I would like to clear up.

    Now as best as I can tell this is your problem and solution:

    Modo's grid by default does not increase/decrease by the numbers you want, 1,2,4,8,16 and so on. So you have created a menu that turns modo's fixed grid on at those numbers, which you manually change up/down when working.

    If that is correct then you are missing something, because you do not need to use such a menu. If you set grid increments correctly (10, 25, 50) and units to game units, modo's grid will automatically change to 1/2/4/8/16/etc when zooming. I can guarantee this 100% works; it's what I've had modo set to for ages.

    Here's where I think you made a mistake and got confused: In your screenshots and posts you for some reason mentioned that you entered 102400 as a fixed grid number. I can see from the screenshot you posted your fixed grid is set to 102400 not 1024. 102400 does not fit the binary pattern of 1/2/4/8/etc. Maybe the imported cube from udk gets size up x100, hence the extra two zeros on the end that is throwing you off (since anything that's x100 won't match the established pattern). So you have mistaken 409600 as a number in our binary pattern, when really it's just because the imported cube has been sized up x100. If you scale your 409600 cube down to 1%, it will match the grid.

    As you can see in this image; I've drawn out a 64^2 square and a 128^2, all snapped to grid. I can zoom in or out as much as I want and it will match (although obviously when the grid gets too big to represent something it won't have an exact point, but it will still be matching)

    tK2fWNV.png

    I hope that has been a fair and accurate understanding of your problem/solution.
  • peanut™
    Options
    Offline / Send Message
    peanut™ polycounter lvl 19
    Yeeaah !! just got the pie menu to finally work this morning, it was easy actually and i just noticed the new dropdown (red).

    Just a question, would there be a way to add something to revert to Modo's original setting 'on the fly' without having to go in the preferences ?


    piemenu_2.jpg
  • repete
    Options
    Offline / Send Message
    repete polycounter lvl 6
    If I remember correctly the modo button in the pie reverts the snapping/workplane back to modos original but I am not sure if it changes the default unit system, if not you can just record a macro and copy/paste it to that script and your done.

    Remember every preference setting change can be recorded to a macro.
  • Farfarer
    Options
    Offline / Send Message
    Yeah, if you change the value, then check in the command history, you should see what the command is.

    You can then set somewhere in a form to that command. If your replace the argument with ? then you'll be able to change it from there.

    So the command for your form would probably be something like

    pref.value units.gameUnits ?

    (I don't know what the actual command is off-hand).
  • peanut™
    Options
    Offline / Send Message
    peanut™ polycounter lvl 19
    repete wrote: »
    If I remember correctly the modo button in the pie reverts the snapping/workplane back to modos original but I am not sure if it changes the default unit system, if not you can just record a macro and copy/paste it to that script and your done.

    Remember every preference setting change can be recorded to a macro.

    If i want to revert to the Modo settings it doesn't seem to work, how do you record a macro again ?

    Farfarer wrote: »
    Yeah, if you change the value, then check in the command history, you should see what the command is.

    You can then set somewhere in a form to that command. If your replace the argument with ? then you'll be able to change it from there.

    So the command for your form would probably be something like

    pref.value units.gameUnits ?

    Yes i looked at the command history, it looks like this @{C:/Users\****\Documents\Luxology\Content\Kits\Game Unit snapping\modo.LXM} is this what you are referring to ?

    When i run the modo.LXM it doesn't seem to produce anything other than an error message ... how do you edit LXM files ?
  • repete
    Options
    Offline / Send Message
    repete polycounter lvl 6
    To record a macro just goto system/record macro and do your operation.

    Save the macro file with "Save to file" and put it on your desktop. Open it with the notepad if you want to add or remove commands. You can edit any LXM file just like a text file as long as it ends with .LXM.

    peanut™ wrote: »
    If i want to revert to the Modo settings it doesn't seem to work, how do you record a macro again ?




    Yes i looked at the command history, it looks like this @{C:/Users\****\Documents\Luxology\Content\Kits\Game Unit snapping\modo.LXM} is this what you are referring to ?

    When i run the modo.LXM it doesn't seem to produce anything other than an error message ... how do you edit LXM files ?
  • peanut™
    Options
    Offline / Send Message
    peanut™ polycounter lvl 19
    repete wrote: »
    To record a macro just goto system/record macro and do your operation.

    Save the macro file with "Save to file" and put it on your desktop. Open it with the notepad if you want to add or remove commands. You can edit any LXM file just like a text file as long as it ends with .LXM.

    Thanks for the reply repete, i will make a macro for this function since manual install seems to not be working. All the credit goes to you man :D
  • repete
    Options
    Offline / Send Message
    repete polycounter lvl 6
    peanut™ wrote: »
    Thanks for the reply repete, i will make a macro for this function since manual install seems to not be working. All the credit goes to you man :D


    Are you still on 601 ?
  • peanut™
    Options
    Offline / Send Message
    peanut™ polycounter lvl 19
    No i'm under 801, it didn't work on first try.
  • peanut™
    Options
    Offline / Send Message
    peanut™ polycounter lvl 19
    Ok got it to work. It should have pointed to C:/Users\****\Documents\Luxology\Content\Kits\GameUnitsnapping. Instead it was pointing to C:/User\****\AppData\Roaming\Luxology

    This is confusing both path look the same but act differently .... It works now !!
  • repete
    Options
    Offline / Send Message
    repete polycounter lvl 6
    peanut™ wrote: »
    No i'm under 801, it didn't work on first try.

    I will edit the new form I made for 801 to UE4 (I use it for modular things) and fire it off to you, tomorrow probably.

    It's easy as pie (pun intended)


    :D


    PS working on a new modo to UE4 grid form as the power of 2 grid in UE4 could be a thing of the past in the future (no idea why but there it is).
  • peanut™
    Options
    Offline / Send Message
    peanut™ polycounter lvl 19
    Yeah! will be waiting for sure ... thanks a million for those tools
  • peanut™
    Options
    Offline / Send Message
    peanut™ polycounter lvl 19
    For those who struggled like me to figure out Modo's unit setup, here is something for you. You only have to change the accuracy (fixed increment)and Modo will stamp this as his default unit measuring.

    Example: I like to work in meters so if you type 100cm Modo will write down 1m (took me a while to get it aaaaah!!) ;)

    Unit_Measures.jpg
  • igi
    Options
    Offline / Send Message
    igi polycounter lvl 12
    That's right and you can directly access to same options under snapping menu too.

    SnappingOptions.png
  • peanut™
    Options
    Offline / Send Message
    peanut™ polycounter lvl 19
    thanks didn't know about this one ...
  • meathead
    Options
    Offline / Send Message
    meathead polycounter lvl 4
    Has anyone got this to work with UE4 new Grid settings like 1 - 5 - 10 ect. A lot of people are saying thats the way to go now instead of using the power of two.
  • peanut™
    Options
    Offline / Send Message
    peanut™ polycounter lvl 19
    meathead wrote: »
    Has anyone got this to work with UE4 new Grid settings like 1 - 5 - 10 ect. A lot of people are saying thats the way to go now instead of using the power of two.

    Do you care to elaborate, isn't the power of 2 for texturing or may have i misunderstood something ?

    On edit: do you mean while modeling/assembling ?
Sign In or Register to comment.