fedeberge - Moho Camera to Blender
Posted: Thu Dec 28, 2023 5:54 am
Hi guys, first post I believe.
I made a script that let's you export the camera from Moho to Blender.
Running the script will prompt a window to choose a folder.
Then it saves the animation data in a json that's compatible with this Blender Addon by adroitwhiz
https://github.com/adroitwhiz/after-eff ... der-export
I don't know how to code in Lua and I suck at reading documentation so I wrote this script while looking very closely at:
ponysmasher's DS Camera to AE
https://lostmarble.com/forum/viewtopic.php?f=12&t=18091
and
SimplSam's AE Camera Export+
viewtopic.php?t=34765
As well as some other sources online to figure out what even are affine matrices and how do they work.
I based the logic on ponysmasher's script (saving to a file, baking every keyframe) because it fits my workflow better
Also, since the interpolation is lost, baking every keyframe makes the animation more accurate
But I found Sam's zoom factor to be more precise, so I copied (sorry I couldn't figure out the math)
How to install?
-- Download the .lua file and copy it into
%your custom content folder&\Moho Pro\Scripts\Menu\3D
(It works as a tool but I haven't made a icon yet)
-- reload scripts (Ctrl Shift Alt L) or restart Moho
How to use?
In Moho:
-- Once you finish animating in Moho, run the script
-- Choose where to save (don't write a name, the script will save a json with the same name as your moho file)
In Blender:
-- Install adroitwhiz's addon
-- Run it from File > Import > After Effects composition data, converted (.json)
-- Chose your json
-- IMPORTANT! Set the options to the right:
------Scale Factor 1
------Adjust Frame Start/End
That's it. Now you can render whatever you want and then just overlay Moho's characters over Blender's backgrounds
Future updates:
--I want to rewrite the Blender Import addon to work out of the box
--I'd like to also be able to export Moho's layers's positions in 3D space
--Figure a way of making it work two-way at first and then between Moho Blender and AE with just one json (and maybe TB Harmony)
Really special thanks to:
SimplSam
David Sandberg (ponysmasher)
Links:
My script @github
https://github.com/fedeberge/fb_camerat ... es/tag/0.1
adroitwhiz's blender addon
https://github.com/adroitwhiz/after-eff ... der-export
And lastly my ko-fi just in case any one of the 5 people that use Moho and Blender wants to donate.
https://ko-fi.com/fedeberge
I made a script that let's you export the camera from Moho to Blender.
Running the script will prompt a window to choose a folder.
Then it saves the animation data in a json that's compatible with this Blender Addon by adroitwhiz
https://github.com/adroitwhiz/after-eff ... der-export
I don't know how to code in Lua and I suck at reading documentation so I wrote this script while looking very closely at:
ponysmasher's DS Camera to AE
https://lostmarble.com/forum/viewtopic.php?f=12&t=18091
and
SimplSam's AE Camera Export+
viewtopic.php?t=34765
As well as some other sources online to figure out what even are affine matrices and how do they work.
I based the logic on ponysmasher's script (saving to a file, baking every keyframe) because it fits my workflow better
Also, since the interpolation is lost, baking every keyframe makes the animation more accurate
But I found Sam's zoom factor to be more precise, so I copied (sorry I couldn't figure out the math)
How to install?
-- Download the .lua file and copy it into
%your custom content folder&\Moho Pro\Scripts\Menu\3D
(It works as a tool but I haven't made a icon yet)
-- reload scripts (Ctrl Shift Alt L) or restart Moho
How to use?
In Moho:
-- Once you finish animating in Moho, run the script
-- Choose where to save (don't write a name, the script will save a json with the same name as your moho file)
In Blender:
-- Install adroitwhiz's addon
-- Run it from File > Import > After Effects composition data, converted (.json)
-- Chose your json
-- IMPORTANT! Set the options to the right:
------Scale Factor 1
------Adjust Frame Start/End
That's it. Now you can render whatever you want and then just overlay Moho's characters over Blender's backgrounds
Future updates:
--I want to rewrite the Blender Import addon to work out of the box
--I'd like to also be able to export Moho's layers's positions in 3D space
--Figure a way of making it work two-way at first and then between Moho Blender and AE with just one json (and maybe TB Harmony)
Really special thanks to:
SimplSam
David Sandberg (ponysmasher)
Links:
My script @github
https://github.com/fedeberge/fb_camerat ... es/tag/0.1
adroitwhiz's blender addon
https://github.com/adroitwhiz/after-eff ... der-export
And lastly my ko-fi just in case any one of the 5 people that use Moho and Blender wants to donate.
https://ko-fi.com/fedeberge