Sometimes you may wish to control everything in one script, especially if you’re creating complex xpresso setup, too much nodes can get messy in xpresso editor…
That’s because I would like to share a small Cinema 4D C.O.F.F.E.E. Script doing the same job with default Range Mapper Node in Cinema 4D Xpresso.
1 2 3 4 5 6 7 8 9 10 11 |
main() { var fixbug = ((Input_Upper - Input_Lower)/100); var expres = ((Output_Upper - Output_Lower)/100)*(Input - Input_Lower); if (Input_Upper == Input_Lower) { fixbug = 1; expres = 0; } Output = expres/fixbug + Output_Lower; } |
Of course we need to create our C.O.F.F.E.E. node and paste this code. And also we should add Input_Lower, Input_Upper, Output_Upper, Output_Lower ports.
Leave a Reply
Want to join the discussion?Feel free to contribute!