<commit_before>import json
import bpy
import bmesh
import struct
import mathutils
import math
from math import radians
import copy
from . import materials, meshes, entities


def to_model(blender_object, force):
    if not blender_object:
        return None

    if blender_object.get("export_model") in {"0", "False", "false", 0}:
        return None

    if blender_object.type not in {"MESH", "EMPTY"}:
        return None

    if blender_object.parent is not None and not force:
        if blender_object.get("entity_type") is not None:
            return None

    print("---")
    print("Exporting: " + blender_object.name)
    print("Type: " + blender_object.type)
    print("Entity type: " + str(blender_object.get("entity_type")))
    print("Parent: " + str(blender_object.parent))
    model = dict()
    model['name'] = blender_object.name

    m = blender_object.matrix_local
    location = [m[0][3], m[1][3], m[2][3]]

    transform = list()
    for row in m.col:
        transform.extend(list(row))<commit_msg>Make class<commit_after>import json
import bpy
import bmesh
import struct
import mathutils
import math
from math import radians
import copy
from . import materials, meshes, entities

class Model(object):
    def __init__(self, name=None, transform=[1, 0, 0, 0,
                                             0, 1, 0, 0,
                                             0, 0, 1, 0,
                                             0, 0, 0, 1], axis = [0, 0, 1], angle = 0,
                 euler = [0, 0, 0], position = [0, 0, 0], mesh = None,
                 material = None, lit = True):
        self.name = name
        self.transform = transform
        self.axis = axis
        self.angle = 0
        self.angle = angle
        self.euler = euler
        self.position = position
        self.mesh = mesh
        self.material = material
        self.lit = lit



def to_model(blender_object, force):
    if not blender_object:
        return None

    if blender_object.get("export_model") in {"0", "False", "false", 0}:
        return None

    if blender_object.type not in {"MESH", "EMPTY"}:
        return None

    if blender_object.parent is not None and not force:
        if blender_object.get("entity_type") is not None:
            return None

    print("---")
    print("Exporting: " + blender_object.name)
    print("Type: " + blender_object.type)
    print("Entity type: " + str(blender_object.get("entity_type")))
    print("Parent: " + str(blender_object.parent))
    model = dict()
    model['name'] = blender_object.name

    m = blender_object.matrix_local
    location = [m[0][3], m[1][3], m[2][3]]

    transform = list()
    for row in m.col:
        transform.extend(list(row))
{'fraction_non_alphanumeric': 0.11948529411764706, 'fraction_numerical': 0.015808823529411764, 'mean_word_length': 2.3061968408262454, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1400976', 'n_tokens_mistral': 860, 'n_tokens_neox': 801, 'n_words': 241}