goat3d

changeset 35:4f8383183d62

renamed goatblender to blendgoat added goatanimfmt animation file format description
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 05 Oct 2013 21:19:10 +0300
parents 8471225a460c
children 9a211986a28b
files doc/goatanimfmt doc/goatfmt exporters/blendgoat/src/blendgoat.py exporters/goatblender/src/goatblender.py
diffstat 4 files changed, 78 insertions(+), 44 deletions(-) [+]
line diff
     1.1 --- a/doc/goatanimfmt	Sat Oct 05 03:08:22 2013 +0300
     1.2 +++ b/doc/goatanimfmt	Sat Oct 05 21:19:10 2013 +0300
     1.3 @@ -1,3 +1,34 @@
     1.4 -goat3d animation file format
     1.5 +Goat3D animation file format
     1.6  ----------------------------
     1.7 -TODO
     1.8 +
     1.9 +Chunk structure
    1.10 +---------------
    1.11 +Multiple tracks might apply to the same node, to allow for different
    1.12 +interpolation, extrapolation, and time ranges between position, rotation, and
    1.13 +scaling tracks.
    1.14 +
    1.15 +ANIM
    1.16 + +--ANIM_NAME
    1.17 + |   +--<STRING>
    1.18 + +--TRACK
    1.19 +     +--TRACK_NAME
    1.20 +     |   +--<STRING>
    1.21 +     +--TRACK_NODE
    1.22 +     |   +--<STRING>	(name of the scene node using this track)
    1.23 +     +--TRACK_ATTR
    1.24 +     |   +--<STRING>	(specify the attribute affected, see NOTE1)
    1.25 +     +--TRACK_INTERP
    1.26 +     |   +--<STRING>    ("step", "linear", "cubic")
    1.27 +     +--TRACK_EXTRAP
    1.28 +     |   +--<STRING>	("extend", "clamp", "repeat", "pingpong")
    1.29 +     +--TRACK_KEY
    1.30 +         +--TRACK_KEY_TIME
    1.31 +         |   +--<INT>	(time in milliseconds)
    1.32 +         +--TRACK_KEY_VALUE
    1.33 +             +--<FLOAT|FLOAT3|FLOAT4>
    1.34 +
    1.35 +NOTE1: The attribute might be any user-defined string, but the following
    1.36 +standard attribute names are specified:
    1.37 + - "position" keys are (x,y,z) vectors
    1.38 + - "rotation" keys are (x,y,z,w) quaternions, with w being the real part
    1.39 + - "scaling" keys are (x,y,z) scale factors
     2.1 --- a/doc/goatfmt	Sat Oct 05 03:08:22 2013 +0300
     2.2 +++ b/doc/goatfmt	Sat Oct 05 21:19:10 2013 +0300
     2.3 @@ -1,3 +1,6 @@
     2.4 +Goat3D scene file format
     2.5 +------------------------
     2.6 +
     2.7  Chunk structure
     2.8  ---------------
     2.9  
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/exporters/blendgoat/src/blendgoat.py	Sat Oct 05 21:19:10 2013 +0300
     3.3 @@ -0,0 +1,42 @@
     3.4 +# Goat3D Blender >2.5 exporter
     3.5 +import bpy;
     3.6 +from bpy_extras.io_utils import ExportHelper
     3.7 +
     3.8 +bl_info = {
     3.9 +	"name": "Goat3D scene",
    3.10 +	"author": "John Tsiombikas",
    3.11 +	"version": (0, 1),
    3.12 +	"location": "File > Import-Export",
    3.13 +	"description": "Mutant Stargoat, Goat3D scene file format: http://code.google.com/p/goat3d/",
    3.14 +	"category": "Import-Export"
    3.15 +}
    3.16 +
    3.17 +class ExportGoat3D(bpy.types.Operator, ExportHelper):
    3.18 +	bl_idname = "export.goat3d"
    3.19 +	bl_label = "Goat3D scene export"
    3.20 +
    3.21 +	fname = bpy.props.Stringproperty(subtype="FILE_PATH")
    3.22 +
    3.23 +	@classmethod
    3.24 +	def poll(cls, ctx):
    3.25 +		return ctx.object is not None
    3.26 +
    3.27 +	def execute(self, context):
    3.28 +		file = open(self.filepath, "w")
    3.29 +		file.write("foobar " + ctx.object.name)
    3.30 +		return {'FINISHED'}
    3.31 +
    3.32 +def menu_func(self, ctx):
    3.33 +	self.layout.operator_context = 'INVOKE_DEFAULT'
    3.34 +	self.layout.operator(ExportGoat3D.bl_idname, text="Goat3D scene export")
    3.35 +
    3.36 +def register():
    3.37 +	bpy.utils.register_module(__name__)
    3.38 +	bpy.types.INFO_MT_file_export.append(menu_func)
    3.39 +
    3.40 +def unregister():
    3.41 +	bpy.utils.unregister_module(__name__)
    3.42 +	bpy.types.INFO_MT_file_export.remove(menu_func)
    3.43 +
    3.44 +if __name__ == "__main__":
    3.45 +	register()
     4.1 --- a/exporters/goatblender/src/goatblender.py	Sat Oct 05 03:08:22 2013 +0300
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,42 +0,0 @@
     4.4 -# Goat3D Blender >2.5 exporter
     4.5 -import bpy;
     4.6 -from bpy_extras.io_utils import ExportHelper
     4.7 -
     4.8 -bl_info = {
     4.9 -	"name": "Goat3D scene",
    4.10 -	"author": "John Tsiombikas",
    4.11 -	"version": (0, 1),
    4.12 -	"location": "File > Import-Export",
    4.13 -	"description": "Mutant Stargoat, Goat3D scene file format: http://code.google.com/p/goat3d/",
    4.14 -	"category": "Import-Export"
    4.15 -}
    4.16 -
    4.17 -class ExportGoat3D(bpy.types.Operator, ExportHelper):
    4.18 -	bl_idname = "export.goat3d"
    4.19 -	bl_label = "Goat3D scene export"
    4.20 -
    4.21 -	fname = bpy.props.Stringproperty(subtype="FILE_PATH")
    4.22 -
    4.23 -	@classmethod
    4.24 -	def poll(cls, ctx):
    4.25 -		return ctx.object is not None
    4.26 -
    4.27 -	def execute(self, context):
    4.28 -		file = open(self.filepath, "w")
    4.29 -		file.write("foobar " + ctx.object.name)
    4.30 -		return {'FINISHED'}
    4.31 -
    4.32 -def menu_func(self, ctx):
    4.33 -	self.layout.operator_context = 'INVOKE_DEFAULT'
    4.34 -	self.layout.operator(ExportGoat3D.bl_idname, text="Goat3D scene export")
    4.35 -
    4.36 -def register():
    4.37 -	bpy.utils.register_module(__name__)
    4.38 -	bpy.types.INFO_MT_file_export.append(menu_func)
    4.39 -
    4.40 -def unregister():
    4.41 -	bpy.utils.unregister_module(__name__)
    4.42 -	bpy.types.INFO_MT_file_export.remove(menu_func)
    4.43 -
    4.44 -if __name__ == "__main__":
    4.45 -	register()