вот код для блендера 3.3.0, аддон: blinfo = { "name": "AI Progress Track Maker…
- User
вот код для блендера 3.3.0, аддон:
bl_info = { "name": "AI Progress Track Maker Importer", "author": "AlonsoBeast", "version": (1, 0, 4), "blender": (3, 3, 0), "location": "View3D > Sidebar > F1 Track Builder Toolkit", "description": "Tool for managing and transforming track progress curves", "category": "Import-Export", }
import bpy import xml.etree.ElementTree as ET from bpy.props import StringProperty, IntProperty, BoolProperty from bpy.types import Operator, Panel from bpy_extras.io_utils import ImportHelper, ExportHelper import tempfile import shutil from mathutils import Vector
def create_spline(name, points): curve_data = bpy.data.curves.new(name=name, type='CURVE') curve_data.dimensions = '3D'
codespline = curve_data.splines.new('POLY') spline.points.add(len(points) - 1) for i, (x, y, z) in enumerate(points): spline.points[i].co = (x, y, z, 1) # Сохраняем Y и Z в исходном порядке Save Save Save curve_object = bpy.data.objects.new(name, curve_data) bpy.context.collection.objects.link(curve_object) return curve_objectdef mirror_y_global(obj): bpy.context.view_layer.objects.active = obj obj.select_set(True) bpy.ops.object.mode_set(mode='OBJECT') bpy.ops.object.transform_apply(location=False, rotation=False, scale=True) bpy.ops.transform.mirror(orient_type='GLOBAL', constraint_axis=(False, True, False)) obj.select_set(False)
def create_mesh_from_splines(left_spline, right_spline): left_points = left_spline.data.splines[0].points right_points = right_spline.data.splines[0].points
code - Assistant