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

    noseman

    @noseman

    2
    Reputation
    97
    Profile views
    29
    Posts
    1
    Followers
    0
    Following
    Joined Last Online

    noseman Unfollow Follow

    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

    Latest posts made by noseman

    • RE: "Cubic Bias" interpolation...

      Thanks Ferdinand!

      posted in Cinema 4D SDK
      N
      noseman
    • RE: "Cubic Bias" interpolation...

      @ferdinand

      ...This also applies to the interpolation modes you quoted, while they are technically close, they are not exactly what the gradient type is doing internally.

      haha, of course.
      Would it make sense to add this to the github examples at some point?

      Thank you @ferdinand

      posted in Cinema 4D SDK
      N
      noseman
    • "Cubic Bias" interpolation...

      I had a question on Twitter relating C4D Gradients.
      On the Github examples:
      https://github.com/PluginCafe/cinema4d_cpp_sdk_extended
      ... we have the old, R20 interpolations but is missing "Cubic Bias".

      case 0: return g1; break;
      case 1: return g1 + (g2 - g1) * per; break;
      case 2: return g1 + (g2 - g1) * Ln(per * 1.7182819 + 1.0); break;
      case 3: return g1 + (g2 - g1) * (1.0 - Ln((1.0 - per) * 1.7182819 + 1.0)); break;
      case 4: return g1 + (g2 - g1) * Smoothstep(0.0_f, 1.0_f, per); break;
      

      Does anyone know what it is?
      Thanks

      posted in Cinema 4D SDK
      N
      noseman
    • How to get a MoGraph Selection using a Python Effector...

      Thanks to the help of @m_adam I have the simplest code that allows you to get the MoGraph Selection data from a MoGraph Generator with a MoGraph Selection.
      In the attached project, I have a Matrix Object with a MoGraph Selection Tag and the Python effector that prints the selection data to the console.
      This implementation requires you drag the Selection Tag into the "Selection" link (Effector Tab->Selection).
      Because the method is based on the Tag Name, make sure the Selection Tag has a nice unique name to avoid any confusion.
      The code is fully Commented for your convenience (or inconvenience for that matter)...

      import c4d
      from c4d import gui
      
      from c4d.modules import mograph as mo
      
      
      def main():
          moData = mo.GeGetMoData(op) #Get MoGraph Data
      
          moSelTagName = op[c4d.ID_MG_BASEEFFECTOR_SELECTION] #Get the MoGraph Selection Tag Name from the Effector's "Selection" Link
      
          # Retrieve the first tag attached to the generator (the Matrix) matching the name
      
          moSelTag = None # initialize the "moSelTag" Variable
      
          for tag in gen.GetTags(): # Go through All tags on the MoGraph Generator...
              # "gen" is a Global Variable holding the MoGraph Generator (e.g. the cloner object which executes the Python Effector)
      
              if not tag.IsInstanceOf(c4d.Tmgselection): # if the tag is NOT a MoGraph Selection, try the next tag
                  continue
      
              # if the previous is FALSE, then the Tag is a MoGraph Selection
              if tag.GetName() == moSelTagName: # Does the Tag found above have the same name as the Linked Selection Tag?
                  moSelTag = tag # If the above is true, then set the Variable to that Tag and Break the Original Loop to continue down
                  break
      
          if moSelTag: # If after all of the above we have a valid tag in the Variable, then do the following:
              sel = mo.GeGetMoDataSelection(moSelTag) #Get the Mograph Selection from the Tag
              selData = sel.GetAll(moData.GetCount()) #Get the Data from the Mograph Selection
              print(selData) # Print the Data
      
      
      # Execute main()
      if __name__=='__main__':
          main()
      

      Get Mograph Selection data 01A.c4d

      posted in Cinema 4D SDK sdk
      N
      noseman
    • RE: How to make a Python Plugin...

      @mikeudin Have you managed to make the plugin converter work with the latest versions?
      One of the reasons I started this thread was that I couldn't... hopefully it was some error I made.
      If you have some information, please share.
      Cheers

      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
    • RE: There is a bug and some issues in the inner extrude tool res/.h files (S22 and R21)

      Maxon has decided to move all Labs plugins to Cineversity, and the Labs website is no longer available.
      As far as the Py Parametric plugins, they are on hold until I create a tutorial for them, which I'm planning for this week.
      Would it be a stretch if I asked for the "Disconnect" tool to be added if possible?
      In any case, whenever you make a change, let me know and I'll make sure they get updated.
      Thanks

      EDIT: you can email me directly. noseman[at]noseman[dot]org

      posted in Cinema 4D SDK
      N
      noseman
    • RE: There is a bug and some issues in the inner extrude tool res/.h files (S22 and R21)

      Extrude inner Subd 0 is the most common way it's used in modeling.
      As far as the Subdivide, the animation would be a good reason to allow for 0 (no SubD)
      5b65d164-5d27-41fc-b7a8-0607a1689c83-image.png
      ef241d24-0382-41e1-b894-4ef651c03cd8-image.png

      posted in Cinema 4D SDK
      N
      noseman
    • RE: There is a bug and some issues in the inner extrude tool res/.h files (S22 and R21)

      Hi Manuel,
      I was about to make some new tutorials for Cineversity for the Py-Parametric tools and came across this. I can't set the minimum Subdivisions to 0.
      Has this been looked at?
      Thanks

      posted in Cinema 4D SDK
      N
      noseman
    • RE: Get Point Positions of Selected N-Gon or Polygon

      @x_nerve Thanks!

      posted in General Talk
      N
      noseman