Creating a Custom Animation Format

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Fahim, Distinct Sun, Víctor Paredes, erey, Belgarath, slowtiger

Post Reply
Noodle
Posts: 2
Joined: Thu Apr 05, 2018 6:53 am

Creating a Custom Animation Format

Post by Noodle » Sat Apr 07, 2018 2:18 am

I am a game programmer who programs in LUA with LOVE2D. I love using moho studio and I need to convert my animation into a custom animation file format I have created, Because I'm not really a fan of using frame-by-frame raster image animations. Is there a scripting function in Moho Studio where it returns all the animation and vector data?

Just wanna show you images my current work because why not:

animation format WIP (currently a table)
Image

Running in-game
Image

Reference Animation
Image
User avatar
synthsin75
Posts: 7103
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Creating a Custom Animation Format

Post by synthsin75 » Sat Apr 07, 2018 3:05 am

You would have to use multiple functions to get the layer transforms and point motion of that example individually.
Or read from the Moho file format. Either way, creating your own format sounds very daunting.
Noodle
Posts: 2
Joined: Thu Apr 05, 2018 6:53 am

Re: Creating a Custom Animation Format

Post by Noodle » Sat Apr 07, 2018 6:03 am

synthsin75 wrote:You would have to use multiple functions to get the layer transforms and point motion of that example individually.
Or read from the Moho file format. Either way, creating your own format sounds very daunting.
I understand.
For starters, could you give me a sample code that could only give a single layer transform X & Y data if possible?
Thank you in advance for replying
User avatar
synthsin75
Posts: 7103
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Creating a Custom Animation Format

Post by synthsin75 » Sat Apr 07, 2018 6:41 am

Code: Select all

local frame = moho.frame
local xRotation = moho.layer.fRotationX:Getvalue(frame)
local yRotation = moho.layer.fRotationY:Getvalue(frame)
Referenced here: http://mohoscripting.com/index.php?show ... =MohoLayer
Post Reply