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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Trouble calling xparticles function

    Scheduled Pinned Locked Moved PYTHON Development
    2 Posts 0 Posters 217 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 19/10/2016 at 08:30, xxxxxxxx wrote:

      Hello,

      I did post this on the xparticles forum, but that post has only 10 views and no replies in the past five days, so I thought I'd try my luck here.

      I'm having trouble calling the FindClosest() function in the Neighbor class. I'm not too familiar with OOP, but I think I did this right. However, when I print-to-console what should be the list returned by the function, only a zero is printed. Can someone tell me what I'm doing wrong or if this function is just not supported right now? Here's the relevant code I have:

      import xparticles
      ...
      emitter = doc.SearchObject("xpEmitter")
      emitter = xparticles.ToEmitter(emitter) 
      count = emitter.GetAliveCount()
      r = 50
        
      for p in xrange(count) :
          xp = emitter.GetParticle(p)
          p_pos = xp.GetPosition()
          neighbor = xparticles.Neighbor()
          near = neighbor.FindClosest(p_pos, r)
      

      Thanks

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

        On 20/10/2016 at 06:32, xxxxxxxx wrote:

        Hi,

        unfortunately we (the SDK Team) have no information about XParticles, so we need to leave this question up to the community. Sorry.

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