Hello,
I have Python code that runs on each frame during animation, and changes the target which some boid particles are following. It’s fine during development (with Alt+P), but when I render, Blender crashes.
Here’s a simplified form of the code:
def change_boid_target(context):
if (condition):
# Get the boids' go-to-goal rule
particle_system = bpy.data.objects['Emitter'].particle_systems[0];
goal_rule = particle_system.settings.boids.states['State'].rules['Goal'];
# Update the goal
goal_rule.object = bpy.data.objects['Waypoint3'];
# Set change_boid_target() to run on each frame
bpy.app.handlers.frame_change_post.append(change_boid_target);
The crash happens on the line labelled “Update the goal”. Is there a workaround?
MANY thanks,
Peter.