def listParams(self, node, paramType = None, nameFilter = None): ''' List parameters of the node ''' nentry = ai_nodes.AiNodeGetNodeEntry(node) count = ai_node_entry.AiNodeEntryGetNumParams(nentry) generator = ( ai_params.AiParamGetName(ai_node_entry.AiNodeEntryGetParameter(nentry, i)) for i in range(count) ) return generator
def getParamType(self, node, parameter): ''' Get the parameter type of the node ''' nentry = ai_nodes.AiNodeGetNodeEntry(node) count = ai_node_entry.AiNodeEntryGetNumParams(nentry) for i in range(count): pentry = ai_node_entry.AiNodeEntryGetParameter(nentry, i) pname = ai_params.AiParamGetName(pentry) if parameter == pname: ptypeIndex = ai_params.AiParamGetType(pentry) ptype = ai_params.AiParamGetTypeName(ptypeIndex) return ptype
def getASSParamType(node, parameter): # 获取参数类型 # 获取node entry nentry = ai_nodes.AiNodeGetNodeEntry(node) # 获取节点参数个数 count = ai_node_entry.AiNodeEntryGetNumParams(nentry) # 循环查找指定参数的类型 for i in range(count): # 获取parameter entry pentry = ai_node_entry.AiNodeEntryGetParameter(nentry, i) # 获取参数名 pname = ai_params.AiParamGetName(pentry) if parameter == pname: # 获取参数类型序号 ptypeIndex = ai_params.AiParamGetType(pentry) # 获取参数类型名称 ptype = ai_params.AiParamGetTypeName(ptypeIndex) return ptype