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
    • Recent
    • Tags
    • Users
    • Login

    Menu State for Python Scripts? [LIMITATION]

    Scheduled Pinned Locked Moved PYTHON Development
    6 Posts 0 Posters 482 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

      On 04/06/2015 at 03:46, xxxxxxxx wrote:

      Hello, with COFFEE-Scripts you can set a menustate to grey out the Script-Icon when no Object is selected. Is there a Way to do so with Python?
      Thanks for any help.
      Holger

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

        On 04/06/2015 at 07:13, xxxxxxxx wrote:

        Hi Holger,

        It seems the ENABLE Menu State doesn't dynamically enable/disable a COFFEE script icon/menu depending on the active selection state. How are you doing this in COFFEE?

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

          On 04/06/2015 at 11:11, xxxxxxxx wrote:

          As far as I understand, it's only possible to set an enable/disable state with a CommandPlugin, not with a Python Script.

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

            On 04/06/2015 at 11:16, xxxxxxxx wrote:

            To do this in COFFEE, you would include the following in the Menu State field of the COFFEE Script Editor:

              
            if(op){   
            ENABLE=TRUE;        
            }   
            else{   
                 ENABLE=FALSE;        
            }   
            
            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              On 05/06/2015 at 00:34, xxxxxxxx wrote:

              Hi Donovan,

              Thanks for the code and explanation.
              And as you've already stated it is not possible to do such thing for a Python script, only for a Python CommanData plugin with CommandData.GetState(). There's no support of Menu State ENABLE/CHECKED for Python scripts.

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

                On 05/06/2015 at 00:37, xxxxxxxx wrote:

                Hello Guys. Thanks for your answers.
                In coffee-scripts I enter this code into the menustate-Field:

                if (!op) { ENABLE=FALSE; return FALSE; }
                ENABLE=TRUE;

                That is working. In python we dont have a menu-state Field. I thought maybe there is another way to grey out Icons. I saw that with Python-Plugins so I thought there is a way for pythonscripts as well.

                To bad this is not implemented. Maybe I post an Idea. Cu arround. Holger

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