setValue method

void setValue(
  1. String key,
  2. dynamic newValue
)

Implementation

void setValue(String key, dynamic newValue) {
  if (key == "alphaTest") {
    alphaTest = newValue;
  } else if (key == "bumpScale") {
    bumpScale = newValue;
  } else if (key == "alphaMap") {
    alphaMap = newValue;
  } else if (key == "aoMap") {
    aoMap = newValue;
  } else if (key == "blendDst") {
    blendDst = newValue;
  } else if (key == "blendDstAlpha") {
    blendDstAlpha = newValue;
  } else if (key == "blendSrcAlpha") {
    blendSrcAlpha = newValue;
  } else if (key == "blendEquation") {
    blendEquation = newValue;
  } else if (key == "blending") {
    blending = newValue;
  } else if (key == "blendSrc") {
    blendSrc = newValue;
  } else if (key == "blendSrcAlpha") {
    blendSrcAlpha = newValue;
  } else if (key == "clearcoat") {
    clearcoat = newValue;
  } else if (key == "clearcoatRoughness") {
    clearcoatRoughness = newValue;
  } else if (key == "clipIntersection") {
    clipIntersection = newValue;
  } else if (key == "clipping") {
    clipping = newValue;
  } else if (key == "clippingPlanes") {
    clippingPlanes = newValue;
  } else if (key == "clipShadows") {
    clipShadows = newValue;
  } else if (key == "color") {
    if (newValue.runtimeType == Color) {
      color = newValue;
    } else {
      color = Color(0, 0, 0).setHex(newValue);
    }
  } else if (key == "colorWrite") {
    colorWrite = newValue;
  } else if (key == "defines") {
    defines = newValue;
  } else if (key == "depthPacking") {
    depthPacking = newValue;
  } else if (key == "depthTest") {
    depthTest = newValue;
  } else if (key == "depthWrite") {
    depthWrite = newValue;
  } else if (key == "dithering") {
    dithering = newValue;
  } else if (key == "emissive") {
    if (newValue.runtimeType == Color) {
      emissive = newValue;
    } else {
      emissive = Color(0, 0, 0).setHex(newValue);
    }
  } else if (key == "emissiveMap") {
    emissiveMap = newValue;
  } else if (key == "flatShading") {
    flatShading = newValue;
  } else if (key == "fog") {
    fog = newValue;
  } else if (key == "fragmentShader") {
    fragmentShader = newValue;
  } else if (key == "instanced") {
    instanced = newValue;
  } else if (key == "lights") {
    lights = newValue;
  } else if (key == "linecap") {
    linecap = newValue;
  } else if (key == "linejoin") {
    linejoin = newValue;
  } else if (key == "linewidth") {
    linewidth = newValue;
  } else if (key == "matcap") {
    matcap = newValue;
  } else if (key == "map") {
    map = newValue;
  } else if (key == "metalness") {
    metalness = newValue;
  } else if (key == "metalnessMap") {
    metalnessMap = newValue;
  } else if (key == "name") {
    name = newValue;
  } else if (key == "normalMap") {
    normalMap = newValue;
  } else if (key == "normalScale") {
    normalScale = newValue;
  } else if (key == "opacity") {
    opacity = newValue;
  } else if (key == "polygonOffset") {
    polygonOffset = newValue;
  } else if (key == "polygonOffsetFactor") {
    polygonOffsetFactor = newValue;
  } else if (key == "polygonOffsetUnits") {
    polygonOffsetUnits = newValue;
  } else if (key == "premultipliedAlpha") {
    premultipliedAlpha = newValue;
  } else if (key == "reflectivity") {
    reflectivity = newValue;
  } else if (key == "roughness") {
    roughness = newValue;
  }else if (key == "refractionRatio") {
    refractionRatio = newValue;
  }else if (key == "roughnessMap") {
    roughnessMap = newValue;
  } else if (key == "shading") {
    //   // for backward compatability if shading is set in the constructor
    throw ('THREE.' +
        type +
        ': .shading has been removed. Use the boolean .flatShading instead.');
    //   this.flatShading = ( newValue == FlatShading ) ? true : false;

  } else if (key == "shininess") {
    shininess = newValue;
  } else if (key == "side") {
    side = newValue;
  } else if (key == "size") {
    size = newValue;
  } else if (key == "dashSize") {
    dashSize = newValue;
  } else if (key == "gapSize") {
    gapSize = newValue;
  } else if (key == "scale") {
    scale = newValue;
  } else if (key == "sizeAttenuation") {
    sizeAttenuation = newValue;
  } else if (key == "stencilZFail") {
    stencilZFail = newValue;
  } else if (key == "stencilZPass") {
    stencilZPass = newValue;
  } else if (key == "stencilFail") {
    stencilFail = newValue;
  } else if (key == "stencilFunc") {
    stencilFunc = newValue;
  } else if (key == "stencilRef") {
    stencilRef = newValue;
  } else if (key == "stencilWrite") {
    stencilWrite = newValue;
  } else if (key == "toneMapped") {
    toneMapped = newValue;
  } else if (key == "transparent") {
    transparent = newValue;
  } else if (key == "uniforms") {
    uniforms = newValue;
  } else if (key == "vertexShader") {
    vertexShader = newValue;
  } else if (key == "visible") {
    visible = newValue;
  } else if (key == "vertexColors") {
    print("set vertexColors: $newValue ");
    vertexColors = newValue;
  } else if (key == "wireframe") {
    wireframe = newValue;
  } else if (key == "wireframeLinewidth") {
    wireframeLinewidth = newValue;
  } else if (key == "shadowSide") {
    shadowSide = newValue;
  } else if (key == "specular") {
    if (newValue.runtimeType == Color) {
      specular = newValue;
    } else {
      specular = Color(0, 0, 0).setHex(newValue);
    }
  } else {
    throw ("Material.setValues key: $key newValue: $newValue is not support");
  }
}