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. noseman
    3. Best
    N
    • Profile
    • Following 0
    • Followers 1
    • Topics 11
    • Posts 29
    • Best 2
    • Controversial 0
    • Groups 0

    Best posts made by noseman

    • RE: iterating on multiple Tmgselection tags

      Replying to my own question. We need to define it using

      mo.GeGetMoDataSelection(Tag)
      

      Code that works.

      import c4d
      from c4d.modules import mograph as mo
      
      def main():
          Cloner =  op.GetObject()
          md = mo.GeGetMoData(Cloner)
          AllTags = Cloner.GetTags()
          
          for Tag in AllTags:
      
              if Tag.GetType() == c4d.Tmgselection:
                  print Tag
                  SelTag = mo.GeGetMoDataSelection(Tag) #This is the new line
                  print SelTag.GetCount()
      
      posted in Cinema 4D SDK
      N
      noseman
    • How to make a Python Plugin...

      I always wanted to be able to convert Scripts to Plugins but didn't know how. Thanks to some great people, here is the bare minimum code required to make a Cinema 4D Python Plugin.
      Save this as a .pyp file, and put it in a folder in the Plugins. It should appear in the Extensions menu.
      Mind you, this ONLY functions like a Script, click-run-done. No UI, no Attributes, nothing...

      There's a ton of other stuff you can read here:
      https://developers.maxon.net/docs/py/2023_2/misc/pluginstructure.html

      import c4d
      from c4d import gui
      
      class HelloWorldCommand(c4d.plugins.CommandData):
          def Execute(self, doc):
      
              #Put your executable Code here...
              c4d.gui.MessageDialog("Hello World!")
      
              return True
      
      if __name__ == "__main__":
          c4d.plugins.RegisterCommandPlugin(
              id=1059500, #Get Unique ID from https://developers.maxon.net/forum/pid
              str="HelloWorld",
              info=0,
              dat=HelloWorldCommand(),
              help="put some Help test here...",
              icon=c4d.bitmaps.InitResourceBitmap(5126)
              )
      
      posted in Cinema 4D SDK python
      N
      noseman