Hi,
I'm trying to create a math node and modify its corresponding Input[2]. However, it gives me an error TypeError: __setitem__ got unexpected type 'float'
I tried with an integer but it also gives me an error.
Is there a way around this?
Thank you for looking at the problem.
You can see the code here:
import c4d
# Main function
def main():
cube = c4d.BaseObject(c4d.Ocube)
doc.InsertObject(cube)
expresso = cube.MakeTag((c4d.Texpresso))
nodemaster = expresso.GetNodeMaster()
math_node = nodemaster.CreateNode(nodemaster.GetRoot(), c4d.ID_OPERATOR_MATH, None, x=0, y=0)
# This line works
math_node[c4d.GV_MATH_FUNCTION_ID] = 2
# This line does not work. The '[2000,1001]' was retrieved by dragging the Input[2] to the console.
math_node[2000,1001] = -1.0
c4d.EventAdd()
# Execute main()
if __name__=='__main__':
main()