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
    1. Maxon Developers Forum
    2. specnazspe
    S
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 1
    • Best 0
    • Controversial 0
    • Groups 0

    specnazspe

    @specnazspe

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

    specnazspe Unfollow Follow

    Latest posts made by specnazspe

    • Script path instead of call command in Python

      Hi there, I have a question about a few lines of Python code in Cinema 4D. I have a functional script that executes my saved script via a button. However, sometimes the saved script changes the Command ID, causing the button to fail.

      Is there a way to specify the Command ID in my script or can someone rewrite it to execute based on the file path instead?

      Thank you for any possible solutions.

      from typing import Optional
      import c4d
      
      #Python Tags Object placed User Data Button
      def message(msg_type, data):
          if msg_type == c4d.MSG_NOTIFY_EVENT:
              event_data = data['event_data']
              if event_data['msg_id'] == c4d.MSG_DESCRIPTION_COMMAND:
                  desc_id = event_data['msg_data']['id']
                  if desc_id[1].id == 16:
                      c4d.CallCommand(600000014)
      
      def Button():
          c4d.CallCommand(600000014)
      
      
      def main():
      
          obj = op.GetObject()
          bc = c4d.BaseContainer()
          obj.AddEventNotification(op, c4d.NOTIFY_EVENT_MESSAGE, 0, bc)
      
      posted in Cinema 4D SDK 2023 python
      S
      specnazspe