Setting material hue-shift or colourize
-
In the SU material adjust the texture colour. You can adjust the Hue, Saturation and Lightness etc. But you can also set it to colourize instead of just shifting the values. Is that possible from the API?
-
http://code.google.com/apis/sketchup/docs/ourdoc/texture.html#average_color returns the texture's default 'color' to use when texture is set 'off'. You can of course set the material's actual "color" to anything desired which is similar to colorize, but of course it's not quite the same thing...
http://code.google.com/apis/sketchup/docs/ourdoc/material.html#materialType returns the "type" of the material - 0=solid, 1=textured and 2=textured+colorized: however' there doesn't seem to be a method for changing the settings...
material.materialType=2
is missing. It seems you can only find if colorize is set, but you can't set it externally... We could make a clunky work around importing a colorized skm file and changing its other accessible settings like color= and texture= to match the material in question (I'm 'good' at 'clunky' !) but then of course we'd also need a newmaterial.loadSKM(my.skm)
method...To avoid that we could import a special component with that colorized material applied to it then immediately delete it ? Use that material and rename it to match, clone the details from the other one etc, using my
material.name="newName"
method ??? -
Ok, so I'm haven't missed any methods that actually do this. One more for the feature requests then.
Advertisement