Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Encrypt .pyp file to .pypv with script or command line?

    Cinema 4D SDK
    2024 python
    3
    4
    818
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • F
      f2b86
      last edited by f2b86

      Hello,
      Is it possible to encrypt .pyp files with script, like manual source protector in C4D would do it?
      I thought it was possible with c4dpy, but unfortunately it doesn't seem to work.

      Regards.

      1 Reply Last reply Reply Quote 0
      • M
        m_adam
        last edited by

        Hi g_encryptPypFile="file" should work as explained in c4dpy - CommandLine, note that this is a general command line so you can also use Cinema 4D.

        Cheers,
        Maxime

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        1 Reply Last reply Reply Quote 1
        • J
          JACK0319
          last edited by

          Hi,

          here is some code i used for create pypv

          def call_c4dpy(C4D_PATH, cmd):
              # 需要把c4dpy.exe所在路径添加到环境变量
              # C4D_PATH = r"~\Maxon Cinema 4D R26"
              if C4D_PATH not in os.environ["PATH"]:
                  os.environ["PATH"]+=f"{C4D_PATH};"
          
              # cmd 也可以是脚本路径 cmd = r"~\c4dtest script.py" 
              _cmd = f"c4dpy \"{cmd}\"" # 脚本路径必须是字符串
              subprocess.call(_cmd) # 调用并且可以实时看到结果 
          
          def creat_pypv(C4D_PATH, plugin_path):
              # pyp 生成 pypv
              # c4dpy.exe g_encryptPypFile="G:\C4D JACK Plugins\G4Designer\G4Designer.pyp"
              cmd = f"c4dpy g_encryptPypFile=\"{plugin_path}\""
              call_c4dpy(C4D_PATH, cmd)
          
          1 Reply Last reply Reply Quote 2
          • F
            f2b86
            last edited by

            Thank you, it works perfectly!

            1 Reply Last reply Reply Quote 0
            • ferdinandF ferdinand forked this topic on
            • First post
              Last post