playMaker

Author Topic: Material GetPropertyBlock[SOLVED]  (Read 139 times)

MajorIdea

  • Full Member
  • ***
  • Posts: 111
    • View Profile
Material GetPropertyBlock[SOLVED]
« 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!
« Last Edit: November 08, 2017, 12:09:52 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12342
  • Official Playmaker Support
    • View Profile
Re: GetPropertyBlock
« Reply #1 on: November 06, 2017, 11:24:22 PM »
Hi,

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

 Bye,

 Jean

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12342
  • Official Playmaker Support
    • View Profile
Re: GetPropertyBlock
« Reply #2 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

MajorIdea

  • Full Member
  • ***
  • Posts: 111
    • View Profile
Re: Material GetPropertyBlock[SOLVED]
« Reply #3 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:

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12342
  • Official Playmaker Support
    • View Profile
Re: Material GetPropertyBlock[SOLVED]
« Reply #4 on: November 09, 2017, 09:16:09 AM »
Hi,

 I'll do the getters tomorrow.

 bye,

 Jean

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12342
  • Official Playmaker Support
    • View Profile
Re: Material GetPropertyBlock[SOLVED]
« Reply #5 on: November 10, 2017, 01:34:38 AM »
Hi,

 done, available on the Ecosystem.

 bye,

 Jean