I hope someone can help me figure this out. I’m trying to find the Vector location of a particle, one within a particle system that’s using “Keyed” physics from one or more systems.
Here’s a blend with a simple keyed particle system to show an example: particle test.blend (545 KB)
The red cube has a particle system using a single particle (represented as the blue monkey). That particle system is “Keyed” between the particle systems of the two green objects. I’m trying to access the location of that particle(blue monkey in the sample file) from the red system for each frame. I want to figure out what the path of the keyed particle.
The following code is a sample that works as expected on a particle system that is NOT keyed. It checks the location of the particle at frame 1 and frame 50 and prints each, when ran on a system using Newtonian, the results change as expected.
But when used with a particle system using the Keyed physics type, the location stays the same and doesn’t respect the actual location of the particle which is keyed from the other particle systems.
On the sample file, running this script with a green object prints in the consol two different vector locations. But when the red object is selected, the location doesn’t change.
import bpy
obj = bpy.context.object
ps = obj.particle_systems.activeprint("
Check Particle Location")bpy.context.scene.frame_set(1)
print("
Frame "+str(bpy.context.scene.frame_current))
for x in ps.particles:
loc1 = x.location
print(loc1)bpy.context.scene.frame_set(50)
print("
Frame "+str(bpy.context.scene.frame_current))
for x in ps.particles:
loc2 = x.location
print(loc2)
So how can I find that location? I’ve looked through the api documentation and found “particle_keys”. But that’s not helping me find to location.
http://www.blender.org/documentation/blender_python_api_2_60_0/bpy.types.Particle.html#bpy.types.Particle.particle_keys
I’ve been searching like crazy, but no luck. So if anyone has any hints, I’d be very grateful!