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. peXel
    3. Posts
    P
    • Profile
    • Following 0
    • Followers 0
    • Topics 3
    • Posts 13
    • Best 0
    • Controversial 0
    • Groups 0

    Posts made by peXel

    • RE: Stop automatic rename of objects script.py

      Oh my god, thank you!!! Now material exchange does work properly again.
      Without this, it's just a mess to get rid of all .1, .2, .3, before I could execute the mat exchange.
      What a great helper, should be integrated really...

      Thank you very much and have a nice day

      posted in Cinema 4D SDK
      P
      peXel
    • RE: Stop automatic rename of objects script.py

      Might it be possible to get the script ass well working within our material manager? The new automatic rename of our materials drives me crazy sadly. If that might bepossible it would be so great and a good addition to R25...

      Best Regards,
      Peter

      posted in Cinema 4D SDK
      P
      peXel
    • RE: ZeroAxis R23 help

      That are great news, but sadly I am not a Phyton User

      posted in Cinema 4D SDK
      P
      peXel
    • RE: ZeroAxis R23 help

      Hi Zipit,

      yes that's it, now it's working like expected. Should be integrated in our main C4D core, like reset PSR
      Thanks for solving it!
      Yes it was just removing the x, because I don't have any clue about Python 2.7 or 3.7 or even changes sadly.
      It's really a pitty that there's no convert 2.7 to 3.7 script button for nonprogrammers 🙂

      Best,
      Peter

      posted in Cinema 4D SDK
      P
      peXel
    • RE: ZeroAxis R23 help

      Hi There,

      the script is not working properly sadly. It does set the axis back to 0,0,0, but it stays it's orientation.
      It needs to copy the axis orientation same as the object one up in hierarchy, see original code.
      What did change inside the SDK and how do I get this behavior back again?

      Thank you very much for your help, it's a great helper for everybody if it does work again

      Best,
      Peter

      posted in Cinema 4D SDK
      P
      peXel
    • RE: ZeroAxis R23 help

      Hi x_nerve,

      thank you very much it does work now like expected!

      Best,
      Peter

      posted in Cinema 4D SDK
      P
      peXel
    • ZeroAxis R23 help

      Hi There,

      I had for R21 this script. It was working like reset PSR, but for the object axis only.
      Could anyone help me please to get this great little helper back for the R23?

      Thank you very much,

      Best,
      Peter

      import c4d
      
      from c4d import Vector as V
      
      def main():
      
          if op is None or not op.CheckType(c4d.Opoint):
              return False
      
          ObjMatrix = op.GetMg()
      
          ObjPoints = op.GetAllPoints()
      
          Pcount = op.GetPointCount()
      
          doc.StartUndo()
          doc.AddUndo(c4d.UNDOTYPE_CHANGE, op)
          op.SetAbsRot(V(0))
          op.SetAbsPos(V(0))
          op.Message(c4d.MSG_UPDATE)
          NewMatrix = op.GetMg()
      
          for point in xrange(Pcount):
              op.SetPoint(point,~NewMatrix*ObjMatrix*ObjPoints[point])
      
          op.Message(c4d.MSG_UPDATE)
          c4d.EventAdd()
          doc.EndUndo()
      
      if __name__=='__main__':
      
          main()
      
      posted in Cinema 4D SDK python r23
      P
      peXel
    • RE: Stop automatic rename of objects script.py

      PERFECT! Thank you very much. It's really a great helper. Back to good old times 🙂

      Best,
      Peter

      posted in Cinema 4D SDK
      P
      peXel
    • RE: Stop automatic rename of objects script.py

      Hi There,

      Sorry I was off for a while (...)
      Thanks @PluginStudent for this, but it does not solve the problem sadly.
      It does just rename one object. What I am looking for is to rename all objects at all, no matter if .1 .2 .3 or what else .xxx
      Just to get things more clean again. I am not a programmer, so I can't do any real scripting sadly

      Thank you very much

      Best,
      Peter

      posted in Cinema 4D SDK
      P
      peXel
    • Stop automatic rename of objects script.py

      Hi There,

      yes there might be some or more users what do like the automatic rename, but on the other hand there are still users that like it to have the structure clean instead.
      Do you know if there is already a script done by someone what deletes every text starting from .1, .2, .3 and so on to clean it up a bit or does anybody know how to script this?

      Thank you very much for your help!

      Best Regards,
      Peter and Michael

      posted in Cinema 4D SDK
      P
      peXel
    • RE: Toggle knife cut planes

      @m_magalhaes PERFECT! thank you very much!

      import c4d
      from c4d import gui
      
      def main():
          def tool():
              return c4d.plugins.FindPlugin(doc.GetAction(), c4d.PLUGINTYPE_TOOL)
      
          def object():
              return doc.GetActiveObject()
      
          def tag():
              return doc.GetActiveTag()
      
          def renderdata():
              return doc.GetActiveRenderData()
      
          def prefs(id):
              return c4d.plugins.FindPlugin(id, c4d.PLUGINTYPE_PREFS)
      
          c4d.CallCommand(431000164, 431000164) # Plane Cut
       tool()[c4d.MDATA_KNIFEPLANE_PLANE] = (tool()[c4d.MDATA_KNIFEPLANE_PLANE] + 1) % 3
      
      if __name__=='__main__':
          main()
          c4d.EventAdd()
      
      posted in Cinema 4D SDK
      P
      peXel
    • Toggle knife cut planes

      Hello There,

      in earlier days (R19 and before) I had a script to toggle the planes from our plane knife cut tool. Sadly it's not working anymore (R21).
      What I was able to create was a simple plane cut script for each plane, but I need now three shortcuts to switch them instead of one.
      Does anybody have an idea, how this script will look like, with one shortcut?

      Thank you very much!

      Best,
      Peter

      import c4d
      from c4d import gui
      
      def main():
          def tool():
              return c4d.plugins.FindPlugin(doc.GetAction(), c4d.PLUGINTYPE_TOOL)
      
          def object():
              return doc.GetActiveObject()
      
          def tag():
              return doc.GetActiveTag()
      
          def renderdata():
              return doc.GetActiveRenderData()
      
          def prefs(id):
              return c4d.plugins.FindPlugin(id, c4d.PLUGINTYPE_PREFS)
      
          c4d.CallCommand(431000164, 431000164) # Plane Cut
          tool()[c4d.MDATA_KNIFEPLANE_PLANE_MODE] = 2
          tool()[c4d.MDATA_KNIFEPLANE_PLANE] = 0
      
      if __name__=='__main__':
          main()
          c4d.EventAdd()
      
      posted in Cinema 4D SDK r21 python
      P
      peXel