mati-nvidia / omni-bookshelf-generator

A bookshelf generator Kit Extension created using OpenUSD
Apache License 2.0
9 stars 4 forks source link

Books do not render #1

Open richjohnson-wwt opened 3 months ago

richjohnson-wwt commented 3 months ago

I cloned the repo and launched the extension in Composer v2023.2.2 (105.1.2). The bookshelf renders according to the values set in UI but no books appear. There are no errors logged to the console. The book_A.usd file is under the data folder in my workspace.

richjohnson-wwt commented 3 months ago

It is a great tutorial series otherwise.

LarsonmAtWwt commented 3 months ago

We determined that the books will render if we check the BookInstancers Instanceable checkmark, and it will continue rendering even if that checkmark is unchecked. I don't think this is the 'correct' solution however, and would interested in learning how to get the books to render properly.

richjohnson-wwt commented 3 months ago
def clearInstanceableOnBookInstancer(self):
        instancer_path = self.geom_scope_path.AppendPath("BooksInstancer")
        omni.kit.commands.execute('ToggleInstanceableCommand', prim_path=[Sdf.Path(instancer_path)])

This solves the issue. Add this code to the bottom of generator.py and call it from the generate method.