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

Not working as intended simSwapTextures, simSetObjectMaterial, simSetObjectMaterialFromTexture #4398

Closed
HSC-1 opened this issue Mar 9, 2022 · 4 comments
Labels
api bug-report for issues filed as bug reports

Comments

@HSC-1
Copy link
Contributor

HSC-1 commented Mar 9, 2022

Question

What's your question?

First
I Failed to use simSwapTextures
Following the example, I returned empty list

import airsim 

c = airsim.VehicleClient()
print(c.simSwapTextures("test",0))

tags
texture_bp
So I'm looking for replacement
find #3992
I try this API but not working as intended

print(c.simSetObjectMaterialFromTexture("texture", "sample_texture.jpg"))
print(c.simSetObjectMaterial("texture","sample_texture"))

This output is True, False
image

I obviously care about directories
sample_texture.jpg in my diretory is with python file
Jist in case, I put it all diretory else

@jonyMarino jonyMarino added bug-report for issues filed as bug reports api labels Mar 9, 2022
@HSC-1
Copy link
Contributor Author

HSC-1 commented Mar 31, 2022

Add Visual Studio log message

LogStreaming: Warning: Failed to read file 'sample_texture.jpg' error.
LogImageUtils: Warning: Error creating texture. sample_texture.jpg could not be found

I found Visual Studio log message.
What settings should UE4 set so that the above errors are not occur?
I'm sure I put the image file in all the directories.

UE4.26 version

@HSC-1
Copy link
Contributor Author

HSC-1 commented Apr 1, 2022

Sorry. It was a matter of the directory and the name of the material.
But if it's not blueprint, it doesn't work as intended.
The chair is blueprint,Just the table is static mesh actor.
image

@HSC-1 HSC-1 closed this as completed Apr 7, 2022
@deoliveirajoshua
Copy link

I'm getting a similar error when running the change_texture_example.py script in UE 4.27 version. The jpg is in the working directory of my script. How did you find a workaround?

@HSC-1
Copy link
Contributor Author

HSC-1 commented May 25, 2022

I'm getting a similar error when running the change_texture_example.py script in UE 4.27 version. The jpg is in the working directory of my script. How did you find a workaround?

Hello, can you try by modifying the full directory of jpg?
ex) "C:./user/Airsim/image.jpg"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api bug-report for issues filed as bug reports
Projects
None yet
Development

No branches or pull requests

3 participants