Announcement

Collapse
No announcement yet.

m2u interactive sync script for Maya -> UE4

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    I following your works with a big interest. Keep going =).
    CG Artist for StarGate Network
    Discord : https://discord.gg/CYBkFWD

    Comment


      #17
      Absolutely amazing. As an old follower of Norman I am glad to know someone else is taking over the task of finishing this. Keep it up!

      edit: Also this will import correctly collision models along with the assets and correctly collide in UE4 right?
      Last edited by SammVarnish; 08-02-2014, 10:56 PM.

      Comment


        #18
        I am tempted to try and port it to Cinema4D
        please go ahead, all you actually need to provide is a cinema4D python implementation for m2u (and, until there is a UI built on pyside, a cinema4d internal UI) please check out the m2u repository or fork it and get going. (cinema4d can talk python, right? if not, you probably would have to write something standalone up to the point where commands are sent over the TCP port)

        Absolutely amazing. As an old follower of Norman I am glad to know someone else is taking over the task of finishing this. Keep it up!

        edit: Also this will import correctly collision models along with the assets and correctly collide in UE4 right?
        Yes, the old work of Norman was our initial inspiration to do start the project back then in UDK times. We wondered why Norman never continued his work, probably had something else to do
        Collision is not actively supported currently, but since it is natively implemented in the UE-FBX-pipeline it might work out-of-the-box or shouldn't be hard to get working. But there are other parts I want to look into before that, since the main idea of m2u is that configured assets already exist on both ends of the pipeline

        Comment


          #19
          What happens if you move the pivot point from the model or create a group ? The sync is broken or ?
          CG Artist for StarGate Network
          Discord : https://discord.gg/CYBkFWD

          Comment


            #20
            I got the pivot thing working two days ago. This also works in hierarchies, as long as the hierarchies are the same in the UE.

            Grouping...
            The problem is, UE has only a very... simple... implementation for hierarchies (aka. nested transforms, grouping, attaching) because they obviously decided to go for the horrible invisible-locked-groups-thing from 3DsMax

            Objects in a hierarchie in UE will not be duplicated, when the parent is duplicated.
            When I send a transformation to UE it has to be relative to the parent. If the parent does not exist in UE (or the object is not attached to that parent) the transformation will be off.
            Therefore, groups from maya have to be mirrored in UE by creating an empty transform, for which there is no real useful actor there.
            I could create StaticMesh actors without a mesh... they will be displayed as a warning in the analyze window when building the level.
            I could create a Note actor instead... they will be displayed as a Note in the analyze window.
            Both options are annoying.
            The other actors possible would be TextRenderActor or TargetActor, which both are dynamic, and thus you cannot attach static meshes to them.
            Creating a StaticMesh Actor with a static mesh but setting it to be hidden in Editor and in Game could be another solution, but those will show up in FBX files when exporting and so.
            Providing a "MayaStyleGroupActor" (all we need is a transform node) with the Plugin is no option because the plugin should be editor-only and not required for shipping the game.

            After testing a little, I came to the conclusion that it is possible to set Actor's mobility to static, via code, although it is hidden in the editor. So I will probably go with creating TargetActors for Groups and setting them tho static.


            The complete other solution would be to not reproduce grouping information at all in UE and always use world-space transformations, but I think grouping information is not only important for transformations, but also for cleaning up the outliner. That is why i will go with the TargetActor as an empty transform way. Until UE comes with a simple TransformActor that the user can toggle dynamic or static if that is needed for matinee animations or so.

            Comment


              #21
              Ok, I think it's not a big deal if the group & parent don't work for now. But my point is, if you have a "Mesh A" with a pivot point in the center of it, you duplicate "Mesh A" (in instance, I guess), but for some reason (honestly, I do that all the time) you need to change the pivot point just on one Mesh, what happens in this case ? All pivots move ? All Meshes moves in UE4 but not in Maya ? Something else ?
              CG Artist for StarGate Network
              Discord : https://discord.gg/CYBkFWD

              Comment


                #22
                as long as you don't "Freeze Transformations" the actual origin of the mesh (the origin from which the vertex-positions are measured) will still be the same, no matter where you move the pivot(s)
                That means, I can always figure out how the actual transform of a mesh is, measured from that origin. This is also the position that will be moved to the world origin before exporting. So, the "mesh origin" will always match up between meshes in maya and UE, no matter where your pivots in maya are.
                If you move the pivot on one mesh, the other meshes will not be touched in the slightest.

                I will put a video up where I show that maya-pivot-hell now works, within the next few days.

                If you want to get the origin of a mesh to another position, you will have to freeze transformations. But that will actually alter the geometry, so two meshes, although looking exactly the same, will be different objects. But that is the point of freezing transformations, although some people don't know the consequences.

                Comment


                  #23
                  Ok great, do you plan to port your script for UE 4.3 (and more) or you stay to the 4.2 ? Speedy37 (our programer, he created the converter UDK to UE4) try to compile it for the 4.3 and he told me you used some private thing and if I want to used it, he need to upload a big file.
                  CG Artist for StarGate Network
                  Discord : https://discord.gg/CYBkFWD

                  Comment


                    #24
                    Very cool, i see this type of workflow being industry standard in the future, hopefully...

                    It just makes sense.


                    Twitter - @TheCSilverman

                    Ancient Cistern | Advanced Material Pack Ed. 1 | Advanced Material Pack Ed. 2 | Advanced Material Pack Ed. 3 | Texture Pack Ed. 1 | Container Pack Ed. 1 | Road Sign Pack Ed. 1

                    Comment


                      #25
                      Thank you alfalfasprossen. Yes, cinema4d can talk python. Unfortunately I'm not a programmer. But I'll try
                      || DigitalTRX | C4DGames ||

                      Comment


                        #26
                        Originally posted by alfalfasprossen View Post
                        please go ahead, all you actually need to provide is a cinema4D python implementation for m2u (and, until there is a UI built on pyside, a cinema4d internal UI) please check out the m2u repository or fork it and get going. (cinema4d can talk python, right? if not, you probably would have to write something standalone up to the point where commands are sent over the TCP port)
                        Yeah it does python fine, I initially thought I would deal with outputting the correct text file, just so happens I wrote a basic Python script about year or so ago for C4D to export positions of cloners for stadium seating..

                        So with this, the in DCC plugin has to connect to a server that is running in UE?

                        Comment


                          #27
                          Ok great, do you plan to port your script for UE 4.3 (and more) or you stay to the 4.2 ? Speedy37 (our programer, he created the converter UDK to UE4) try to compile it for the 4.3 and he told me you used some private thing and if I want to used it, he need to upload a big file.
                          Not sure what he means, I only use Engine-code and my .dylib is about 500kB in size. But yes, I plan to visit a Friend tonight and use his unlimited supplies of internets to download 4.3 for my mac and my PC, so I might be able to supply a compiled .dll tomorrow or so, depending on how problematic the conversion to 4.3 will be.

                          Yeah it does python fine, I initially thought I would deal with outputting the correct text file, just so happens I wrote a basic Python script about year or so ago for C4D to export positions of cloners for stadium seating..

                          So with this, the in DCC plugin has to connect to a server that is running in UE?
                          Outputting a text file would be a good start I think.

                          The m2uPlugin (the UE plugin) will start a TCP listener (server) when the plugin is loaded. Currently the listening address is hardcoded (localhost:3939).
                          On the m2u side (the python script). When telling m2u to "initialize" it is told which Program (Maya, Max, ...) it should load and which Editor (UEngine, Unity, ...) it should use. m2u will then load the modules for those if they exist (a folder named accordingly inside the m2u directory).
                          Those Program and Editor modules have to provide an Interface, a certain set of functions that is common across them (which is currently changing constantly, because.. WIP).
                          So all a Cinema4D module for m2u would have to do is, provide the correct interface functions (and a UI, until there might be a common UI across all programs) and internally make the correct calls to the Editor module's interface (getting the module using m2u.core.getEditor())
                          The python->TCP->UEngine->DoStuff will then be handled by the ue4 python module and the m2uPlugin.

                          If you, for some reason, don't want to adhere to the m2u structure, you have to make a TCP connection to the m2uPlugin yourself and send the correctly formatted commands, where the provided m2u implementation should be the reference.

                          Comment


                            #28
                            Would certainly be great to have a working version for 4.3!

                            Comment


                              #29
                              EXCELLENT WORK! This is one of the best things i've see so far this year!
                              Twitter - EyeOfScar

                              E-Mail

                              Comment


                                #30
                                thank you guys

                                It took a while, fighting with Visual Studio, but I got it to work with 4.3 and 4.4 on Windows and Mac of course.
                                ( I uninstalled all my old VS and reinstalled VS2013 again only to find out my Anti-virus program was the cause of UBT not being able to compile... )

                                latest additions:

                                - you can unleash pivots in maya, the transforms of the objects are taken from their actual origins now.
                                - added display layer syncing, adding, removing, renaming layers and changing membership of objects. (a bit buggy sometimes)
                                (- disabled parenting syncing until I will implement adding empty transforms in UE for maya's group transforms)

                                A Note on Layers:
                                Maya allows an object to be member of one and only one layer at a time. UE allows objects to be member in multiple layers, though the object will only be hidden if all layers of which it is member are hidden. When using layer syncing, a member-change will always tell UE to remove the object from all other layers. So we will force Maya's Display Layer behaviour onto UE here.

                                A Note on Grouping / Parenting:
                                You can use groups in maya and children of that group will be transformed correctly. But beware of duplicating groups or so, as there is no name-checking currently implemented for that case. Normally the children of a duplicated group in maya will have the same names as their originals, but will be prefixed (namespace) by their parent.
                                so duplicating a group1 with children pCube1 and pCube2 will generate a group2 with children group2|pCube1 and group2|pCube2. This will cause any names involved in this to be unfindable in UE, so the sync will be broken until you make sure you rename the duplicated objects with unique names.
                                In some future update, there will be a name syncing for duplicated children, but not yet.

                                To use it:
                                You will have to compile it yourself, because you have to make a change to one engine source file to compile on Windows!
                                1.) get the tag from here: https://bitbucket.org/m2u/m2uue4plugin/commits/tag/v0.2
                                2.) do the following change to line 7 in /Source/Editor/UnrealEd/Classes/Factories/FbxFactory.h
                                from
                                Code:
                                class UFbxFactory : public UFactory
                                to
                                Code:
                                class UNREALED_API UFbxFactory : public UFactory
                                This will make sure that UFbxFactory class is exported from the library and the m2uPlugin can find it when linking to it. This step is not necessary on Mac, only on Windows!
                                3.) recompile the Engine and the plugin.
                                4.) start the Editor and enable m2uPlugin under the Editor tab in the Plugin manager. You will have to restart the Editor.

                                For Maya:
                                1.) check out the develop branch from here: https://bitbucket.org/m2u/m2u/branch/develop
                                2.) put the path to the directory where the m2u directory is located to the python path and initalize m2u:
                                Code:
                                import m2u
                                m2u.core.initialize("maya","ue4")
                                
                                from m2u.maya import mayaInternalUI
                                mayaInternalUI.createUI()

                                Changing the FbxFactory.h file should only be a temporary solution. I will either file a request to epic to make that change in a future engine version or I will have to copy more code from the UFbxFactory and derive from UFactory instead, but I would have to move my code to a repository on Github which restricts access to Users having access to Epics current engine repository, because that would be a lot of copy-pasted engine code then. We will see.
                                Last edited by alfalfasprossen; 08-11-2014, 05:25 PM.

                                Comment

                                Working...
                                X