Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
817 views
in Technique[技术] by (71.8m points)

python - blender import/export script

I should create a python script for Blender that imports obj and exports obj removing all texture sections. I never used blender, is there a good tutorial for scratch the surface and achieve this simple task?

thank you

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The blender python api website includes several tutorials to learn using python in blender. You can find details of the obj importer and exporter options. The obj import/export is handled by a python addon that is included with blender.

You could start with something as simple as -

import bpy,os
for f in os.listdir('/path/to/use'):
    bpy.ops.import_scene.obj(filepath=f)
    bpy.ops.export_scene.obj(filepath=f,use_materials=False)

If you need more help, blender has it's own SE site that is better for blender specific scripting.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...