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

    Normal Move command has no effect in R2023

    Bugs
    python
    2
    3
    767
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • bacaB
      baca
      last edited by m_adam

      Hi everyone,

      R2023 has issue with normal modeling commands, like Normal Move.
      R26, R25 and previous still working fine.

      For ex. this Python Generator has no effect over polygon objects:

      from typing import Optional
      import c4d
      
      doc: c4d.documents.BaseDocument # The document evaluating this python generator
      op: c4d.BaseObject # The python generator
      hh: Optional["PyCapsule"] # A HierarchyHelp object, only defined when main is executed
      
      def main() -> c4d.BaseObject:
          childOp = op.GetDown()
          cloneOp = (childOp.GetDeformCache() or childOp.GetCache() or childOp).GetClone()
      
          if cloneOp.CheckType(c4d.Opolygon):
              cloneOp.GetPolygonS().SelectAll(cloneOp.GetPolygonCount())
      
              bc = c4d.BaseContainer()
              bc.SetData(c4d.MDATA_NORMALMOVE_VALUE, 100.0)
              c4d.utils.SendModelingCommand(
                  command=c4d.ID_MODELING_NORMALMOVE_TOOL,
                  list=[cloneOp],
                  mode=c4d.MODELINGCOMMANDMODE_POLYGONSELECTION,
                  bc=bc,
                  doc=doc,
              )
      
          childOp.Touch()
          return cloneOp
      
      1 Reply Last reply Reply Quote 0
      • M
        m_adam
        last edited by m_adam

        Hi @baca you need to define the mode of the document to be in Mpolygons. I will check if this is really the intended way (tools being more context specific) or if this is a bug.

        So now you need to do something like that:

            doc = c4d.documents.BaseDocument()
            doc.SetMode(c4d.Mpolygons)
        

        Which give us:

        from typing import Optional
        import c4d
        
        doc: c4d.documents.BaseDocument # The document evaluating this python generator
        op: c4d.BaseObject # The python generator
        hh: Optional["PyCapsule"] # A HierarchyHelp object, only defined when main is executed
        
        def main() -> c4d.BaseObject:
            childOp = op.GetDown()
            cloneOp = (childOp.GetDeformCache() or childOp.GetCache() or childOp).GetClone()
        
            if cloneOp.CheckType(c4d.Opolygon):
                cloneOp.GetPolygonS().SelectAll(cloneOp.GetPolygonCount())
        
                doc = c4d.documents.BaseDocument()
                doc.SetMode(c4d.Mpolygons)
        
                bc = c4d.BaseContainer()
                bc.SetData(c4d.MDATA_NORMALMOVE_VALUE, 100.0)
                c4d.utils.SendModelingCommand(
                    command=c4d.ID_MODELING_NORMALMOVE_TOOL,
                    list=[cloneOp],
                    mode=c4d.MODELINGCOMMANDMODE_POLYGONSELECTION,
                    bc=bc,
                    doc=doc,
                )
        
            childOp.Touch()
            return cloneOp
        

        EDIT: After checking with the dev, this is indeed a bug we are going to fix, I added the "to fix" flag and will bump this topic once a fix will be available in a public release.

        Cheers,
        Maxime.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        bacaB 1 Reply Last reply Reply Quote 1
        • bacaB
          baca @m_adam
          last edited by

          @m_adam thanks!

          1 Reply Last reply Reply Quote 0
          • maxonM maxon moved this topic from Cinema 4D SDK on
          • First post
            Last post