Jump to content

Recommended Posts

For any of you Python fans, especially Jed, I thought you might appreciate this gorgeous file:

 

Python Effector.c4d.zip

 

If only I were good enough to have created the Python Effector for it.

  • Like 1

Whoever said that things don't make you happy obviously didn't have Cinema 4D

Share this post


Link to post
Share on other sites

  • Topic Author
  • southpaw, Glad you like it! You might like this tutorial:

     

     

    • Like 1

    Whoever said that things don't make you happy obviously didn't have Cinema 4D

    Share this post


    Link to post
    Share on other sites

    @southpaw if you're referring to the complicated syntax for C4D in python, are you aware that you can usually just drag stuff from the AM to the python window to get the correct code ? See example

     

    clickdrag.thumb.png.7df6d7156cd0e402f24215d68c981053.png

     

    here's a couple of 'cheat sheets' I use a lot, that might be of use to you (or anyone)

    position stuff.txt

    py math.txt

     

    apologies if you know ^^ all this already

     

    BTW I develop stuff in Pycharm - cinema tends to lock up too easily if for instance you get stuck in a loop.

     

    https://www.jetbrains.com/pycharm/

    Share this post


    Link to post
    Share on other sites

    @Teknow,

    Many thanks, I've seen the Entagma video previously, I didn't understand it at time, but found it much easier to follow this time around.

     

    @jed,

    Again many thanks, for the advice and the cheat sheets, i'll be sure to take a look.

    My main issue with learning C4D Python SDK is where in the dicumentation to look. For instance in the Entagma video that Teknow shared, at around 17 minutes, they mention the "insertUnder" function to insert the newly created splines under the Geo Null, which makes perfect sense when watchng the video, but I'd struggle to work out that I even needed that function in the first place, and wouldn't really know where to search for it without knowing the name.

     

    I would find it easier if the Python SDK was layed out in a simlar fashion to a book on programing languages, a little more chronological so to speak. I understand that proir knowledge of Python is a big help, but just think the SDK would benefit from a few simple'ish tutorials explaining importing a classes, geometry creation, event updates etc. Just enough to get you going.

     

    Will keep trying though, I've always throught that things like loops and arrays in Python are much simpler and to create than they are in xpresso. That's not a dig at xpresso, just a preference of mine.

     

     

     


    Phil Richards, www.fugidesign.co.uk

    Share this post


    Link to post
    Share on other sites
  • Topic Author
  • southpaw, I just waded through that tutorial and was able to follow it but It made me realize that it does exactly what Netcreator plugin does but with way less functionality. But now I understand some of what is under the hood of Netcreator. 

    Anyone who can do Python gets my respect!


    Whoever said that things don't make you happy obviously didn't have Cinema 4D

    Share this post


    Link to post
    Share on other sites

    @southpaw maybe we should start a Python tips for beginners thread. The rules would be nothing too convoluted, and must have comments in the code explaining things.

     

    eg this lottery program -

     

    works best with monospaced font eg Digital Readout Upright, Consolas etc, has interesting zfill method. Press play and stop when you feel lucky.

     

    lottery.c4d

    • Like 1

    Share this post


    Link to post
    Share on other sites

    @teknow, & @jed & anyone else interested,

     

    Just seen this post from Tim Clapham of Helloluxx,

    https://helloluxx.com/tutorials/spline-points-to-clones/

     

    He explains how to iterate through  spline points and attach them to mograph objects using expresso and a small amount of Python. 
    Pretty much the same thing I was trying to do a few months back but could only get so far. 

    • Like 1

    Phil Richards, www.fugidesign.co.uk

    Share this post


    Link to post
    Share on other sites
  • Topic Author
  • Southpaw, Thanks for that link! I am looking forward to going though it.

    Here is a file using Hair which does similar:

     

    https://drive.google.com/file/d/1XmQtnKtjsB24kRRH7Fg46H_FRJLxO9Cc/view?usp=sharing


    Whoever said that things don't make you happy obviously didn't have Cinema 4D

    Share this post


    Link to post
    Share on other sites

    @southpaw interesting video - the bit about GetCache > hierarchy opens up some possibilites.

    Share this post


    Link to post
    Share on other sites
  • Topic Author
  • That tutorial is not working for me. When I add a Python Node in Xpresso all ports are for Real data type and wouldn't allow me to link the Cloner object with the input port on the Python node. So I made a new Link data type port but then the output port is still a Real data type. In other words, exactly how do I make that Python node??

     

    Edit: I got it to work! I had to create input and output Link data type ports and then rename them to match the lines of code in the Python node.


    Whoever said that things don't make you happy obviously didn't have Cinema 4D

    Share this post


    Link to post
    Share on other sites

    Great yang script, Don!

    ...

    You can count on me to learn and kick up some Python! Start That thread. I'll be threre.

    ...

    Mike Udin youtube channel is really great to start... well, he speaks russian but it can be very clear, although. I do not speak russian at all.

    ...

    João Marco

    Share this post


    Link to post
    Share on other sites

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.
    Note: Your post will require moderator approval before it will be visible.

    Guest
    Reply to this topic...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.


    • Recently Browsing   0 members

      No registered users viewing this page.

    YOUTUBE CHANNEL:

    ABOUT US:

    C4D Cafe is the largest CINEMA 4D community. We provide facilities for discussion, showcasing and learning our favorite software :)
    ×
    ×
    • Create New...