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

    Reset Scale With Compensate Points?

    Cinema 4D SDK
    r25 python
    2
    3
    579
    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.
    • B
      bentraje
      last edited by

      Hi,

      Is there a python equivalent of Reset Scale With Compensate Points command?

      Illustration of what it does:

      1. Supposing you have a point in 200cm (in xyz) with the polygon object at 100 (in xyz)
      2. If you reset scale with no compensate, the point will be at 2cm and polygon at 1 scale.
      3. But if you scale with compensate, the point will still be at 200cm and polygon at 1 scale, which is what I'm after.

      cbda9028-d764-4a19-9cd3-3938d4fc26bf-image.png

      P.S. There is an existing thread regarding the topic but its not resolved. Also its referring to a rig, which has complicated hierarchy. I'm only referring to ,

      1 Reply Last reply Reply Quote 0
      • M
        m_adam
        last edited by

        Hi @bentraje you cna use the SendModelingCommang with the MDATA_RESETSYSTEM_COMPENSATE flag. All settings are explained in Python MCOMAND page. So do to what you are aiming for, you should do:

        import c4d
        
        def main() -> None:
            settings = c4d.BaseContainer()
            settings[c4d.MDATA_RESETSYSTEM_COMPENSATE] = True
            settings[c4d.MDATA_RESETSYSTEM_RECURSIVE] = True
            
            res = c4d.utils.SendModelingCommand(command=c4d.MCOMMAND_RESETSYSTEM,
                                            list=[op],
                                            mode=c4d.MODELINGCOMMANDMODE_ALL,
                                            bc=settings,
                                            doc=doc)
        
            c4d.EventAdd()
        
        if __name__ == '__main__':
            main()
        

        Cheers,
        Maxime.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        1 Reply Last reply Reply Quote 0
        • B
          bentraje
          last edited by

          @m_adam

          Gotcha. Thanks for the response.
          It works but I was kinda looking for the thought process on how to implement it.
          Mainly because the command is only limited to scale. I was hoping I can modify it to include also rotation.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post