Skip to content
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

Can you change MPC vars at runtime with a script? #3481

Open
HoomanRamezani opened this issue Mar 17, 2021 · 5 comments
Open

Can you change MPC vars at runtime with a script? #3481

HoomanRamezani opened this issue Mar 17, 2021 · 5 comments

Comments

@HoomanRamezani
Copy link

Can you change MPC vars at runtime with a script?

Is it possible to change the value of Material Parameter Collection variables during runtime with Python (or any other language)?
I currently have this set up to be a function of keyboard clicks, but I’m hoping to automate things. If it’s not possible to change MPC vars through API calls, is there a recommended way to simulate keyboard clicks in UE4 with a Python script? I’ve found generic ‘simulate keypresses’ packages, but am wondering if there are any specific packages that play nicely with UE4.

I’m using

  • Linux Ubuntu
  • UE4 version 4.24.1
  • Python 3.8.5.
@rajat2004
Copy link
Contributor

Have you added the keyboard bindings in C++ yourself like this, or is it like another plugin using Blueprints? In the first case, you could add RPC calls like all the AirSim APIs to call the method, and use them from Python or C++.
For the latter, options like pydirectinput and https://stackoverflow.com/questions/14489013/simulate-python-keypresses-for-controlling-a-game might work, but haven't used them myself.

Sidenote, just to confirm, you're not talking about the distortion params already present in the cameras right? Cause there are APIs for them already

@HoomanRamezani
Copy link
Author

Thanks! Do you have any recommendations for resources on adding your own rpc integration?

@rajat2004
Copy link
Contributor

For examples on how to add a new API, you can see this commit, and various other PRs like #2834 or #2867. Best way to get some help if stuck somewhere might be to push to a branch and post here or maybe open a draft PR

@jonyMarino
Copy link
Collaborator

Hi @HoomanRamezani! and welcome! Out of curiosity: Why are you interested in changing MPC params during simulation?

@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically marked as stale because it has not had activity from the community in the last year. It will be closed if no further activity occurs within 20 days.

@stale stale bot added the stale label Apr 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants