From 82d1846cbca9e774bb524ca185fc2e6634f38126 Mon Sep 17 00:00:00 2001 From: joric Date: Wed, 24 Jan 2018 12:16:57 +0500 Subject: [PATCH] started animation keys --- io_scene_b3d/B3DParser.py | 8 +++- io_scene_b3d/import_b3d.py | 89 +++++++++++++++++++++++++++++++++++--- 2 files changed, 90 insertions(+), 7 deletions(-) diff --git a/io_scene_b3d/B3DParser.py b/io_scene_b3d/B3DParser.py index 63755d6..48fe0b2 100644 --- a/io_scene_b3d/B3DParser.py +++ b/io_scene_b3d/B3DParser.py @@ -122,12 +122,12 @@ class B3DParser: flags = self.i(1)[0] keys = [] while self.fp.tell()1: assign_material_slots(ob, node, mat_slots) - #postprocess(ob, mesh, node) + #postprocess(ob, mesh, node) # breaks weighting return ob def import_node(node, parent): - if 'vertices' in node: + global armatures, bonesdata, weighting, bones_ids, bones_node + + if 'vertices' in node and 'faces' in node: ob = import_mesh(node) else: ob = bpy.data.objects.new(node.name, None) @@ -199,6 +273,10 @@ def import_node(node, parent): w.append((vert_id, weight)) weighting[bone_name] = w + if 'bones' in node and not bones_node: + print(bones_node) + bones_node = node + return ob def walk(root, parent=None): @@ -246,9 +324,10 @@ def load_b3d(filepath, mtex.use_map_color_diffuse = True materials[i] = material - global armatures, bonesdata, weighting, bones_ids + global armatures, bonesdata, weighting, bones_ids, bones_node walk(data) - make_skeleton() + if data.frames: + make_skeleton(data) def load(operator, context,