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
    1. Maxon Developers Forum
    2. jeongseok
    3. Posts
    J
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 2
    • Best 0
    • Controversial 0
    • Groups 0

    Posts made by jeongseok

    • RE: set sculpting layer data from high resolution mesh.

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

      posted in Cinema 4D SDK
      J
      jeongseok
    • set sculpting layer data from high resolution mesh.

      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

      posted in Cinema 4D SDK
      J
      jeongseok