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

    Python and linkbox

    Scheduled Pinned Locked Moved PYTHON Development
    8 Posts 0 Posters 742 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 23/08/2012 at 06:12, xxxxxxxx wrote:

      I'm creating a python plugin.
      The GUI is created in the code and not in a res file.

      E.g.  self.AddComboBox(MY_COMBOBUTTON, c4d.BFV_MASK)
            self.AddChild(MY_COMBOBUTTON, 0, "Add Selections")     
            self.AddChild(MY_COMBOBUTTON, 1, "Substract Selections" )

      How can I add a link box and then drag and drop objects into this linkbox?

      _<_img src="http://chicagoc4d.com/c4dpythonsdk/\_images/linkbox.png" height="30" width="193" border="0" /_>_

      If have seen the documentation in the Cinema 4d Python Help, but I do not quite understand it.
      An example would be nice.

      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 23/08/2012 at 06:33, xxxxxxxx wrote:

        To add a linkbox in a dialog you have to use the custom LinkBoxGui. Here's how to create one:

        self.linkBox = self.AddCustomGui(MY_LINKBOX, c4d.CUSTOMGUI_LINKBOX, "", c4d.BFH_SCALEFIT|c4d.BFV_SCALEFIT, 0, 0)
        

        You can then call self.linkBox.GetLink()/SetLink() to get/set the linked object.

        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 23/08/2012 at 07:17, xxxxxxxx wrote:

          Thanks very much for the quick and clear reply.
          So this is what I have done:

          def CreateLayout(self) :
            ... 
            self.linkBox = self.AddCustomGui(MY_LINKBOX, c4d.CUSTOMGUI_LINKBOX, "", c4d.BFH_SCALEFIT|c4d.BFV_SCALEFIT, 0, 0)

          and in
          def Command(self, id, msg) :
            ...     
            print self.linkBox.GetLink()

          What I find very odd, that the getlink does not need an ID. E.g. MY_LINKBOX.
          What if I like to use 2 linkboxes?
          How to distinguish them?

          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 23/08/2012 at 07:54, xxxxxxxx wrote:

            If you want to use 2 linkboxes I don't see where's the problem:

            self.linkBox1 = self.AddCustomGui(MY_LINKBOX1, c4d.CUSTOMGUI_LINKBOX, "", c4d.BFH_SCALEFIT|c4d.BFV_SCALEFIT, 0, 0)
            self.linkBox2 = self.AddCustomGui(MY_LINKBOX2, c4d.CUSTOMGUI_LINKBOX, "", c4d.BFH_SCALEFIT|c4d.BFV_SCALEFIT, 0, 0)
            

            GetLink() doesn't need a linkbox ID because you call it over an instance of a LinkBoxGui.

            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 24/08/2012 at 00:38, xxxxxxxx wrote:

              Of course, clear. Thanks

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

                On 01/01/2013 at 11:33, xxxxxxxx wrote:

                Originally posted by xxxxxxxx

                If you want to use 2 linkboxes I don't see where's the problem:

                self.linkBox1 = self.AddCustomGui(MY_LINKBOX1, c4d.CUSTOMGUI_LINKBOX, "", c4d.BFH_SCALEFIT|c4d.BFV_SCALEFIT, 0, 0)
                self.linkBox2 = self.AddCustomGui(MY_LINKBOX2, c4d.CUSTOMGUI_LINKBOX, "", c4d.BFH_SCALEFIT|c4d.BFV_SCALEFIT, 0, 0)
                

                GetLink() doesn't need a linkbox ID because you call it over an instance of a LinkBoxGui.

                Hi Yannick Puech, happy new year.

                In .res there is a special code to enter?

                my file .res:

                      LINK CASELLAPERSONALE
                      { 
                        CENTER_V; ALIGN_LEFT; SIZE 218, 0; 
                      }
                

                but not work....

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

                  On 01/01/2013 at 12:19, xxxxxxxx wrote:

                  Hi Caleidos4D,
                  I got your private message.

                  I personally always use Add.... for dialogs.
                  And only use the .res file for things like tags, tools, object's, etc...

                  GeDialog + .res = Hair Pulling  !Tongue[URL-REMOVED]

                  -ScottA


                  [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.

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

                    On 01/01/2013 at 13:24, xxxxxxxx wrote:

                    ah! OK!!! ScottA Thank you  🙂

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