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

Function _writeTwoArgumentFunc

python/Scripts/genmdl.py:170–176  ·  view source on GitHub ↗
(file, outputType, functionName, arg1="mxp_in1", arg2="mxp_in2")

Source from the content-addressed store, hash-verified

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':
172 file.write(INDENT + 'return mk_color4(' + functionName + '(mk_float4(' + arg1 + '), mk_float4(' + arg2 + ')));\n')
173 elif outputType == 'color':
174 file.write(INDENT + 'return color(' + functionName + '(float3(' + arg1 + '), float3(' + arg2 + ')));\n')
175 else:
176 file.write(INDENT + 'return ' + functionName + '(' + arg1 + ', ' + arg2 + ');\n')
177
178def _writeThreeArgumentFunc(file, outputType, functionName, arg1, arg2, arg3):
179 if outputType == 'color4':

Callers 1

mainFunction · 0.85

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected