playMaker

Author Topic: [SOLVED] Unitys Shadergraph Float access?  (Read 450 times)

Adam Z

  • Full Member
  • ***
  • Posts: 152
    • View Profile
[SOLVED] Unitys Shadergraph Float access?
« on: March 13, 2019, 10:55:23 AM »
Hi, for some reason I can't access my Materials float when I created it with Shadergraph. Any thoughts?

Thanks.
« Last Edit: April 24, 2019, 07:36:46 AM by Adam Z »

Adam Z

  • Full Member
  • ***
  • Posts: 152
    • View Profile
Re: Unitys Shadergraph Float access?
« Reply #1 on: April 23, 2019, 06:53:56 PM »
Hi, does anyone know of a solution? Thanks.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3632
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Unitys Shadergraph Float access?
« Reply #2 on: April 23, 2019, 08:32:43 PM »

Thore

  • Sr. Member
  • ****
  • Posts: 341
    • View Profile
Re: Unitys Shadergraph Float access?
« Reply #3 on: April 24, 2019, 02:48:04 AM »
I think shader graph mangles the names. This might help:
https://forum.unity.com/threads/im-having-trouble-accessing-shadergraph-exposed-properties-through-c-script.526398/

When a new property is added, it generates an inscrutable string, as visible on the second picture above. To access the property, you just need to define a name there (convention is _yourPropertyParameter).

Adam Z

  • Full Member
  • ***
  • Posts: 152
    • View Profile

Adam Z

  • Full Member
  • ***
  • Posts: 152
    • View Profile
Re: [SOLVED] Unitys Shadergraph Float access?
« Reply #5 on: April 24, 2019, 07:41:26 AM »
To be a bit more specific; when you create your shader with Unity's Shader Graph and add a parameter to the Blackboard, it generates a Reference ID (i.e. Texture2D_355C4C5). You can either use that, or rename it to whatever you'd like (it seems to put an _ before whatever you decide to name it). Just use your renamed Reference ID (i.e. _ThisIsRenamed)  in your Playmaker node and you should be good to go.

Thanks everyone.