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

    Multi-Buttons with Python

    PYTHON Development
    0
    22
    14.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.
    • H
      Helper
      last edited by

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

      On 04/06/2011 at 07:59, xxxxxxxx wrote:

      I was hoping that this might possibly be a way to change some of the C4D interface options when C4D starts up.

      I just started looking into this:

      from  os  import remove  
      import os  
      import time  
      import c4d  
      from c4d import gui, utils  
        
      start = time.time()  
      if start > 1300000000:  
       gui.MessageDialog("Welcome")  
         
      path = r"C:\Users\user\AppData\Roaming\MAXON\CINEMA 4D R12 Demo_0E6F67AE\prefs\coffeesymbolcache"  
        
      remove(path)
      

      The timer function isn't working properly in this example.
      But hopefully you should get the idea what I'm trying to do with it.

      -ScottA

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

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

        On 04/06/2011 at 08:35, xxxxxxxx wrote:

        From the docs:

        Can I execute code on startup of CINEMA 4D?
        In some cases it might be necessary that you need to execute Python code on startup of CINEMA 4D before any other Python stuff is loaded. In this case, go to the user folder of CINEMA 4D and create a file in the python prefs   {USER_FOLDER}/prefs/python/.
        _
        _
        > > python_init.py Autostart Python Code.

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

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

          On 04/06/2011 at 08:59, xxxxxxxx wrote:

          Thanks for the heads up.
          I'll give it a try.

          -ScottA

          Edit:
          The problem I'm running into is that this python file runs before C4D has finished loading. So it doesn't accept the code in it.

          For example:
          If I wanted the UI to load with the scale tool active. And I put c4d.CallCommand(200000089) in the file. It doesn't work because the python file is trying to execute that command before C4D has finished loading.

          I was wondering if this kind of thing was possible to do?

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

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

            On 04/06/2011 at 09:39, xxxxxxxx wrote:

            No, this is not possible. Btw, opening GUI is blocked on startup.

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

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

              On 04/06/2011 at 09:49, xxxxxxxx wrote:

              Sorry to hear that.
              But thanks for the help.

              -ScottA

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

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

                On 04/06/2011 at 10:27, xxxxxxxx wrote:

                Haha, I already found a workaround some time ago.
                I wanted to insert an object into the document on c4d start up. But it didn't work. I found out that the active document on startup isnt the same as when c4d has finished loading.

                So what to do ? Start a Thread on C4D startup that compares the current document with the document you got when the thread actually started within a while-loop.

                If the document is not the same, C4D did finish loading.

                Cheers,

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

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

                  On 04/06/2011 at 10:37, xxxxxxxx wrote:

                  Do you have an example of this?

                  -ScottA

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

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

                    On 04/06/2011 at 10:50, xxxxxxxx wrote:

                    Of course, you should now me now ;-D

                    Example Code

                    Cheers,

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

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

                      On 04/06/2011 at 10:52, xxxxxxxx wrote:

                      Why don't you use the template.c4d? This file is loaded on startup

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

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

                        On 04/06/2011 at 11:14, xxxxxxxx wrote:

                        That's pretty cool niklas. 👍

                        -ScottA

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