Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python 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

    Example for PluginMessage is failing

    Scheduled Pinned Locked Moved PYTHON Development
    6 Posts 0 Posters 522 Views
    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.
    • H Offline
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 12/12/2012 at 17:25, xxxxxxxx wrote:

      I'm trying to run R13 with -nogui and have a plugin dynamically generate some C4D files at startup (and then shutdown).

      The docs say to implement PluginMessage; check if the ID is equal to C4DPL_COMMANDLINEARGS and then use sys.argv.

      However, when I tried to do that only an error is raised:

      AttributeError
          'module' object has no attribute 'argv'

      So... how do I access the command line arguments given to the executable? (This is on Windows, BTW.)

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 13/12/2012 at 01:43, xxxxxxxx wrote:

        Are you sure you call argv on sys module and not on another?
        Also, you may have an issue with Python on your computer because this should work.

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 13/12/2012 at 10:12, xxxxxxxx wrote:

          Originally posted by xxxxxxxx

          Are you sure you call argv on sys module and not on another?
          Also, you may have an issue with Python on your computer because this should work.

          Yes. Here's "all" the code from the plugin:

          import c43, sys
            
          def PluginMessage(id, data) :
          	if id == c4d.C4DPL_COMMANDLINEARGS:
          		print sys.argv
          		return True
            
          	return False
          

          That's more or less what the docs for R13 say to do to get the command line arguments. But no dice.

          The box is a fresh Windows Server 2012 RTM English 64Bit. I didn't install Python (I thought that C4D brought its own).

          So what am I doing wrong?

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

            On 13/12/2012 at 11:26, xxxxxxxx wrote:

            there is a typo in your import statement.

            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

              On 13/12/2012 at 15:42, xxxxxxxx wrote:

              Originally posted by xxxxxxxx

              there is a typo in your import statement.

              Sorry, I hand-typed that because the virtual machine didn't sync clipboards. It's actually c4d.

              However, upgrading to the latest version of R13 (061) appears to have fixed things up.

              1 Reply Last reply Reply Quote 0
              • H Offline
                Helper
                last edited by

                THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                On 15/12/2012 at 18:41, xxxxxxxx wrote:

                Hi, I can confirm all versions after R13.061 have this fix included.

                Cheers, Seb

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post