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

    Matrix generates no points while on vertex mode using a spline generator plugin

    Cinema 4D SDK
    python r20
    2
    3
    720
    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.
    • P
      pyr
      last edited by a_block

      hey,

      i got a spline tool which is unsing the ISSPLINE and GENERATOR flag.

      if i set a matrix object mode to anything exept vertex it generates points accordingly to the choosen distribution mode.

      if i convert the spline generator to an actual spline the vertex distribution works well.

      1 Reply Last reply Reply Quote 0
      • r_giganteR
        r_gigante
        last edited by

        Hi Pyr,

        I've tried with a very basic spline generator and the clones are properly created under all "distribution" modes.

        Here's the plugin responsible for generating the curve:

        import math
        import c4d
        from c4d import plugins, utils
        
        PLUGIN_ID = 99911332
        
        class SDKSupport_11332 (plugins.ObjectData):
        
        	def Init(self, node):
        		return True
        
        	def GetContour(self, op, doc, lod, bt):
        		rad = 200
        		sub = 3
        		TANG = 0.415
        		
        		op = c4d.SplineObject(sub, c4d.SPLINETYPE_BEZIER)
        		if not op: return None
        		
        		for i in xrange(sub):
        			sn, cs = utils.SinCos(math.pi*i/float(sub-1))
        			op.SetPoint(i, c4d.Vector(cs*rad,sn*rad,0.0))
        			vl = c4d.Vector(sn*rad*TANG,-cs*rad*TANG,0.0)
        			vr = -vl
        			op.SetTangent(i, vl, vr)
        		
        		op.Message(c4d.MSG_UPDATE)
        			
        		return op
        
        if __name__ == "__main__":
        		plugins.RegisterObjectPlugin(id=PLUGIN_ID, 
        			str="SDKSupport_11332", 
        			description="SDKSupport_11332",
        			g=SDKSupport_11332, 
        			info=c4d.OBJECT_GENERATOR|c4d.OBJECT_ISSPLINE, 
        			icon=None)	
        

        Can you provide some further detail on your spline generator?

        Cheers, Riccardo

        1 Reply Last reply Reply Quote 2
        • P
          pyr
          last edited by

          Ok this was defently my fault. It works now.
          I was using GetVirtualObjects instead of GetContour.

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