已解决
blender操作模型数据的若干代码
来自网友在路上 168868提问 提问时间:2023-11-20 17:16:25阅读次数: 68
最佳答案 问答题库688位专家为你答疑解惑
1. 导出obj:
bpy.ops.export_scene.obj(filepath="",check_existing=True,axis_forward='-Z',axis_up='Y',filter_glob="*.obj;*.mtl",use_selection=False,use_animation=False,use_mesh_modifiers=True,use_edges=True,use_smooth_groups=False,use_smooth_groups_bitflags=False,use_normals=True,use_uvs=True,use_materials=True,use_triangles=False,use_nurbs=False,use_vertex_groups=False,use_blen_objects=True,group_by_object=False,group_by_material=False,keep_vertex_order=False,global_scale=1,path_mode='AUTO'
)
2. 导出GLB:
bpy.ops.export_scene.gltf(
filepath = '',
check_existing = True,
export_import_convert_lighting_mode = 'SPEC',
gltf_export_id = '',
export_format = 'GLB',
ui_tab = 'GENERAL', export_copyright = '',
export_image_format = 'AUTO',
export_image_add_webp = False,
export_image_webp_fallback = False,
export_texture_dir = '',
export_jpeg_quality = 75,
export_image_quality = 75,
export_keep_originals = False,
export_texcoords = True,
export_normals = True,
export_draco_mesh_compression_enable = False,
export_draco_mesh_compression_level = 6,
export_draco_position_quantization = 14,
export_draco_normal_quantization = 10,
export_draco_texcoord_quantization = 12,
export_draco_color_quantization = 10,
export_draco_generic_quantization = 12,
export_tangents = False,
export_materials = 'EXPORT',
export_colors = True,
export_attributes = False,
use_mesh_edges = False,
use_mesh_vertices = False,
export_cameras = False,
use_selection = False,
use_visible = False,
use_renderable = False,
use_active_collection_with_nested = True,
use_active_collection = False,
use_active_scene = False, export_extras = False,
export_yup = True,
export_apply = False,
export_animations = True,
export_frame_range = False,
export_frame_step = 1,
export_force_sampling = True,
export_animation_mode = 'ACTIONS',
export_nla_strips_merged_animation_name = 'Animation',
export_def_bones = False,
export_hierarchy_flatten_bones = False,
export_optimize_animation_size = True,
export_optimize_animation_keep_anim_armature = True,
export_optimize_animation_keep_anim_object = False,
export_negative_frame = 'SLIDE',
export_anim_slide_to_zero = False,
export_bake_animation = False,
export_anim_single_armature = True,
export_reset_pose_bones = True,
export_current_frame = False,
export_rest_position_armature = True,
export_anim_scene_split_object = True,
export_skins = True, export_influence_nb = 4,
export_all_influences = False,
export_morph = True,
export_morph_normal = True,
export_morph_tangent = False,
export_morph_animation = True,
export_morph_reset_sk_data = True,
export_lights = False, export_try_sparse_sk = True,
export_try_omit_sparse_sk = False,
export_gpu_instances = False,
export_nla_strips = True,
export_original_specular = False,
will_save_settings = False, filter_glob = '*.glb'
)
3. 细分模型:
file_loc = 'mm_frame.obj'imported_object = bpy.ops.import_scene.obj(filepath=file_loc)
obj_object = bpy.context.selected_objects[0]bpy.ops.object.mode_set(mode="EDIT")
bpy.ops.mesh.subdivide(number_cuts=2)
bpy.ops.object.mode_set(mode="OBJECT")bpy.data.objects['Cube'].select_set(True)
bpy.ops.object.delete()
imported_object = bpy.ops.import_scene.obj(filepath=file_loc)obj = bpy.context.window.scene.objects[2]
print(obj)
bpy.context.view_layer.objects.active = obj bpy.ops.object.mode_set(mode="EDIT")
bpy.ops.mesh.subdivide(number_cuts=2)
bpy.ops.export_scene.obj(filepath="zetaxh.obj")
查看全文
99%的人还看了
相似问题
- 最新AIGC创作系统ChatGPT系统源码,支持最新GPT-4-Turbo模型,支持DALL-E3文生图,图片对话理解功能
- 思维模型 等待效应
- FinGPT:金融垂类大模型架构
- 人工智能基础_机器学习044_使用逻辑回归模型计算逻辑回归概率_以及_逻辑回归代码实现与手动计算概率对比---人工智能工作笔记0084
- Pytorch完整的模型训练套路
- Doris数据模型的选择建议(十三)
- python自动化标注工具+自定义目标P图替换+深度学习大模型(代码+教程+告别手动标注)
- ChatGLM2 大模型微调过程中遇到的一些坑及解决方法(更新中)
- Python实现WOA智能鲸鱼优化算法优化随机森林分类模型(RandomForestClassifier算法)项目实战
- 扩散模型实战(十一):剖析Stable Diffusion Pipeline各个组件
猜你感兴趣
版权申明
本文"blender操作模型数据的若干代码":http://eshow365.cn/6-40517-0.html 内容来自互联网,请自行判断内容的正确性。如有侵权请联系我们,立即删除!
- 上一篇: Unity中 Start和Awake的区别
- 下一篇: Pycharm中添加Python库指南