Normal Move command has no effect in R2023

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

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.

@m_adam thanks!