Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python 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
    • Recent
    • Tags
    • Users
    • Login

    Snapping Functions not working [SOLVED]

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 315 Views
    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.
    • H Offline
      Helper
      last edited by

      On 08/06/2015 at 03:37, xxxxxxxx wrote:

      Hello,

      is it possible that the snapping funtions are still partly broken?
      This Code is not working. Or am I doing something wrong? The Quantize Part is working. But I cant set the BC for the snapping settings.

      import c4d
      from c4d.modules import snap
        
        
      def main() :
        
          bc = snap.GetSnapSettings(doc)
          bc[c4d.SNAP_SETTINGS_MODE] = c4d.SNAP_SETTINGS_MODE_3D
          bc[c4d.SNAPMODE_POINT]=True
          bc[c4d.SNAPMODE_EDGE]=False
          bc[c4d.SNAPMODE_POLYGON]=False
          snap.SetSnapSettings(doc, bc)
         
          snap.SetQuantizeStep(doc, None, c4d.QUANTIZE_SCALE, 0.5)
          snap.SetQuantizeStep(doc, None, c4d.QUANTIZE_MOVE,25)
          
          c4d.EventAdd()
        
          
      if __name__=='__main__':
          main()
      
      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        On 08/06/2015 at 05:40, xxxxxxxx wrote:

        I got the right code now. Solved it for me. But the SDK example needs to be changed.

        c4d.CallCommand(c4d.SNAP_SETTINGS_3D)
            
            snap.EnableSnap(True, doc, c4d.SNAPMODE_POINT)
            snap.EnableSnap(False, doc, c4d.SNAPMODE_EDGE)
            snap.EnableSnap(False, doc, c4d.SNAPMODE_POLYGON)
            snap.EnableSnap(False, doc, c4d.SNAPMODE_SPLINE)
            snap.EnableSnap(False, doc, c4d.SNAPMODE_AXIS)
            snap.EnableSnap(False, doc, c4d.SNAPMODE_INTERSECTION)
            snap.EnableSnap(False, doc, c4d.SNAPMODE_MIDPOINT)
            snap.EnableSnap(False, doc, c4d.SNAPMODE_WORKPLANE)
            snap.EnableSnap(False, doc, c4d.SNAPMODE_GUIDE)

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          On 08/06/2015 at 07:31, xxxxxxxx wrote:

          Hi,

          Thanks for reporting this issue in the Python documentation. The example for the use of the snap module will be changed.

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