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. jochemdk
    3. Best
    • Profile
    • Following 0
    • Followers 0
    • Topics 12
    • Posts 44
    • Best 4
    • Controversial 0
    • Groups 0

    Best posts made by jochemdk

    • RE: MographToNulls available for free as a Python scripting tag

      @mikeudin Thx Mike,
      Even though I don't speak a word of Russian, I do like your movies 🙂

      posted in General Talk
      jochemdkJ
      jochemdk
    • RE: Wrong random clone displayed issue

      @m_adam
      Hi, I did some more testing…

      Things only go wrong with a linearCloner’s offset if:
      _ any applied baseEffector has the visibility check turned on
      _ has a mograph selection/weight tag
      _ and if a linearCloner’s offset >= the smallest index of the selection
      _ (so random has nothing to do with it 🙂

      posted in Cinema 4D SDK
      jochemdkJ
      jochemdk
    • RE: WeightManager/Autoweight > set the amount of Joints in Python?

      Hi @m_adam, thx for your input, it does reset the WeightManager, but doesn’t do the autoWeighting accordingly..

      _First thing I noticed: a difference between int 64 & 32. Not sure if this might be a problem..
      Reading the GET> AutoWeight…base.jointcount : <int64> “number of joints”
      Reading the SET> AutoWeight…base.jointcount : <int32> “number of joints”

      _After the WeightManager is being set (to 1 joint in my case), I can’t click on the “Calculate button” manually.
      Nothing happens, unless I change the joint count manually to another number. So something in the update hasn’t been applied..
      Note that reading the dict says <int32>, until manually changed, than is says <int64> again..

      _I also tried wmgr.SetDirty(doc) / wmgr.Update(doc) / followed by another c4d.EventAdd().. Perhaps these need a different approach as well?
      I tried to find something in the “maxon/frameworks” folders you linked to, but couldn’t find any info on how to tackle this issue.

      So the current status is still that “default weighting” is applied.
      If you can please help in the right direction, it would be greatly appreciated, tia, Jochem

      import c4d, maxon
      from maxon.frameworks import animation
      
      
      def main():
          doc = c4d.documents.GetActiveDocument()
          wmgr = c4d.modules.character.CAWeightMgr
          #wmgr.SetDirty(doc)
          
          heatmap_id = wmgr.GetAutoWeightAlgoId(doc, 1) # heatmap
          settings = wmgr.GetAutoWeightDictionary(doc, heatmap_id)
          settings.Set(maxon.frameworks.animation.AUTOWEIGHTPARAMETERS.JOINTCOUNT, 1)
          settings.Set(maxon.frameworks.animation.AUTOWEIGHTPARAMETERS.SELECTEDPOINTS, False)
          settings.Set(maxon.frameworks.animation.AUTOWEIGHTPARAMETERS.ALLOWZEROLENGTH, False)
          wmgr.SetAutoWeightDictionary(doc, settings, heatmap_id)
          #doc.ExecutePasses(None,True,True,True,flags=c4d.BUILDFLAGS_NONE)
          c4d.EventAdd()
          
          # getWeightTag - setActive
          firstJoint = doc.GetFirstObject().GetDown().GetDown() # just in my testDoc..
          weightTag = (firstJoint.GetWeightTag())["op"]
          doc.SetActiveTag(weightTag, c4d.SELECTION_NEW)
          #weightTag.GetObject().SetBit(c4d.BIT_ACTIVE)
              
          # update weightManager / doesn't make any difference..
          #wmgr.SetDirty(doc)
          #wmgr.Update(doc)
          #c4d.EventAdd()
          
          # autoWeight func
          wmgr.SelectAllJoints(doc)
          bla = wmgr.AutoWeight(doc)
          print(bla) # prints True, but not in the right way :{
          c4d.EventAdd()
      
      if __name__=='__main__':
          main()
      
      posted in General Talk
      jochemdkJ
      jochemdk