Author Topic: Automatize Material ID Render Element  (Read 12203 times)

2016-05-24, 12:45:55

julecocq

  • Active Users
  • **
  • Posts: 29
    • View Profile
Hi guys,

A great feature would be to:

1- Add a ID to all materials present in a scene, in an automatic way, without having to add them manually. And more than 16 IDs...

2- Add all mask ID render element needed to render all masks, without again, having to add them manually in the render element tab.

At work I'm using Maya / Vray, and we have developped a script to do this in 2 clicks.
Maybe there is way to do that already ?

What do you think ?

Thanks guys !

2016-05-24, 13:08:24
Reply #1

Juraj

  • Active Users
  • **
  • Posts: 4815
    • View Profile
    • studio website
Does it not work that way already (1) ? Or maybe I understand it wrong, but all you have to do is select MatID pass and it will randomize each element for you.
Please follow my new Instagram for latest projects, tips&tricks, short video tutorials and free models
Behance  Probably best updated portfolio of my work
lysfaere.com Please check the new stuff!

2016-05-24, 13:15:35
Reply #2

julecocq

  • Active Users
  • **
  • Posts: 29
    • View Profile
oh yeah ? If yes I didn't know it.

edit: But is it rendering/randomizing RGB masks ? no RGB is a no go...


what about point 2 ?
« Last Edit: 2016-05-24, 13:25:28 by julecocq »

2016-05-24, 13:27:38
Reply #3

Juraj

  • Active Users
  • **
  • Posts: 4815
    • View Profile
    • studio website
Hmm, masks, you're right not sure, since I don't use that. I remember DBOX guys asking me something similar last year....

Maru will answer for sure
Please follow my new Instagram for latest projects, tips&tricks, short video tutorials and free models
Behance  Probably best updated portfolio of my work
lysfaere.com Please check the new stuff!

2016-05-24, 14:47:46
Reply #4

lacilaci

  • Active Users
  • **
  • Posts: 749
    • View Profile
add render element CMasking_ID and in Masking by ID rollout set to Material ID.

What you get is a render pass with random colors per material. Is that what you're asking for?

2016-05-24, 15:01:36
Reply #5

julecocq

  • Active Users
  • **
  • Posts: 29
    • View Profile
well, this is an option... but random colors is not the best.

RGB masks are the best for selection.

So what I ask for, is, a feature which allows to create all RBG masks you need, in a few clicks.

1- Add an ID in all material present in the scene (more than 16)
2- Add all render element needed to render the mask

When u have 100 materials visible in ur render, it's a bit painfull to add 33/34 RGB masks render elements.

2016-05-24, 22:58:14
Reply #6

Frood

  • Active Users
  • **
  • Posts: 2002
    • View Profile
    • Rakete GmbH
1- Add an ID in all material present in the scene (more than 16)

This is just not possible with Max. You cannot break the 15/16 ID barrier even by scripting, it´s not an UI restriction.

The all-material-pass(es) you are looking for would have to be created differently (maybe by creating object clusters and use the AND condition in CMasing_Mask together with Manual selections or GBuffer ID to get more than 15 IDs to distinguish) or somehow Corona internally.

At least a script like this would be no fun to write and it also wouldn´t be able to handle every scene - a frustrating mess :)

Good Luck!

Never underestimate the power of a well placed level one spell.

2016-05-25, 10:31:17
Reply #7

julecocq

  • Active Users
  • **
  • Posts: 29
    • View Profile
This is really bad...

When you have DOF or Motion Blur, having RGB masks is the best. I don't understand why such a simple thing is not possible in Max.

You guys at Corona have an idea ?

2016-05-25, 12:29:36
Reply #8

alexyork

  • Active Users
  • **
  • Posts: 739
  • Partner at Recent Spaces
    • View Profile
    • RECENT SPACES
It should be possible for someone to script a simple version of this which does the following:

- for each unique material in the scene create a CoronaMask element and include all the objects with that material assigned to them

You can then Render Only Elements and there should be X number of mask elements - a simple b/w mask for each material type.

Now if someone can be bothered to do it... :)
Alex York
Partner
RECENT SPACES
recentspaces.com

2016-05-25, 13:08:43
Reply #9

Frood

  • Active Users
  • **
  • Posts: 2002
    • View Profile
    • Rakete GmbH
You ignore for example multisub materials (and whatever else might arise). Think of a car (single mesh) having 30 or more materials. So It has to be some AND operation with material IDs - somehow.

IMHO the only proper option which would work in every(?) scene is to render each material in a seperate (render) pass by batch. This could be automated by script yes, but... it´s ugly :)

Good Luck

Never underestimate the power of a well placed level one spell.

2016-05-25, 13:15:45
Reply #10

julecocq

  • Active Users
  • **
  • Posts: 29
    • View Profile
There are scripts working for Vray, so we should find a way to do that with corona :)

Good idea Alexyork !

Or what about having a script/feature doing:

1_For all shaders in the scene, select by material
2_Add an object ID to the geo
3_Add all render element needed to render the mask


?

2017-03-21, 13:39:41
Reply #11

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 9048
  • Turning coffee to features since 2009
    • View Profile
This seems like very specific request that is not suited for general usage - it is used for very specific workflow and is extremely memory demanding. I am moving this to resolved without implementing, as it is more suitable to do via custom-made script
Rendering is magic.How to get minidumps for crashed/frozen 3ds Max | Sorry for short replies, brief responses = more time to develop Corona ;)