-
Can only render script generated particles via “render view” or picture viewer
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 Pythondef 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()