Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity › Forums › Maxon Cinema 4D › Can only render script generated particles via “render view” or picture viewer

  • Can only render script generated particles via “render view” or picture viewer

    Posted by Ben Morrow on July 10, 2015 at 1:29 am

    Hey so the task I have is to render thinking particles using the cloner technique to give them geometry so they show up.

    I am using the below user script (albeit with more complex layout for the particles). If I run it I get all the right particles and can see them fine using “render view” .. I can’t however render them out to a video (even a preview video) because they don’t show up. I have confirmed that other objects in the scene render out to video.

    My guess is that I need some sort of “birthing” event similar to what happens with an emitter, but I can’t seem to work out how to do that.

    I have tried a range of strategies to execute the code including a custom generator, but all to no avail.

    Any help much appreciated!!

    import c4d
    from c4d import gui
    from c4d import documents
    #Welcome to the world of Python

    def main():
    Doc = documents.GetActiveDocument()
    TPMS = Doc.GetParticleSystem()
    ids = TPMS.AllocParticles(500)

    for i in range(500):
    idx = ids[i]
    TPMS.SetLife(idx, doc.GetMaxTime()) # set life to the doc length
    TPMS.SetPosition(idx, c4d.Vector(0.0,0.0,i*2.0))
    TPMS.SetSize(idx, 10.0)
    TPMS.SetSpin(idx,c4d.Vector(0.0,0.0,0.0),0.0)

    if __name__==’__main__’:
    main()

    Ben Morrow replied 11 years, 2 months ago 2 Members · 2 Replies
  • 2 Replies
  • Brian Jones

    July 10, 2015 at 2:46 pm

    particles don’t render unless you use something to make them visible – assign an object to the particle (i.e.. the Shape node in xpresso) or use something like Hair or Pyrocluster or Sketch and Toon – or other 3rd party plugins

  • Ben Morrow

    July 10, 2015 at 9:30 pm

    So I was indeed using the cloner to instance a cube geometry based on the thinking particles.

    The problem was in fact this line:

    Doc = documents.GetActiveDocument()

    which was causing all particles to be created in the editor rather than the batch renderer (even at render time).

    removing that line and replacing the references with just ‘doc’ fixed it.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy