OSLMap: textureMap

OSLMap - superclass: textureMap; super-superclass:material - 11:2 - classID: #(2140830621L, 1875767309L) 

The OSLMap texturemap provides a container object to hold Open Shader Language shaders. Available in 3ds Max 2019 and higher. 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

OSLMap interfaces

Interface: IMtlRender_Compability_MtlBase

Properties:

Methods:

Actions:

Interface: iMultipleOutputChannelsWithValues

Properties:

 .numIMultipleOutputChannels : integer : Read         

Gets the number of output ports for the OSLMap.

Methods:

 <string>getIMultipleOutputChannelLocalizedName <index>index 
           getIMultipleOutputChannelLocalizedName - no automatic redraw after invoked 

Returns the localized name string for the specified output channel.

 <string>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.

 <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:

Interface: iMultiOutputConsumer

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:

 <boolean>SetOutputToInput <index>input_index <maxObject>output_rtarg <index>output_index 
          
 <maxObject>GetOutputRefTargetFromInput <index>input_index 
          
 <index>GetOutputIndexFromInput <index>input_index 
          
 <boolean>CanAssignOutputToInput <index>input_index <maxObject>output_rtarg <index>output_index 
          
 <string>GetInputName <index>input_index 
           GetInputName - no automatic redraw after invoked 
          
 <string>GetInputLocalizedName <index>input_index 
          GetInputLocalizedName - no automatic redraw after invoked 
          

Actions: