Blender Python nulls along a curve

I’ve been trying  to learn python in blender and here’s my first go at scripting something:

To use:

1.make a nurbs curve

2.make 5 nulls/empties all empties script

import bpy

selected = bpy.context.selected_objects

count = 0
total = 4
offset = 0.0

for obj in selected:
offset = count/total = obj
bpy.context.object.constraints["Follow Path"].target =["NurbsPath"]
bpy.context.object.constraints["Follow Path"].use_fixed_location = True
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.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s