MQShaderNode 保存材质中的着色器参数。
属性#
方法#
getOptionValue(option_name)#
获取着色器 .xml 文件中定义的选项值。
- 参数:
string option_name - 选项名称
- 返回值:
string - 选项值
getParameterNum #
获取参数数量。
- 返回值:
int - 参数数量
getParameterName(index)#
获取参数名称。
- 参数:
int index - 参数索引
- 返回值:
string - 名称
getParameterOptionValue(parameter_index_or_name, option_name)#
获取着色器 .xml 文件中定义的参数选项值。
- 参数:
int / string parameter_index_or_name - 参数索引或参数名称 string option_name - 选项名称
- 返回值:
string - 选项值
getParameterValueType(parameter_index_or_name)#
根据索引或名称,获取指定参数的数值类型。
- 参数:
int / string parameter_index_or_name - 参数索引或参数名称
- 返回值:
string - 选项值
["bool"] bool(True 或 False)
["int"] int
["float"] float
["color"] MQColor
["string"] string
getParameterArraySize(parameter_index_or_name)#
根据索引或名称,获取指定参数的数组元素数量。
- 参数:
int / string parameter_index_or_name - 参数索引或参数名称
- 返回值:
int - 数组元素数量
getParameterBoolValue(parameter_index_or_name[, array_index])#
根据索引或名称,以 bool 类型获取指定参数的值。
- 参数:
int / string parameter_index_or_name - 参数索引或参数名称 int array_index - 数组中的索引
- 返回值:
bool - 值
getParameterIntValue(parameter_index_or_name[, array_index])#
根据索引或名称,以 int 类型获取指定参数的值。
- 参数:
int / string parameter_index_or_name - 参数索引或参数名称 int array_index - 数组中的索引
- 返回值:
int - 值
getParameterFloatValue(parameter_index_or_name[, array_index])#
根据索引或名称,以 float 类型获取指定参数的值。
- 参数:
int / string parameter_index_or_name - 参数索引或参数名称 int array_index - 数组中的索引
- 返回值:
float - 值
getParameterColorValue(parameter_index_or_name[, array_index])#
根据索引或名称,以 MQColor 类型获取指定参数的值。
- 参数:
int / string parameter_index_or_name - 参数索引或参数名称 int array_index - 数组中的索引
- 返回值:
MQColor - 值
getParameterStringValue(parameter_index_or_name[, array_index])#
根据索引或名称,以 string 类型获取指定参数的值。
- 参数:
int / string parameter_index_or_name - 参数索引或参数名称 int array_index - 数组中的索引
- 返回值:
string - 值
setParameterBoolValue(parameter_index_or_name[, array_index], value)#
根据索引或名称,以 bool 值设置指定参数。
- 参数:
int / string parameter_index_or_name - 参数索引或参数名称 int array_index - 数组中的索引 bool value - 值
setParameterIntValue(parameter_index_or_name[, array_index], value)#
根据索引或名称,以 int 值设置指定参数。
- 参数:
int / string parameter_index_or_name - 参数索引或参数名称 int array_index - 数组中的索引 int value - 值
setParameterFloatValue(parameter_index_or_name[, array_index], value)#
根据索引或名称,以 float 值设置指定参数。
- 参数:
int / string parameter_index_or_name - 参数索引或参数名称 int array_index - 数组中的索引 float value - 值
setParameterColorValue(parameter_index_or_name[, array_index], value)#
根据索引或名称,以 MQColor 值设置指定参数。
- 参数:
int / string parameter_index_or_name - 参数索引或参数名称 int array_index - 数组中的索引 MQColor value - 值
setParameterStringValue(parameter_index_or_name[, array_index], value)#
根据索引或名称,以 string 值设置指定参数。
- 参数:
int / string parameter_index_or_name - 参数索引或参数名称 int array_index - 数组中的索引 string value - 值
getMappingNum #
获取贴图数量。
- 返回值:
int - 贴图数量
getMappingName(index)#
获取贴图名称。
- 参数:
int index - 贴图索引
- 返回值:
string - 名称
getMappingOptionValue(mapping_index_or_name, option_name)#
获取着色器 .xml 文件中定义的贴图选项值。
- 参数:
int / string mapping_index_or_name - 贴图索引或贴图名称 string option_name - 选项名称
- 返回值:
string - 选项值
getMappingFilename(mapping_index_or_name)#
获取贴图文件名。
- 参数:
int / string mapping_index_or_name - 贴图索引或贴图名称
- 返回值:
string - 文件名
setMappingFilename(mapping_index_or_name, filename)#
设置贴图文件名。
- 参数:
int / string mapping_index_or_name - 贴图索引或贴图名称 string filename - 文件名
getMappingUVChannel(mapping_index_or_name)#
获取贴图的 UV 通道名称。
- 参数:
int / string mapping_index_or_name - 贴图索引或贴图名称
- 返回值:
int - UV 通道 ID
setMappingUVChannel(mapping_index_or_name, channel)#
设置贴图的 UV 通道名称。
- 参数:
int / string mapping_index_or_name - 贴图索引或贴图名称 int channel - UV 通道 ID
getMappingConnectedNodeID(mapping_index_or_name)#
获取连接到此贴图的节点 ID。
- 参数:
int / string mapping_index_or_name - 贴图索引或贴图名称
- 返回值:
list[string,string] - 包含子着色器节点 ID 和输出参数名称的列表
setMappingConnectedNodeID(mapping_index_or_name, shader_node_id, output)#
获取连接到此贴图的节点 ID。
- 参数:
int / string mapping_index_or_name - 贴图索引或贴图名称 string shader_node_id - 子着色器节点 ID string output - 输出参数名称
getMappingConnectedNode(mapping_index_or_name)#
获取连接的着色器节点。
- 参数:
int / string mapping_index_or_name - 包含着色器节点 ID 和输出参数名称的列表
- 返回值:
MQShaderNode - 子着色器节点
getMappingParameterNum(mapping_index_or_name)#
获取贴图文件名。
- 参数:
int / string mapping_index_or_name - 贴图索引或贴图名称
- 返回值:
int - 参数数量
getMappingParameterName(mapping_index_or_name, index)#
获取贴图参数名称。
- 参数:
int / string mapping_index_or_name - 贴图索引或贴图名称 int index - 贴图索引
- 返回值:
string - 参数名称
getMappingParameterValueType(mapping_index_or_name, parameter_index_or_name)#
根据索引或名称,获取指定贴图参数的数值类型。
- 参数:
int / string mapping_index_or_name - 贴图索引或贴图名称 int / string parameter_index_or_name - 贴图参数索引或贴图参数名称
- 返回值:
string - 选项值
["bool"] bool(True 或 False)
["int"] int
["float"] float
["color"] MQColor
["string"] string
getMappingParameterArraySize(mapping_index_or_name, parameter_index_or_name)#
根据索引或名称,获取指定贴图参数的数组元素数量。
- 参数:
int / string mapping_index_or_name - 贴图索引或贴图名称 int / string parameter_index_or_name - 贴图参数索引或贴图参数名称
- 返回值:
int - 数组元素数量
getMappingParameterBoolValue(mapping_index_or_name, parameter_index_or_name[, array_index])#
根据索引或名称,以 bool 类型获取指定贴图参数的值。
- 参数:
int / string mapping_index_or_name - 贴图索引或贴图名称 int / string parameter_index_or_name - 贴图参数索引或贴图参数名称 int array_index - 数组中的索引
- 返回值:
bool - 值
getMappingParameterIntValue(mapping_index_or_name, parameter_index_or_name[, array_index])#
根据索引或名称,以 int 类型获取指定贴图参数的值。
- 参数:
int / string mapping_index_or_name - 贴图索引或贴图名称 int / string parameter_index_or_name - 贴图参数索引或贴图参数名称 int array_index - 数组中的索引
- 返回值:
int - 值
getMappingParameterFloatValue(mapping_index_or_name, parameter_index_or_name[, array_index])#
根据索引或名称,以 float 类型获取指定贴图参数的值。
- 参数:
int / string mapping_index_or_name - 贴图索引或贴图名称 int / string parameter_index_or_name - 贴图参数索引或贴图参数名称 int array_index - 数组中的索引
- 返回值:
float - 值
getMappingParameterColorValue(mapping_index_or_name, parameter_index_or_name[, array_index])#
根据索引或名称,以 MQColor 类型获取指定贴图参数的值。
- 参数:
int / string mapping_index_or_name - 贴图索引或贴图名称 int / string parameter_index_or_name - 贴图参数索引或贴图参数名称 int array_index - 数组中的索引
- 返回值:
MQColor - 值
getMappingParameterStringValue(mapping_index_or_name, parameter_index_or_name[, array_index], value)#
根据索引或名称,以 string 类型获取指定贴图参数的值。
- 参数:
int / string mapping_index_or_name - 贴图索引或贴图名称 int / string parameter_index_or_name - 贴图参数索引或贴图参数名称 int array_index - 数组中的索引 string value - 值
setMappingParameterBoolValue(mapping_index_or_name, parameter_index_or_name[, array_index], value)#
根据索引或名称,以 bool 值设置指定贴图参数。
- 参数:
int / string mapping_index_or_name - 贴图索引或贴图名称 int / string parameter_index_or_name - 贴图参数索引或贴图参数名称 int array_index - 数组中的索引 bool value - 值
setMappingParameterIntValue(mapping_index_or_name, parameter_index_or_name[, array_index], value)#
根据索引或名称,以 int 值设置指定贴图参数。
- 参数:
int / string mapping_index_or_name - 贴图索引或贴图名称 int / string parameter_index_or_name - 贴图参数索引或贴图参数名称 int array_index - 数组中的索引 int value - 值
setMappingParameterFloatValue(mapping_index_or_name, parameter_index_or_name[, array_index], value)#
根据索引或名称,以 float 值设置指定贴图参数。
- 参数:
int / string mapping_index_or_name - 贴图索引或贴图名称 int / string parameter_index_or_name - 贴图参数索引或贴图参数名称 int array_index - 数组中的索引 float value - 值
setMappingParameterColorValue(mapping_index_or_name, parameter_index_or_name[, array_index], value)#
根据索引或名称,以 MQColor 值设置指定贴图参数。
- 参数:
int / string mapping_index_or_name - 贴图索引或贴图名称 int / string parameter_index_or_name - 贴图参数索引或贴图参数名称 int array_index - 数组中的索引 MQColor value - 值
setMappingParameterStringValue(mapping_index_or_name, parameter_index_or_name[, array_index], value)#
根据索引或名称,以 string 值设置指定贴图参数。
- 参数:
int / string mapping_index_or_name - 贴图索引或贴图名称 int / string parameter_index_or_name - 贴图参数索引或贴图参数名称 int array_index - 数组中的索引 string value - 值
getOutputParameterNum #
获取着色器 .xml 文件中定义的输出参数数量。
- 返回值:
int - 输出参数数量
getOutputParameterName(index)#
获取着色器 .xml 文件中定义的输出参数。
- 参数:
int index - 输出参数索引
- 返回值:
string - 名称
getOutputParameterOptionValue(parameter_index_or_name, option_name)#
获取着色器 .xml 文件中定义的输出参数选项值。
- 参数:
int / string parameter_index_or_name - 输出参数索引或输出参数名称 string option_name - 选项名称
- 返回值:
string - 选项值
getOutputParameterValueType(parameter_index_or_name)#
根据索引或名称,获取指定输出参数的数值类型。
- 参数:
int / string parameter_index_or_name - 输出参数索引或输出参数名称
- 返回值:
string - 选项值
["bool"] bool(True 或 False)
["int"] int
["float"] float
["color"] MQColor
["string"] string