PDA

View Full Version : particleFill script not working


iamslaymaker
11-18-2011, 04:55 AM
I am trying to write a script to automatically create spheres, fill it with particles, and make the filled sphere a goal. Here are the commands I am using:

import maya.cmds as cmds import maya.mel as mel
cmds.select('testSphere')
#cmds.particleFill()

maya.mel.eval('particleFill -rs 4 -maxX 1 -maxY 1 -maxZ 1 -minX 0 -minY 0 -minZ 0 -pd 1 -cp;')
cmds.select( 'testSphere', tgl=True )
cmds.goal;
print ("its working")
# Error: line 1: RuntimeError: file <maya console> line 4: Error occurred during execution of MEL script #



This will fill the sphere with particles, but then errors out and will not continue with the rest of the script. I have tried this without using a MEL command. The python command (#cmds.particleFill()) alone also gives an error: # Error: line 1: RuntimeError: file <maya console> line 4: Maya command error #

This is maya 2012.
Can anyone tell me if this is a bug and/or if there is a work around for this?

iamslaymaker
11-18-2011, 04:58 AM
Alternatively, I am trying to figure out how to have the particles inside a sphere stay inside (colide with the inside) even when another colliding sphere passes thought. When this occurs now, it knocks out the particles, and they float away.

CGTalk Moderation
11-18-2011, 04:58 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.