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

    Vertex map is not correctly filled

    Scheduled Pinned Locked Moved PYTHON Development
    2 Posts 0 Posters 499 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 18/12/2017 at 11:40, xxxxxxxx wrote:

      I have an objectdata plugin.
      In GetVirtualObjects() I create a vertex map.
      This vertex map is the then used in a Smoothing deformer.

      The hierarchy is then:
      - Null
        Smoothing deformer
        objA - vertex deformer.

      This works! Smoothing is visible.
      I can see that if I insert a clone of this intermediate result.

      After that I do a CSTO, but then it seems as if the vertex map is not correctly filled.
      No smoothing is visible.

          def GetVirtualObjects(self, op, hierarchyhelp) :
        
              doc = op.GetDocument()
        
              if op.GetDown() is None or op.GetDown().GetNext() is None:
                  return c4d.BaseObject(c4d.Onull)
        
              res = op.GetAndCheckHierarchyClone(hierarchyhelp, op.GetDown(), c4d.HIERARCHYCLONEFLAGS_ASPOLY , True)
              if res['dirty'] == False:
                  return res['clone']
                  
              objA = res['clone'].GetDown()
              objB = objA.GetNext()
              
              vertexMap = self.Selection2VertexMap(objA)  #create and add vertex map. This works.
        
              null2 = c4d.BaseObject(c4d.Onull)  
              objA.InsertUnder(null2)
              
              smoothingObject = c4d.BaseObject(1024529)     #smoothing
              smoothingObject[c4d.ID_CA_SMOOTHING_DEFORMER_OBJECT_STRENGTH] = .20  
              smoothingObject[c4d.ID_CA_SMOOTHING_DEFORMER_OBJECT_ITERATIONS] = 20
              smoothingObject[c4d.ID_CA_SMOOTHING_DEFORMER_OBJECT_STIFFNESS] = 1.0
              smoothingObject[c4d.ID_CA_SMOOTHING_DEFORMER_OBJECT_STIFF_MAP] = vertexMap    
              smoothingObject.InsertUnder(null2)
       
              cstoObject = self.CSTO(doc, null2) 
              doc.InsertObject(null2.GetClone())          #debug: Show intermediate result
              return cstoObject
      
      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        On 18/12/2017 at 13:08, xxxxxxxx wrote:

        I guess I solved it.
        I am now using a temp document for the csto.

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