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

    Select edges of object returned by a object plugin

    Scheduled Pinned Locked Moved PYTHON Development
    5 Posts 0 Posters 953 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 10/04/2018 at 07:05, xxxxxxxx wrote:

      I hava an object plugin that returns a polygonal object.
      This of course a virtual object and not a "real" object.

      Now I was wondering, is it because it is a virtual object, that you cannot select the polygons of the returned object?
      If not, is there a way to select polygons or edges of the returned object?

      Or is this a nonsense question, because you cannot select polygons due to the nature of the object plugin?

      -Pim

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

        On 11/04/2018 at 01:34, xxxxxxxx wrote:

        Hi Pim,

        I'm afraid is something not possible, all generators (I guess when you are telling Object Plugin we are currently speaking of a generator) get this limitation of not being able to select a component in the viewport (for example you can't select face/edge/point of a cube, which is nothing more than a generator).

        So the only solution for you is to make some selection tag, which can be used by the user.

        Hope it's answers to your questions.

        Cheers,
        Maxime

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

          On 11/04/2018 at 02:57, xxxxxxxx wrote:

          Thanks, clear.

          What do you mean with "some selection tag, which can be used by the user".
          How can the user define / select what to select usiin a selection tag?

          -Pim

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

            On 11/04/2018 at 04:57, xxxxxxxx wrote:

            For example, you can predefine some selection tags

            Here an from the Python Generator

            import c4d
              
            def main() :
                cube = c4d.BaseObject(c4d.Ocube)
                tag = c4d.BaseTag(c4d.Tpolygonselection)
                tag.SetName("Custom Selection")
                bs = tag.GetBaseSelect()
                bs.Select(0)
              
                cube.InsertTag(tag)
                return cube
            

            Now you can assign a material to this python generator and in the selection write "Custom Selection" it will then only affect the first face.

            Another solution for the user is to use the correction deformer to make such a selection, here

            .
            But you can't automate this from your ObjectData since it's not allowed to modify the scene in an ObjectData.

            Cheers,
            Maxime

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

              On 11/04/2018 at 08:05, xxxxxxxx wrote:

              Yes, of course, the correction deformer, thanks!

              -Pim

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