Skip to content
Discussion options

You must be logged in to vote

Hi @Disgruntoad

The shape ID gets defined whenever the Shape object is instantiated. However, when using parallel scene loading the instantiation order is potentially very random. You can turn off parallel loading by passing parallel=False to mi.load_dict()/mi.load_file. With this change you should get consistent IDs.

Another useful trick:

shapes = scene.shapes()
for shape in shapes:
    print(f"shape: {shape}")
    print(f"id: {dr.reinterpret_array(mi.UInt32, mi.ShapePtr(shape))}\n")

This way you can associate ID's to their string representation which usually holds the filename of the mesh. You can do the same trick for BSDFs too.
If you can build this mapping at runtime, without relying…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Disgruntoad
Comment options

@njroussel
Comment options

@Disgruntoad
Comment options

Answer selected by Disgruntoad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants