No announcement yet.

m2u interactive sync script for Maya -> UE4

  • Filter
  • Time
  • Show
Clear All
new posts

    m2u interactive sync script for Maya -> UE4

    Hi there,
    I'm currently working on a UE4 implementation to interactively sync Maya's... let's say "level building data".

    I started the original m2u (short for Max/Maya to UDK) over a year ago with a friend as a student-project, as the name says, for UDK.
    It was quite a hassle communicating with UDK via the windows-UI

    But UE4 has full source code access, so this should be much more powerful in the long run. To get an Idea of what I'm talking about:

    features you see in the video:
    - syncing the persp viewport camera
    - fast fetching selected objects from the Editor (uses ExportSelected to FBX)
    - syncing transforms of objects
    - duplicating of objects
    - hiding/showing of objects (a bit buggy)
    - deleting objects
    - parenting of objects (still very WIP)
    - renaming objects (unused and used names)

    I'm actually working on this for my master's thesis, but that means I have to write the nonsensical text-stuff soon, so I won't have much time to actually improve the code until the end of August.

    I will keep you posted, and I would like to hear from you guys what you think of it, what you think the most necessary features would be and so on.

    what's under the hood?
    m2u itself is a modular python script
    the UE4 frontend is a c++ editor plugin
    communication between the python and UE4 side is done via a TCP port

    Maya? I'm a Max-user!
    Sorry to hear that
    My focus is currently only on Maya->UE4. But m2u was planned to be completely modular. We had a very basic 3DsMax implementation for the UDK version. Technically it is possible to write an implementation for any 3d-Authoring Program out there as long as the calls to the python library with the necessary data is made. Maybe my Friend who worked with me on the first m2u will get onboard when he has more time to spare, maybe some other guy will make a Max-implementation when the whole project is a little bit less WIP, we will see

    Can I take a look at your code?
    Of course, I have nothing to hide.
    The m2u python scripts are here:
    I'm currently working on the feature/ue4 branch, the develop branch will always be updated when certain features have been added or bugs have been fixed. The master branch will only be updated when a bigger set of features is working as expected on mac and windows. So, when you want to try this, always check out the develop branch
    The plugin code is here:
    This code is very monolithic at the moment. I don't have time to do nice refactoring currently, but I definitely will!

    More videos:

    Feature Status:
    - syncing the persp viewport camera
    - fast fetching selected objects from the Editor (uses ExportSelected to single FBX file)
    - syncing transforms of objects (now correct even with modified pivots)
    - duplicating of objects
    - hiding/showing of objects (due to the nature of how isolate select works in maya, this may not always be 100% correct)
    - deleting objects
    - renaming objects (unused and used names)
    - syncing display layers (a bit buggy sometimes)

    work in progress:
    - a modular pySide based UI (some of the pipeline-tasks depend on this)
    - allow and auto-detect Maya-Y-up space
    - getting 'known' meshes from the file system (importing the fbx file associated with a static mesh by checking the project structure on the file system. This allows to build levels in maya, and send the whole stuff to UE at once)
    - sending 'new' meshes from maya to UE (export to fbx, create asset, place in level. Thought further, this allows to quickly edit meshes and get the changes in the engine with one click)
    - getting 'unknown' meshes which are not on the file system but exist as static meshes in UE
    - parenting and grouping of objects
    - support for other objects than meshes (namely lights)
    - making mass operations like selection and duplication faster (currently only one operation per tick)

    to be investigated some day (no idea when I will come to this):
    - transferring collision data (UCX prefixed meshes)
    - transferring dependent textures (automatically import/export)
    - sending skeletal mesh posing data (interactively get posing response in engine viewport when editing animations in maya)
    - syncing cameras on playback (for creating camera paths in maya and seeing an interactive preview in the editor)
    - two way interactive sync for simple stuff like selection (select something in UE will select the same in Maya)
    - ...

    Please tell me what you think of it
    Last edited by alfalfasprossen; 08-12-2014, 05:42 PM.

    This is great, i would use it on a regular basis. What are the limitations on scene size? Any idea on when it will be finished and how much will it be?


      awesome work! very impressive, that's going to be part of my workflow now.
      Last edited by Laserman; 07-23-2014, 06:35 PM.


        Heck! That's awesome. I'll definitely need to give this a go, once I have some free time. Thanks for sharing and looking forward to seeing more!


          This is amazing work. Well done. It's definitely going to help a lot of people save time editing meshes in the projects.
          Q.U.B.E. 2 | Q.U.B.E: Director's Cut


            Fantastic job alfalfasprossen! This is for sure going to be a time saver for users. Keep up the great work!


              What wizardry is this? Looks really interesting! So does this work with UE4 brushes or what would be the general workflow of laying out a level like this?


                Exciting, looking forward to seeing more.
                Tim Elek - Sr. VFX Artist Epic Games


                  This looks amazing! Sent it to the animators and riggers and everybody was pretty excited at the possibilities.
                  Gavin Moran
                  Snr. Animator
                  Epic Games





                      thx for the nice comments

                      Did some investigation into DisplayLayers today, maya doesn't provide many callbacks, when it comes to that. That means we are in for another session of CommandCallback and string-parsing

                      This is great, i would use it on a regular basis. What are the limitations on scene size? Any idea on when it will be finished and how much will it be?
                      Good to hear
                      Limitations on scene-size? It will only be a matter of performance. The more objects are synced, the more communication and especially executing commands will have to be done. So in theory there is no limitation of how much stuff you can transfer or sync, it may only take some time for the job to fish.

                      When will it be finished? Don't know if it will ever be "finished"... there will probably always turn up new features to be implemented. If the current state is all you need, just grab the code and compile it for yourself Until all the features are built in that I currently have planned... probably in two months or so (won't have much time for programming next month)

                      It will be free, at least I currently have no plans on monetizing it... maybe if I come up with the-ultimate-feature™ I might think about it, but... I'm more a friend of free-stuff to help people make good games

                      What wizardry is this? Looks really interesting! So does this work with UE4 brushes or what would be the general workflow of laying out a level like this?
                      Currently it uses the existing static meshes from a Level (export to FBX, import in maya) and syncs by the name of the objects. So for laying out a level you would currently at least have to start by placing the required static meshes in UE first.
                      Moving a whole scene from maya over to UE with one click (or maybe a few more) is planned for the future.

                      I will keep you posted


                        a little update

                        Batch export meshes from maya.
                        this will check objects for an "AssetPath" attribute, which points to an .fbx file for this mesh, relative to the project's asset-source directory. (You will be able to set that directoy through a UI or settings file in the future) If no path is given, the user's Temp-Folder will be used. (That's the darn long paths you see in my video, OSX temp directories). If no "AssetPath" attribute is found (because the meshes were not created with such a pipeline in mind), the script will autogenerate one based on the name of one of the same objects. Object matches are identified by checking the vertex-topolgy.
                        All that information has to be presented to the User in a UI, but currently there is none. So just automatic export to temp-directory for now

                        Silently automatically import fbx files as assets in UE.
                        The script will tell UE which .fbx file to import to which location in the projects content path ("/Game/...").
                        Silently means, that there are no popup-dialogs from UE asking about static-mesh settings or overwrite-warnings.
                        Problems, like overwrite, may be send to the script-ui (maya-side) to ask the user what to do, depending on user choice. Especially giving the user the option to change the name of the file/asset. This is not implemented yet, because there is no fancy UI for maya yet.
                        Internal FBX-import problems (errors while importing the mesh) will still cause popup dialogs in the Editor.

                        Automatically assemble the level.
                        With all assets imported, it will create a new Actor for each mesh sent from maya.
                        All objects in maya using the topologically same geometry will reference the same static mesh. (the info for that is taken from the "AssetPath" attribute)
                        The object names in maya have to be unique within the scene! Nested Transforms are not interpreted corretly! In short that means: NO GROUPS. Make sure all your objects are parented to the world only.

                        this will allow you to switch between interactive syncing and sending (and in some future version really two-way-syncing) the whole level to UE.
                        There is still some work to do to make sure that names between maya and UE will be synced. But if you just want your already built geometry in UE, the current version of the script should already be usable for you.

                        The Batch-file parsing stuff shown at the end of the video was mainly integrated for JBaldwin's max-script.

                        If you want to use it now, you will have to compile the plugin yourself. Possibly you will have to make changes to work with the UE4 version you are using, because I'm still on 4.1. I think I will be able to update to 4.3 this weekend.
                        get the tag from here:

                        To get the maya script, get this tag:

                        put the m2u folder somewhere maya can find it (maya script path) or add the path to sys.path
                        and execute this in mayas script editor (python of course)
                        import m2u
                        from m2u.maya import mayaInternalUI
                        I will keep you posted
                        Last edited by alfalfasprossen; 07-29-2014, 04:24 PM.


                          This looks insane! I'm sure this would benefit a lot of people, working like this would significantly speed up a modular workflow.


                            This is very very cool, I am tempted to try and port it to Cinema4D (why is there not more hours in a day!!)


                              I am tempted to try and port it to Cinema4D
                              any news?

                              thank you
                              || DigitalTRX | C4DGames ||