Enable rotationPP with pm.particleInstancer

Trying to set rotation = “rotationPP” on an nParticleShape object, but an error is thrown unless you click on the object first (and some behind the scenes updates/connections are made). I’ve tried selecting, changing frames, etc through script first, but nothing works so far, except manually clicking on the object first.

#have to manually click on the nparticle_shape here, otherwise the error below occurs
pm.particleInstancer(nparticles_shape, name = p_instancer, edit = True, rotation = "rotationPP")
# Error: Invalid particle attribute name: rotationPP. #

Any ideas? Are there some connections I need to take care of manually before getting to this point?

Still testing this. Frustrating, as you literally need to have the Attribute Editor open (not Channel Box, etc), to trigger the update/connections that create the attribute “rotationPP”.

Ok! The simplest solution worked (so far). I figured something really complicated was going on, but it looks like just manually adding the attribute “rotationPP” through script is all that’s needed. I’m still curious why it’s setup to fail manually, if you aren’t working in the AE. Figured it out by diffing two .ma files, saved before and after clicking on the AE. The only real difference was the simple addAttr line.