Announcement

Collapse
No announcement yet.

m2u interactive sync script for Maya -> UE4

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

    #31
    Been trying to compile this unsuccessfully, so this comes at a great time. Even with the new version I keep having a problem with UBT where it complains about SlateCore:

    Code:
    Binding IntelliSense data... 0%ERROR: Exception thrown while processing dependent modules of m2uPlug...
    in
    ERROR: Couldn't find module rules file for module 'SlateCore'.
    Goes away when I comment out the SlateCore part in the build file, is that ok?

    Edit: ah never mind, I was on 4.1 by mistake. Trying on 4.3.
    Last edited by Gigantoad; 08-11-2014, 06:44 PM.

    Comment


      #32
      If it builds successfully then it should be ok, i guess.
      I haven't had that error yet and I added the slate-references when I got an unresolved external symbol from some engine-class that uses Slate. But maybe adding SlateCore was not necessary.

      Comment


        #33
        Yeah compiled fine, thanks. I grabbed the Maya bit but can't seem to figure what you mean by this:

        Originally posted by alfalfasprossen View Post
        2.) put the path to the directory where the m2u directory is located to the python path and initalize m2u:

        Comment


          #34
          in a managed environment (pipeline), there are certain places where you put scripts, which are by default added to the pythonpath by maya. Those are environment variables pointing to certain directories (PYTHONPATH, MAYA_SCRIPT_PATH)

          If you don't want to care about setting up those paths (because you don't use many more other scripts or so), you can just add to the pythonpath within python by executing this:
          Code:
          import sys
          sys.path.append("C:/path/to/folder/in/which/m2u/folder/lies")
          so if you put the m2u folder into "C:/temp" then add that to the path, NOT "C:/temp/m2u"

          Comment


            #35
            Alright, now I have the m2u window loaded in Maya but it seems I can't connect.

            Code:
            # Error: m2u.udk.udkUI : No UDK instance found. #
            I have the UE4 editor running and the plugin is enabled. Anything else I need to do?

            Oh right, it's going to udk folder instead of ue4 for some reason?
            Last edited by Gigantoad; 08-11-2014, 09:36 PM.

            Comment


              #36
              you need to run initialize explicitly with the parameters telling it to initialize for UE4, not UDK (which still is the default in code, maybe i should remove default parameters from that function)
              Code:
              m2u.core.initialize("maya","ue4")

              Comment


                #37
                This is looking amazing! Any plans to support the collision authoring tools in the editor? Right now the interaction tools and camera controls are pretty rough in some of the tools. This could help out with that tremendously!
                @Brian__May

                Comment


                  #38
                  Ok so connect seems to work, but using "Sync Camera" or "Fetch Selected" results in Maya freezing and me having to kill it in Task Manager. And "Send Selected To Editor" produces:

                  Code:
                  # m2u.maya.mayaCommand : found 1 selected meshes
                  # m2u.maya.mayaCommand : found 1 untagged
                  # m2u.maya.mayaCommand : found 0 tagged
                  # m2u.maya.mayaCommand : found 0 tagged uniques
                  # m2u.maya.mayaCommand : assuming new untagged unique: pSphere1
                  # m2u.maya.mayaCommand : found 1 uniques (with untagged)
                  # m2u.maya.mayaCommand : settings file path is: D:\GitHub\m2u\ue4/ue4FBXSettings.fbxexportpreset
                  // Error: Preset file not found. // 
                  // Error: D:GitHubm2uue4\ue4FBXSettings.fbxexportpreset // 
                  # Error: MelError: file D:\3d\Autodesk\Maya2015\Python\lib\site-packages\pymel\core\language.py line 835: Error during execution of MEL script: Preset file not found.
                  D:GitHubm2uue4\ue4FBXSettings.fbxexportpreset
                  Script:
                    FBXLoadExportPresetFile -f "D:\GitHub\m2u\ue4/ue4FBXSettings.fbxexportpreset"; #
                  Now GitHub may sound a bit odd since you're on Bitbucket, I just wanted to have it all in one place. Not that it matters of course. But the red part seems to be missing some slashes? Maybe an issue with backslashes on Windows or something? Tried to reverse the slash in the PYTHONPATH environment variable, that did nothing though.

                  Comment


                    #39
                    the missing slashes should be fixed, please make sure you checkout the develop branch, not the master branch!

                    the freezing might be caused by the tcp not being able to connect to localhost, maybe caused by a firewall or your machine being in a LAN. It was only recently that I came across the same problem and I'm not sure about the solution to that problem yet.
                    please execute the two following command in a python shell, when the editor is running and m2uPlugin is loaded:
                    Code:
                    import socket
                    
                    # client code
                    s=None
                    
                    def openConnection(TCP_IP = '127.0.0.1', TCP_PORT=3939):
                        BUFFER_SIZE = 1024
                        global s
                        
                        s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
                        s.connect((TCP_IP, TCP_PORT))
                    
                    openConnection()
                    the log-window in the Editor should tell you if a connection was made. Otherwise you will get an error by python, that the connection has been refused.


                    This is looking amazing! Any plans to support the collision authoring tools in the editor? Right now the interaction tools and camera controls are pretty rough in some of the tools. This could help out with that tremendously!
                    Thank you. You mean the other editor windows, like the Static Mesh Editor? I didn't think of that yet, I think the most used means of collision authoring would be to create UCX prefixed meshes in the 3d-authoring program and export them with the mesh to the FBX file? But I did not actively investigate anything in the form of syncing collision yet.

                    Comment


                      #40
                      So sorry, my origin pointed to https://bitbucket.org/m2u/m2u/branch/develop yet I still get the master branch unless I manually switch to the develop branch. God I hate version control. It's fixed now, both m2u and your shell code connect successfully and everything else works as expected as well.

                      Thanks for the support. Hopefully I'll be able to help others who might run into the same troubles.

                      Comment


                        #41
                        hehe, version control can be a ***** sometimes...
                        good to hear it works though.

                        Comment


                          #42
                          So this is really fun. It has a nice side effect too. UE4 editor doesn't support 3DConnexion devices like SpaceNavigator yet, but Maya does. With the camera sync enabled I can now basically use this, even directly in the editor with Maya in the background for some reason. The only limitation being that I can't select an object and use that as the center of rotation like I have set up in Maya. I guess selecting in the editor doesn't result in selection in Maya, otherwise even that would work.

                          The other slightly bothersome thing is that I can't control where new meshes go in the content browser. They all land in the root directory and if I move them somewhere else the link breaks.

                          Excellent work for sure, it really is a bit magical

                          Comment


                            #43
                            Originally posted by alfalfasprossen View Post
                            the missing slashes should be fixed, please make sure you checkout the develop branch, not the master branch!

                            the freezing might be caused by the tcp not being able to connect to localhost, maybe caused by a firewall or your machine being in a LAN. It was only recently that I came across the same problem and I'm not sure about the solution to that problem yet.
                            please execute the two following command in a python shell, when the editor is running and m2uPlugin is loaded:
                            Code:
                            import socket
                            
                            # client code
                            s=None
                            
                            def openConnection(TCP_IP = '127.0.0.1', TCP_PORT=3939):
                                BUFFER_SIZE = 1024
                                global s
                                
                                s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
                                s.connect((TCP_IP, TCP_PORT))
                            
                            openConnection()
                            the log-window in the Editor should tell you if a connection was made. Otherwise you will get an error by python, that the connection has been refused.



                            Thank you. You mean the other editor windows, like the Static Mesh Editor? I didn't think of that yet, I think the most used means of collision authoring would be to create UCX prefixed meshes in the 3d-authoring program and export them with the mesh to the FBX file? But I did not actively investigate anything in the form of syncing collision yet.
                            For some dynamic objects it's better to use the built in tools to place capsules or spheres. The built in tools for moving in the environment and placing the capsules is really bare-bones. This could be a pretty nice set of tools for dealing with that
                            @Brian__May

                            Comment


                              #44
                              So when I edit an object in Maya, say bevel or extrude something, it doesn't auto-update in the Editor. When I then use "Send Selected To Editor" I now have the updated object duplicated on top of each other.

                              I assume this is a known limitation currently or am I doing it wrong?

                              Comment


                                #45
                                yes, this is because there is no fancy UI yet to tell exactly what you want to do (send as new, send as overwrite, etc.) And there are some checks like "does this asset already exist in UE" not implemented yet to get this fully working. Possibility of an interactive update of the geometry is not yet investigated, and even if, it would most likely only be a preview with an temporary actor, because you would still have to "export and import" the asset, which takes too much time to be "interactive".

                                I'm sorry I can't implement more features or fix bugs currently because I have to write the theoretical part of my thesis

                                Comment

                                Working...
                                X