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

    CommandData "Switch"

    Scheduled Pinned Locked Moved SDK Help
    2 Posts 0 Posters 225 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 16/10/2010 at 20:48, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   11 
      Platform:      Mac OSX  ; 
      Language(s) :     C++  ;

      ---------
      Hey all,

      I'm trying to create a command similar to the "Use Generators" command in c4d.  I know how to have the command affect the setting in my SceneHook that I want it to, I just don't know how to make the command act like the Use Generators command (like a bool, stays highlighted when active, and regular when not).

      The GetState function in the commanddata class doesn't really give any clues how this could be done (that I saw anyway).

      thanks,
      kvb

      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 16/10/2010 at 20:59, xxxxxxxx wrote:

        7 minutes later...

        Got it lol.

        LONG SwitchCommand::GetState(BaseDocument *doc)
        {
        PluginSceneHook *sh = doc->FindSceneHook(ID_MYSCENEHOOK);
        if (!sh) return FALSE;
        BaseContainer *bc = sh->GetDataInstance();
        if (!bc) return FALSE;
        if(bc->GetBool(ID_SWITCH)==TRUE) 
        {
        return CMD_VALUE | CMD_ENABLED;
        }else return CMD_ENABLED;
        }
        
        1 Reply Last reply Reply Quote 0
        • First post
          Last post