question

Shawn Kearney avatar image
Shawn Kearney asked ·

Per-instance parameter overrides

I am having a lot of trouble getting procedural parameter overrides to behave as I expect them to. I was working on a dynamic bookshelf generator that will be populated with several randomly assigned book asset's .ass file, and then use the ID parameter and the Utility Shader to randomize the the cover art so that they have some variation.

However, this doesn't seem to work as expected. The first book created seems to behave like a master, and all other books pick up it's ID rather than reflecting the individual override. I also tried using the 'random' shader's seed parameter, likewise without success. I'm getting random values, but not at an instance-by-instance scope.

c4dtoaassasset
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Peter Horvath avatar image
Peter Horvath answered ·

There are multiple problems with this.

First of all we have a procedural cache, which means if multiple procedurals load the same ASS file, then the objects are not created multiple times, only once. This can be disabled by setting the 'enable_procedural_cache off' text in the Render Settings > Diagnostics > User Options, so that's fine.

Next each procedural have to have a different namespace, otherwise the node names collide. Currently you can not setup that when the procedurals are generated by an object generator (e.g. Cloner).

Next there's a random keyword in the assignment expression, but that does not work with uint parameters at the moment, like the id.

Hopefully these will be fixed soon in an upcoming release.

2 comments Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Hi Peter! I'm doing this all within a python generator, so I can set name spaces individually as I'm just running an iterator and generating a unique BaseObject for each book. I was thinking there was a namespace issue, so I've already confirmed that I can do this. I am also planning to just assign the UID to the Object ID.

This should work. I'll try later.

Also, Is there an easy way to directly obtain bounds of the asset?

0 Likes 0 · ·

You can maybe generate a random float number to the meshes using the expression 'float myvalue = random * 1000' and read that value via a user_data_float to the seed of the random shader.

You can get the bounds of the Arnold Procedural object via the GetMp() and GetRad() functions, but not the individual meshes within the procedural.

0 Likes 0 · ·
Stephen Blair avatar image
Stephen Blair answered ·

instances won't necessarily have a different ID. That depends on whether the translator (C4DtoA in this case) assigns an ID. I haven't checked yet.

The Object mode of the Utility shader should give a different a value for each instance, maybe use that to drive the randomization?

For random, the seed has to be different for each instance, so it depends on what you're plugging into the seed.

Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Welcome to the Arnold Answers community.

This is the place for Arnold renderer users everywhere to ask and answer rendering questions, and share knowledge about using Arnold, Arnold plugins, workflows and developing tools with Arnold.

If you are a new user to Arnold Answers, please first check out our FAQ and User Guide for more information.

When posting questions, please be sure to select the appropriate Space for your Arnold plugin and include the plugin version you are using.

Please include images, scene and log files whenever possible as this helps the community answer your questions.

Instructions for generating full verbosity log files are available for MtoA, MaxtoA, C4DtoA, HtoA, KtoA, and Kick.

If you are looking for Arnold Documentation and Support please visit the Arnold Support site.

To try Arnold please visit the Arnold Trial page.

Bottom No panel present for this section.