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

    set sculpting layer data from high resolution mesh.

    Cinema 4D SDK
    2
    3
    507
    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.
    • J
      jeongseok
      last edited by m_adam

      Hello.

      I want to sculpting from high mesh.
      High mesh was got from zbrush.
      this is like 'Project Mesh'.
      My code is simple but was not working.

      import c4d
      from c4d.modules import sculpting
      
      def main():
          sculpt = sculpting.GetSelectedSculptObject(doc)
          sel = doc.GetActiveObject()
          if not sculpt:
              return
          if not sel:
              return
          if sel == sculpt.GetOriginalObject():
              return
          if sculpt.GetPointCount() != sel.GetPointCount():
              return
      
          firstLayer = sculpt.GetFirstLayer()
      
          layer = firstLayer.GetFirstSculptLayer()
      
          for i in range(firstLayer.GetPointCount()):
              layer.SetOffset(i, sel.GetPoint(i))
          sculpt.Update()
          c4d.EventAdd()
      
      if __name__ == "__main__":
          main()
      

      Traceback (most recent call last):
      File "scriptmanager", line 26, in <module>
      File "scriptmanager", line 21, in main
      TypeError: an integer is required

      SculptLayer.SetOffset(self, index, offset)
      offset is vector. but 'TypeError: an integer is required'

      how can i fix it?
      Thank you.

      sculpting _error.c4d

      screenshot_154.png

      1 Reply Last reply Reply Quote 0
      • ManuelM
        Manuel
        last edited by

        hi,

        There's actually a bug in the API, not only this method is affected. It probably affect all method of the sculpt module using a vector as a parameter.
        This will be fixed as soon as possible.

        Cheers,
        Manuel

        MAXON SDK Specialist

        MAXON Registered Developer

        J 1 Reply Last reply Reply Quote 2
        • J
          jeongseok @Manuel
          last edited by

          @m_magalhaes Thank you for reply. I am going to use it for this project. Hope it gets fixed soon. Thank you.

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