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

    Getting the content of a LINK from a GeDialog

    Scheduled Pinned Locked Moved PYTHON Development
    5 Posts 0 Posters 495 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 02/08/2016 at 12:02, xxxxxxxx wrote:

      Supposedly I can only get some types of values from GeDialog items. Namely:

      GeDialog.GetBool()
      GeDialog.GetLong()
      GeDialog.GetInt32()
      GeDialog.GetReal()
      GeDialog.GetFloat()
      GeDialog.GetVector()
      GeDialog.GetString()
      GeDialog.GetColorField()
      GeDialog.GetTime()
      GeDialog.GetFilename()
      GeDialog.CheckTristateChange()

      But I have a LINK field.
      How can I get a value from it?

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

        On 02/08/2016 at 12:03, xxxxxxxx wrote:

        You get the LinkBoxCustomGui with GeDialog.FindCustomGui() then use LinkBoxCustomGui.GetLink().

        Cheers,
        Nik

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

          On 02/08/2016 at 14:15, xxxxxxxx wrote:

          Hello Niklas.
          Thank you for the answer.
          I have tried it but I get True, instead of a LinkBoxCustomGui.
          I read in the SDK that...

          Note: Returns True if the custom GUI was found in the dialog but its type is unknown by Python and cannot be returned.

          My dialog is defined by a res file, not by a AddCustomGui() and the SDK also says that:

          "Get the custom GUI for a certain ID. The GUI object must have been previously added with AddCustomGui()"

          This means that it is not possible to get the value of a LINK gizmo that is defined by a res file?

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

            On 02/08/2016 at 14:30, xxxxxxxx wrote:

                    mylink = self.FindCustomGui(MY_LINKBOX, c4d.CUSTOMGUI_LINKBOX)  
                  if mylink.GetLink().GetType() != None:   
                      print mylink.GetLink().GetName() #<--The name of the object in the linkbox gizmo
            

            -ScottA

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

              On 02/08/2016 at 15:06, xxxxxxxx wrote:

              Aha!!! My mistake was that I was doing:

              mylink = self.FindCustomGui(MY_LINKBOX, MY_PLUGIN_ID)

              But it was...

              mylink = self.FindCustomGui(MY_LINKBOX, c4d.CUSTOMGUI_LINKBOX)

              THANK YOU!!! 😄

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