Skip to content

Instantly share code, notes, and snippets.

@jedStevens
Created January 17, 2019 21:52
Show Gist options
  • Save jedStevens/4aaca6c025c25bd7bec493c09ba34252 to your computer and use it in GitHub Desktop.
Save jedStevens/4aaca6c025c25bd7bec493c09ba34252 to your computer and use it in GitHub Desktop.
import bpy
import os
basedir = bpy.path.abspath('//shadefoot/story_mode/ch1/trees/maple/')
bpy.ops.object.select_all(action='DESELECT')
scene = bpy.context.scene
for obj in scene.objects:
scene.objects.active = obj
obj.select = True
for child in obj.children:
child.select = True
if obj.type == 'CURVE':
bpy.ops.export_scene.obj(filepath = os.path.join(basedir, obj.name + ".obj"), use_selection = True)
for child in obj.children:
child.select = False
obj.select = False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment