I would like to create a particle system or hair in which the particles conform to the surface.
For instance, a particle system of a special object such as a long cylinder, which can be conformed to the surface of a sphere in random arrangements with paths that are randomized. I would like to arrive at something similar to this image:
Is this possible?
I thought about doing it via a particle system of bezier curves on a sphere and then applying a modifier to the curves, but I believe this would require doing it with a script and I haven't yet figured out how to do all of the scripting. Is there a simpler manner to do this?
I have tried creating a hair emitter with a empty force field sphere object (negative value for force at -1) and a collision sphere object, but the hair does not coalesce around the sphere. Instead I just get this:
It appears that the hair does not have segments which are allowed to bend.
Furthermore, I would like to have an object which will follow these paths created by the hair or emitter such as this:
Such that I can get a close up image of the interface such as this:
This code shows some of my difficulty in getting the particle system entities to be flexible and conform to a surface:
import bpy
import math
def reset():
# Set to Object mode initially
bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
# Delete all objects in project at current
for i in bpy.data.objects:
bpy.data.objects[i.name].select = True
bpy.ops.object.delete()
# Delete all materials in curent project
for i in bpy.data.materials[:]:
bpy.data.materials.remove(bpy.data.materials[i.name])
# Set background to white
world = bpy.context.scene.world
world.horizon_color = (1,1,1)
# Add a camera
bpy.ops.object.camera_add()
obj_camera = bpy.data.objects["Camera"]
obj_camera.location = (10,-10, 8)
obj_camera.rotation_euler = (math.pi/3, 0, math.pi/4)
reset()
bpy.ops.mesh.primitive_uv_sphere_add( \
size = 1, \
view_align = False, \
enter_editmode = False, \
location = (0, 0, 0))
ob = bpy.context.active_object
ob.name = 'Collision Sphere'
ob.show_name = True
col_sph = bpy.data.objects['Collision Sphere']
bpy.ops.object.modifier_add(type='COLLISION')
bpy.ops.mesh.primitive_uv_sphere_add( \
size = 1, \
view_align = False, \
enter_editmode = False, \
location = (0, 0, 0))
ob = bpy.context.active_object
ob.name = 'Emitter'
ob.show_name = True
em_sph = bpy.data.objects['Emitter']
bpy.ops.object.empty_add( type = "SPHERE", location=(0,0,0))
ob = bpy.context.active_object
ob.name = 'Force'
ob.show_name = True
force_sph = bpy.data.objects['Force']
bpy.ops.object.forcefield_toggle()
force_sph.field.strength = -1
bpy.ops.object.group_add()
bpy.context.scene.objects.active = em_sph
bpy.ops.object.particle_system_add()
psys1 = em_sph.particle_systems[-1]
psys1.name = 'Tubes'
psys1.use_hair_dynamics = True
pset1 = psys1.settings
pset1.name = 'TubeSettings'
pset1.type = 'HAIR'
pset1.use_hair_bspline = True
pset1.effector_weights.group = bpy.data.groups["Group"]
pset1.effector_weights.gravity = 0
pset1.effector_weights.apply_to_hair_growing = True
This gives just a spiky ball, without any bending of the hair. Any suggestions?