Hi guys. It seems like maybe there are a few artists (obviously we are the ones most interested in using this) in here struggling to get this working. I’ve gone a couple rounds with it myself. I thought I finally sorted it out last night. I installed visual studio 2013, downloaded the source ( Downloading Unreal Engine Source Code | Unreal Engine Documentation ) ,then put the zip I downloaded from: https://bitbucket.org/m2u/m2uue4plugin/ in the plugins directory ( E:\UnrealEngine-release\UnrealEngine-release\Engine\Plugins ) and compiled. It reports this: ========== Build: 14 succeeded, 0 failed, 2 up-to-date, 26 skipped ========== . However, when I try to load the plugin I am getting this error message:
Plugin ‘m2uPlugin’ failed to load because module ‘m2uPlugin’ could not be found. Please ensure the plugin is properly installed, otherwise consider disabling the plugin for this project.
I admit I am in a bit over my head, but I am really determined to get this working. On the maya side I put the contents from ( https://bitbucket.org/m2u/m2u/src/425e545ac38d0dd94475805212753f791727f3c1?at=master ) in the maya scripts folder: C:\Users\josh\Documents\maya\scripts and set the PYTHONPATH to the same dir. That part seems ok. At least I am able to run this bit of python without errors:
import m2u
m2u.core.initialize(“maya”, “ue4”)
create UI here, send the initialized m2u module to the ui if necessary (max)
in maya it should be in the maya namespace ?
#createUI(m2u)
#TODO check if pyQt is installed, if not, use the simple internal maya UI
from m2u.maya import mayaInternalUI
mayaInternalUI.createUI()
A little guidance on this matter would be greatly appreciated. This workflow seems really ideal.
I got everything to work for unreal 4.7.6 but was unable to get it to work for 4.9. For 4.9’s API changed on how it handles buttons… at least that seems to be the errors i am getting.
@antithing that error you can correct in the mayaCommand.py script. Just add the following at the end of the variable.
.replace("\","/")
For example:
expcmd = “FBXExport -f “%s” -s;” % path
expcmd = “FBXExport -f “%s” -s;” % path.replace("\","/")
OR like this
lsfcmd = “FBXLoadExportPresetFile -f “%s”;” % sfpath.replace("\","/")
You may need to add that in a few more places, depends on the line errors you are getting in Maya.
@vertigoo i’m sure you figured it out, but i was able to load the gui like so. #maya python editor i use maya 2015
import sys
sys.path.append(‘c:/yourPath’ ) #m2u folder should be under yourPath
import m2u
reload(m2u)
from m2u.maya import mayaInternalUI
m2u.core.initialize(“maya”,“ue4”)
m2u.core.getProgram().mayaInternalUI.createUI()
My two cents. i played with this for about an hour or so. Its has some great ideas and seems promising. Its still rough around the edges, the plugin could do a better job when dealing with matrices and transforms (especially when dealing with rotations), as i got inconsistent results when updated objects. Would love to see some movement on this and see it continue/ evolve. I’m myself am exploring alternative ways of connecting programs to unreal (like maya, sketchup, max). The biggest hurdle right now, is time.
So i was able to get this to work for 4.10 with visual studio 2015
m2uPlugin.cpp change line 171
Data.Init(DataSize);
to:
Data.SetNumUninitialized(DataSize);
m2uHelper.h change line 36
Chopped.ParseIntoArray( &Result, TEXT(","), false);
to:
Chopped.ParseIntoArray( Result, TEXT(","), false);
compile. There is a problem with using ConstructObject about it being deprecated in the next release. They mention to switch to NewObject. I tried changing it to NewObject but ue4 crashes once it tried to import the fbx. So i left it with the ConstructObject for the moment. It still compiles
One odd thing
The fbx import UI opens everytime i send information from maya to ue4 but it works
when I tried to compile the plugin in vs community 2015, I got a bunch of error after making the above two changes. Any chance I got the wrong version of source files?
1>z:\unreal projects\fbxbuildertest\plugins\m2u-m2uue4plugin-71a3d39e50fe\source\m2uplugin\private\m2uAssetHelper.h(160): error C2039: ‘ValidForCurrentGame’: is not a member of ‘UFactory’
1> Z:\Epic Games\4.10\Engine\Source\Developer/AssetTools/Public/IAssetTools.h(10): note: see declaration of ‘UFactory’
1>z:\unreal projects\fbxbuildertest\plugins\m2u-m2uue4plugin-71a3d39e50fe\source\m2uplugin\private\m2uAssetHelper.h(265): error C2065: ‘FNotificationInfo’: undeclared identifier
1>z:\unreal projects\fbxbuildertest\plugins\m2u-m2uue4plugin-71a3d39e50fe\source\m2uplugin\private\m2uAssetHelper.h(265): error C2146: syntax error: missing ‘;’ before identifier ‘Info’
1>z:\unreal projects\fbxbuildertest\plugins\m2u-m2uue4plugin-71a3d39e50fe\source\m2uplugin\private\m2uAssetHelper.h(265): error C3861: ‘Info’: identifier not found
1>z:\unreal projects\fbxbuildertest\plugins\m2u-m2uue4plugin-71a3d39e50fe\source\m2uplugin\private\m2uAssetHelper.h(266): error C2065: ‘Info’: undeclared identifier
1>z:\unreal projects\fbxbuildertest\plugins\m2u-m2uue4plugin-71a3d39e50fe\source\m2uplugin\private\m2uAssetHelper.h(266): error C2228: left of ‘.ExpireDuration’ must have class/struct/union
1> z:\unreal projects\fbxbuildertest\plugins\m2u-m2uue4plugin-71a3d39e50fe\source\m2uplugin\private\m2uAssetHelper.h(266): note: type is ‘unknown-type’
1>z:\unreal projects\fbxbuildertest\plugins\m2u-m2uue4plugin-71a3d39e50fe\source\m2uplugin\private\m2uAssetHelper.h(267): error C2065: ‘Info’: undeclared identifier
1>z:\unreal projects\fbxbuildertest\plugins\m2u-m2uue4plugin-71a3d39e50fe\source\m2uplugin\private\m2uAssetHelper.h(267): error C2228: left of ‘.bUseLargeFont’ must have class/struct/union
1> z:\unreal projects\fbxbuildertest\plugins\m2u-m2uue4plugin-71a3d39e50fe\source\m2uplugin\private\m2uAssetHelper.h(267): note: type is ‘unknown-type’
1>z:\unreal projects\fbxbuildertest\plugins\m2u-m2uue4plugin-71a3d39e50fe\source\m2uplugin\private\m2uAssetHelper.h(268): error C2065: ‘Info’: undeclared identifier
1>z:\unreal projects\fbxbuildertest\plugins\m2u-m2uue4plugin-71a3d39e50fe\source\m2uplugin\private\m2uAssetHelper.h(268): error C2228: left of ‘.bFireAndForget’ must have class/struct/union
1> z:\unreal projects\fbxbuildertest\plugins\m2u-m2uue4plugin-71a3d39e50fe\source\m2uplugin\private\m2uAssetHelper.h(268): note: type is ‘unknown-type’
1>z:\unreal projects\fbxbuildertest\plugins\m2u-m2uue4plugin-71a3d39e50fe\source\m2uplugin\private\m2uAssetHelper.h(269): error C2065: ‘Info’: undeclared identifier
1>z:\unreal projects\fbxbuildertest\plugins\m2u-m2uue4plugin-71a3d39e50fe\source\m2uplugin\private\m2uAssetHelper.h(269): error C2228: left of ‘.bUseSuccessFailIcons’ must have class/struct/union
1> z:\unreal projects\fbxbuildertest\plugins\m2u-m2uue4plugin-71a3d39e50fe\source\m2uplugin\private\m2uAssetHelper.h(269): note: type is ‘unknown-type’
1>z:\unreal projects\fbxbuildertest\plugins\m2u-m2uue4plugin-71a3d39e50fe\source\m2uplugin\private\m2uAssetHelper.h(270): error C2027: use of undefined type ‘FSlateNotificationManager’
1> Z:\Epic Games\4.10\Engine\Source\Runtime\Slate\Public\SlateBasics.h(131): note: see declaration of ‘FSlateNotificationManager’
1>z:\unreal projects\fbxbuildertest\plugins\m2u-m2uue4plugin-71a3d39e50fe\source\m2uplugin\private\m2uAssetHelper.h(270): error C3861: ‘Get’: identifier not found
1>z:\unreal projects\fbxbuildertest\plugins\m2u-m2uue4plugin-71a3d39e50fe\source\m2uplugin\private\m2uAssetHelper.h(270): error C2228: left of ‘.AddNotification’ must have class/struct/union
1> z:\unreal projects\fbxbuildertest\plugins\m2u-m2uue4plugin-71a3d39e50fe\source\m2uplugin\private\m2uAssetHelper.h(270): note: type is ‘unknown-type’
1>z:\unreal projects\fbxbuildertest\plugins\m2u-m2uue4plugin-71a3d39e50fe\source\m2uplugin\private\m2uAssetHelper.h(270): error C2065: ‘Info’: undeclared identifier
1>z:\unreal projects\fbxbuildertest\plugins\m2u-m2uue4plugin-71a3d39e50fe\source\m2uplugin\private\m2uAssetHelper.h(270): error C2227: left of ‘->SetCompletionState’ must point to class/struct/union/generic type
1>z:\unreal projects\fbxbuildertest\plugins\m2u-m2uue4plugin-71a3d39e50fe\source\m2uplugin\private\m2uAssetHelper.h(270): error C2027: use of undefined type ‘SNotificationItem’
1> Z:\Epic Games\4.10\Engine\Source\Runtime\Slate\Public\SlateBasics.h(123): note: see declaration of ‘SNotificationItem’
1>z:\unreal projects\fbxbuildertest\plugins\m2u-m2uue4plugin-71a3d39e50fe\source\m2uplugin\private\m2uAssetHelper.h(270): error C2065: ‘CS_Fail’: undeclared identifier
1>Z:\Unreal Projects\fbxBuilderTest\Plugins\m2u-m2uue4plugin-71a3d39e50fe\Source\m2uPlugin\Private\m2uPlugin.cpp(663): warning C4996: ‘UTextRenderComponent::SetText’: Passing text as FString is deprecated, please use FText instead (likely via a LOCTEXT). Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile.
1> Z:\Epic Games\4.10\Engine\Source\Runtime\Engine\Classes\Components/TextRenderComponent.h(96): note: see declaration of ‘UTextRenderComponent::SetText’
1> m2uFbxFactory.cpp
1> FbxBuilderStaticMeshImportData.cpp
1> FbxBuilderSkeletalMeshImportData.cpp
1> FbxBuilderTextureImportData.cpp
1>Z:\Unreal Projects\fbxBuilderTest\Plugins\m2u-m2uue4plugin-71a3d39e50fe\Source\m2uPlugin\Private\m2uFbxFactory.cpp(5): error C2143: syntax error: missing ‘)’ before ‘(’
1>Z:\Unreal Projects\fbxBuilderTest\Plugins\m2u-m2uue4plugin-71a3d39e50fe\Source\m2uPlugin\Private\m2uFbxFactory.cpp(5): error C2206: ‘Um2uFbxFactory::{ctor}’: typedef cannot be used for function definition
1>Z:\Unreal Projects\fbxBuilderTest\Plugins\m2u-m2uue4plugin-71a3d39e50fe\Source\m2uPlugin\Private\m2uFbxFactory.cpp(5): error C2059: syntax error: ‘&’
1>Z:\Unreal Projects\fbxBuilderTest\Plugins\m2u-m2uue4plugin-71a3d39e50fe\Source\m2uPlugin\Private\m2uFbxFactory.cpp(5): error C2059: syntax error: ‘)’
1>Z:\Unreal Projects\fbxBuilderTest\Plugins\m2u-m2uue4plugin-71a3d39e50fe\Source\m2uPlugin\Private\m2uFbxFactory.cpp(6): error C2065: ‘PCIP’: undeclared identifier
1>Z:\Unreal Projects\fbxBuilderTest\Plugins\m2u-m2uue4plugin-71a3d39e50fe\Source\m2uPlugin\Private\m2uFbxFactory.cpp(6): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>Z:\Unreal Projects\fbxBuilderTest\Plugins\m2u-m2uue4plugin-71a3d39e50fe\Source\m2uPlugin\Private\m2uFbxFactory.cpp(7): error C2448: ‘Super’: function-style initializer appears to be a function definition
1>Z:\Unreal Projects\fbxBuilderTest\Plugins\m2u-m2uue4plugin-71a3d39e50fe\Source\m2uPlugin\Private\m2uFbxFactory.cpp(41): error C2039: ‘bReplaceVertexColors’: is not a member of ‘UnFbx::FBXImportOptions’
1> Z:\Epic Games\4.10\Engine\Source\Editor/UnrealEd/Private/FbxImporter.h(108): note: see declaration of ‘UnFbx::FBXImportOptions’
sorry, my bad. It’s really painful for a non programmer to compile sth. I was grabbing the tag 0.2 file which is dated back to 2014. Now I clicked download — Download repository which seems to be more recent. those errors went away. However I still got these near the end the compilation:
1> [46/47] Link UE4Editor-m2uPlugin.dll
1> Creating library Z:\Unreal Projects\fbxBuilderTest\Plugins\m2u-m2uue4plugin-c7b6b17858a0\Intermediate/Build/Win64\UE4Editor\Development\UE4Editor-m2uPlugin.lib and object Z:\Unreal Projects\fbxBuilderTest\Plugins\m2u-m2uue4plugin-c7b6b17858a0\Intermediate/Build/Win64\UE4Editor\Development\UE4Editor-m2uPlugin.exp
1>m2uFbxFactory.cpp.obj : error LNK2019: unresolved external symbol “void * __cdecl fbxsdk::FbxMalloc(unsigned __int64)” (?FbxMalloc@fbxsdk@@YAPEAX_K@Z) referenced in function “public: void * __cdecl fbxsdk::FbxBaseAllocator::AllocateRecords(unsigned __int64)” (?AllocateRecords@FbxBaseAllocator@fbxsdk@@QEAAPEAX_K@Z)
1>m2uFbxFactory.cpp.obj : error LNK2019: unresolved external symbol “void __cdecl fbxsdk::FbxFree(void *)” (?FbxFree@fbxsdk@@YAXPEAX@Z) referenced in function “public: void __cdecl fbxsdk::FbxRedBlackTree<class fbxsdk::FbxMap<class fbxsdk::FbxString,class fbxsdk::FbxObject *,struct fbxsdk::FbxStringCompare,class fbxsdk::FbxBaseAllocator>::KeyValuePair,struct fbxsdk::FbxStringCompare,class fbxsdk::FbxBaseAllocator>::Clear(void)” (?Clear@?$FbxRedBlackTree@VKeyValuePair@?$FbxMap@VFbxString@fbxsdk@@PEAVFbxObject@2@UFbxStringCompare@2@VFbxBaseAllocator@2@@fbxsdk@@UFbxStringCompare@3@VFbxBaseAllocator@3@@fbxsdk@@QEAAXXZ)
1>m2uFbxFactory.cpp.obj : error LNK2019: unresolved external symbol “public: __cdecl fbxsdk::FbxString::FbxString(class fbxsdk::FbxString const &)” (??0FbxString@fbxsdk@@QEAA@AEBV01@@Z) referenced in function “public: __cdecl fbxsdk::FbxPair<class fbxsdk::FbxString const ,class fbxsdk::FbxObject *>::FbxPair<class fbxsdk::FbxString const ,class fbxsdk::FbxObject *>(class fbxsdk::FbxPair<class fbxsdk::FbxString const ,class fbxsdk::FbxObject *> const &)” (??0?$FbxPair@$$CBVFbxString@fbxsdk@@PEAVFbxObject@2@@fbxsdk@@QEAA@AEBV01@@Z)
1>m2uFbxFactory.cpp.obj : error LNK2019: unresolved external symbol “public: __cdecl fbxsdk::FbxString::~FbxString(void)” (??1FbxString@fbxsdk@@QEAA@XZ) referenced in function “public: __cdecl fbxsdk::FbxPair<class fbxsdk::FbxString const ,class fbxsdk::FbxObject *>::~FbxPair<class fbxsdk::FbxString const ,class fbxsdk::FbxObject *>(void)” (??1?$FbxPair@$$CBVFbxString@fbxsdk@@PEAVFbxObject@2@@fbxsdk@@QEAA@XZ)
1>m2uFbxFactory.cpp.obj : error LNK2019: unresolved external symbol "public: __cdecl fbxsdk::FbxString::operator char const *(void)const " (??BFbxString@fbxsdk@@QEBAPEBDXZ) referenced in function "public: int __cdecl fbxsdk::FbxStringCompare::operator()(class fbxsdk::FbxString const &,class fbxsdk::FbxString const &)const " (??RFbxStringCompare@fbxsdk@@QEBAHAEBVFbxString@1@0@Z)
1>m2uFbxFactory.cpp.obj : error LNK2019: unresolved external symbol "public: int __cdecl fbxsdk::FbxString::Compare(char const *)const " (?Compare@FbxString@fbxsdk@@QEBAHPEBD@Z) referenced in function "public: int __cdecl fbxsdk::FbxStringCompare::operator()(class fbxsdk::FbxString const &,class fbxsdk::FbxString const &)const " (??RFbxStringCompare@fbxsdk@@QEBAHAEBVFbxString@1@0@Z)
1>Z:\Unreal Projects\fbxBuilderTest\Plugins\m2u-m2uue4plugin-c7b6b17858a0\Binaries\Win64\UE4Editor-m2uPlugin.dll : fatal error LNK1120: 6 unresolved externals
looks like you placed the code underneath your projects folder. you need to download the full source of the engine and place the m2u plugin underneath plugins under the engine itself. Then in visual studio you need to do a full rebuild in order for visual studio to find the plugin and compile it.
yes I put the plugin in the project file to compile it since I don’t have full source of the engine. However, I add a FBX module in the build file of the plugin, now it compiles successfully. Thanks.
Now facing another problem. Seems like we need to make maya work in Z up, and after freeze transformation, object’s pivot in UE4 will be reset to world origin. Any chance that we could fix that?
After numerous trials and error and restarting maya and unreal each time (I don’t know how to refresh the python compilation, and uneal m2u seems to be dead each time I close and reopen maya), I made some dirty modifications to 3 py script on the maya side so that:
Maya can work in Y-up and sync perfectly with unreal (working in Z-up could be a problem since I use mocap and it seems the world space in Maya and unreal is +/- reversed even setup to be z-up, making me so confused in adjusting numbers)
cam sync also works
when fetch from the editor, I found that the fbx has -90 x rotation which makes my previous effort useless. I don’t know how to implement a fix in the m2u script. but I do managed to write a seperate py script to clean the mess to make the sync work again if objects are fetched from the editor. maya to unreal is not affect.
4.hope someone could make it better. I am not a programmer, please excuse the mess.
4.13 is supported: m2u · GitHub
I would assume that it will compile for 4.14 as well, as there were no deprecation warnings in 4.13, but it shouldn’t be hard to find out
Hi there! Thanks for good tool, looks promising.
Allright we’ve finally started maya scripts. The issue was in 2 files:
assetHelper.py and systemHelper.py
You won’t beleive but it began to work after these files were lowercased!
Looks like python is too sensitive to filenames.
During compiling the plugin from sources it throws one error in file m2uAssetHelper.h:
UFactory::ResetState(); - something about call on non-static class member.
and deprecation warning in file m2uOpObject.h:
line 640: ChildRoot->DetachFromParent(true);
finally compiled in VS2015 by commenting out line with error and leaving deprecation warning as is.