Recursively creating thousands of MObjects

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I'm leveraging the instancing behavior of importing multiple GPU caches of the same object.
Say I have 100000 alembic spheres each with a different transform. I wan't to create these in the fastest way possible. some pseudocode for what I'm doing with OpenMaya is:
mdm = OpenMaya.MDagModifier()
for each instance:
create gpucache node
set the alembic filename
apply a transform
mdm.doIt()
now, over very many objects(with varying complexity) this is painfully slow to build, with doIt() adding roughly 1/2 the time of the instance creation section to the total time. Here's a profiling example:
this instance took 0.00145 seconds.
this instance took 0.00066 seconds.
this instance took 0.00066 seconds.
doIt() took 0.00125 seconds.
This is also not multithreaded. How can I multithread something like this?