Skip to content

Commit

Permalink
Altered the format a bit.
Browse files Browse the repository at this point in the history
  • Loading branch information
iwoplaza committed Apr 9, 2020
1 parent 5040e51 commit d5e0e9a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions data.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
# <pep8 compliant>

import bpy
from .statics import FORMAT_VERSION


def create_bone_data(scene_bone):
return {
'name': scene_bone.name,
'keyframes': []
}
# end create_bone_data


def create_armature_data(scene_armature):
armature = {
'name': scene_armature.name,
'bones': {}
}

Expand Down Expand Up @@ -78,7 +77,7 @@ def create_data(context, EXPORT_SEL_ONLY=False):
for obj in scene_objs:
if obj.type == 'ARMATURE':
armature = create_armature_data(obj)
armatures[armature['name']] = armature
armatures[obj.name] = armature

orig_frame = scene.frame_current

Expand All @@ -94,6 +93,7 @@ def create_data(context, EXPORT_SEL_ONLY=False):
scene.frame_set(orig_frame, subframe=0.0)

return {
'version': FORMAT_VERSION,
'meta': bpy.app.version_string,
'armatures': armatures
}
Expand Down
2 changes: 1 addition & 1 deletion export_mobends.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ def save(context,

# Exporting the data as JSON
with open(filepath, 'w', encoding='utf8', newline='\n') as f:
f.write(json.dumps(data, sort_keys=True, indent=4))
f.write(json.dumps(data, indent=4))

return { 'FINISHED' }
3 changes: 3 additions & 0 deletions statics.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# <pep8 compliant>

FORMAT_VERSION = 1

0 comments on commit d5e0e9a

Please sign in to comment.