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

    SculptTag

    Scheduled Pinned Locked Moved Cinema 4D SDK
    r20pythonwindows
    6 Posts 4 Posters 768 Views 3 Watching
    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.
    • M Offline
      mp5gosu
      last edited by r_gigante

      Hello,

      I tried getting a sculpting tag via

      tag = op.GetTag(c4d.Tsculpt)
      

      Unfortunately, this returns a BaseTag and I'm not able to cast it to a SculptTag in order to use GetSculptObject() from it.
      Is there something wrong here with the documentation/API or does my lacking python knowledge let me oversee something?

      Thanks,
      Robert

      1 Reply Last reply Reply Quote 0
      • kbarK Offline
        kbar
        last edited by

        If you just want to get access to the currently selected sculpt object you can use

        import c4d
        from c4d.modules import sculpting as sculpt

        doc = documents.GetActiveDocument()
        sculptObject = sculpt.GetSelectedSculptObject(doc);

        https://www.gamelogicdesign.com
        https://www.plugins4d.com

        1 Reply Last reply Reply Quote 0
        • M Offline
          mp5gosu
          last edited by

          @kbar Yes, thank you. This is my current "workaround".

          1 Reply Last reply Reply Quote 0
          • r_giganteR Offline
            r_gigante
            last edited by

            Hi @mp5gosu, as suggested by @kbar - thanks dude - you've to use the GetSelectedSculptObject() because of a limitation in the BaseObject::GetTag() Python implementation.

            Cheers, R

            1 Reply Last reply Reply Quote 1
            • M Offline
              mp5gosu
              last edited by

              @r_gigante Thanks. This is what I assumed.

              1 Reply Last reply Reply Quote 0
              • M Offline
                m_adam
                last edited by

                The bug is fixed in S22.

                Cheers,
                Maxime.

                MAXON SDK Specialist

                Development Blog, MAXON Registered Developer

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