Navigation

    • Register
    • Login
        No matches found
    • Search
    1. Home
    2. Fowdy
    F

    Fowdy

    @Fowdy

    0
    Reputation
    3
    Posts
    12
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    • Profile
    • More
      • Following
      • Followers
      • Topics
      • Posts
      • Best
      • Groups
    Fowdy Follow

    Best posts made by Fowdy

    This user hasn't posted anything yet.

    Latest posts made by Fowdy

    (Python) Help making Pip work in Cinema 4D

    Hi!,

    As I was trying to find out a solution on how to do this in this forum, I came across this reply on how to install pip in Cinema 4D:

    Now how to install pip?
    
    1. Downloads https://bootstrap.pypa.io/get-pip.py.
    2. Downloads the c4dpy version matching your Cinema 4D version. (Already included in R21)
    3. Moves c4dpy and get-pip.py in the Cinema 4D folder.
    4. Opens a shell to the Cinema 4D folder:
    Window: Type cmd in the top path and press Enter.
    Mac: Open a new shell, then with cd navigate to your Cinema 4D folder. (You can drag and drop the path).
    5. Runs this command line c4dpy get-pip.py. This will execute the get-pip script which will, download and install the pip module.
    6. Now you can start to play with pip c4dpy -m pip install numpy. c4dpy allow to runs any module with the -m argument see c4dpy commandline. in this case I asked to pip to download and install numpy but any other 3rd party compatible with pip can be downloaded and used.
    With that's said we do not provide support for 3rd party modules, so if it does not work with Cinema 4D Python environment, we can't help you.
    
    Cheers,
    Maxime.
    

    I got some questions:

    • for step 1, when I opened the link, it redirects me to a wall of code. Do I copy + paste it in Python's IDLE and make a .py out of it? how do I install it exactly
    • for step 2, I am confused which one I should download here 5b6b1bd2-47da-4e17-ab98-bbb5c238c6b1-image.png
    • for step 3, by "Cinema 4D folder" which one do you mean? like the exact path?
    • for step 4, I do something like this right?
      7df7be5d-2b7a-4fff-84fc-5d730765566c-image.png (I select "Open PowerShell window here" then run the code from step 5, right?)

    I want to use pip to make this line of code work inside Cinema 4D:

    from pynput.keyboard import Key, Controller
    import time
    
    keyboard = Controller()
    
    time.sleep(2)
    keyboard.press('4')
    keyboard.release('4')
    

    Will this code work when I successfully follow the "how to install pip" instruction?
    Thank you guys

    posted in Cinema 4D SDK •
    I need help with this Python code

    What I want to do with this code is when i turn on the User Data (Boolean) of the Python Tag, it hits the "Record Animated":
    import c4d

    def main():
        pass  #put in your code here
        
        onoff = op[c4d.ID_USERDATA, 1]
        print ("userdataXD: ", onoff)
        if onoff == 1:
            c4d.CallCommand(202665) # Record Animated
    

    For some reason the call command for Record Animated does not work (but in theory it should; I am new at this so this might sound newbie to most of you guys)
    Thank you

    posted in Cinema 4D SDK •
    Record Keyframe of Object's property when it changes (Python; is it possible?)

    Hi!

    I am kind of new to C4D python coding. I have good grasp of the coding basics (if-else, for/while loops, booleans, etc), but I want to know if there is a way to record keyframe of an object's property when it changes.


    This is the rough draft of what I want to do:

    Using a User Data (Boolean) that is added to a Python Tag of a Null Object (used just to hold the tag), the code will record the keyframe of an Object's property as it changes when timeline is played (let's just say the Object's property is controlled by a node in XPresso Tag, so there's no keyframe)

    The User Data (Boolean) of the Python Tag is controlled by an XPresso Tag so that it detects whether or not the Object's property is changed

    Basically, as the timeline is playing and the Object's property is changing, the code will create keyframes for those changes


    Not sure if this is clear enough or not. Hopefully you guys can help me! I really want to learn this software so much.
    (I want to use this code for character animation, so if it is possible, may the method of recording the keyframes be "Record Animated"-like (R23 feature, basically only records the properties that are touched or animated))

    Thank you so much!

    posted in Cinema 4D SDK •