Help: Assigning a "normal map" to a Material from a script doesn't work.

eyalfxeyalfx Posts: 5

Hi there,

I have a script that takes a simple json and populate a material with texture maps. It's working perfectly for Diffuse, bump and Glossiness but doens't work on normal map.

The error I'm getting is  TypeError: Result of expression 'prop.setMap' [undefined] is not a function.

EDIT:::::  Nevermind I figured it out.  it seems like for Normal Map I need to use prop.setValue() instead of prop.setMap()..

Anyone knows why some properties requires setValue() instead of setMap() ?

Post edited by eyalfx on

Comments

  • Richard HaseltineRichard Haseltine Posts: 96,219
    edited September 2020

    Does the shader you have applied use an image property for normals, while the others take both map and numeric value? You could try printing the proeprty's className().

    Post edited by Richard Haseltine on
  • Thanks Richard.

    The shader is "Daz Studio Default" so setValue() works for prop "Normal Map"

    I tried printing it using this line of code but it's not telling me anything.

    print("prop " + prop.name + " class " + prop.className());

    Output log : prop Normal Map class function className() {[native code]}

     

  • Should work for any QObject

Sign In or Register to comment.