[Freecad] Реализован интерфейс добавления свойства (property) к фрейм объекту"

This commit is contained in:
brothermechanic 2023-04-12 09:19:17 +00:00 committed by Igor Brylyov
parent b744fe30a0
commit 7f13c0056f
4 changed files with 32 additions and 13 deletions

View file

@ -4,7 +4,7 @@ DESCRIPTION.
Convert and setup FreeCAD solid objects to 3d assets mesh files.
Support Blender compiled as a Python Module only!
"""
__version__ = "0.2"
__version__ = "0.3"
import logging
import os
@ -33,21 +33,32 @@ def freecad_asset_pipeline(fcstd_path,
blend_path=None,
sdf_path=None):
""" Setup FreeCAD scene to CG asset """
# prepare blend file
remove_collections()
cleanup_orphan_data()
# import objects
obj_importer(fcstd_path, tessellation)
if json_path is not None:
for point in os.listdir(json_path):
if point.endswith('.json'):
empty_importer(point)
# import lcs
if json_path is None:
json_path = os.path.dirname(fcstd_path)
for f in os.listdir(os.path.dirname(fcstd_path)):
if f.endswith('.json'):
json_file = os.path.join(json_path, f)
empty_importer(json_file)
# sdf setup WIP
if sdf_path is not None:
sdf_mesh_selector(sdf_path)
# retopo
asset_setup()
# save blender scene
if blend_path is not None:
if not os.path.isdir(os.path.dirname(blend_path)):
os.makedirs(os.path.dirname(blend_path))
bpy.ops.wm.save_as_mainfile(filepath=blend_path)
# export all objects