Creating Geometry With Python In C4D

comments 19
Tutorials
Featured Video Play Icon

Hi people from the internet. After posting my geometry creation tutorial for Houdini, people approached me with the question, if such a plexus effect is possible in Cinema 4D, too. And I said no, not without plugins. But after thinking about it for a little while, I found a solution to do this with Cinema4D off-the-shelf tools. I’m using the ParticlePassAB node to find the closest points and Python to create the geometry. So if you’re interested in having a closer look on an old but powerful TP feature, this tutorial is for you.

You don’t have to rely on this technique though, if you’re just after the results. There are plugins, even free ones, out there doing just this effect. One of them is the UberTracer by Gene Magtoto, that you can download here: http://www.genemagtoto.com/c4dplugins/

Download Example Scene

Share on FacebookTweet about this on TwitterPin on PinterestEmail this to someoneShare on LinkedInShare on Google+

19 Comments

  1. Great Stuff!
    I was thinking of doing the same thing in Python but couldn’t think of an easy way of getting the closest points, but this seems to be the way to go!

    And I believe it should also be possible to automate the Connect + Delete step by putting all splines into a Connect Object and collapse it within Python. Or do you know of another way of adding segments to a Spline?

    • Manuel says

      Hi Florian,

      the problem with the connect object is probably that it’ll take a long time to connect all the splines. Other than that it’ll work. It’s of course possible to add segments to a spline directly. You can do so by calling ResizeObject() after the spline creation and tell it how many segments it should have. Then you’ll use SetSegment() to set the individual segments. The problem with the setup from the tutorial is that you are inside of a Xpresso iteration. And that means you don’t know the segment information at any given time. What you would want to do is to write the closest point information to a sequential string attribute. This can be used in a python generator to create the splines afterwards. This would allow for removing the doubles as a side effect.

      Hope this helps, cheers mnu

  2. Pingback: Create Plexus-Style Geometry in C4D With Python - Lesterbanks

  3. Hi Manuel,

    Firstly, great tutorial. However I have hit a snag.

    Everything seemed to be working fine but once I had added all of the data into the Python Editor then nothing seems to happen.

    I have actually run through the tutorial twice now to double check to see if I had made a simple mistake along the way. Is there any way you would be able to look at my file to see if there is something simple I have done wrong? Then if there is anything I could do to repay the favour I would be happy to, a collaboration perhaps?

    Many thanks
    Craig

    • Manuel says

      Hi Craig, send it to mail[at]entagma[dot]com and I will have a look if my time allows.

  4. Reto Christiani from C.biz says

    Danke Manuel for making me a bit smarter today!
    well explained and snatched more from my Python restraint!
    also took just a couple more steps to create a rig and replacing all kinds of plugins.

  5. Pingback: Creating Geometry with Python rig | christiani .biz

  6. hi, great tutorial, but I am making mistakes, any chance for a sample scene file please?, thank you in advance,Craig

  7. Matt White says

    I can’t quite get it to work.

    I see you created a second particle group but can’t see where you used it.

    • Manuel says

      The second particle group was left over from some previous experiments accidentally, and was not used in the setup.

  8. Nils Denon says

    Hi Manuel,

    Thanks for this great tutorial! Unfortunately like Craig I did this tutorial two times and I am also not getting any network of splines. Splines are being generated but they all have the same position.
    I double checked the python but found no errors and the console doesn’t throw any…

    Would you be so kind and either check my File or provide a working example?

    https://www.dropbox.com/s/dusjrnicty412v9/pythonGeometry.c4d?dl=0

  9. Nils Denon says

    Thanks a lot Manuel! I can’t wait to see new tutorials from you guys!

  10. Jose Ponce says

    Thank you for the great tutorial, I haven’t worked much with xpresso or python within c4d, and was still able to follow along and understand the process.

    I was just wondering if you might be able to suggest a natural looking method of animating the growth of the sweep from a single point of origin across the whole object? Currently animating the sweep results in a spread out growth from all the individual particle points. The only other thing I can think of is converting to object and using a boole or using an animated black and white texture as a matte across the object.

    Thank you again

  11. I think I posted a comment before saying that everything ran perfectly…. but anyways I would like to thank you again for the tutorial, I am not myself very good with xpresso neither python because I am not good at them but I am curious on how they work, this tut it´s a very good start to learn and understand both, I enjoyed a lot and it triggered some interesting ideas, too powerful. Thanks a lot! you can check the results on my website.
    Take care guys!
    http://www.kumo-z.com

Leave a Reply

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