Testing Emitter parameters (Res,Dens,Visc,IntPres, etc.)

Discussion about scripting with Python
bmecohen
Posts: 28
Joined: Thu Sep 27, 2012 12:55 pm

Testing Emitter parameters (Res,Dens,Visc,IntPres, etc.)

Postby bmecohen » Wed Oct 24, 2012 4:09 pm

Hy!

I would like to make a comparison test, between parameter settings and collect the data in excel to analyse their behavior. If you have any interesting tests or personal experience about this, please highlight it!

I made a script to make 10 cubes and emitters. I also made 2 groups, one for the cubes and one for the emitters, but I don't know how to force this cubes/emitters to get inside the Group.

the script:

Code: Select all

cubes = scene.addGroup()
cubes.setName("Cubes")
emitters = scene.addGroup()
emitters.setName("Emitters")

for i in range (1,11) :
   
# Create cubes
   cube = scene.addCube()
   cube.setName("Cube %d" % i)
   cube.setParameter("Scale", Vector.new(2.0,2.0,1.0))
   cube.freezeTransformations()
   cube.setParameter("Position", Vector.new(i*2.2-10,0.0,0.0))
   
# Create emitters
   emitter = scene.addEmitter("Square")
   emitter.setName("Emitter %d" % i)
   emitter.setParameter("Scale", Vector.new(1.8,1.0,0.9))
   emitter.setParameter("Position", Vector.new(i*2.2-10,0.99,0.0))
   emitter.setParameter("Resolution",50.0)


bmecohen
Posts: 28
Joined: Thu Sep 27, 2012 12:55 pm

Re: Testing Emitter parameters (Res,Dens,Visc,IntPres, etc.)

Postby bmecohen » Wed Oct 24, 2012 7:00 pm

I would like to make a range with specified data and add to a parameter in the for loop something like this:

range[0.0001, 0.001, 0.01, 0.1, 1, 10, 100, 1000]
with for loop in every step go to the next value.

User avatar
Otuama
Posts: 1155
Joined: Fri Apr 02, 2010 12:56 am
Location: Swansea
Contact:

Re: Testing Emitter parameters (Res,Dens,Visc,IntPres, etc.)

Postby Otuama » Thu Oct 25, 2012 9:14 pm

Hi.

I think it'd be something like:

cubes.add(cube.getName())
&
emitters.add(emitter.getName())
iCreate Ltd
'Strength does not come from physical capacity. It comes from an indomitable will.' - Gandhi
'What Does Success Look Like?' - iCreate Ltd



Return to “Python-Scripting”

Who is online

Users browsing this forum: No registered users and 3 guests