kaolin icon indicating copy to clipboard operation
kaolin copied to clipboard

NameError: name 'Usd' is not defined

Open MotivaCG opened this issue 2 years ago • 4 comments

kal.io.usd.create_stage(stagename)

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
[<ipython-input-12-43e16bc41c30>](https://localhost:8080/#) in <module>()
      1 stagename = './recon_stage5.usd';
----> 2 stage = kal.io.usd.create_stage(stagename)
      3 usdmesh = kal.io.usd.add_mesh(stage, '/World/mesh', triverts[0], trifaces[0])
      4 stage.Save()

[/content/kaolin/kaolin/io/usd.py](https://localhost:8080/#) in create_stage(file_path, up_axis)
    372     """
    373     assert os.path.exists(os.path.dirname(file_path)), f'Directory {os.path.dirname(file_path)} not found.'
--> 374     stage = Usd.Stage.CreateNew(str(file_path))
    375     world = stage.DefinePrim('/World', 'Xform')
    376     stage.SetDefaultPrim(world)

NameError: name 'Usd' is not defined

MotivaCG avatar Apr 13 '22 02:04 MotivaCG

Hi @MotivaCG !

Did you previously get this warning? https://github.com/NVIDIAGameWorks/kaolin/blob/master/kaolin/io/usd.py#L32

Caenorst avatar Apr 17 '22 14:04 Caenorst

Nope it didn't trigger that warning you can check it on your own https://colab.research.google.com/drive/1m4jRzuQY2sSpjaS2i-pUgKuMsCf16vRU?usp=sharing

MotivaCG avatar Apr 21 '22 06:04 MotivaCG

Can you try from pxr import Usd? This is weird because I do see that usd-core is getting installed during kaolin installation.

Caenorst avatar Apr 21 '22 18:04 Caenorst

ModuleNotFoundError Traceback (most recent call last) in () ----> 1 from pxr import Usd 2 3 stagename = './recon_stage5.usd'; 4 stage = kal.io.usd.create_stage(stagename) 5 usdmesh = kal.io.usd.add_mesh(stage, '/World/mesh', triverts[0], trifaces[0])

ModuleNotFoundError: No module named 'pxr'

MotivaCG avatar Apr 25 '22 12:04 MotivaCG