getnamo / TensorFlow-Unreal

TensorFlow plugin for the Unreal Engine.
Other
1.15k stars 211 forks source link

Fail to convert project to cpp #49

Closed Mrmiffo closed 5 years ago

Mrmiffo commented 5 years ago

Plugin version: tensorflow-ue4.22-v0.13.0-cpu UE4 version: 4.22.3 Visual Studio Community: 2017 15.9.14

Issue: When converting the project from a Blueprint only as per the documentation and https://allarsblog.com/2015/11/04/converting-bp-project-to-cpp/ , the build fails when building with the configuration set to Development. Visual studio throws two errors: Severity Code Description Project File Line Suppression State Error C2039 'SetCurrentLevel': is not a member of 'UWorld' TensorFlowExamples D:\Unreal Projects\tensorflow-ue4-examples\Plugins\UnrealEnginePython\Source\UnrealEnginePython\Private\UObject\UEPyWorld.cpp 319

and Severity Code Description Project File Line Suppression State Error MSB3075 The command ""D:\Unreal Engine\UE_4.22\Engine\Build\BatchFiles\Build.bat" TensorFlowExamples Win64 Development -Project="D:\Unreal Projects\tensorflow-ue4-examples\TensorFlowExamples.uproject" -WaitMutex -FromMsBuild" exited with code 5. Please verify that you have sufficient rights to run this command. TensorFlowExamples C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets 44

I've tried both using one of the UE4 template projects, an empty newly created project, as well as the tensorflow-ue4-examples project. All fail with the same issue.

If I try to package the project without converting the python code will not run, but the game will start. If I try to package the project after the failed conversion UE4 will fail with the same error. Building with configuration Development Editor is successful.

Steps to recreate:

  1. Create a new UE4 project (UE4 4.22.3)
  2. Add the Plugins folder from tensorflow-ue4.22-v0.13.0-cpu.7z
  3. Start the project
  4. Create a new .cpp file, let UE4 compile
  5. Open visual studio, select configuration Development Editor
  6. Right-click project name and select Build, build successful
  7. Change configuration to Development
  8. Right-click project name and select Build, build fails with the above errors.

Am I doing something wrong? :)

Mrmiffo commented 5 years ago

Found a solution in the thread of issue #16

In UEPyWorld.cpp change the following code: if (world->SetCurrentLevel(level)) Py_RETURN_TRUE;

To: `#if WITH_EDITORONLY_DATA if (world->SetCurrentLevel(level)) Py_RETURN_TRUE;

endif`

getnamo commented 5 years ago

Please consider making a pull request and I'll merge the required fixes