Community
Arnold for Cinema 4D Forum
Rendering with Arnold in CINEMA 4D using the C4DtoA plug-in.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Per-instance parameter overrides

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
Shawn_Kearney1
340 Views, 4 Replies

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.

Tags (3)
Labels (3)
4 REPLIES 4
Message 2 of 5

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.



// Stephen Blair
// Arnold Renderer Support
Message 3 of 5

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.

Message 4 of 5

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?

Message 5 of 5

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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report