-
Notifications
You must be signed in to change notification settings - Fork 75
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
[Issue] Add your own models to TDW #507
Comments
@hannibal9943 Please run local_object.py again, then send the Editor log (not the player log) |
Thanks for your kind reply. I send the editor log. |
I appreciate your quick reply. If you don't mind, please tell me how to solve the above problem? |
@hannibal9943 Thanks for uploading the asset bundles. I tried loading them and got the same error. I ran local_object.py on my own machine and the asset bundles are ok. Can you please run this again and send the Editor log in addition to the log.txt file generated by Asset Bundle Creator? Additionally, try this:
from pathlib import Path
from tdw.asset_bundle_creator.model_creator import ModelCreator
from tdw.backend.paths import EXAMPLE_CONTROLLER_OUTPUT_PATH
# Change this to the actual path.
source_file = Path.home().joinpath("tdw/Python/example_controllers/3d_models/cube.fbx")
output_directory = EXAMPLE_CONTROLLER_OUTPUT_PATH.joinpath("local_object_cube")
m = ModelCreator()
m.source_file_to_prefab(name="cube",
source_file=source_file,
output_directory=output_directory)
Result: You should see a cube in the Scene view. Let me know if something else happens. |
I tried running this myself. There was a bug, but not the bug you've been having. Try upgrading TDW and asset_bundle_creator and run local_object.py again. If it still fails, please tell me your OS version and whether you're using an M1. |
Thank you for the friendly words in your comments. source_files.zip Thanks in advance. |
I'm getting,
while attempting to add_object, very similar to local_object.py Have the latest, I've tried unity: 2020.3.48f1 and 2022.3.11f1, manually converting model (tried both .obj and .fbx) source to asset bundle using the command: &"C:\Programs/Unity/Hub/Editor/2022.3.11f1/Editor/Unity.exe" -projectpath "C:/Users/hirak/asset_bundle_creator" -quit -batchmode -executeMethod ModelCreator.SourceFileToAssetBundles -name="cube" -source="C:/Users/hirak/Downloads/Gravel_001_SD-20231025T063244Z-001/untitled.fbx" -output_directory="D:/tdw/test"
# same arguments for Unity version 2020.348f1
🤷 , hence the direct command Any idea or hits of cause? |
@hiracu Please run your controller again and then attach the Editor log to this GitHub issue. |
Hi @subalterngames , After running, &"C:\Programs\Unity\Unity 2020.3.48f1\Editor\Unity.exe" -projectpath "C:/Users/hirak/asset_bundle_creator" -quit -batchmode -executeMethod ModelCreator.SourceFileToAssetBundles -name="cube" -source="C:/Users/hirak/Downloads/Gravel_001_SD-20231025T063244Z-001/untitled.obj" -output_directory="D:/tdw/test" the log is, Editor.log Thanks |
@hiracu There are no errors in the log you sent me. Can you send me your modified local_object.py code? |
@alters-mit , from tdw.asset_bundle_creator.model_creator import ModelCreator
from tdw.controller import Controller
from tdw.add_ons.third_person_camera import ThirdPersonCamera
from tdw.add_ons.image_capture import ImageCapture
from tdw.backend.paths import EXAMPLE_CONTROLLER_OUTPUT_PATH
from platform import system
from pathlib import Path
output_directory = r"D:\tdw\test"
name = "cube"
# Get the path to the asset bundle.
#asset_bundle_path = Path(output_directory).joinpath(system()).joinpath(name)
#uri = f"file:///{str(asset_bundle_path.resolve())}"
uri = "file:///D:/tdw/test/Windows/cube"
#print(asset_bundle_path, uri)
# Launch the controller.
c = Controller()
camera = ThirdPersonCamera(position={"x": 0, "y": 0, "z": -0.6}, avatar_id="a")
capture = ImageCapture(avatar_ids=["a"], path=output_directory)
c.add_ons.extend([camera, capture])
c.communicate([{"$type": "create_empty_environment"},
{"$type": "add_object", "name": "cube", "url": uri, "scale_factor": 1, "id": c.get_unique_id()},
# test, works
# {
# "$type": "add_object",
# "name": "jug02",
# "url": "file:///D:/tdw/assets/models/windows/2018-2019.1/jug02",
# "scale_factor": 1.0,
# # "position": {
# # # "x": 1.1990649221416774,
# # # "y": 0.9167836,
# # # "z": -2.0800465898213116
# # },
# # "category": "jug",
# "id": c.get_unique_id(),#5458180
# },
])
c.communicate({"$type": "terminate"}) On running the script the terminal output (that hangs) is,
along with a blank white scene rendered, a/img_0000.jpg. I tried, Asset Bundle Extractor. I was able to view TDW assets (cube, appliance-ge-profile-microwave_composite) as a test but I couldn't view my cube that was created in SourceFileToAssetBundles. I wonder if there was something wrong with the packaging? Thanks |
I ran asset bundle creator on Unity 2020.3.24f1 and was able to render image without the error. @alters-mit thanks for your help 🙇 |
Hi there,
The TDW based on real to sim transfer for embodied AI is very interesting and great works.
Under the TDW environment, I am testing the following: (1) converting my 3D models(.fbx or .obj) into an asset bundle, (2) adding a scene to TDW.
For test the above, I first ran the example file(local_object.py).
As a result of the simulation, the build work generated an error as follows:
##################################################################################################
Your installed tdw Python module is up to date with PyPi.
Build version 1.10.9
Unity Engine 2020.3.24f1
Python tdw module version 1.10.9
The build quit due to an error. Check the build log for more info.
If the build is on the same machine as this controller, the log path is probably C:\Users\argo8\AppData\LocalLow\MIT\TDW\Player.log
If the build is on a remote Linux server, the log path is probably ~/.config/unity3d/MIT/TDW/Player.log (where ~ is your home directory)
Error while downloading Asset Bundle: Failed to decompress data for the AssetBundle 'file:///C:\Users\argo8\tdw_example_controller_output\local_object\Windows\cube'.
Asset bundle is null: file:///C:\Users\argo8\tdw_example_controller_output\local_object\Windows\cube [TDWInput.AddObject]
Tried to create null object. [TDWInput.AddObject]
##################################################################################################
If you don't mind, please tell me how to solve the above problem?
Thanks in advance.
Player.log
The text was updated successfully, but these errors were encountered: