Playmaker Feedback > Action Requests

Material GetPropertyBlock[SOLVED]

(1/2) > >>

MajorIdea:
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!

jeanfabre:
Hi,

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

 Bye,

 Jean

jeanfabre:
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

MajorIdea:
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:

jeanfabre:
Hi,

 I'll do the getters tomorrow.

 bye,

 Jean

Navigation

[0] Message Index

[#] Next page

Go to full version