-
-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Send to Unreal - Not working on mac #19
Comments
hey thanks for the assist! In blender can you please open blender console (in Window) and post the result of starting RPC servers? (pipeline->utilities->Start RPC Servers) I dont think there are logs from initialization. None that I can find at any rate. |
So I played around a bit, added prints to the plugin code locally and started blender via console to see them but until now, I could not really track down completely, what the issue might be. Via I'm not into python so I can't tell too much what would be needed here to fix it but what I tried was to change this Here is the output of the plugin running with my custom prints where you can see a bit whats happening. If you need to dig in further, I also have discord and other tools where we could work together on the code and debugging. |
Awesome thank you for that! I'm unavailable this weekend but will be back Monday to dig in. |
I'm also trying to get this to work on a Macbook Pro M1 with Blender 4.1, UE 5.3. Happy to help with debugging, looking at logs, running blender with debug flags e.g. I'm a s/w engineer, so don't hesitate about getting technical. I also get the message, "No instance of Unreal Editor found", or no message at all. |
Hey @andygagnon I do not have a M1 mac, but the issue has got to be within this remote_execution.py. This is what I know. Send to Unreal has its own rpc package it uses for remote calls to unreal and thats all http over 9998 The only reason it needs remote_execution.py is to initially spawn its own rpc server. Once that is created and responding it doesn't need it anymore. BlenderTools/send2ue/dependencies/unreal.py Line 184 in 0a3ab4f
So hypothetically, I think just running this in the unreal python REPL would initialize the connection blender needs. import sys
import os
import threading
for thread in threading.enumerate():
if thread.name =="UnrealRPCServer":
thread.kill()
os.environ["RPC_TIME_OUT"] = "{rpc_response_timeout}"
sys.path.append(r"{dependencies_path}")
from rpc import unreal_server
rpc_server = unreal_server.RPCServer()
rpc_server.start(threaded=True) Beyond that I would probably reccomend using a debugger and dropping some breakpoints in |
remote_execution.py was copied from Epic's Python plugin with no changes. I wonder if there's a conflict? |
Sorry, guys, I am also looking into this issue, trying to figure out what is going on. I ran up a simple test python, to execute against unrealEditor. What I received back is confirmation to me that the problem is entirely blender plugin side. Using the provided remote_execution,
I managed to retrieve with tcpdump -A -I en0 & tcpdump -A -I lo0 on my Mac I was able to confirm that these files send appropriate messages into unrealEditor, and unreal editor responds with its node identification as one would expect. tcpdump -A -ni lo0 host 239.0.0.1
tcpdump -A -ni en0 host 239.0.0.1 When getting the plugin to do this it sent the information from what I can tell, but unreal didn't receive it. The two tcpdump commands were executing on my Network interface (wireless) and on the loopback interface and messages would appear on on each when working. For clarity unreal was configured to listen on 0.0.0.0 as per previous discussion points the test python got responses from unreal. Sorry im not usually into blender but started playing and want to get this pipeline working as well. So im trying to figure out what goes on inside the plugin.
When compared to the output of the blender start RPC call.. the output only appeared on the loopback ip 127.0.0.1, and Unreal didn't acknowledge it, where when the script worked communications were found on both interfaces. lo0 and en0 |
So I have dug a little deeper, and I have managed to get the ping pong to respond to Blender but this is not an advancement.
Essentially I came across this issue a few times while debugging it but thought this was because I wasn't running blender. altered it like so and received the same result. Where previously I did not receive anything except ping now its ping pong open and close connections. The open being an attempt to link up to Unreals Command Port.
Anyway I dont know if I'm barking up the wrong tree or not. but my gut feeling is that Blender's bpy_struct base class and preferences implementations may have changed under the hood. Anyway, my progress towards figuring this out got to the redirection to the command_port, at 6776. Alas I haven't figured out where this happens in the code yet. baby steps :)
|
Thank you everyone for your support! I've committed some changes here 639b537 that I'd like tested please! |
Hey so I ran that up, in my blender and it behaved the same as what I did was doing ti tries to reach out for the command endpoint on 6776. but ends in closing the connection. Looks like my biggest issue in figuring out this issue Is getting a development plugin running appropriately. Can load a plugin no problem but getting any useful information out of a running blender Logs dont seem to appear, This is the logs from blender on a run with this configuration. Further to this it is communicating with unreal. It reports missing module each time I reload the plugin or restart the rpc servers. |
any guess is as good as mine if not better lol. I just rely on printing to the console (Window > Toggle System Console) Going back to your first comment, this is interesting So it works after making this change? I wonder why it works on Windows then? |
So I think that is a red herring, I think I made that change after making a similar change to yours locally that caused it to work. The Crux of the problem is this one. Essentially After Each print(os.getcwd()) I got these in the log
Albeit I'm using an alias / symbolic link to link send2ue into blenders plugin directory. In this instance send2ue contains a module that is loaded by unreal, one in blender one trying to load it from inside blenders safe area. Im going to have to dig some more I think in Mac forums to figure out how to either Whitelist this behaviour or figure out what the right way to handle it is. |
Possibly, That downloads folder issue may have been a misclick when playing with unreal, I can't remember when I installed it was a while back :(. But with the python library needing to be somewhere it can be accessed by unreal is annoying. The dependencies either need to be copied over and overwritten each time it runs (which may be possible but fear the security layer will block this behavior as one app reaches inside another.) Or, as you say Manual step for Mac Users to copy the dependencies into a place unreal can use them. Which I feel this may be the safest way forward but is prone to human error. Edit: The thing that is confusing me, Unreal can edit / save projects make levels all without that permission but to load a module from python, it can't do it with out it enabled ? Seems like two different enforcement policies are being applied to Unreal Editor and the PythonScript Plugin. |
okok. So then I think it would be worth pushing the following before diving into a full macos first-run process/guide:
|
Yea I think the I know seeing |
Yeah good points. I will implement these changes in the next few days and upload a test package for everyone to try before pushing to main. |
@JoshQuake I'm ready to test this on Mac OS, but I'm not sure how to get this recent build from github The latest release is 2.4.5 from June 17. Suggestions? Thanks. |
We're close to pushing a release but in the meantime the src/addons/send2ue folder can be zipped and installed to test: |
You mentioned that you tried to work on it but it is not quite working with your VM.
EpicGamesExt#695
I'm on a mac and could help you fixing this issue.
I've tinkered around on the mac like the others with ports and Multicast Bind Address but nothing helps.
Can you tell me how or where I can get logs from unreal regarding the initialisation of the python plugin?
The text was updated successfully, but these errors were encountered: