I’ve been trying to learn python in blender and here’s my first go at scripting something:
1.make a nurbs curve
2.make 5 nulls/empties
3.select all empties
import bpy selected = bpy.context.selected_objects count = 0 total = 4 offset = 0.0 for obj in selected: offset = count/total bpy.context.scene.objects.active = obj bpy.ops.object.constraint_add(type='FOLLOW_PATH') bpy.context.object.constraints["Follow Path"].target = bpy.data.objects["NurbsPath"] bpy.context.object.constraints["Follow Path"].use_fixed_location = True bpy.ops.object.location_clear() bpy.context.object.constraints["Follow Path"].offset_factor = offset count += 1
Hoping to make it more generic and dynamic and as a operator.
I tried getting the list.count for the total but it wasn’t returning a decimal number :S so need to find out how to get the count of a selection. list.count()
Also want to make it so that the last object selected is the curve, at the moment it just looks for a curve called NurbsCurve, LAME.
I think it’s a good start for learning python and it’s loads of fun, I’m looking forward to rigging more things with curves.