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

    Lasso Selection Tool MDATA_SELECTION_VISIBLE Setting Doesn't Work

    Bugs
    python s26 windows
    2
    2
    681
    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.
    • G
      Gaal Dornik
      last edited by i_mazlov

      Hello, i'm trying to make a popup menu with selection modes and for some reason lasso selection Visible option which is set by MDATA_SELECTION_VISIBLE isn't working. Live and Rectangle Selection are working fine...

      Cinema 4D R26.

      from typing import Optional
      import c4d
      from c4d import gui
      
      def tool():
          return doc.GetActiveToolData()
        
      def main() -> None:
          # Set IDs
          ID_LIVE_SELECTION              = c4d.FIRST_POPUP_ID
          ID_LIVE_SELECTION_THROUGH      = c4d.FIRST_POPUP_ID + 1
          ID_LASSO_SELECTION             = c4d.FIRST_POPUP_ID + 2
          ID_LASSO_SELECTION_THROUGH     = c4d.FIRST_POPUP_ID + 3
          ID_RECTANGLE_SELECTION         = c4d.FIRST_POPUP_ID + 4
          ID_RECTANGLE_SELECTION_THROUGH = c4d.FIRST_POPUP_ID + 5
      
          # Create container for Popup
          popup = c4d.BaseContainer()
          popup.SetString(ID_LIVE_SELECTION,              "Live Selection")
          popup.SetString(ID_LIVE_SELECTION_THROUGH,      "Live Selection Through")
          popup.SetString(ID_LASSO_SELECTION,             "Lasso Selection")
          popup.SetString(ID_LASSO_SELECTION_THROUGH,     "Lasso Selection Through")
          popup.SetString(ID_RECTANGLE_SELECTION,         "Rectangle Selection")
          popup.SetString(ID_RECTANGLE_SELECTION_THROUGH, "Rectangle Selection Through")
      
          # Display Popup
          result = gui.ShowPopupDialog(cd=None, bc=popup, x=c4d.MOUSEPOS, y=c4d.MOUSEPOS)
          print("result: %s" % result)
      
          # Process
          if result == ID_LIVE_SELECTION:
              c4d.CallCommand(200000083) # Live Selection
              tool()[c4d.MDATA_SELECTLIVE_VISIBLE] = True
              tool()[c4d.MDATA_SELECTLIVE_RADIUS] = 3
          elif result == ID_LIVE_SELECTION_THROUGH:
              c4d.CallCommand(200000083) # Live Selection
              tool()[c4d.MDATA_SELECTLIVE_VISIBLE] = False
              tool()[c4d.MDATA_SELECTLIVE_RADIUS] = 3
          elif result == ID_LASSO_SELECTION:
              c4d.CallCommand(200000085) # Lasso Selection
              tool()[c4d.MDATA_SELECTION_VISIBLE] = True
          elif result == ID_LASSO_SELECTION_THROUGH:
              c4d.CallCommand(200000085) # Lasso Selection
              tool()[c4d.MDATA_SELECTION_VISIBLE] = False
          elif result == ID_RECTANGLE_SELECTION:
              c4d.CallCommand(200000084) # Rectangle Selection
              tool()[c4d.MDATA_SELECTION_VISIBLE] = True
          elif result == ID_RECTANGLE_SELECTION_THROUGH:
              c4d.CallCommand(200000084) # Rectangle Selection
              tool()[c4d.MDATA_SELECTION_VISIBLE] = False
      
          c4d.EventAdd()
      
      """
      def state():
          # Defines the state of the command in a menu. Similar to CommandData.GetState.
          return c4d.CMD_ENABLED
      """
      
      if __name__ == '__main__':
          main()
      
      1 Reply Last reply Reply Quote 0
      • i_mazlovI
        i_mazlov
        last edited by

        Hi @Gaal-Dornik ,

        Thanks for reaching out to us. Please excuse the delay.

        This issue is now tracked via internal bug tracking system. Thread is tagged to_fix, so that the thread can be tracked more closely.

        Cheers,
        Ilia

        MAXON SDK Specialist
        developers.maxon.net

        1 Reply Last reply Reply Quote 0
        • maxonM maxon moved this topic from Cinema 4D SDK on
        • First post
          Last post