MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/MaterialX / _writeOperatorFunc

Function _writeOperatorFunc

python/Scripts/genmdl.py:162–168  ·  view source on GitHub ↗
(file, outputType, arg1, functionName, arg2)

Source from the content-addressed store, hash-verified

160 file.write(INDENT + 'return ' + functionName + '(mxp_in);\n')
161
162def _writeOperatorFunc(file, outputType, arg1, functionName, arg2):
163 if outputType == 'color4':
164 file.write(INDENT + 'return mk_color4(mk_float4(' + arg1 +') ' + functionName + ' mk_float4(' + arg2 + '));\n')
165 elif outputType == 'float3x3' or outputType == 'float4x4':
166 file.write(INDENT + 'return ' + outputType + '(' + arg1 + ') ' + functionName + ' ' + outputType + '(' + arg2 + ');\n')
167 else:
168 file.write(INDENT + 'return ' + arg1 + ' ' + functionName + ' ' + arg2 + ';\n')
169
170def _writeTwoArgumentFunc(file, outputType, functionName, arg1="mxp_in1", arg2="mxp_in2"):
171 if outputType == 'color4':

Callers 1

mainFunction · 0.85

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected