# HG changeset patch # User John Tsiombikas # Date 1380997150 -10800 # Node ID 4f8383183d628521393987c436c965d6c19ba373 # Parent 8471225a460c5ab20086d9d79e0d9f6ea6e68b86 renamed goatblender to blendgoat added goatanimfmt animation file format description diff -r 8471225a460c -r 4f8383183d62 doc/goatanimfmt --- a/doc/goatanimfmt Sat Oct 05 03:08:22 2013 +0300 +++ b/doc/goatanimfmt Sat Oct 05 21:19:10 2013 +0300 @@ -1,3 +1,34 @@ -goat3d animation file format +Goat3D animation file format ---------------------------- -TODO + +Chunk structure +--------------- +Multiple tracks might apply to the same node, to allow for different +interpolation, extrapolation, and time ranges between position, rotation, and +scaling tracks. + +ANIM + +--ANIM_NAME + | +-- + +--TRACK + +--TRACK_NAME + | +-- + +--TRACK_NODE + | +-- (name of the scene node using this track) + +--TRACK_ATTR + | +-- (specify the attribute affected, see NOTE1) + +--TRACK_INTERP + | +-- ("step", "linear", "cubic") + +--TRACK_EXTRAP + | +-- ("extend", "clamp", "repeat", "pingpong") + +--TRACK_KEY + +--TRACK_KEY_TIME + | +-- (time in milliseconds) + +--TRACK_KEY_VALUE + +-- + +NOTE1: The attribute might be any user-defined string, but the following +standard attribute names are specified: + - "position" keys are (x,y,z) vectors + - "rotation" keys are (x,y,z,w) quaternions, with w being the real part + - "scaling" keys are (x,y,z) scale factors diff -r 8471225a460c -r 4f8383183d62 doc/goatfmt --- a/doc/goatfmt Sat Oct 05 03:08:22 2013 +0300 +++ b/doc/goatfmt Sat Oct 05 21:19:10 2013 +0300 @@ -1,3 +1,6 @@ +Goat3D scene file format +------------------------ + Chunk structure --------------- diff -r 8471225a460c -r 4f8383183d62 exporters/blendgoat/src/blendgoat.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/exporters/blendgoat/src/blendgoat.py Sat Oct 05 21:19:10 2013 +0300 @@ -0,0 +1,42 @@ +# Goat3D Blender >2.5 exporter +import bpy; +from bpy_extras.io_utils import ExportHelper + +bl_info = { + "name": "Goat3D scene", + "author": "John Tsiombikas", + "version": (0, 1), + "location": "File > Import-Export", + "description": "Mutant Stargoat, Goat3D scene file format: http://code.google.com/p/goat3d/", + "category": "Import-Export" +} + +class ExportGoat3D(bpy.types.Operator, ExportHelper): + bl_idname = "export.goat3d" + bl_label = "Goat3D scene export" + + fname = bpy.props.Stringproperty(subtype="FILE_PATH") + + @classmethod + def poll(cls, ctx): + return ctx.object is not None + + def execute(self, context): + file = open(self.filepath, "w") + file.write("foobar " + ctx.object.name) + return {'FINISHED'} + +def menu_func(self, ctx): + self.layout.operator_context = 'INVOKE_DEFAULT' + self.layout.operator(ExportGoat3D.bl_idname, text="Goat3D scene export") + +def register(): + bpy.utils.register_module(__name__) + bpy.types.INFO_MT_file_export.append(menu_func) + +def unregister(): + bpy.utils.unregister_module(__name__) + bpy.types.INFO_MT_file_export.remove(menu_func) + +if __name__ == "__main__": + register() diff -r 8471225a460c -r 4f8383183d62 exporters/goatblender/src/goatblender.py --- a/exporters/goatblender/src/goatblender.py Sat Oct 05 03:08:22 2013 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -# Goat3D Blender >2.5 exporter -import bpy; -from bpy_extras.io_utils import ExportHelper - -bl_info = { - "name": "Goat3D scene", - "author": "John Tsiombikas", - "version": (0, 1), - "location": "File > Import-Export", - "description": "Mutant Stargoat, Goat3D scene file format: http://code.google.com/p/goat3d/", - "category": "Import-Export" -} - -class ExportGoat3D(bpy.types.Operator, ExportHelper): - bl_idname = "export.goat3d" - bl_label = "Goat3D scene export" - - fname = bpy.props.Stringproperty(subtype="FILE_PATH") - - @classmethod - def poll(cls, ctx): - return ctx.object is not None - - def execute(self, context): - file = open(self.filepath, "w") - file.write("foobar " + ctx.object.name) - return {'FINISHED'} - -def menu_func(self, ctx): - self.layout.operator_context = 'INVOKE_DEFAULT' - self.layout.operator(ExportGoat3D.bl_idname, text="Goat3D scene export") - -def register(): - bpy.utils.register_module(__name__) - bpy.types.INFO_MT_file_export.append(menu_func) - -def unregister(): - bpy.utils.unregister_module(__name__) - bpy.types.INFO_MT_file_export.remove(menu_func) - -if __name__ == "__main__": - register()