kubric icon indicating copy to clipboard operation
kubric copied to clipboard

Bug in kb.assets.utils.add_hdri_dome

Open ziyuw opened this issue 3 years ago • 2 comments

When calling the function the following error occured:

Traceback (most recent call last): File "/kubric/challenges/multiview_matting/worker.py", line 210, in <module> dome = kb.assets.utils.add_hdri_dome(hdri_source, scene, background_hdri) File "/usr/local/lib/python3.9/dist-packages/kubric/assets/utils.py", line 98, in add_hdri_dome dome_path = hdri_source.fetch("dome.blend") TypeError: fetch() missing 1 required positional argument: 'asset_id

ziyuw avatar Mar 27 '22 03:03 ziyuw

This is the offending line: https://github.com/google-research/kubric/blob/3f216bd800c76a96f3fa44a4bc2dcc5bda0a2604/kubric/assets/utils.py#L98

ziyuw avatar Mar 27 '22 03:03 ziyuw

Ah, goood catch, that function should be updated or removed. The dome was moved to be an asset in KuBasic and can be added like this:

kubasic = kb.AssetSource.from_manifest("gs://kubric-public/assets/KuBasic/KuBasic.json")

# Add Dome object
dome = kubasic.create(asset_id="dome", name="dome", static=True, background=True)
scene += dome
# Set the texture 
dome_blender = dome.linked_objects[renderer]
texture_node = dome_blender.data.materials[0].node_tree.nodes["Image Texture"]
texture_node.image = bpy.data.images.load(background_hdri_filename)

Qwlouse avatar Mar 28 '22 10:03 Qwlouse