Rodrigo Pegorari Computer Graphics, Gamedev and Arts

Rodrigo Pegorari
P5toMax: Connect Processing and 3dsMax

P5 to Max is a Max script tool to make a connection between 3dsMax and Processing. The goal of the project is to bring Processing language advantages to 3dsMax.

If you don´t know the Processing language, check here. Using P5 to Max and Using Processing with some libs, we can do easily procedural animations, realtime camera and Wii remote control capture, Arduino connection, realtime audio spectrum and others…


How it works:

Start a sketch in processing as server.

Drag the to 3dsMax viewport or “Run Script”. Adjust your settings, and click on “Connect”.

When the Max Script is “playing”, it sends a time counter to the Processing Server.

The server works with this value, using as reference to make your animations. This way is possible to make a relationship between 3dsMax Timeline and the Processing generated animation.

So, after define your MaxScript commands, Processing sends back this value to 3dsMax.

Finnaly, the Max Script will execute this command.

The video shows a simple procedural animation:

P5toMax: Connecting Processing with 3dsMax from Rodrigo Pegorari on Vimeo.


  • P5toMax v1.0 Download (49Kb)
  • Did you like this? Share it:

    26 Responses to P5toMax: Connect Processing and 3dsMax

    1. dominik says:

      Hi. Looks great! But I’m new to this..
      Could you share your 50cubes_server Processing sketch for me to check the code and try with your sketch pls?

      • pegorari says:

        Hi Dominik, i´m glad you like it!
        This sketch (and the Max file) are included in the folder “example”, on the same download link above, take a look there!

    2. dominik says:

      Great! (overlooked that folder somehow) It works. Thanks!
      How do you hook up the boxes to Processing? F.e. if I duplicate a box in max it doesn’t get animated…

      Tutorial somewhere?

      great work.

    3. Pegorari says:

      In the code:

      MaxCommand += “$box”+i+”.pos = ["+value_x*i+","+value_y*i+","+value_z+"]\n”;

      “$box”+i is the object name (just “box” in max)

      But you have the statement “for (int i = 1; i <= 50; i++){",
      then the objects in max should have a name from "box1" to "box50"

      Another example:

      MaxCommand += "$ObjectName.pos = ["+value_x*i+","+value_y*i+","+value_z+"]\n";

      In Max, your object name is just "ObjectName"

    4. dominik says:

      thanks! I’ll check it out. Programming language became a little more comprehensible. I’ll send a link to the animation I want to make based on your code. I’ve been exporting quite some processing sketches to max as dxf.

      thanks again.

    5. Pegorari says:

      Man, your artworks are quite beautiful!! Keep me posted if you make something with my script, I realy would like to see!

    6. Luca says:

      Hi Rodrigo,

      I try your 3DS MAX script to connect Processing to 3DS Max. It work. Thank you.
      I have a question. Are there some limitations to message sent on the socket or to buffer size?
      I try to sent a lot of data and the framerate slow down.

      How can I fix this problem?

      thank you in advance


      • pegorari says:

        Hi Luca,
        I’m having the same problem here when working with a lot of data.
        At this moment I haven’t found a solution yet, but I’ll keep you posted about any news.

    7. that’s f**king awesome thing. Haven’t tried it but will try definitely. hve u tried it using max 2012 btw ???

    8. arman hadilou says:

      Hi. that is great job.

      I was just wondering if it is possible to change the material as well?


    9. Chris K says:

      Hi Rodrigo,

      I’ve been playing with your script and the 3D flocking Boids from OpenProcessing ( and was wondering how easily they might be combined?

      I am very new to processing but have some fish in max I would love to animate swimming around for a project I am working on!

      My worry is that even if I managed to call each of the Boids locations from their arraylist (BoidList class within the above code), because their movement doesn’t seem govered by any relation to a time counter, as your code does, the two couldn’t be matched.

      What do you think? Is it possible?

      • pegorari says:

        Hi Christopher,
        Sure, you will make this integration easily, just creating the same number of objects on 3dsmax and sending the vector3 position and rotation from each boid in the processing to max…
        Basically, you will use the same command in the sample code “$ObjectNameInMax.pos = ["+value_x*i+","+value_y*i+","+value_z+"]\n”;
        Maybe the rotation will need some convertion, but only small maths that you can found in the processing forum.
        Don´t forget to share the result if you create something cool :D

    10. carlos castro says:

      hola me parece excelente todo lo que has hecho, tienes toda mi admiración. hice una mano humana en 3ds Max, y quiero controlarla con potenciomentros, mi pregunta es como envió y recibo datos del puerto serie en Procesing o en 3ds Max. para controlar la animación desde un hardware.

      te agradecería cualquier ayuda.

    11. elías says:

      Hi Rodrigo!

      It´s very interesting the tool that you made for 3dmax and Processing, also the rest of your work. I have a doubt. It´s possible ton reverse de process?, i mean, i need to export the work made in 3dMax or Autocad to Processing to work on it.Would be possible modeling in 3dmax and then work on it in Processing, modifying and animating?, my English is very bad, I’m Spanish.
      Thank you and regards!

    12. Alba says:

      Hi Rodrigo,

      I’m still very new to Processing but this is very interesting!! I was wondering, is it possible to change other parameters of the boxes, like length or segments?

      Thanks for making this!

      • pegorari says:

        Hello, the tool only sends parameters from processing to max. These parameters are in maxscript language. So you can use the specific command for this, take a look at the maxscript language reference. Thanks!

    13. Naz says:

      Hi Rodrigo, hope you’re well, I tired your max strip tool and works well, it’s a very good invention.
      I was wondering if I could use it to generate data from arduino to change form of an object in studio max, is that possible? If so how?
      Thanks .

    14. Natasha says:

      Hi @pegorari
      thanks for the awesome link-but i was wondering is there a way you know how to export a sketch to render in 3ds max or rhino? is there a format of some sort to export it in?
      kind regards,

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

    Spam Protection by WP-SpamFree