-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Dynamically set object textures from existing UE material or texture PNG #3992
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really love the texture in the example!
Thanks for the review, @rajat2004 - I've pushed some fixes! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @saihv, thanks for submitting this PR, this looks like a good change to take, however I'm having trouble launching the Blocks environment with your PR checked out. I get the following error message:
---------------------------
Message
---------------------------
Default Property warnings and errors:
Error: CDO Constructor (SimModeBase): Failed to find Material'/AirSim/HUDAssets/DomainRandomizationMaterial.DomainRandomizationMaterial'
---------------------------
OK
---------------------------
I checked and confirmed that Unreal/Plugins/AirSim/Content/HUDAssets/DomainRandomizationMaterial.uasset is present in my repo and Blocks environment, but it doesn't show up in the editor. Just out of curiosity, which version of the editor are you using? There may be a version mismatch here.
recreate DomainRandomizationMaterial to make it compatible with UE 4.25
add new method stubs for setObjectMaterial APIs
I was able to test this locally and confirmed the new APIs are working as expected. Thanks for submitting this PR @saihv! |
About
This PR adds API functions to dynamically change the textures of in-game objects either to existing Unreal material assets (
simSetObjectMaterial
), or to arbitrary texture PNGs (simSetObjectMaterialFromTexture
) - in order to help with generating data with domain randomization. Path to a.uasset
or an image file (.png
,.jpg
etc.) should be specified based on the function being used.How Has This Been Tested?
Run AirSim with the Blocks map, and run
PythonClient/environment/change_texture_example.py
Screenshots (if appropriate):