Adding .SBSAR files to project via the Python API

Hey all,
I am building an application that needs to apply a .SBSAR file as a material to multiple prims. Applying materials to a prim isn’t the problem, as the API for that is quite clear. Rather, my issue is adding the .SBSAR into the project as a material.
So far when I’ve added the .SBSAR to the project via the API, the system seems to not really understand what the material is. The result is a material that doesn’t work and has properties that look nothing like how it would if you drag-and-dropped it into the scene manually.
I would love to do this programmatically via the python API, but I’ve found no way to do it so far. Has anybody here tried to do this? I would love some guidance as to how this might be done.

Much Appreciated,
Cooper

Hi @coopgod! Great question! There’s actually a Kit Command for this. I found it by looking at the Commands History when I dragged the SBSAR file into the Stage.

import omni.kit.commands

omni.kit.commands.execute('AddSbsarReferenceAndBind',
	sbsar_path='C:/path/to/blueberry_skin.sbsar',
	target_prim_path=None)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.