armory3d / armory

3D Engine with Blender Integration
https://armory3d.org
zlib License
3.05k stars 317 forks source link

Krom standalone player / compiling armory project issues #474

Closed AFWSI closed 6 years ago

AFWSI commented 6 years ago

OK, why am I getting errors like this when I try to compile a armory project in visual studio. I looked in all folders and there appears to be no .pch file anywhere.

Error C1083 Cannot open precompiled header file: 'Release\amorytest2.pch': No such file or directory amorytest2 C:\Users\User\Blender Files\Blender .blend Files\build_armory_test2\windows-build\Sources\src\Main.cpp 2

Also, how do I get Krom standalone player to work. I seen this thread armory3d/armory#427 and I copied "latest Krom binaries" to armsdk/win32/Krom/win32 ,but that just makes a window flash really quick and doesn’t play the scene. Is there something else that makes Krom standalone player work? I was able to get the built in player to work ,but not standalone.

(optional - drag & drop zipped .blend file here)

luboslenco commented 6 years ago

Sorry I got confused, is this about compiling for Krom or compiling your armory project to c++ target? Does bundled Krom work ok?

There should be no special steps when compiling Krom. You coud try running some Kha example in it from command line, to see if that works. You can also try the node Kha/make on a raw Kha example and see if you can compile that in VS.

https://github.com/Kha-Samples

AFWSI commented 6 years ago

Yeah, hard to explain. The first part is about compiling my c++ project in visual studio. From instructions here http://armory3d.org/manual/platforms/windows.html .I’m able to create the .sln and other files needed within blender/armory ,but compiling/building the project in visual studio gives the error(step 2 from link above). After doing some reading looks like issue on my end ,but I tried some of these steps with no luck. https://stackoverflow.com/questions/6096384/how-to-fix-pch-file-missing-on-build

When your talking about bundled Krom, your talking about built in player in blender/armory? That works fine.

The standlone player issue. When I hit the play button from “Armory Player” a window just quickly flashes and my scene doesn’t play in a new window like this video https://m.youtube.com/watch?v=2-xkLH5FjPw

If needed I will make a video showing the window closing/crashing.

AFWSI commented 6 years ago

See if this helps any.

Here is what I get in Visual Studio. I tried “ not use precompiled headers” that is recommended here https://social.msdn.microsoft.com/Forums/vstudio/en-US/49eb0d77-86b7-4735-8d7f-aef94d505b3b/cant-get-rid-of-fatal-error-c1083?forum=vcgeneral ,but I end up with the same error still. visual_studio_errors

From previous post, I copied the Krom binaries from the link to armsdk/win32/Krom/win32 krom_issue

Here you can see the built in player works fine ,but I can't get the standalone working. I'm sure I'm missing something simple. https://www.youtube.com/watch?v=OoE4DKzwVJg&feature=youtu.be

AFWSI commented 6 years ago

Well, this is my last post cause I don’t want to flood with comments ,but I wanted to give a update. I managed to solve my one problem with the compiling/building project by adding stdafx.h and stdafx.cpp to my project, tweaking header settings for project and the cpp file, right clicking on the cpp and hitting compile. That took care of the “missing” pch file that the error was wanting ,but then everything was looking for 3 or 4 .h files that seems to be nowhere.

On the standalone player, I managed to get it to stay open and say non responding before it decide to close from not responding. I got that by copying the files in thread from previous comment ,but replacing the natives_blob.bin with the one from here. https://github.com/armory3d/krom_blender/tree/master/source/blender/editors/space_armory/Deployment/release/win32 There seems to be an issue and I’m not smart enough to compile/build krom.

krom_stop_running

luboslenco commented 6 years ago

@AFWSI thanks for additional info, sorry that I did not have time to investigate yet. Packing new builds now and then getting back to this!

luboslenco commented 6 years ago

Argh, I think I know what went wrong there - on Windows Krom has to be set to OpenGL using node Kore/make --noshaders -g opengl when building. Adding a note to the docs.

You can also get a pre-built Krom from https://github.com/armory3d/Krom_bin now.

AFWSI commented 6 years ago

I knew it was probably something simple, but I couldn’t figure it out. I was finally able to get it working by using the pre-built Krom you posted. I haven’t tested a project again in Visual Studio to see if I still have that issue or not. I’ll try again later and see.

RNavega commented 6 years ago

Does this mean that krom_blender and krom_blender28 need the same fix on Windows, since they have it "built-in"? https://github.com/armory3d/armory/blob/master/blender/arm/make.py#L224-L233

luboslenco commented 6 years ago

No, Blender only ever runs OpenGL so Krom is always set to that: https://github.com/armory3d/krom_blender/blob/master/source/blender/editors/space_armory/CMakeLists.txt#L253

For regular Krom it defaults to Direct3D11 on Windows.

RNavega commented 6 years ago

Ah, ok, thanks for clarifying.