Export a Mash Network to an Alembic point-cloud.
[!WARNING] It seems the script fully work only when using a MASH Instancer. When using a repro_mesh only the basic translate/rotate/scale attrbiutes seems to work.
- Copy/paste in script editor
- Select the Mash Network you want to export.
- Run script.
- A file dialog open : Select the path + filename for the alembic export.
(wip)
You can use the scene_config
dictionnary:
The build.particleSystems
keys allow you to create a new attribute on the
particleSystem for export (you must also add it in export.alembic.attributes
). This attribute can be then connected to an attribute on the Mash Node
by
specifying it in the mashAttr
key.
The mashAttr
key except the path of the attribute on the Mash Node
that
must be connected to the newly created p.s. attribute. Make sure these two
attributes are of the same type.
This is an enough special case to be explained here. If you are using Mash
Instances you might now that the color
mash node can't be used. But here is
a workaround as explained here.
The issue is that the point color
attribute must be gathered on the mash
Python
node. To avoid rewriting all the script while actually not needed,
the solution is simply to create a new attribute on the Mash Node called like
colorPP
, and connect the Python.colorOutPP
attribute to it. Then in
the script you just have to modify the scene_config
dict as usual :
scene_config = {
"build": {
"particleSystem": {
"MyColorRandom": {
"dataType": "vectorArray",
"mashAttr": "colorPP"
}
},
},
"export": {
"alembic": {
"attributes": ["MyColorRandom"]
}
}
}
- Doesn't seem to support animated attribute export except from P.
See LICENSE.md.
Huge thanks to Onouris on Discord for showing me the initial nParticle setup that saved my ass when I needed it.