Open/Save File dialog at runtime

Thanks @khalibloo for the fast replay ,but i want to use c++ only for opening the window, can you please give me the link for the opening of window with button tutorial, it will be really helpful, i am new to UE4(I am doing the same thing as you guys did , after the window open i want to select file and that will create geometry in UE4,did you do something like this ??). Thanks in advance

Have a look at my comment above. I posted some of the cpp files there. I can’t figure out how to link to the comment. But it’s the one right after emptyT asked if I could share the successes. It’s not much of a tutorial, but I think you’ll find it useful.

I followed the steps given in your comment but how to see if its working on not , how do i connect this code with some button ??I cant drag and drop class file in editor !!(I cant upload image for some reason but its plugin button above the editor)

@khalibloo can you please help me on this ??

The class gives you a blueprint node you can use. You simply attach the node to an OnClick event to a button in your interface. The node looks a little like so. Depending on what variables you choose to expose in c++.

250667-ue-fd-fileops-node.png

the chances are that I might have done something wrong in spite of following the exact steps, so could you help me a bit? after creating the blueprint, I dragged it as an actor in the scene and hit the play button, but I received an error saying that there’s an infinite loop somewhere - no other detail given
do you happen to have any idea of what might be causing that?

found the problem: I assigned it to “event begin” and didn’t notice that the code was treating the event too. I have a different problem now though: it gives me an error “unexpected indent (file_dialog.py, line 2)”. I decided to comment that line and it gives me the same error for the next line

Ah great! I never would have thought of that as a possible cause. I’m guessing you’re fairly new to python. Python uses indentation instead of curly braces to block out its code. So indentation is a big deal in python. You should take some time to understand it. If you’re using vs code, you can use the format document command (alt + shift + f) and see the difference.

thank you, that made the error go away! it seems the indentation got messed up when I pasted your code

Looks like I ran into something else: “ModuleNotFoundError: No module named ‘PySide2’”. I followed your instructions and I installed it, and it does appear in that folder

When I had a similar issue, it turned out that unreal was using my system wide python installation rather than the embedded one. The simplest way to confirm this would be to uninstall your system-wide python. But before doing that, see if restarting unreal editor fixes the issue.

A restart didn’t fix the issue and uninstalling the system-wide python made it worse. It now says that “UnrealEnginePython module could not be loaded”. Which kind of makes sense, because I am using the installation from sources as I want it working after build as well

Yes, that does make sense. If you installed from source, keep in mind you’ll need to rebuild the solution and embed your own python. The process is detailed on their github readme. but if you did all of that and you still are getting this issue, then you should create an issue on their repo. it would be easier to get more accurate help there.

So I will then, thanks a lot!

I just made a minimal project from scratch using the embedded version of the UnrealEnginePython plugin. I installed pyside2 and it works. I’ve created a repo on bitbucket Bitbucket. perhaps you may find it useful. I excluded the plugin folder from the repo because my version of the engine is 4.19. But if you used the embedded version of the plugin for your version of the engine, I believe it should work fine. All the features I was using in the source version have since made it to the release packages, so there is no longer a need to build from source.

252639-error1.png

alt text

252661-

][4]

Why?My code reported an error…

Try building the solution. A lot of times, the red lines are false positives. I also have quite a few red lines in mine, but it builds successfully.

#include “FileOps.h” What is it? I didn’t find him… 么么哒~

In my case, the first 2 files were FileOps.cpp and FileOps.h. The remaining 2 were FileDialog.cpp and FileDialog.h. You should replace “include “FileOps.h”” with the name of your own file.

FileOps Is BlueprintFunctionLibrary? So what is FileOpsBPLibrary?