Modifier Property pass override

Nazar
Posts: 7
Joined: Fri Sep 07, 2018 2:15 pm

Modifier Property pass override

Postby Nazar » Fri Sep 07, 2018 2:23 pm

Hi,
I'm trying to setup different modifier property for different passes. Property set allows to capture properties of the object, but not the modifier from its stack. In my case this is Material modifier/Material ID parameter. Could you advice, please, how to get access to such properties?

Thank you in advance,
Nazar

admin
Site Admin
Posts: 136
Joined: Mon Jun 19, 2017 4:08 pm

Re: Modifier Property pass override

Postby admin » Fri Sep 07, 2018 2:46 pm

Hi

This can be done by manually specifying the modifier and modifier property in the custom properties list, indexed by the modifier name.

As an example, if I create sphere and add a bend modifier, add to a capture set, and then in the Capture Set Parameters, below the 'Custom Properties' list on the right, in the field next to the 'Add' button I enter

modifiers[#Bend].BendAngle

and press the add button and then select the new item added to the list and hit apply - then any objects added to the set that have a bend modifier named 'Bend' will have their bend angle captured/restored (if you rename the modifier you'll need to recreate the property capture item). You should be able to index by integer too, though by name as the above example will survive modifiers being added/removed.

See how that goes, it works in my test - I have a sphere and a box added to a set created as above, and both have bend modifiers independently captured per pass. If you aren't sure what the name of the property is you can turn on the macrorecorder and then adjust the value - most properties should print to the listener the command to make the change, though it may take a 'show' or 'showproperties' call in a script editor (ie show $.modifiers[#Bend] if the sphere is selected).

An alternative is to use the before/after scripts to set what you need via script - this can give you more control or access to items not easily accessible otherwise but does require some scripting knowledge.

cheers,
grant

Nazar
Posts: 7
Joined: Fri Sep 07, 2018 2:15 pm

Re: Modifier Property pass override

Postby Nazar » Fri Sep 07, 2018 3:58 pm

Thank you very much, Grant!
You recommendations allowed me to solve my issue.
We faced with the problem with RPMMaterial and Corona render. Corona doesn't recognise PR material and generates very nice errors (attached) :)
So, as a plan B we set up material switcher via Material modifier. With your recommendation it works.
But, of cause, it would be great to have direct RPMMaterial support in Corona. Is this something doable?

Thank you for your help!
Nazar
Attachments
Capture2.JPG
RPMaterial Corona Error
Capture2.JPG (56.89 KiB) Viewed 4618 times

admin
Site Admin
Posts: 136
Joined: Mon Jun 19, 2017 4:08 pm

Re: Modifier Property pass override

Postby admin » Sat Sep 08, 2018 3:25 pm

Hi

While compatibility would likely be possible (after maybe some feedback from the corona developers) I'm wondering if the 'Remove RPMMaterial during Render' option is working as it should, or if this option is maybe off? (can you check in the 'Capture Globals' of the Properties tab).

This feature was originally added to support particular shaders in mental ray: while the RPM material was coded to be compatible with MR, certain shaders didn't like being sub-shaders, so what this feature does is completely remove the RPM material from the scene only during render (by swapping out the rpm material for the active submaterial prior to render, and swapping back after) - so that the RPM material should never be 'seen' by the renderer at all.

If this option is on - and I believe it's on by default - then I'm wondering why it's not working for you?

If the 'remove RPMMaterial during render' is on already, it may be that the Corona renderer isn't triggering the #preRender and #postRender callbacks - if this is the case I'll look into a way you could hook this up yourself.

As a test of whether it could work for you, before rendering (without your own switching hooked up) restore a pass that would otherwise render with problems and then evaluate:

rpmdata.RPMpreRenderSwapMat()

and then render: Does that then render without the issues?

then evaluate

rpmdata.RPMpostRenderSwapMat()

to restore the material setup to what it was before.


cheers,
grant

Nazar
Posts: 7
Joined: Fri Sep 07, 2018 2:15 pm

Re: Modifier Property pass override

Postby Nazar » Mon Sep 10, 2018 9:12 am

Good afternoon, Grant,

Thank you for you reply. We tried to recreate our error on newly created simple scene (with three boxes). 'Remove RPMMaterial during Render' is active there by default. And material switching works as it should there :/ So this is good news.
We will continue keeping our eyes on this problem when working on the real scene. We will keep you informed.
Thank you for you support!

with optimism,
Nazar


Return to “Questions”

Who is online

Users browsing this forum: No registered users and 1 guest

cron