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

Dynamically set object textures from existing UE material or texture PNG #3992

Merged
merged 7 commits into from
Nov 9, 2021

Conversation

saihv
Copy link
Contributor

@saihv saihv commented Aug 28, 2021

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):

image

Copy link
Contributor

@rajat2004 rajat2004 left a 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!

AirLib/include/api/RpcLibClientBase.hpp Outdated Show resolved Hide resolved
Unreal/Plugins/AirSim/Source/WorldSimApi.cpp Outdated Show resolved Hide resolved
Unreal/Plugins/AirSim/Source/WorldSimApi.cpp Outdated Show resolved Hide resolved
Unreal/Plugins/AirSim/Source/WorldSimApi.cpp Outdated Show resolved Hide resolved
Unreal/Plugins/AirSim/Source/WorldSimApi.cpp Outdated Show resolved Hide resolved
Unreal/Plugins/AirSim/Source/WorldSimApi.cpp Outdated Show resolved Hide resolved
Unreal/Plugins/AirSim/Source/WorldSimApi.cpp Outdated Show resolved Hide resolved
Unreal/Plugins/AirSim/Source/WorldSimApi.cpp Outdated Show resolved Hide resolved
Unreal/Plugins/AirSim/Source/WorldSimApi.cpp Outdated Show resolved Hide resolved
Unreal/Plugins/AirSim/Source/WorldSimApi.cpp Outdated Show resolved Hide resolved
@saihv
Copy link
Contributor Author

saihv commented Aug 28, 2021

Thanks for the review, @rajat2004 - I've pushed some fixes!

Copy link
Contributor

@zimmy87 zimmy87 left a 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
@zimmy87
Copy link
Contributor

zimmy87 commented Nov 9, 2021

I was able to test this locally and confirmed the new APIs are working as expected. Thanks for submitting this PR @saihv!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants