Playmaker Forum

Playmaker Feedback => Action Requests => Topic started by: MajorIdea on November 03, 2017, 03:10:02 PM

Title: Material GetPropertyBlock[SOLVED]
Post by: MajorIdea on November 03, 2017, 03:10:02 PM
I was looking for a better alternative to material instances and came across this:

http://thomasmountainborn.com/2016/05/25/materialpropertyblocks/

It's a really powerful feature but not very well known.

I tried to find access to it via the get property action of the mesh renderer component but doesn't seem to be there.

It would be wonderful to have those GetPropertyBlock and SetPropertyBlock actions.

Cheers!
Title: Re: GetPropertyBlock
Post by: jeanfabre on November 06, 2017, 11:24:22 PM
Hi,

 yep, that goes in. Thanks for finding this! Working on it right now.

 Bye,

 Jean
Title: Re: GetPropertyBlock
Post by: jeanfabre on November 08, 2017, 12:09:27 AM
Hi,

 ok, they are available on the Ecosystem now:

SetMaterialPropertyBlockColor
SetMaterialPropertyBlockFloat
SetMaterialPropertyBlockTexture

 let me know if you need the getters or other variables from this.

 Bye,

 Jean
Title: Re: Material GetPropertyBlock[SOLVED]
Post by: MajorIdea on November 09, 2017, 07:10:59 AM
Just made a quick test and it totally works!

The getters would be useful. For example: using this to fade out trees between the camera and player animating the alpha. With the "Get" we can get the current alpha and smoothly interpolate from the current value, rather than having cases where the tree is in the middle of fading out when it detects its no longer in the way and jumps to going from full transparency to full opacity.

Thanks Jean!

Quick test:
(https://i.imgur.com/gsTLSg4.jpg)
Title: Re: Material GetPropertyBlock[SOLVED]
Post by: jeanfabre on November 09, 2017, 09:16:09 AM
Hi,

 I'll do the getters tomorrow.

 bye,

 Jean
Title: Re: Material GetPropertyBlock[SOLVED]
Post by: jeanfabre on November 10, 2017, 01:34:38 AM
Hi,

 done, available on the Ecosystem.

 bye,

 Jean