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

    UV Peeler - accessible?

    Cinema 4D SDK
    python
    2
    3
    404
    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.
    • .
      .del
      last edited by

      Hi - I'm wondering if the UV Peeler is accessible via python. I see it listed in the SDK but I'm not familiar with how to use it.

      Can it be used with SendModelingCommand or bodypaint.CallUVCommand?

      The documentation references C4DAtom.SetParameter() but I've never used this.

      Any info that can push me in the right direction is appreciated.

      thanks,
      .del

      1 Reply Last reply Reply Quote 0
      • ManuelM
        Manuel
        last edited by

        hi,

        The tool UV Peeler must have some edge selected that will be used as seems. In this thread, you will find some useful information how to do that.

        To Apply the UV Peeler you have two options. One using the script log that will write for you almost all the code you need or using the function SendmodelingCommand.

        There is no public symbol defined for this tool, you need to use the value itself.

        import c4d
        from c4d import gui
        
        
        
        # using the script log only
        def MethodeOne():
            def tool() -> c4d.plugins.BasePlugin:
                return c4d.plugins.FindPlugin(doc.GetAction(), c4d.PLUGINTYPE_TOOL)
            c4d.CallCommand(1031207) # UV Peeler
            uvPeeler = tool()
            uvPeeler[c4d.MDATA_UVPEELER_MIN_U] = 0.29
            c4d.CallButton(uvPeeler, c4d.MDATA_UVPEELER_APPLY)
        
        def main():
            # using the fuinction SendModelingCommand.
            # Parameter of the tool must be defined.
            settings = c4d.BaseContainer()
            settings[c4d.MDATA_UVPEELER_MIN_U] = 0.29
            settings[c4d.MDATA_UVPEELER_MAX_U] = 1
            settings[c4d.MDATA_UVPEELER_MIN_V] = 0
            settings[c4d.MDATA_UVPEELER_MAX_V] = 1
            settings[c4d.MDATA_UVPEELER_U_UNIFORMITY] = 1
            settings[c4d.MDATA_UVPEELER_V_UNIFORMITY] = 0
            # There is no symbol that define the UVPeeler tool id. Use the value instead.
            res = c4d.utils.SendModelingCommand(command=1031207,
                                        list=[op],
                                        bc=settings,
                                        doc=doc)
            c4d.EventAdd()
        
        # Execute main()
        if __name__=='__main__':
            main()
        

        Cheers,
        Manuel

        MAXON SDK Specialist

        MAXON Registered Developer

        1 Reply Last reply Reply Quote 0
        • .
          .del
          last edited by

          HI -

          Thanks for the response!

          I'm going to go with the sendModelingCommand method. I never would have thought to put the CallCommand value in there.

          This is really going to help me finish this script. I appreciate your help.

          thank you,
          .del

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