脚本与 Python API

MQShaderNode · 着色器节点

本页目录
  1. 属性
  2. 方法
  3. getOptionValue(option_name)
  4. getParameterNum
  5. getParameterName(index)
  6. getParameterOptionValue(parameter_index_or_name, option_name)
  7. getParameterValueType(parameter_index_or_name)
  8. getParameterArraySize(parameter_index_or_name)
  9. getParameterBoolValue(parameter_index_or_name[, array_index])
  10. getParameterIntValue(parameter_index_or_name[, array_index])
  11. getParameterFloatValue(parameter_index_or_name[, array_index])
  12. getParameterColorValue(parameter_index_or_name[, array_index])
  13. getParameterStringValue(parameter_index_or_name[, array_index])
  14. setParameterBoolValue(parameter_index_or_name[, array_index], value)
  15. setParameterIntValue(parameter_index_or_name[, array_index], value)
  16. setParameterFloatValue(parameter_index_or_name[, array_index], value)
  17. setParameterColorValue(parameter_index_or_name[, array_index], value)
  18. setParameterStringValue(parameter_index_or_name[, array_index], value)
  19. getMappingNum
  20. getMappingName(index)
  21. getMappingOptionValue(mapping_index_or_name, option_name)
  22. getMappingFilename(mapping_index_or_name)
  23. setMappingFilename(mapping_index_or_name, filename)
  24. getMappingUVChannel(mapping_index_or_name)
  25. setMappingUVChannel(mapping_index_or_name, channel)
  26. getMappingConnectedNodeID(mapping_index_or_name)
  27. setMappingConnectedNodeID(mapping_index_or_name, shader_node_id, output)
  28. getMappingConnectedNode(mapping_index_or_name)
  29. getMappingParameterNum(mapping_index_or_name)
  30. getMappingParameterName(mapping_index_or_name, index)
  31. getMappingParameterValueType(mapping_index_or_name, parameter_index_or_name)
  32. getMappingParameterArraySize(mapping_index_or_name, parameter_index_or_name)
  33. getMappingParameterBoolValue(mapping_index_or_name, parameter_index_or_name[, array_index])
  34. getMappingParameterIntValue(mapping_index_or_name, parameter_index_or_name[, array_index])
  35. getMappingParameterFloatValue(mapping_index_or_name, parameter_index_or_name[, array_index])
  36. getMappingParameterColorValue(mapping_index_or_name, parameter_index_or_name[, array_index])
  37. getMappingParameterStringValue(mapping_index_or_name, parameter_index_or_name[, array_index], value)
  38. setMappingParameterBoolValue(mapping_index_or_name, parameter_index_or_name[, array_index], value)
  39. setMappingParameterIntValue(mapping_index_or_name, parameter_index_or_name[, array_index], value)
  40. setMappingParameterFloatValue(mapping_index_or_name, parameter_index_or_name[, array_index], value)
  41. setMappingParameterColorValue(mapping_index_or_name, parameter_index_or_name[, array_index], value)
  42. setMappingParameterStringValue(mapping_index_or_name, parameter_index_or_name[, array_index], value)
  43. getOutputParameterNum
  44. getOutputParameterName(index)
  45. getOutputParameterOptionValue(parameter_index_or_name, option_name)
  46. getOutputParameterValueType(parameter_index_or_name)

MQShaderNode 保存材质中的着色器参数。

属性#

读取(get) 写入(set) 类型 名称 说明
x string shaderFilename 着色器文件名

方法#

成员 说明
getOptionValue 获取着色器 .xml 文件中定义的选项值。
getParameterNum 获取参数数量。
getParameterName 获取参数名称。
getParameterOptionValue 获取着色器 .xml 文件中定义的参数选项值。
getParameterValueType 根据索引或名称,获取指定参数的数值类型。
getParameterArraySize 根据索引或名称,获取指定参数的数组元素数量。
getParameterBoolValue 根据索引或名称,以 bool 类型获取指定参数的值。
getParameterIntValue 根据索引或名称,以 int 类型获取指定参数的值。
getParameterFloatValue 根据索引或名称,以 float 类型获取指定参数的值。
getParameterColorValue 根据索引或名称,以 MQColor 类型获取指定参数的值。
getParameterStringValue 根据索引或名称,以 string 类型获取指定参数的值。
setParameterBoolValue 根据索引或名称,以 bool 值设置指定参数。
setParameterIntValue 根据索引或名称,以 int 值设置指定参数。
setParameterFloatValue 根据索引或名称,以 float 值设置指定参数。
setParameterColorValue 根据索引或名称,以 MQColor 值设置指定参数。
setParameterStringValue 根据索引或名称,以 string 值设置指定参数。
getMappingNum 获取贴图数量。
getMappingName 获取贴图名称。
getMappingOptionValue 获取着色器 .xml 文件中定义的贴图选项值。
getMappingFilename 获取贴图文件名。
setMappingFilename 设置贴图文件名。
getMappingUVChannel 获取贴图的 UV 通道名称。
setMappingUVChannel 设置贴图的 UV 通道名称。
getMappingConnectedNodeID 获取连接到此贴图的节点 ID。
setMappingConnectedNodeID 获取连接到此贴图的节点 ID。
getMappingConnectedNode 获取连接的着色器节点。
getMappingParameterNum 获取贴图文件名。
getMappingParameterName 获取贴图参数名称。
getMappingParameterValueType 根据索引或名称,获取指定贴图参数的数值类型。
getMappingParameterArraySize 根据索引或名称,获取指定贴图参数的数组元素数量。
getMappingParameterBoolValue 根据索引或名称,以 bool 类型获取指定贴图参数的值。
getMappingParameterIntValue 根据索引或名称,以 int 类型获取指定贴图参数的值。
getMappingParameterFloatValue 根据索引或名称,以 float 类型获取指定贴图参数的值。
getMappingParameterColorValue 根据索引或名称,以 MQColor 类型获取指定贴图参数的值。
getMappingParameterStringValue 根据索引或名称,以 string 类型获取指定贴图参数的值。
setMappingParameterBoolValue 根据索引或名称,以 bool 值设置指定贴图参数。
setMappingParameterIntValue 根据索引或名称,以 int 值设置指定贴图参数。
setMappingParameterFloatValue 根据索引或名称,以 float 值设置指定贴图参数。
setMappingParameterColorValue 根据索引或名称,以 MQColor 值设置指定贴图参数。
setMappingParameterStringValue 根据索引或名称,以 string 值设置指定贴图参数。
getOutputParameterNum 获取着色器 .xml 文件中定义的输出参数数量。
getOutputParameterName 获取着色器 .xml 文件中定义的输出参数。
getOutputParameterOptionValue 获取着色器 .xml 文件中定义的输出参数选项值。
getOutputParameterValueType 根据索引或名称,获取指定输出参数的数值类型。

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
输入关键词,查找手册中的内容。