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. Ofcourse88
    O
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 1
    • Best 0
    • Controversial 0
    • Groups 0

    Ofcourse88

    @Ofcourse88

    0
    Reputation
    11
    Profile views
    1
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    Ofcourse88 Unfollow Follow

    Latest posts made by Ofcourse88

    • How to adress the mograph cloner offset in the attached python code please :)
      import c4d
      
      def main():
          global traveled
          global lastPos
      
          obj = op.GetObject()
          objMat = obj.GetMg()
          frame = doc.GetTime().GetFrame(doc.GetFps())
          forwardVec = objMat.MulV(c4d.Vector(1.0, 0.0, 0.0))
          sign = 1.0
      
          try: lastPos
          except NameError:
              lastPos = obj.GetMg().off
          try: traveled
          except NameError:
              traveled = 0
      
          if frame == 0:
              traveled = 0
              lastPos = objMat.off
          else:
              currentPos = objMat.off
              # calculate actual movement
              distVec = currentPos - lastPos
              dotProd = distVec.Dot(forwardVec)
              if dotProd > 0: sign = -1.0
              projVec = forwardVec * dotProd
              dist = projVec.GetLength()
              lastPos = currentPos
              traveled = traveled + sign * dist
          # find the material
          mat = obj.GetTag(c4d.Ttexture)
          mat[c4d.TEXTURETAG_OFFSETX] = traveled / 500.0
          # the factor depends on the texture and the obje
      

      Hello, how to adress the Mograph cloner offset (cloner is set to object (spline) and i want just to edit the part in the code

      mat[c4d.TEXTURETAG_OFFSETX] = traveled / 500.0
      

      and make it work, but i am affraid i will need to edit more, for example to find the object. I am noob about python or any language, so could you help me someone please 🙂

      posted in Cinema 4D SDK
      O
      Ofcourse88