Chaos Corona Forum

Chaos Corona for 3ds Max => [Max] I need help! => Topic started by: busseynova on 2023-10-31, 18:32:01

Title: object attributes in Corona
Post by: busseynova on 2023-10-31, 18:32:01
I'm trying to create a master material for a range of fabrics. I've used this method before with Vray, but something isn't playing nicely now. My method then was to use a custom user attribute to pass on an index to an OSL 1ofN node which picks the appropriate map and passes it on to the material.

I just found this in the OSL documentation:

Quote
'OSL also allows the generic getattribute() function to get a named attribute from the scene. It is up to the renderer executing the OSL code to populate these named attributes, which means it is outside the control of the OSL Map itself to guarantee whether these attributes are defined.'

Does this mean that Corona can't get object attributes for shader level functions?

Any alternative mathods anyone would like to suggest? I am trying to use object ID as an alternative via a CoronaMultiMap, but it doesn't seem to be working currently.

Title: Re: object attributes in Corona
Post by: Aram Avetisyan on 2023-11-01, 09:37:36
Hi,

I am not sure what your exact workflow looks like, but it sounds that what you need and want to do is possible through CoronaUserProperty map:
https://docs.chaos.com/display/CRMAX/Corona+User+Property+Map

You can user it in combination with CoronaMultiMap of course.
The video in the link also demonstrate a simple usage of the map, feel free to check it out.
Title: Re: object attributes in Corona
Post by: Frood on 2023-11-01, 10:26:10
but something isn't playing nicely now.

Maybe you are just not aware of the fact that you need to restart interactive rendering when changing object properties to see the result. Because your example just works here :)

And yes, if assigning IDs would be ok for you, plug all maps into a CoronaMultimap node, check only "Object GBuffer ID" and that's it.

You can user it in combination with CoronaMultiMap of course.

What exactly are you referring to? While you can use both, OSL named attribute and CoronaUserProperty to get a value, you cannot use it to either control CoronaMutimap nor CoronaSelectMap afaik.


Good Luck



Title: Re: object attributes in Corona
Post by: busseynova on 2023-11-01, 17:49:44
Quote
Maybe you are just not aware of the fact that you need to restart interactive rendering when changing object properties to see the result. Because your example just works here :)

haha thanks, yes I realised this shortly after posting.

Quote
OSL named attribute
Ok, I stand corrected, it does work! I think it was the same issue, I wasn't refreshing the interactive render.

Quote
CoronaMutimap

Yeah I can't see how this works. Would be great if it did as you have the batch texture import there