OSLMap - superclass: textureMap; super-superclass:material - 11:2 - classID: #(2140830621L, 1875767309L)
Value > MAXWrapper > Material > TextureMap > OSLMap |
NEW in 3ds Max 2019: The OSLMap texturemap provides a container object to hold Open Shader Language shaders. All OSL shaders shipped with 3ds Max are instances of this class .
The OSLMap container has some constant properties that are common to all instances of OSLMaps. Other properties, such as input and output ports, and shader options, are created dynamically by the shader code, and will vary depending on the instance.
Constructor
OSLMap...
Properties
These properties are common to all OSLMap instances.
<OSLMap>.OSLAutoUpdate BooleanClass default: false -- boolean; OSL_Auto_Update
Specifies whether the OSL shader code is linked to the file on disk (true), or is held independently by the OSL Map in the scene. This parameter corresponds to the link icon next to the file name in the OSLMap UI.
<OSLMap>.OSLCode String -- string; OSL_Code
A string that contains the OSL shader code. The default is a simple shader that can be used as a starting point for creating a new shader.
The default shader mixes two input colors (or maps) and produces a single output color:
// Simple Example Shader with three inputs two outputs, to demo the syntax. // For more information read the OSL Language Specifictaion: // https://github.com/imageworks/OpenShadingLanguage/blob/master/src/doc/osl-languagespec.pdf shader Example [[ string help="Example shader with three inputs and two outputs<br>" ]] ( // Inputs color Input_A = 0.5 [[ string label = "A"]], color Input_B = 0.5 [[ string label = "B"]], float Mixer = 0.5 [[ float min = 0.0, float max = 1.0 ]], // Outputs output color Out = 0.0, output color Mix = 0.0) { Out = Input_A + Input_B; // Sum Mix = mix(Input_A, Input_B, Mixer); // Mix }
<OSLMap>.OSLPath String default: "" -- filename; OSL_Path
If the OSL code is loaded from a file, this parameter holds the path to that file. This parameter is maintained even if the file is unlinked (by setting .OSLAutoUpdate to false).
<OSLMap>.numIMultipleOutputChannels Integer default: 2 -- integer; Read-only
Specifies the number of output ports for the shader.
<OSLMap>.numInputs
Specifies the number of input ports.
OSLMap Example Properties
These properties exist on the default example OSLMap, and are defined by the example .OSLCode string.
<OSLMap>.Input_A Color default: (color 127.5 127.5 127.5) -- animatable; fRGBA color; Controller Scaling: ([1,1,1,1] : (color 255 255 255)); WeirdScaled ([1,1,1,1])
<OSLMap>.Input_A_map UndefinedClass default: undefined -- texturemap
<OSLMap>.Input_B Color default: (color 127.5 127.5 127.5) -- animatable; fRGBA color; Controller Scaling: ([1,1,1,1] : (color 255 255 255)); WeirdScaled ([1,1,1,1])
<OSLMap>.Input_B_map UndefinedClass default: undefined -- texturemap
<OSLMap>.Mixer Float default: 0.5 -- animatable; float
<OSLMap>.Mixer_map UndefinedClass default: undefined -- texturemap
Properties:
Methods:
Actions:
Properties:
.numIMultipleOutputChannels : integer : Read
Gets the number of output ports for the OSLMap.
Methods:
<TSTR by value>getIMultipleOutputChannelLocalizedName <index>index getIMultipleOutputChannelLocalizedName - no automatic redraw after invoked
Returns the localized name string for the specified output channel.
<TSTR by value>getIMultipleOutputChannelName <index>index getIMultipleOutputChannelName - no automatic redraw after invoked
Returns the name string for the specified output channel.
<enum>getIMultipleOutputChannelType <index>index getIMultipleOutputChannelType enums: {#float|#integer|#rgb|#point3|#string|#filename|#material|#texturemap|#bitmap|#node|#maxObject|#matrix3|#paramblock2|#point4|#frgba getIMultipleOutputChannelType - no automatic redraw after invoked
Returns the type of the specified output channel.
<fpvalue by value>getIMultipleOutputChannelValue <index>index time:<time> getIMultipleOutputChannelValue - no automatic redraw after invoked time default value: 0f
Returns the value of the specified output channel at the specified time.
Actions:
This interfaces is exposed to MAXScript, but the properties and methods listed here are not implemented and cannot be used.
Properties:
.numInputs : integer : Read
Methods:
<bool>SetOutputToInput <index>input_index <maxObject>output_rtarg <index>output_index
<maxObject>GetOutputRefTargetFromInput <index>input_index
<index>GetOutputIndexFromInput <index>input_index
<bool>CanAssignOutputToInput <index>input_index <maxObject>output_rtarg <index>output_index
<TSTR by value>GetInputName <index>input_index GetInputName - no automatic redraw after invoked
<TSTR by value>GetInputLocalizedName <index>input_index GetInputLocalizedName - no automatic redraw after invoked
Actions: