In another question I ask How to make these scripted duplivert monkeys always face “out” using duplicates? Here I would like to ask if there is a better (or at least alternate) way to do this besides using duplicates or "dupliverts".
Here's an example using dupliverts - the same as in the other question and so far I haven't figured out there how to get the monkeys placed on the icosphere's vertices or it's faces to face "out".
Is there a different way to do this?
note: I will not always use monkeys on icospheres - this is an abstraction. I'm working towards correctly animating this constellation of 4,425 Earth-facing satellites where I'll have roughly eighty rotating circles with sixty "monkeys" each. However I will also be using 2D meshes in a second project (rather than circles), so I really want to understand the underlying logic/math of the orientations, both on 1D (circles) and 2D meshes.
edit: Here is one of the images from the linked satellite question to help illustrate why I want to create "monkeys" (satellites) in groups, and not create and keyframe four thousand individuals:
Potentially adjustable things:
# monkey.rotation_euler = 0, 0, pi # ??
bpy.ops.object.parent_set(type='OBJECT', keep_transform=True) # keep_transform ??
bpy.context.object.use_dupli_vertices_rotation = True # ??
Ok here is a basic script:
import bpy, math
pi = math.pi
loco_f, loco_v = (-5, 0, 5), (+5, 0, 5)
bpy.ops.object.select_all(action='SELECT')
bpy.ops.object.delete(use_global=False)
bpy.ops.mesh.primitive_ico_sphere_add(location=loco_f, size=4, subdivisions=2)
shape_mesh_f = bpy.context.active_object
bpy.ops.mesh.primitive_ico_sphere_add(location=loco_v, size=4, subdivisions=2)
shape_mesh_v = bpy.context.active_object
bpy.ops.mesh.primitive_monkey_add(radius=1, location=loco_f)
monkey_f = bpy.context.active_object
# monkey.rotation_euler = 0, 0, pi
bpy.ops.mesh.primitive_monkey_add(radius=1, location=loco_v)
monkey_v = bpy.context.active_object
# monkey.rotation_euler = 0, 0, pi
bpy.ops.object.select_all(action='DESELECT')
monkey_f.select = True
bpy.context.scene.objects.active = shape_mesh_f
bpy.ops.object.parent_set(type='OBJECT', keep_transform=True)
bpy.context.object.dupli_type = 'FACES'
bpy.context.object.use_dupli_vertices_rotation = True
bpy.ops.object.select_all(action='DESELECT')
monkey_v.select = True
bpy.context.scene.objects.active = shape_mesh_v
bpy.ops.object.parent_set(type='OBJECT', keep_transform=True)
bpy.context.object.dupli_type = 'VERTS'
bpy.context.object.use_dupli_vertices_rotation = True