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

    R20 Startup script location - python_init.py

    Cinema 4D SDK
    python r20
    6
    9
    3.5k
    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.
    • PixelsInProgressP
      PixelsInProgress
      last edited by PixelsInProgress

      Hi everyone

      Anyone know if it's possible to add a startup script in R20 like in previous versions?

      The old method was adding a python_init.py file to the directory:

      Cinema 4D RXX_XXXXXXX>prefs>python

      The python directory no longer exists so not sure where to put it.

      Thanks!

      Adam

      1 Reply Last reply Reply Quote 1
      • R
        randmcnally
        last edited by

        I would also like the answer to this question. can anyone enlighten us?

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

          edit:
          Go here: {HOME}\AppData\Roaming\Maxon\Cinema4D_RXX_YYYYYYYY\python27\maxon_generated and use the __init__.py to execute scripts.

          1 Reply Last reply Reply Quote 0
          • PixelsInProgressP
            PixelsInProgress
            last edited by

            That'll do it. Thanks!

            It's worth noting that this seems to get loaded after all of the other plugins whereas in the method for previous versions it was before. - Just in case that might be a factor for anybody.

            Cheers,

            Adam

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

              Hey Adam,

              for now, I don't know better. Docs don't state anything about it yet. Guess, we'll have to wait until devs are back. Maybe someone can shed some light onto this.

              1 Reply Last reply Reply Quote 0
              • Y
                y_puech
                last edited by y_puech

                Hi,

                Sorry for being late in the discussion here.

                In R20 python_init.py is no longer executed at startup of Cinema. Sorry this change was not documented.

                The __init__.py script in the preferences path python27/maxon_generated was not meant for this but it can be used as replacement.
                However, as Adam pointed out the difference in his last post here, the __init__.py script in R20 is executed after the plugins are registered. Pre-R20 python_init.py was executed before the plugins registration.
                This means a plugin cannot rely on operations done in python27/maxon_generated/__init__.py.

                Note the other Python files in the directory python27/maxon_generated (_configuration.py and _enums.py) must not be modified.

                Former MAXON SDK Engineer

                T 1 Reply Last reply Reply Quote 4
                • T
                  Tom @y_puech
                  last edited by Tom

                  @y_puech said in R20 Startup script location - python_init.py:

                  In R20 python_init.py is no longer executed at startup of Cinema.

                  Why not?

                  Is there a chance that you possibly bring this feature back again please?
                  That really was quite handy for some cases.

                  Kind regards,
                  Tom

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

                    Hi @Tom
                    This will be fixed within a future release.

                    Cheers,
                    Maxime.

                    MAXON SDK Specialist

                    Development Blog, MAXON Registered Developer

                    T 1 Reply Last reply Reply Quote 1
                    • T
                      Tom @m_adam
                      last edited by

                      @m_adam said in R20 Startup script location - python_init.py:

                      This will be fixed within a future release.

                      Well, that's a relief then. Good to know.

                      Thank you Maxime for the clarification.

                      Kind regards,
                      Tom

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