MAXON CINEMA 4D: Cinema 4D Forum Adobe After Effects Forum

Can only render script generated particles via "render view" or picture viewer

COW Forums : Maxon Cinema 4D

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Ben Morrow
Can only render script generated particles via "render view" or picture viewer
on Jul 10, 2015 at 1:29:12 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()


Return to posts index

Brian Jones
Re: Can only render script generated particles via "render view" or picture viewer
on Jul 10, 2015 at 2:46:14 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


Return to posts index


Ben Morrow
Re: Can only render script generated particles via "render view" or picture viewer
on Jul 10, 2015 at 9:30:31 pm
Last Edited By Ben Morrow on Jul 10, 2015 at 9:31:03 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.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]