Compound : textureMap
Compound - superclass: textureMap; super-superclass:material - 7:4 - classID: #(1366243801L, 590182697L); creatable: true
Exposes the Compound node in the Slate Material Editor. A Compound is not a material per se, but a node in the SME that contains a material graph. Compounds can expose input and output channels.
The Compound
interface and related interfaces may change in future releases.
Example
-- create a material and add it to a compound in the SME
physMat = PhysicalMaterial()
sme.open()
-- by default there's one view:
nodeView = sme.getView 1
pos = [10,10]
-- add our material to the SME
matNode = nodeView.createNode physMat &pos
myChecker = osl_Checker()
physMat.base_color_map = myChecker
chkrNode = nodeView.createNode myChecker &pos
-- This is the same as the "Package Nodes Into Compound" command
pkgNode = nodeView.PackageNodesIntoCompound #(physMat, myChecker) &pos
-- to work with the actual compound, we need to get the node reference:
myComp = pkgNode.reference
-- add a new input channel
inputChannel = myComp.addInput()
-- connect it to the 3rd input on Checker: Color1
inputChannel.connect myChecker 3
-- Add an output channel
outputChannel = myComp.addOutput()
outputChannel.connect physMat 1
actionMan.executeAction 369891408 "40060" -- SME: Lay Out All
Properties
<Compound>.members ArrayParameter default: #() -- maxObject array
Get/set the component members of the compound as an array of ReferenceTarget:Compound_Member objects. These are similar to SME node objects, with a reference property pointing to the actual material/map object.
<Compound>.numIMultipleOutputChannels Integer default: 0 -- integer;
Gets the number of output channels with multiple channels for the compound.
<Compound>.numInputs Integer default: 0 -- integer;
Gets the number of inputs for the compound.
<Compound>.numMembers Integer default: 0 -- integer;
Gets the number of member nodes in the compound. This is the size of the .members
array.
<Compound>.numOutputs Integer default: 0 -- integer;
Gets the number of output channels for the compound.
<Compound>.view_pos Point2 default: [0,0] -- point2
Gets/sets the compound's location in the SME view.
<Compound>.view_scale Float default: 1.0 -- float
The view scale for the compound node.
Compound interfaces:
Interface: compound
Methods:
<Interface>getMember <index>index
Returns a <MixinInterface:compoundmember>
for the compound member at the specified index, or undefined if the index doesn't exist.
<Interface>addMember <maxObject>member
Adds the specified maxObject
(a material or map) to the compound, and returns the<MixinInterface:compoundmember>
for that new compound member.
<boolean>deleteMember <Interface>member
Deletes the specified member from the compound. member
must be a <MixinInterface:compoundmember>
, not the underlying material or map object. This deletes the compound member, but not the referenced map or material object.
<index>setMemberIndex <Interface>member <maxObject>index
Not implemented, do not use.
<index>getMemberIndex <Interface>member
Returns the index for the specified compound member.
<Interface>getInput <index>index
Returns a <MixinInterface:compoundio>
for the compound input at the specified index.
<Interface>addInput()
Adds a new, unconnected input channel for the compound, and returns the <MixinInterface:compoundio>
for that input.
<index>setInputIndex <Interface>input <maxObject>index
Not implemented, do not use.
<index>getInputIndex <Interface>input
Returns the index for the specified input object.
<Interface>getOutput <index>index
Returns a <MixinInterface:compoundio>
for the compound output at the specified index.
<Interface>addOutput()
Adds a new, unconnected output channel for the compound, and returns the <MixinInterface:compoundio>
for that input.
<index>setOutputIndex <Interface>output <maxObject>index
Not implemented, do not use.
<index>getOutputIndex <Interface>output
Returns the index of the specified output channel.
Actions:
Interface: iMultiOutputConsumer
Methods:
<boolean>SetOutputToInput <index>input_index <maxObject>output_rtarg <index>output_index
Sets the output channel at output_index
for the compound, connecting the output channel at input_index
on the output_rtarg
object. Returns true if successful, false if not.
<maxObject>GetOutputRefTargetFromInput <index>input_index
Gets the output reference target from the specified input_index
.
<index>GetOutputIndexFromInput <index>input_index
Returns the index for the output channel associated with the specified input_index
channel.
<boolean>CanAssignOutputToInput <index>input_index <maxObject>output_rtarg <index>output_index
Returns true if the channel specified by input_index
for the specified output_rtarg
object can be assigned to the specified output_index
.
<string>GetInputName <index>input_index
GetInputName - no automatic redraw after invoked
Returns the name for the compound input channel at input_index
.
<string>GetInputLocalizedName <index>input_index
GetInputLocalizedName - no automatic redraw after invoked
Returns the localized name string for the compound input channel at input_index
.
Actions:
Interface: iMultipleOutputChannelsWithValues
Properties:
.numIMultipleOutputChannels : integer : Read
Returns the number of output channels the compound has that support multiple output channels.
Methods:
<string>getIMultipleOutputChannelLocalizedName <index>index
getIMultipleOutputChannelLocalizedName - no automatic redraw after invoked
Returns the localized name of the specified output channel.
<string>getIMultipleOutputChannelName <index>index
getIMultipleOutputChannelName - no automatic redraw after invoked
Returns the non-localized (ENU) name 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 data type for the channel specified by index
.
<value>getIMultipleOutputChannelValue <index>index time:<time>
getIMultipleOutputChannelValue - no automatic redraw after invoked
time default value: 0f
Returns the data value for the channel specified by index
at the specified time:
.
Actions: