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
    • Register
    • Login
    1. Home
    2. Gaal Dornik
    G
    • Profile
    • Following 0
    • Followers 0
    • Topics 9
    • Posts 26
    • Best 0
    • Controversial 0
    • Groups 0

    Gaal Dornik

    @Gaal Dornik

    0
    Reputation
    6
    Profile views
    26
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    Gaal Dornik Unfollow Follow

    Latest posts made by Gaal Dornik

    • RE: How to weld two points to the last selected point?

      Considering this thread it looks like getting points selection order is not trivial task for c4d api.

      posted in Cinema 4D SDK
      G
      Gaal Dornik
    • RE: GetActiveToolData() doesn't work for Mirror Tool

      I want to mirror a polygon selection along specified modeling axis, but i'm kinda stuck since i can't apply the dedicated Mirror Tool, the basic Scale Tool also doesn't allow to set the tool settings...

      posted in Cinema 4D SDK
      G
      Gaal Dornik
    • RE: How to weld two points to the last selected point?

      @i_mazlov

      The problem with this code - it doesn't always work correctly. Sometimes it's not taking into account selection order - welds to the first selected point for example. Look at this preview.

      import c4d
      
      def main():
          doc = c4d.documents.GetActiveDocument()
          op = doc.GetActiveObject()
      
          lastPoint = op.GetPointS().GetLastElement()
      
          settings = c4d.BaseContainer()
          settings[c4d.MDATA_WELD_TOPOINT] = True
          settings[c4d.MDATA_WELD_POINTINDEX] = lastPoint
          settings[c4d.MDATA_WELD_OBJECTINDEX] = op
          
          doc.StartUndo()
          doc.AddUndo(c4d.UNDOTYPE_CHANGE, op)
          
          result = c4d.utils.SendModelingCommand(
                          command=c4d.ID_MODELING_WELD_TOOL,
                          list=[op],
                          mode=c4d.MODELINGCOMMANDMODE_POINTSELECTION,
                          bc=settings,
                          doc=doc,)                
          doc.EndUndo()
          c4d.EventAdd()
      
      if __name__=='__main__':
          main()
      
      posted in Cinema 4D SDK
      G
      Gaal Dornik
    • RE: Howto add headers & dividers for a ShowPopupDialog?

      It works as expected in C4D 2024, but not in the previous versions.

      posted in Cinema 4D SDK
      G
      Gaal Dornik
    • How to weld two points to the last selected point?

      Hello, currently this code welds two points in the middle, but i want it to weld to the last selected point, setting MDATA_WELD_TOPOINT to True doesn't help. How to solve this?

      import c4d, sys
      
      
      #
      # M A I N
      #
      def main():
          doc = c4d.documents.GetActiveDocument()
      
          settings = c4d.BaseContainer()
          settings[c4d.MDATA_WELD_TOPOINT] = True
          
          result = c4d.utils.SendModelingCommand(
                          command=c4d.ID_MODELING_WELD_TOOL,
                          list=[op],
                          mode=c4d.MODELINGCOMMANDMODE_POINTSELECTION,
                          bc=settings,
                          doc=doc,
                          flags=c4d.MODELINGCOMMANDFLAGS_CREATEUNDO)
      
          if not result:
              raise RuntimeError(f"Modelling command failed for {op}.")
      
          # Inform Cinema 4D that the document has been modified.
          c4d.EventAdd()
      
      
      # Execute main()
      if __name__=='__main__':
          main()
      
      posted in Cinema 4D SDK windows s26 2023 python
      G
      Gaal Dornik
    • RE: How to Apply a modeling command?

      Thanks man, i'll take a look at it!

      posted in Cinema 4D SDK
      G
      Gaal Dornik
    • RE: GetActiveToolData() doesn't work for Mirror Tool

      Are there any workarounds for this?

      posted in Cinema 4D SDK
      G
      Gaal Dornik
    • RE: Howto add headers & dividers for a ShowPopupDialog?

      Actually i've got 'Type to search' popup field in C4D 2023.2.0 also, but POPUP_ALLOW_FILTERING flag is omitted.
      Is there a way to hide it?

      posted in Cinema 4D SDK
      G
      Gaal Dornik
    • RE: How to create a radial (pie) menu?

      Thanks for your detailed answers, i hoped there is a simpler way to do it)...
      Pie menus is a very common thing nowadays, why maxon developers haven't implemented it already?
      In modo for example you can create pie menus, popups...etc without any coding.
      Not every user is ready/have the time/etc to learn python to build a simple popup, but almost every user needs to customize their working software.
      I really hope you'll implement these features soon.

      posted in Cinema 4D SDK
      G
      Gaal Dornik
    • GetActiveToolData() doesn't work for Mirror Tool

      Hi, i'm trying to change Mirror Tool settings, but when i get them using GetActiveToolData() it returns me 'None'. Also i've noticed that changing tool settings in the Attributes tab doesn't show up anything in the Script Log, usually i can see tool setting's name and corresponding value in the log.

      Tried both in C4D R26 and 2023.2.0.

      Is it a bug or i'm missing something?

      Thanks.

      import c4d
      
      def main():
          doc = c4d.documents.GetActiveDocument()
          
          c4d.CallCommand(14038) # Mirror
          settings = doc.GetActiveToolData()
          print("settings: %s" % settings)
          
          settings[c4d.MDATA_MIRROR_VALUE] = 0.0
          settings[c4d.MDATA_MIRROR_SYSTEM] = 0
      
          c4d.EventAdd()
      
      # Execute main()
      if __name__=='__main__':
          main()
      
      posted in Cinema 4D SDK windows s26 python 2023
      G
      Gaal Dornik