Moho Camera Importer

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

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
7feet
Posts: 840
Joined: Wed Aug 04, 2004 5:45 am
Location: L.I., New Yawk.
Contact:

Moho Camera Importer

Post by 7feet »

I was just reminded of this companion to my MohoCam camera exporter script that I completely spaced on posting.

It works the same as th MohoCam script, but in reverse. So you would also be able import cameras from various different 3D apps into Moho. One thing to keep in mind is that, since you can't save keyframe interpolation types, the exporter saves exact camera positions for every frame. So when you import, you'll get keyframes on all the camera channels at all frames for the length of the camera move. It's a lot of keyframes, but the only way to really get the exact camera move.

So, ImportCam v1.0

Sorry 'bout the delay.
Aldrik
Posts: 8
Joined: Tue Aug 15, 2006 6:48 pm

Thanks a lot 7feet.

Post by Aldrik »

Too cool! I don't think the extra keys are a issue at all, but I'm sure it wouldn't be to hard to make the script remove the redundant ones (may give it a try if I get time/bord).

Just to let everyone know there is a Maya CC exporter (& probably importer too) for blender being make over at the blender artists forums.

PS. Hi all, just found out about Moho the other day & it looks like a very powerful/fun program (will be picking at your brains very soon)! I'm off to play now, thanks again 7feet! :D
Aldrik
Posts: 8
Joined: Tue Aug 15, 2006 6:48 pm

MohoCam update...

Post by Aldrik »

I've updated both your import and export scripts 7feet.

ExportCam 1.4 changes
1) Fixed a typo that exported the cameras Y position to Z
2) Fixed it so the first frame now gets exported (frame 0)

ImportCam 1.1 changes
1) Removes repeated/redundant frames
2) Now supports files with a negative frame numbers
3) Imports frames at current timeline position

It is possible to work out the interpolation and remove more frames, I may add linear but I'm to lazzy to do the others. :evil:

Image
(Dont have any space of my own at the mo, a mirror would be good :wink:)

PS. 7feet, the Importer code I added is a bit messy (soz), never used lua before & don't have time to check docs.
User avatar
7feet
Posts: 840
Joined: Wed Aug 04, 2004 5:45 am
Location: L.I., New Yawk.
Contact:

Post by 7feet »

Cool, Aldrick. I try not to be too messy myself, or a few months down the line when I want to change something I'll be completely screwed, I'm okay while I'm doing it but it doesn't really "stick". But as long as it works.

Where was the typo? I was looking at the one on my machine and I can't find it, but that doesn't necessarily it ain't in the one I uploaded. Usually when I'm writing something it's in a bit of a frenzy, and I can get a wee bit sloppy on the versioning. I'm terrible like that.
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

7feet wrote:... and I can get a wee bit sloppy on the versioning. I'm terrible like that.
Phew! Not just me then... ;)

On that topic... any descriptions online how exactly to do "versioning" of something like this?

Is it just... a free for all? make it up?

How do you know if something should be...
... v2.0 v1.5 or v1.5b or 1.5.9 or 1.4.6046r0003?

I was always clueless about it...

-vern
User avatar
7feet
Posts: 840
Joined: Wed Aug 04, 2004 5:45 am
Location: L.I., New Yawk.
Contact:

Post by 7feet »

What I've usually tried to do, say after the dreaded "1.0", is to add a full tick after the decimal if I've added a new feature (or just made it actually work), going to 1.1, 1.2, etc. If it's pretty much a minor tweak or bug fix because I did something bone stupid, it would be more like 1.01. Or I might just want to confuse the hell out of everyone and make the new version equalto PI, or a kabbalistic interpretation of my dogs name, factorial. But usually the first bits suffice.

My problem is that I just forget to note it at all. So as I still have every version of Moho 5 from the 1st beta still installed separately on my machine, sometimes I've found myself fishing around through some of my scripts from different places that have the same version number, but seem to do different things. And that's just, y'know, stupid. You get caught up in the moment, and then the next morning... Jeez.
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

Thanks for the reply... it really made my evening. I laughed out loud (I try to avoid that in the middle of the night... scares the neighbors.)
You get caught up in the moment, and then the next morning... Jeez.
This could apply to... well... life in general actually. ;)

-vern
Aldrik
Posts: 8
Joined: Tue Aug 15, 2006 6:48 pm

Post by Aldrik »

7feet wrote:Where was the typo?
I'm sure you must have already fixed for your self... :wink:

sf_MohoCamV1.3.lua

Code: Select all

line210			string.format("%.4f",tostring((position.x * self.positionScaling) * 10))..tabs..
line211			string.format("%.4f",tostring((position.y * self.positionScaling) * 10))..tabs..
line212			string.format("%.4f",tostring((position.y * self.positionScaling) * 10))..tabs..
User avatar
BA
Posts: 196
Joined: Tue Mar 08, 2005 7:28 pm
Location: Griddleville
Contact:

Post by BA »

Does anyone know where to find a script that exports camera info from 3DstudioMAX?
Create cartoon characters and comics in minutes: www.bitstrips.com
Ovjeh
Posts: 26
Joined: Tue Nov 07, 2006 11:53 pm

Post by Ovjeh »

It's here http://www.motionblur.it search for Camera converter.
User avatar
7feet
Posts: 840
Joined: Wed Aug 04, 2004 5:45 am
Location: L.I., New Yawk.
Contact:

Post by 7feet »

Go to http://www.Motionblur.it and get the Camera Converter scripts. That's the format I based the Moho importer and exporter on, and there's a 3DSMax exporter in there.

Ack, Ovjeh, ya beat me to it...
Post Reply