Chaos Corona Forum

Chaos Corona for 3ds Max => [Max] Feature Requests => Topic started by: LKEdesign on 2022-11-24, 18:44:44

Title: Map / Material Select handled by User property
Post by: LKEdesign on 2022-11-24, 18:44:44
It would be SO useful if you could handle more things by User Property   - one of the top items on my list is the switch between maps or materials using Corona Map Select  or Corona Materials Select , but it could also be fx. Corona Mix Map, or maybe even Multimap.
Title: Re: Map / Material Select handled by User property
Post by: maru on 2022-11-25, 12:50:59
So you would like to have a single Corona Select Map with multiple maps connected to it and distribute those maps depending on the user property assigned to specific scene object?
For example an object with "brick" user property would get a brick texture, an object with "wood" property would get a wood texture, etc.

Is that right?

If so, I think you can already achieve something similar, for example, with the Object GBuffer ID.
Set different GBuffer IDs for different objects. Then assign different maps through Corona MultiMap in the Object GBuffer ID mode.

It would be more tricky with materials though.
Title: Re: Map / Material Select handled by User property
Post by: LKEdesign on 2022-11-25, 13:28:30
hmmm  well, I want just to be able to select any of the index numbers in a select map/material  - so I have the freedom to switch between any of the material setups beneath that. Could be anything really
Title: Re: Map / Material Select handled by User property
Post by: maru on 2022-11-25, 13:42:25
So having a user property with value "2" would select material with index number 2?
Title: Re: Map / Material Select handled by User property
Post by: LKEdesign on 2022-11-25, 14:01:32
For instance, yes - I think it would give so much flexibility in scenes and less complicated material setups
Title: Re: Map / Material Select handled by User property
Post by: pokoy on 2022-11-25, 17:30:31
Yes, I was looking for such an option recently and the Select Map/Mat would really be a good candidate for this. Also for CoronaMultimap.
Title: Re: Map / Material Select handled by User property
Post by: maru on 2022-12-13, 13:53:37
I would like to get some additional information on this if possible. I wanted to report it for our devs to review, but I am missing some solid arguments.

I created a dummy scene with two objects.
Object 1 has a user property "material = WOOD"
Object 2 has a user property "material = STONE"

The idea is to use the Corona Select Map/Material or Corona MultiMap in combination with the user properties to decide which object gets which material.

Is this what you would like to have, or am I missing the point?

You mentioned "so useful", "freedom to switch", and "so much flexibility", but this is not enough for me to create a convincing use case.

In my example, you could as well:
- just apply material 1 to object 1 and material 2 to object 2
- use multimap with material ID or object gbuffer ID mode to decide which object get what material properties

Please note that I am not saying that this does not make sense! I am sure it does, but I need to understand better in what specific cases it would be useful, so that I can pass this information to our devs.

For example: is this useful for rendering multiple variants of a specific object? (e.g. multiple renders of a table made of different materials)

Thanks in advance!
Title: Re: Map / Material Select handled by User property
Post by: LKEdesign on 2022-12-15, 00:54:40
Hej Marcin,

I will get back to you ASAP. I have a deadline to take care of first though.

Cheers
Title: Re: Map / Material Select handled by User property
Post by: LKEdesign on 2022-12-16, 09:44:08
I get your point, about just applying the actual material to the object. BUT it's all about flexibility and encapsulation.

IF poosible my 3D assets has only one MultisubMaterial applied. That makes things easy to manage. One of the submaterials can then be a switable material, maybe containing multiple options, which would be cool to be able to reach and switch from the object itself  - encapsulation and flexibility.

Often I make lamps with light materials instead of Coronalights. So to be able to switch the lamp On and OFF, I switch between a map in a SelectMap that is attached as a mask to a layered material that wraps a light material over fx. a lightbulbs glass. Using the UserProperty map, it makes the switching ON and OFF on instances of the same lamp without having to go into the material editor and switch a material.

So being able to switch materials on an instances without the need to go into a potential comnplicated shader tree and swap materials is for me a good reason to add this functionality.

Timeride use the User property to switch between facade colors  - cool. I just think that being able to switch between either maps or materials in the scene, without going into the shader tree, could be so useful.

Maybe it should actually be an integrated part in the SelectMap / SelectMaterial shaders.

In general I would like some changes to the SelectMaps / SelectMaterial.
It would be cool if it in the UI worked more than the MultiSubMaterial.
With this i mean, that you can see either the assigned material name or a designated label.

That would make the selection much easier.

I hope I have made my reasons more clear now. :)
Title: Re: Map / Material Select handled by User property
Post by: arqing on 2022-12-16, 18:23:58
You can do that with just a Controller.
I do it all the time for my HDRs or everything that has a SelectMap or SelectMaterial. With a single click I move from one to another.

(http://controller.jpg)

If the images doesnt load.. check this link:
https://drive.google.com/file/d/11qnEFmcsClEC8Be2Yy5EcKWlWQB_yktU/view?usp=share_link (https://drive.google.com/file/d/11qnEFmcsClEC8Be2Yy5EcKWlWQB_yktU/view?usp=share_link)

Title: Re: Map / Material Select handled by User property
Post by: maru on 2023-01-02, 17:00:37
I am not convinced yet, sorry. It would be still too challenging for me to explain why it is needed.
How is right-clicking on an object > selecting properties from the quad menu > going to user-defined > changing some value by typing text more convenient than just opening the material editor?
How is having a single multi/sub material applied to multiple objects making things easier to manage than having different materials applied to multiple objects?
Lamp on/off example - this sounds like a perfect case for the Select Map / Material. I also did it like this in the past (you can even plug a Corona Color into the Select Map - black vs white). You can also already do it with User Property. For example, the same User Property could be switched between 0 and 1 to make the lamp emit light or not.

In general I would like some changes to the SelectMaps / SelectMaterial.
It would be cool if it in the UI worked more than the MultiSubMaterial.
With this i mean, that you can see either the assigned material name or a designated label.
I don't get this part. Can you explain what changes you mean specifically?



Title: Re: Map / Material Select handled by User property
Post by: Tanner on 2023-01-18, 13:49:53
You can do that with just a Controller.
I do it all the time for my HDRs or everything that has a SelectMap or SelectMaterial. With a single click I move from one to another.

(http://controller.jpg)

If the images doesnt load.. check this link:
https://drive.google.com/file/d/11qnEFmcsClEC8Be2Yy5EcKWlWQB_yktU/view?usp=share_link (https://drive.google.com/file/d/11qnEFmcsClEC8Be2Yy5EcKWlWQB_yktU/view?usp=share_link)

I use the controllers all of the time when I want one selection to influence another. This is a particularly useful, native tool that works when you have a material set up and you change the scale of say the diffuse map, the scale will also affect all the pertaining gloss, normal, height, etc. maps too. But yes, you can have linear/bezier float controllers control most options in Corona material/map nodes.
Title: Re: Map / Material Select handled by User property
Post by: LKEdesign on 2023-01-19, 13:13:04
Guys, you miss the best part  - the flexibility in the scene of being able to use the same material hierarki  and being able to switch instances on / off or give a color value or something.

Example: 
A lamp with a bulb using lightmaterial / glass material in a selectmaterial  - each instance can be switched on and off, without going to the material editior and have two material versions - with the toential risk of having redundancy errors.

- or a monitor where you have 10 different content maps, where you can switch the content per monitor instance  - without having to go to the Material Editor. ( and yes, I know you could just amke a multisub with the individual screen content as a material  - but then again, you have to have redundant materials. )

These are just a few examples.

The red thread in this is to simplify hierkies and workflows  - and by making the Userproperty more versatile - (and not only on Select XX ) I believe you could have an easier life :)
Title: Re: Map / Material Select handled by User property
Post by: Tanner on 2023-01-19, 17:25:52
Example: 
A lamp with a bulb using lightmaterial / glass material in a selectmaterial  - each instance can be switched on and off, without going to the material editor and have two material versions - with the toential risk of having redundancy errors.

In fact I used to do this with controllers linked to a parameter I could turn off and on elsewhere in the scene (like the O.G. Light Lister tool that got discontinued - I'd turn the opacity map off and it would switch to a glass material instead of a black light mat). But instead of using a SelectMTL, you defer to nested (or not) Blend materials. You can link most features with bezier/linear float controllers and assign custom attributes to the objects in the scene. Most people just don't know about it because they have no interest in it.

The other one I've used in the past is selecting which HDRI is used in the scene at any given time by linking the SelectMap SELECTED controller to a generic light object that doesn't actually render. But changing the intensity value to 0.0, 1.0, 2.0, 3.0, etc. would change which sky is visible.

- or a monitor where you have 10 different content maps, where you can switch the content per monitor instance  - without having to go to the Material Editor. ( and yes, I know you could just amke a multisub with the individual screen content as a material  - but then again, you have to have redundant materials. )

You could do this with one material, but plug the screen texture into a multimap and set the randomization to Object GBuffer ID. Then, when you duplicate your monitors (even as instances), you can assign each one a different ID under the properties window to control which image appears on the monitor. No need to for 10 materials, just 10 bitmaps plugged into 1 multimap into 1 material.

I think there is still a bit of background setting up in order to use this User Property much like linking controllers throughout a scene, but I like where your head it at. +1
Title: Re: Map / Material Select handled by User property
Post by: maru on 2023-01-26, 10:24:49
So far nobody answered my questions from https://forum.corona-renderer.com/index.php?topic=38534.msg207848#msg207848 :)

Guys, you miss the best part  - the flexibility in the scene of being able to use the same material hierarki  and being able to switch instances on / off or give a color value or something.
Again, these are just some vague terms like "flexibility". What flexibility? In what exact case? How is the new idea more flexible than the old one?
"give a color value or something" - that's not a very convincing argument :)

Quote
A lamp with a bulb using lightmaterial / glass material in a selectmaterial  - each instance can be switched on and off, without going to the material editior and have two material versions - with the toential risk of having redundancy errors.
Again: "How is right-clicking on an object > selecting properties from the quad menu > going to user-defined > changing some value by typing text more convenient than just opening the material editor?"
(as I asked in https://forum.corona-renderer.com/index.php?topic=38534.msg207848#msg207848)
The other solutions posted by Tanner seem completely fine to me.

Quote
- or a monitor where you have 10 different content maps, where you can switch the content per monitor instance  - without having to go to the Material Editor. ( and yes, I know you could just amke a multisub with the individual screen content as a material  - but then again, you have to have redundant materials. )
Once again, this was already mentioned at least twice, by me and Tanner: you can use one material with Corona Multimap in Object GBuffer ID mode for this. You only need 1 material in this case. You do not need to set up more materials. You only need to load multiple bitmaps into a Multimap, that's all.

Quote
The red thread in this is to simplify hierkies and workflows  - and by making the Userproperty more versatile - (and not only on Select XX ) I believe you could have an easier life :)
And once again: how is using user property instead of other available tools such as multimap or select map more flexible/versatile? How exactly does it make one's life easier?

Title: Re: Map / Material Select handled by User property
Post by: maru on 2023-01-26, 10:36:00
I am attaching two examples made with Multimap in Object GBuffer ID mode: monitors (changing displayed image through object properties - per object, works with instances) and lamp on/off.
My question is: How is this less flexible / less convenient / causes some errors compared to using the requested user properties method?

Note: you do not have to open the material editor - this was one of the arguments in this thread.
Title: Re: Map / Material Select handled by User property
Post by: Tanner on 2023-01-26, 14:31:21
I agree with you Maru, I don't know how User Property is more efficient compared to every way you and I suggested. In fact, this is the first time in my 15+ years of using 3ds that I've seen or heard of someone using that tab under object properties.

It may be worthwhile for the OP to have a maxscript written for him to achieve the level of "efficiency" he's after. Those kinds of requests can be made elsewhere here or on the Autodesk forum.

I will add, if OP doesn't like the material editor (whether its Slate Material Editor or the compact editor) because its too slow, you may have too much going on, especially with the SME. If you clean up your views and purge unnecessary tabs, it helps both 3ds max load files quicker and open SME faster. Also make sure you don't have the SME rendering enabled all of the time, every change needs 1 or more nodes to update, slowing things down.
Title: Re: Map / Material Select handled by User property
Post by: romullus on 2023-01-30, 21:47:12
I am attaching two examples made with Multimap in Object GBuffer ID mode: monitors (changing displayed image through object properties - per object, works with instances) and lamp on/off.
My question is: How is this less flexible / less convenient / causes some errors compared to using the requested user properties method?

Note: you do not have to open the material editor - this was one of the arguments in this thread.

That's very useful maru, but would it be possible to make the IR trigger automatically on object properties change? I tried to make similar setup today and couldn't understand why it's not working, until i realized that you need to restart IR.

Another issue that gbuffer IDs seems not to be working with decals, so maybe option to user properties to drive multimap selection still can be useful? Assuming that user property is working with decals.

And i have even more exiting idea how user properties could be very useful - how about utilizing them in exclude/include lists? The idea is that you could automatically include or include objects in various lists based on their user properties, without needing explicitly add those objects to any of those lists. One of numerous possible scenarios - you create new camera, open its include/exclude list, write something like exclude user property = "interior_1", "kitchen_props", "toilet" and any object that has those tags in their user properties will be automatically excluded from that camera. That would also apply to decals, lights, scatters, distance maps - anything that has exclude/include lists. I think this could be very powerful tool to have. What do you think?