View > Direction > Menu items trough script?

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

Moderators: Víctor Paredes, Belgarath, slowtiger

User avatar
synthsin75
Posts: 10007
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: View > Direction > Menu items trough script?

Post by synthsin75 »

Wow, that camera tool looks really impressive, Lukas!
User avatar
hayasidist
Posts: 3551
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: View > Direction > Menu items trough script?

Post by hayasidist »

Lukas wrote: Mon Oct 11, 2021 7:41 pm This is so much nicer to work with than disabling the camera channels on the timeline!
ok -- I admit it -- that line passed me by first time --- Occam!!!

find the camera channels: (e.g. code based on: https://mohoscripting.com/snippets/4)

CHANNEL_CAMERA_TRACK
CHANNEL_CAMERA_ZOOM
CHANNEL_CAMERA_ROLL
CHANNEL_CAMERA_PANTILT

and mute / unmute them:

Channel:Mute(bool)

??!
User avatar
Lukas
Posts: 1297
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands
Contact:

Re: View > Direction > Menu items trough script?

Post by Lukas »

synthsin75 wrote: Mon Oct 11, 2021 9:32 pm Wow, that camera tool looks really impressive, Lukas!
Thanks, it has proven useful in a few shots already! I'm still finishing up some loose ends and will post it soon.
hayasidist wrote: Tue Oct 12, 2021 9:12 amok -- I admit it -- that line passed me by first time --- Occam!!!

find the camera channels: (e.g. code based on: https://mohoscripting.com/snippets/4)

CHANNEL_CAMERA_TRACK
CHANNEL_CAMERA_ZOOM
CHANNEL_CAMERA_ROLL
CHANNEL_CAMERA_PANTILT

and mute / unmute them:

Channel:Mute(bool)

??!
That might actually be a lot easier indeed! And the camera gizmo isn't in the way when animating. I tried it at first but channel.value no longer returned the correct value. But just found out channel:GetValue(moho.frame) works just fine on muted channels. Thanks, I'll give it a shot!
User avatar
Lukas
Posts: 1297
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands
Contact:

Re: View > Direction > Menu items trough script?

Post by Lukas »

I'm not sure what path to take anymore... I'll just leave this here for now:

Here's two alpha version of the tool: LK_Camera-Alpha

There's a LK_Camera_Mute version and a LK_Camera_Orbit version. Both have their issues.

The Mute version toggles the camera on/off by muting the camera channels. (Leaving out pan/tilt completely and its advised to simply not use zoom too much). We usually zoom in/out by adjusting the Z position of the camera, instead of the zoom tool.

The orbit version switches between 'front' (orbit) view and 'camera' view. Which seems an extreme way to do it, but it does require less modding of the original camera tools that are invoked on onmousedown etc, so I might prefer that one.

What I'm trying to achieve is the ability to toggle the camera on/off in any situation without the viewport jumping around. In any camera key situation. And it would be great to be able to set the camera position etc in both modes easily.

The drawn paths already work really well so far. I find it very useful.

The color buttons also have an 'alt' behaviour. They adjust all keys of that same color to the current position.
Post Reply