So Objecty currently stores everything internally as nodes that have child nodes attached and then in turn can potentially have child-child nodes attached. Each node can have attributes and custom data and each node represents a different class or object E.g. ActorAnimation, ActorBone, ActorKeyFrame, Hotspot and so on.
Currently the objecty project file format is an xml file that stores this all. Check out one of the project files in a text editor to see.
So the exporter API currently allows us to write plugins that have access to this node data. On top of that there are Lua API functions (ones specifically written into Objecty) that give access to file and image builders. So for example via Lua we are able to write files or write images. This could give us the power to write whatever type of file or render whatever type of image.
Here is an early example script that will render an image that can be exported into the game making tool Multimedia Fusion.
function export(animation)
-- get some settings
transparentR,transparentG,transparentB = Setting("transparent_color")
hotspot = Setting("hotspot")
actionPoint = Setting("action_point")
-- get the frames from the animation
frames = animation:GetChildrenWithClass("spriteFrame")
framesTotal = #(frames)
-- first get some layout details for frames
frameWidth,frameHeight,frameOffsetX,frameOffsetY = animation:GetDimensions()
-- figure out the size of the output image
imageWidth = ((frameWidth+3) * framesTotal)+1
imageHeight = frameHeight+4
-- create output image
image = CreateImage(imageWidth,imageHeight)
-- get colors for box stuff
if transparentR == 255 and transparentG == 255 and transparentB == 255 then
borderR = 254
borderG = 254
borderB = 254
else
borderR = 255
borderG = 255
borderB = 255
end
if transparentR == 200 and transparentG == 200 and transparentB == 200 then
pointR = 199
pointG = 199
pointB = 199
else
pointR = 200
pointG = 200
pointB = 200
end
-- render the frames onto the output image
renderX = 0
renderY = 0
for index,frame in ipairs(frames) do
-- get frame details
frameCenterX,frameCenterY = frame:GetCenter()
-- draw transparent
image:Rect(renderX,renderY,frameWidth+4,frameHeight+4,false,transparentR,transparentG,transparentB,255,false)
-- draw the frame
image:Paste(frame:GetImage(),renderX+2+frameOffsetX-frameCenterX,renderY+2+frameOffsetY-frameCenterY,255,false)
-- draw the border
image:Rect(renderX+1,renderY+1,frameWidth+2,frameHeight+2,false,borderR,borderG,borderB,255,false)
-- draw the hotspot
if hotspot then
hotspotX = (frameOffsetX-frameCenterX) + frameCenterX
hotspotY = (frameOffsetY-frameCenterY) + frameCenterY
DebugLog(hotspotX.."x"..hotspotY)
if hotspotX >= 0 and hotspotX < frameWidth and hotspotY >= 0 and hotspotY < frameHeight then
image:Plot(renderX+1+hotspotX,renderY+1,pointR,pointG,pointB,255,false)
image:Plot(renderX+1,renderY+1+hotspotY,pointR,pointG,pointB,255,false)
end
end
-- draw the action point
if actionPoint then
actionPointX = 3
actionPointY = 10
if actionPointX >= 0 and actionPointX < frameWidth and actionPointY >= 0 and actionPointY < frameHeight then
image:Plot(renderX+1+actionPointX,renderY+2+frameHeight,pointR,pointG,pointB,255,false)
image:Plot(renderX+2+frameWidth,renderY+1+actionPointY,pointR,pointG,pointB,255,false)
end
end
-- move the render offset
renderX = renderX + frameWidth + 3
end
-- save the image
image:Save("mmf2_output2.png")
image:Close()
end
That script can output something like this...
So to answer the XML and plugin questions, we could write any format of output so it wouldn't have to be XML. If there was an existing plugin for DBP then we could write a plugin to output from one of Objecty's editors to that DBP plugin. As the 2D skeletal animation system is a more specialised case, part of the kickstarter campaign was to fund creation of a plugin to playback the animation data. It would be written targeting certain languages first, but over time it will be pretty easy to port this to languages that were not yet supported. There is even the route of writing a plugin to export to the spriter format. So all bases are covered really!
Hope that answers your questions!