1
$\begingroup$

I have been trying to create a panel that has a particle system's modifiers, but I do not know how to call the particle system in the panel and I do not know how to get the properties. I tried following the answer on Modifiers: add and set "live" parameters then apply via python.

def draw(self, context):
    layout = self.layout

    obj = context.object

    row = layout.row()
    row.label(text = "Basic", icon = 'WORLD_DATA')

    row = layout.row()
    row.prop(obj.modifiers['Particles'], "count")
$\endgroup$
2
$\begingroup$

It would be something like:

particles = obj.modifiers.get("ParticleSystem 1")
if particles:
    row = layout.row()
    row.prop(particles.particle_system.settings, "count")

or

particles = obj.particle_systems.get('ParticleSystem')
if particles:
    row = layout.row()
    row.prop(particles.settings, "count")
$\endgroup$
2
  • $\begingroup$ I tried it out but the row won't appear. $\endgroup$ Dec 30 '15 at 17:46
  • 1
    $\begingroup$ then you aren't passing it the right names. In console do obj.modifiers[:] and obj.particle_systems[:] to get the lists.. $\endgroup$
    – zeffii
    Dec 30 '15 at 18:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.